/* ========== 终端风格播放器样式 ========== */
:root {
    --player-bg: rgba(8, 10, 14, 0.97);
    --player-border: rgba(255, 107, 61, 0.35);
    --player-text: #b0b8c0;
    --progress-bg: rgba(255, 255, 255, 0.06);
    --progress-fill: #00e676;
    --btn-hover-glow: rgba(0, 230, 118, 0.5);
    --lyric-active: #00e676;
    --lyric-inactive: #546e7a;
    --panel-bg: rgba(6, 8, 12, 0.96);
}

.player-container {
    flex-shrink: 0;
    background: var(--player-bg);
    border-top: 1px solid var(--player-border);
    border-bottom: none;
    padding: 10px 20px 12px;
    user-select: none;
    z-index: 10;
    position: relative;
    overflow: hidden;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), padding 0.35s ease;
    max-height: 600px;
}

.player-container.collapsed {
    max-height: 110px;
    padding-bottom: 0px;
}

.player-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20px;
    right: 20px;
    height: 1px;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(255, 107, 61, 0.5) 15%,
            rgba(255, 107, 61, 0.2) 50%,
            rgba(255, 107, 61, 0.5) 85%,
            transparent 100%);
    pointer-events: none;
}

.player-inner {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
}

.player-info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 22px;
}

.player-song-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.player-now-playing-icon {
    color: var(--text);
    font-size: 13px;
    animation: pulseGlow 2s ease-in-out infinite;
    flex-shrink: 0;
    text-shadow: 0 0 8px rgba(0, 230, 118, 0.5);
}

.player-now-playing-icon.paused {
    animation: none;
    opacity: 0.5;
    text-shadow: none;
}

@keyframes pulseGlow {
    0%,
    100% {
        text-shadow: 0 0 6px rgba(0, 230, 118, 0.4);
    }
    50% {
        text-shadow: 0 0 14px rgba(0, 230, 118, 0.9);
    }
}

.player-song-title {
    color: #d0d8e0;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.3px;
}

.player-song-artist {
    color: var(--timestamp);
    font-size: 11px;
    white-space: nowrap;
    flex-shrink: 0;
}

.player-song-separator {
    color: #444;
    flex-shrink: 0;
    font-size: 10px;
}

.player-time-display {
    color: var(--timestamp);
    font-size: 11px;
    white-space: nowrap;
    flex-shrink: 0;
    letter-spacing: 0.5px;
    font-variant-numeric: tabular-nums;
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
}

.player-progress-container {
    position: relative;
    height: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.player-progress-track {
    width: 100%;
    height: 3px;
    background: var(--progress-bg);
    border-radius: 2px;
    position: relative;
    overflow: visible;
    transition: height 0.15s;
}

.player-progress-container:hover .player-progress-track {
    height: 5px;
}

.player-progress-fill {
    height: 100%;
    background: var(--progress-fill);
    border-radius: 2px;
    position: relative;
    transition: width 0.05s linear;
    box-shadow: 0 0 8px rgba(0, 230, 118, 0.5);
}

.player-progress-fill::after {
    content: '';
    position: absolute;
    right: -5px;
    top: 50%;
    transform: translateY(-50%);
    width: 11px;
    height: 11px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(0, 230, 118, 0.8);
    opacity: 0;
    transition: opacity 0.2s;
}

.player-progress-container:hover .player-progress-fill::after {
    opacity: 1;
}

.player-controls-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.player-ctrl-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #aaa;
    width: 34px;
    height: 34px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
    position: relative;
    flex-shrink: 0;
}

.player-ctrl-btn:hover {
    border-color: var(--text);
    color: var(--text);
    box-shadow: 0 0 10px var(--btn-hover-glow);
    background: rgba(0, 230, 118, 0.05);
}

.player-ctrl-btn:active {
    transform: scale(0.94);
    transition: transform 0.08s;
}

.player-ctrl-btn.play-btn {
    width: 40px;
    height: 40px;
    font-size: 16px;
    border-color: rgba(0, 230, 118, 0.4);
    color: var(--text);
    box-shadow: 0 0 12px rgba(0, 230, 118, 0.2);
}

.player-ctrl-btn.play-btn:hover {
    border-color: var(--text);
    box-shadow: 0 0 20px rgba(0, 230, 118, 0.5);
    background: rgba(0, 230, 118, 0.08);
}

.player-ctrl-btn.toggle-btn {
    font-size: 11px;
    width: auto;
    padding: 0 8px;
    letter-spacing: 0.3px;
    border-color: rgba(255, 107, 61, 0.3);
    color: #b0b8c0;
    white-space: nowrap;
    gap: 3px;
}

