/* 底部浮动播放器样式 - 支持跑马灯、历史记录、定时器、响应式 */
.floating-player {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-top: 2px solid #5a9c20;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    padding: 2px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    box-sizing: border-box;
    font-family: inherit;
}

/* 左区 */
.floating-player-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 2;
    min-width: 0;
}
.floating-player-play-btn {
    background: #5a9c20;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 24px;
    color: white;
    flex-shrink: 0;
}
.floating-player-play-btn:active {
    transform: scale(0.95);
}
.floating-player-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}
.floating-player-title-wrap {
    overflow: hidden;
    white-space: nowrap;
    width: 100%;
}
.floating-player-title {
    display: inline-block;
    font-size: 16px;
    font-weight: bold;
    color: #2c3e50;
    line-height: 1;
    white-space: nowrap;
    animation: none;
    margin:0;
    padding:0;
}
.floating-player-title.marquee {
    animation: marquee 8s linear infinite;
}
@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}
.floating-player-title-wrap.marquee .floating-player-title {
    padding-right: 30px;
}
.floating-player-time {
    font-size: 15px;
    color: #666;
    margin:0;
    padding:0;
    line-height:1;
}

/* 右区 */
.floating-player-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}
.floating-player-status {
    font-size: 15px;
    color: #5a9c20;
    white-space: nowrap;
}
.floating-player-timer {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #f0f7e6;
    border-radius: 20px;
    padding: 4px 8px;
    cursor: pointer;
}
.floating-player-timer-btn {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    padding: 2px;
    color: #5a9c20;
}
.floating-player-countdown {
    font-size: 12px;
    color: #5a9c20;
    font-weight: bold;
    min-width: 50px;
    text-align: center;
}
.floating-player-mode {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 6px;
    color: #2c3e50;
}
.floating-player-share {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 6px;
    color: #2c3e50;
}
.floating-player-history {
    position: relative;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 6px;
    color: #2c3e50;
}
.floating-player-history-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #5a9c20;
    color: white;
    font-size: 10px;
    border-radius: 10px;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    padding: 0 4px;
    display: none;
}
.floating-player-history-badge.show {
    display: inline-block;
}

/* 定时选择菜单（简单弹窗） */
.timer-menu {
    position: fixed;
    bottom: 80px;
    right: 16px;
    background: white;
    border: 1px solid #5a9c20;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    z-index: 1002;
    display: none;
    flex-direction: column;
    width: 160px;
    max-height: 300px;
    overflow-y: auto;
}
.timer-menu.show {
    display: flex;
}
.timer-menu-item {
    padding: 10px 16px;
    cursor: pointer;
    font-size: 14px;
    border-bottom: 1px solid #eee;
}
.timer-menu-item:hover {
    background: #f0f7e6;
}

/* 播放队列弹窗 */
.floating-player-drawer {
    position: fixed;
    bottom: 70px;
    right: 16px;
    width: 90vw;
    max-width: 500px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
    border: 1px solid #5a9c20;
    z-index: 1001;
    display: none;
    flex-direction: column;
    max-height: 70vh;
    overflow: hidden;
}
.floating-player-drawer.show {
    display: flex;
}
.drawer-header {
    padding: 14px 16px;
    background: #5a9c20;
    color: white;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 18px;
}
.drawer-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.drawer-header-left span {
    font-size: 18px;
}
.drawer-delete-all {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
}
.drawer-delete-all:hover {
    background: rgba(255,255,255,0.2);
}
.drawer-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
}
.drawer-list {
    overflow-y: auto;
    flex: 1;
    padding: 8px 0;
}
.drawer-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
}
.drawer-item:hover {
    background: #f9f9f9;
}
.drawer-item-num {
    font-size: 14px;
    color: #5a9c20;
    font-weight: bold;
    width: 36px;
    flex-shrink: 0;
}
.drawer-item-info {
    flex: 1;
    font-size: 15px;
    font-weight: 500;
    color: #2c3e50;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.drawer-item-progress {
    font-size: 12px;
    color: #999;
    margin-left: 12px;
    white-space: nowrap;
    flex-shrink: 0;
}
.drawer-item-actions {
    margin-left: 12px;
    flex-shrink: 0;
}
.drawer-item-actions button {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    color: #e74c3c;
}
.empty-history {
    text-align: center;
    color: #999;
    padding: 40px 20px;
    font-size: 15px;
}

/* 响应式：手机模式下改为上下两行布局 */
@media (max-width: 640px) {
    .floating-player {
        flex-direction: column;
        align-items: stretch;
        padding: 2px 12px;
        gap: 6px;
    }
    .floating-player-left {
        width: 100%;
        margin-bottom: 4px;
    }
    .floating-player-info {
        flex: 1;
    }
    .floating-player-title-wrap {
        width: 100%;
    }
    .floating-player-title {
        font-size: 14px;
    }
    .floating-player-right {
        width: 100%;
        justify-content: space-between;
        gap: 8px;
    }
    .floating-player-status {
        font-size: 14px;
    }
    .floating-player-timer {
        padding: 2px 6px;
    }
    .floating-player-timer-btn {
        font-size: 14px;
    }
    .floating-player-countdown {
        font-size: 11px;
        min-width: 45px;
    }
    .floating-player-mode,
    .floating-player-share,
    .floating-player-history {
        font-size: 18px;
        padding: 4px;
    }
    .floating-player-drawer {
        bottom: 80px;
        right: 10px;
        width: 95vw;
        max-width: none;
    }
    .drawer-item {
        padding: 10px 12px;
    }
    .drawer-item-num {
        width: 30px;
        font-size: 13px;
    }
    .drawer-item-info {
        font-size: 14px;
    }
    .drawer-item-progress {
        font-size: 11px;
        margin-left: 8px;
    }
    .timer-menu {
        bottom: 85px;
        right: 10px;
        width: 140px;
    }
    #david_footer {
        margin-bottom: 50px !important;
    }
}

/* 深色模式 */
@media (prefers-color-scheme: dark) {
    .floating-player {
        background: rgba(30, 30, 30, 0.98);
        border-top-color: #5a9c20;
    }
    .floating-player-title {
        color: #f0f0f0;
    }
    .floating-player-time {
        color: #aaa;
    }
    .floating-player-status {
        color: #8bc34a;
    }
    .floating-player-timer {
        background: #2c2c2c;
    }
    .floating-player-timer-btn,
    .floating-player-countdown {
        color: #8bc34a;
    }
    .floating-player-drawer {
        background: #2c2c2c;
        border-color: #5a9c20;
    }
    .drawer-item {
        border-bottom-color: #444;
    }
    .drawer-item-info {
        color: #eee;
    }
    .empty-history {
        color: #aaa;
    }
    .timer-menu {
        background: #2c2c2c;
        border-color: #5a9c20;
    }
    .timer-menu-item {
        border-bottom-color: #444;
        color: #eee;
    }
    .timer-menu-item:hover {
        background: #3a3a3a;
    }
}