.player-ctrl-btn.toggle-btn.active {
    border-color: var(--text);
    color: var(--text);
    box-shadow: 0 0 8px rgba(0, 230, 118, 0.35);
    background: rgba(0, 230, 118, 0.06);
}

.player-ctrl-btn.toggle-btn .toggle-indicator {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #546e7a;
    transition: all 0.2s;
}

.player-ctrl-btn.toggle-btn.active .toggle-indicator {
    background: var(--text);
    box-shadow: 0 0 6px rgba(0, 230, 118, 0.7);
}

.player-volume-group {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 4px;
}

.player-volume-icon {
    color: #888;
    font-size: 11px;
    cursor: pointer;
    transition: color 0.2s;
    flex-shrink: 0;
}

.player-volume-icon:hover {
    color: var(--text);
}

.player-volume-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 70px;
    height: 3px;
    background: var(--progress-bg);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
    transition: height 0.15s;
}

.player-volume-slider:hover {
    height: 5px;
}

.player-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    border: 2px solid var(--text);
    box-shadow: 0 0 8px rgba(0, 230, 118, 0.5);
}

.player-volume-slider::-moz-range-thumb {
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    border: 2px solid var(--text);
    box-shadow: 0 0 8px rgba(0, 230, 118, 0.5);
}

/* ========== 歌词面板 ========== */
.player-lyric-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, padding 0.25s ease, margin 0.25s ease, border 0.25s ease;
    background: var(--panel-bg);
    border: 0px solid rgba(0, 230, 118, 0.12);
    border-radius: 3px;
    margin: 0;
    padding: 0 12px;
    position: relative;
}

.player-lyric-panel.open {
    max-height: 180px;
    border-width: 1px;
    margin: 4px 0;
    padding: 8px 12px;
}

.player-lyric-panel .lyric-scroll {
    max-height: 160px;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-behavior: smooth;
    padding-right: 4px;
}

.player-lyric-panel .lyric-scroll::-webkit-scrollbar {
    width: 3px;
}

.player-lyric-panel .lyric-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.player-lyric-panel .lyric-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
}

.player-lyric-panel .lyric-line {
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'SF Mono', monospace;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 2px;
    transition: all 0.3s ease;
    cursor: default;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--lyric-inactive);
    letter-spacing: 0.4px;
    border-left: 2px solid transparent;
}

.player-lyric-panel .lyric-line.active {
    color: var(--lyric-active);
    text-shadow: 0 0 8px rgba(0, 230, 118, 0.55);
    font-size: 12px;
    font-weight: 600;
    border-left-color: var(--lyric-active);
    background: rgba(0, 230, 118, 0.04);
}

.player-lyric-panel .lyric-line.no-lyrics {
    color: #555;
    font-style: italic;
    border-left: none;
    text-align: center;
}

/* ========== 播放列表面板 ========== */
.player-playlist-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, padding 0.25s ease, margin 0.25s ease, border 0.25s ease;
    background: var(--panel-bg);
    border: 0px solid rgba(255, 107, 61, 0.15);
    border-radius: 3px;
    margin: 0;
    padding: 0 12px;
    position: relative;
}

.player-playlist-panel.open {
    max-height: 250px;
    border-width: 1px;
    margin: 4px 0;
    padding: 8px 12px;
}

.player-playlist-panel .playlist-scroll {
    max-height: 240px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
}

.player-playlist-panel .playlist-scroll::-webkit-scrollbar {
    width: 3px;
}

.player-playlist-panel .playlist-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.player-playlist-panel .playlist-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
}

@keyframes playlistItemFlyIn {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.player-playlist-panel .playlist-item {
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'SF Mono', monospace;
    font-size: 11px;
    padding: 5px 10px;
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #888;
    border-left: 2px solid transparent;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    user-select: none;
    animation: playlistItemFlyIn 0.4s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

.player-playlist-panel .playlist-item:hover {
    color: #d0d8e0;
    background: rgba(255, 255, 255, 0.02);
    border-left-color: rgba(255, 107, 61, 0.5);
}

.player-playlist-panel .playlist-item.playing {
    color: var(--text);
    border-left-color: var(--text);
    background: rgba(0, 230, 118, 0.05);
    text-shadow: 0 0 6px rgba(0, 230, 118, 0.3);
}

.player-playlist-panel .playlist-item .pl-num {
    color: #546e7a;
    flex-shrink: 0;
    width: 18px;
    text-align: right;
}

.player-playlist-panel .playlist-item.playing .pl-num {
    color: var(--text);
}

.player-playlist-panel .playlist-item .pl-title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-playlist-panel .playlist-item .pl-artist {
    color: #546e7a;
    flex-shrink: 0;
    font-size: 10px;
}

.player-playlist-panel .playlist-item.playing .pl-artist {
    color: #7cb88a;
}

.player-playlist-panel .triple-hint {
    text-align: center;
    font-size: 9px;
    color: #3a3a3a;
    margin-top: 6px;
    letter-spacing: 0.5px;
    transition: color 0.3s;
    user-select: none;
}

.player-playlist-panel:hover .triple-hint {
    color: #4a4a4a;
}

.player-playlist-panel .triple-hint.flash {
    color: #ff6b3d;
    text-shadow: 0 0 6px rgba(255, 107, 61, 0.5);
    animation: hintFlash 0.6s ease-out;
}

@keyframes hintFlash {
    0% {
        color: #ffaa6b;
        text-shadow: 0 0 12px rgba(255, 140, 80, 0.8);
    }
    100% {
        color: #3a3a3a;
        text-shadow: none;
    }
}

.player-spectrum-canvas {
    width: 100%;
    height: 44px;
    border-radius: 2px;
    display: block;
    opacity: 0.8;
    image-rendering: auto;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.04);
    flex-shrink: 0;
}

.player-toast {
    position: absolute;
    top: -36px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 20, 10, 0.95);
    border: 1px solid rgba(0, 230, 118, 0.5);
    color: var(--text);
    padding: 6px 16px;
    border-radius: 3px;
    font-size: 11px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 20;
    white-space: nowrap;
    letter-spacing: 0.5px;
}

.player-toast.show {
    opacity: 1;
}

.player-toast.error {
    border-color: rgba(255, 80, 60, 0.6);
    color: #ff6b5b;
    background: rgba(20, 5, 5, 0.95);
}

.hidden-file-input {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
}

/* ========== 项目列表飞入动画 ========== */
.project-item.fly-in {
    animation: flyInFromLeft 1.4s ease-out forwards;
}

@keyframes flyInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-60px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.project-item .bot-char {
    color: var(--border-orange);
}

/* 彻底隐藏播放器（display:none） */
.player-container.hidden {
    display: none;
}

/* 关闭按钮样式 */
.player-close-btn {
    color: #ff5f57;
    font-size: 14px;
    line-height: 1;
}
.player-close-btn:hover {
    color: #ff3333;
    border-color: #ff3333;
    box-shadow: 0 0 6px rgba(255, 80, 60, 0.4);
}

/* 移动端适配 */
        @media (max-width: 768px) {
            .content-panel {
                padding: 12px 16px;
                font-size: 11px;
            }
            .title-text {
                font-size: 11px;
            }
            .title-bar {
                padding: 10px 12px;
            }
            .traffic-light {
                width: 10px;
                height: 10px;
            }
            .traffic-lights {
                gap: 5px;
            }
            
            .timestamp {
                font-size: 10px;
                margin-right: 6px;
            }
            .welcome-banner {
                white-space: nowrap;
                overflow-x: hidden;
                padding: 8px 10px;
                line-height: 1.5;
            }
            .term-btn {
                font-size: 10px;
            }
            .terminal-toolbar {
                gap: 8px;
                padding: 12px 16px;
            }
            .cursor-line {
                font-size: 11px;
                height: 18px;
            }
            .nav-panel.open {
                width: 160px;
            }
            .nav-item {
                font-size: 10px;
            }
            .project-item {
                font-size: 11px;
            }
            .project-section-label {
                font-size: 9px;
            }
            .project-list-container {
                margin-top: 2.6em;
                gap: 7px;
            }
            .player-container {
                padding: 8px 12px 10px;
            }
            .player-container.collapsed {
                max-height: 98px;
            }
            .player-spectrum-canvas {
                height: 32px;
            }
            .player-ctrl-btn {
                width: 28px;
                height: 28px;
                font-size: 11px;
            }
            .player-ctrl-btn.play-btn {
                width: 34px;
                height: 34px;
                font-size: 14px;
            }
            .player-ctrl-btn.toggle-btn {
                font-size: 9px;
                padding: 0 5px;
                gap: 2px;
            }
            .player-volume-slider {
                width: 50px;
            }
            .player-song-title {
                font-size: 10px;
            }
            .player-song-artist {
                font-size: 9px;
            }
            .player-time-display {
                font-size: 9px;
            }
            .player-controls-row {
                gap: 6px;
            }
            .player-lyric-panel.open {
                max-height: 130px;
            }
            .player-lyric-panel .lyric-scroll {
                max-height: 110px;
            }
            .player-lyric-panel .lyric-line {
                font-size: 9px;
            }
            .player-lyric-panel .lyric-line.active {
                font-size: 10px;
            }
            .player-playlist-panel.open {
                max-height: 180px;
            }
            .player-playlist-panel .playlist-scroll {
                max-height: 160px;
            }
            .player-playlist-panel .playlist-item {
                font-size: 9px;
                padding: 4px 8px;
            }
        }