﻿/* LyricEx shell layout (split from styles.css, v2.0.5): sidebar + upload area,
   main content frame, player bar and its mode controls (track toggle,
   transpose/bookmarks, audition buttons, recent/queue sidebar sections). */
/* =========================== SIDEBAR =========================== */
.sidebar {
    width: 220px;
    min-width: 220px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 20px 16px 16px;
    transition:
        background var(--transition),
        border-color var(--transition);
    overflow-y: auto;
    flex-shrink: 0;
}
.sidebar-brand {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--text-primary);
    padding-bottom: 18px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--border-color);
    transition:
        color var(--transition),
        border-color var(--transition);
    /* v3.2.1: the logo opens 关于 on click — no text selection, pointer affordance */
    user-select: none;
    cursor: pointer;
}
.sidebar-brand span {
    color: var(--accent);
}
.sidebar-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 20px;
}
/* v3.2.1: bottom sidebar block pushing the upload area down (was inline) */
.sidebar-section--spacer {
    flex: 1;
    justify-content: flex-end;
}
.sidebar-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    padding: 6px 0 4px 0;
    transition: color var(--transition);
}
.sidebar-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition:
        background var(--transition),
        color var(--transition);
    font-family: inherit;
    text-align: left;
    border-left: 2px solid transparent;
}
.sidebar-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}
.sidebar-btn.active {
    background: var(--bg-active);
    color: var(--text-primary);
    border-left-color: var(--accent);
}
.sidebar-btn .icon {
    font-size: 20px;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
    line-height: 1;
}
.sidebar-btn .label {
    flex: 1;
}
.upload-area {
    margin-top: 8px;
    border: 2px dashed var(--border-color);
    padding: 18px 12px;
    text-align: center;
    cursor: pointer;
    transition:
        border-color var(--transition),
        background var(--transition);
    background: transparent;
    color: var(--text-muted);
    font-size: 13px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}
.upload-area:hover {
    border-color: var(--accent);
    background: var(--bg-hover);
}
.upload-area .icon {
    font-size: 28px;
    color: var(--text-muted);
    transition: color var(--transition);
}
.upload-area:hover .icon {
    color: var(--accent);
}
.upload-area .file-name {
    font-size: 12px;
    color: var(--text-secondary);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.upload-area input[type='file'] {
    display: none;
}
/* v1.6.3: once a package is loaded the upload box collapses to a compact
   horizontal bar (icon + file name) so the song info below stays on screen. */
.upload-area.has-file {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.upload-area.has-file .icon {
    font-size: 15px;
    flex-shrink: 0;
}
.upload-area.has-file .upload-hint {
    display: none;
}
.upload-area.has-file .file-name {
    flex: 1;
    min-width: 0;
}
.sidebar-status {
    margin-top: auto;
    padding-top: 14px;
    font-size: 12px;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    transition:
        color var(--transition),
        border-color var(--transition);
    text-align: center;
    line-height: 1.5;
    min-height: 48px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.sidebar-status .song-title {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 13px;
}
.sidebar-status .song-artist {
    font-size: 11px;
    color: var(--text-muted);
}

/* =========================== MAIN =========================== */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-secondary);
    transition: background var(--transition);
}
.view-container {
    flex: 1;
    overflow: hidden;
    position: relative;
    padding: 20px 24px 16px;
}
/* v1.4.4: give the view content a definite height so .view-lyrics /
   .view-mixed are the real scroll containers (previously scrolling
   happened on the overflow:hidden .view-container, breaking follow) */
#viewContent {
    height: 100%;
    overflow: hidden;
}

/* =========================== PLAYER =========================== */
.player-controls {
    background: var(--player-bg);
    border-top: 1px solid var(--border-color);
    padding: 10px 20px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
    position: relative;
    transition:
        background var(--transition),
        border-color var(--transition);
}
.player-row {
    display: flex;
    align-items: center;
    gap: 10px 16px;
    flex-wrap: wrap;
}
.player-row .ctrl-group {
    display: flex;
    align-items: center;
    gap: 4px;
}
.player-row .ctrl-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition:
        background var(--transition),
        color var(--transition),
        transform 0.15s;
    font-family: inherit;
    position: relative;
}
.player-row .ctrl-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}
.player-row .ctrl-btn:active {
    transform: scale(0.92);
}
/* v3.2.1: compact ctrl button for the drawer volume toggle (was inline 28px) */
.ctrl-btn--compact {
    width: 28px;
    height: 28px;
    font-size: 16px;
}
.player-row .ctrl-btn.playing {
    color: var(--accent);
}
.player-row .ctrl-btn .badge {
    position: absolute;
    top: -4px;
    right: -4px;
    font-size: 9px;
    background: var(--accent);
    color: #fff;
    padding: 1px 5px;
    font-weight: 600;
    line-height: 1.4;
}
.player-row .ctrl-btn .badge.active {
    background: #c0392b;
}
.player-row .progress-wrap {
    flex: 1;
    min-width: 120px;
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}
.player-row .progress-bar {
    flex: 1;
    height: 4px;
    background: var(--progress-bg);
    cursor: pointer;
    position: relative;
    transition: height 0.15s;
}
.player-row .progress-bar:hover {
    height: 6px;
}
.player-row .progress-fill {
    height: 100%;
    background: var(--progress-fill);
    width: 0%;
    transition: width 0.05s linear;
    position: relative;
}
.player-row .progress-thumb {
    position: absolute;
    top: 50%;
    left: 0%;
    width: 14px;
    height: 14px;
    background: var(--progress-fill);
    border: 2px solid var(--bg-secondary);
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);
    transform: translate(-50%, -50%);
    border-radius: 50% !important;
    pointer-events: none;
    transition:
        background var(--transition),
        border-color var(--transition);
    z-index: 2;
}
.player-row .progress-bar:hover .progress-thumb {
    width: 16px;
    height: 16px;
}
.player-row .time-display {
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    color: var(--text-muted);
    min-width: 90px;
    text-align: center;
    font-weight: 500;
    letter-spacing: 0.2px;
    transition: color var(--transition);
    flex-shrink: 0;
}
.player-row .vol-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.player-row .vol-wrap input[type='range'] {
    width: 56px;
    height: 4px;
    -webkit-appearance: none;
    background: var(--progress-bg);
    outline: none;
    cursor: pointer;
    transition: background var(--transition);
}
.player-row .vol-wrap input[type='range']::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: var(--accent);
    cursor: pointer;
    border: none;
}
.player-row .vol-wrap input[type='range']::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: var(--accent);
    cursor: pointer;
    border: none;
}
.player-row .speed-wrap {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}
.player-row .speed-wrap select {
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 2px 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    font-family: var(--font);
    transition:
        background var(--transition),
        color var(--transition),
        border-color var(--transition);
    outline: none;
    height: 28px;
}
.player-row .speed-wrap select:hover {
    border-color: var(--accent);
}
.player-row .mode-wrap {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}
.player-row .mode-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition:
        background var(--transition),
        color var(--transition);
    font-family: inherit;
    position: relative;
}
.player-row .mode-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}
.player-row .mode-btn.active {
    color: var(--accent);
}
.player-row .mode-btn .badge {
    position: absolute;
    top: -2px;
    right: -2px;
    font-size: 8px;
    background: var(--accent);
    color: #fff;
    padding: 1px 4px;
    font-weight: 600;
    line-height: 1.3;
}
.player-row .mode-btn .badge.ab {
    background: #c0392b;
}
/* v2.0.4: the track toggle widens into a pill carrying the active-track label
   (原声/伴奏), so the current main playback track is visible at a glance */
.player-row .mode-wrap .mode-btn#auditionToggleBtn {
    width: auto;
    padding: 0 8px;
    gap: 4px;
    font-size: 12px;
}
.player-row .mode-wrap .mode-btn#auditionToggleBtn .track-label {
    line-height: 1;
    font-weight: 600;
}
.player-row .ab-wrap {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}
.player-row .ab-wrap .ab-btn {
    width: 28px;
    height: 28px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition:
        background var(--transition),
        color var(--transition),
        border-color var(--transition);
    font-family: var(--font);
}
.player-row .ab-wrap .ab-btn:hover {
    border-color: var(--accent);
    color: var(--text-primary);
}
.player-row .ab-wrap .ab-btn.set {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-bg);
}
.player-row .ab-wrap .ab-btn.active-ab {
    border-color: #c0392b;
    color: #c0392b;
    background: rgba(192, 57, 43, 0.1);
}
.player-row .ab-wrap .ab-label {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 500;
    min-width: 20px;
    text-align: center;
}

/* =========================== v2.0.0: TRANSPOSE + BOOKMARKS =========================== */
.player-row .transpose-wrap {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}
.player-row .transpose-btn {
    width: 22px;
    height: 28px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-muted);
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition:
        background var(--transition),
        color var(--transition),
        border-color var(--transition);
    font-family: var(--font);
}
.player-row .transpose-btn:hover {
    border-color: var(--accent);
    color: var(--text-primary);
}
.player-row .transpose-val {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 600;
    min-width: 24px;
    text-align: center;
    font-family: var(--font);
}
.player-row .marks-panel {
    position: absolute;
    bottom: calc(100% + 8px);
    right: 16px;
    z-index: 60;
    width: 230px;
    max-height: 240px;
    overflow-y: auto;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    padding: 6px;
}
.player-row .marks-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.player-row .mark-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 6px;
    border-radius: 6px;
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--bg-hover);
}
.player-row .mark-row.off {
    opacity: 0.55;
}
.player-row .mark-row .mark-active {
    cursor: pointer;
}
.player-row .mark-row .mark-times {
    flex: 1;
    font-family: var(--font);
    white-space: nowrap;
}
.player-row .mark-row .mark-del {
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 12px;
    padding: 2px 4px;
}
.player-row .mark-row .mark-del:hover {
    color: #c0392b;
}
.player-row .marks-empty {
    font-size: 12px;
    color: var(--text-muted);
    padding: 8px;
    text-align: center;
}

/* per-line instrumental audition button (v2.0.0 #13) */
.line-inst,
.study-inst {
    flex-shrink: 0;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 13px;
    padding: 2px 4px;
    opacity: 0.5;
    transition:
        opacity var(--transition),
        color var(--transition);
}
.view-lyrics .lyric-line .line-inst {
    margin-left: auto;
}
.line-inst:hover,
.study-inst:hover {
    opacity: 1;
    color: var(--accent);
}
.study-inst {
    font-size: 15px;
}

/* recent + queue sidebar sections (v2.0.0 #14) */
.recent-list,
.queue-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
    max-height: 160px;
    overflow-y: auto;
}
.recent-row,
.queue-row {
    display: flex;
    align-items: center;
    gap: 4px;
}
.recent-open {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    text-align: left;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 12px;
    padding: 5px 8px;
    border-radius: 6px;
    font-family: var(--font);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition:
        background var(--transition),
        color var(--transition);
}
.recent-open:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}
.recent-open i {
    color: var(--text-muted);
}
.recent-del,
.queue-del {
    flex-shrink: 0;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 12px;
    padding: 4px 6px;
    border-radius: 6px;
    transition: color var(--transition);
}
.recent-del:hover,
.queue-del:hover {
    color: #c0392b;
}
.queue-name {
    flex: 1;
    min-width: 0;
    font-size: 12px;
    color: var(--text-secondary);
    padding: 5px 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* =========================== v2.1.1: PLAYER EXT + DRAWER ===========================
   The always-visible practice core (prev/play/next/reset + loop + track) stays
   on the bar; the .ext-item blocks are pinned into .player-ext or folded into
   .player-drawer by app.js renderPlayerExt() per settings.playerExt. */
.player-main-row {
    display: flex;
    align-items: center;
    gap: 10px 12px;
    flex-wrap: wrap;
}
/* v2.1.1: desktop cover entry button (mobile uses the top-bar #mobileCoverBtn) */
.player-cover-btn {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 15px;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition:
        background var(--transition),
        color var(--transition);
    font-family: inherit;
}
.player-cover-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}
.player-ext {
    display: flex;
    align-items: center;
    gap: 10px 14px;
    flex: 1;
    min-width: 0;
}
.player-ext .ext-item {
    display: flex;
    align-items: center;
    gap: 8px;
}
.player-ext-toggle {
    width: 34px;
    height: 34px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 17px;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition:
        background var(--transition),
        color var(--transition);
    font-family: inherit;
    position: relative;
    flex-shrink: 0;
}
.player-ext-toggle:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}
.player-ext-toggle .badge {
    position: absolute;
    top: -3px;
    right: -3px;
    font-size: 9px;
    background: var(--accent);
    color: #fff;
    padding: 1px 4px;
    font-weight: 600;
    line-height: 1.4;
}
.player-drawer {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 12px;
    right: 12px;
    z-index: 55;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    padding: 10px 12px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
}
.player-drawer .ext-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* =========================== v2.1.1: MOBILE SHELL (hidden on desktop) ===========================
   Top bar, bottom nav, and the two drawers replace the sidebar under the
   narrow-screen breakpoint (see responsive.css). Base styles live here so the
   components don't depend on the media query for their look. */
.mobile-topbar,
.top-drawer,
.bottom-nav,
.more-drawer {
    display: none;
}
.mobile-topbar {
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-sidebar);
    flex-shrink: 0;
}
.mobile-brand {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--text-primary);
    white-space: nowrap;
}
.mobile-brand span {
    color: var(--accent);
}
.mobile-now {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.mobile-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mobile-artist {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mobile-cover-btn,
.mobile-more-btn {
    width: 34px;
    height: 34px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 16px;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition:
        background var(--transition),
        color var(--transition);
    font-family: inherit;
}
.mobile-cover-btn:hover,
.mobile-more-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}
.bottom-nav {
    display: none;
    flex-shrink: 0;
    border-top: 1px solid var(--border-color);
    background: var(--bg-sidebar);
    padding: 4px 6px calc(4px + env(safe-area-inset-bottom));
    gap: 2px;
}
.bottom-nav-slot,
.bottom-nav-more {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 2px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    border-radius: 8px;
    transition:
        background var(--transition),
        color var(--transition);
    font-family: var(--font);
}
.bottom-nav-slot .nav-label,
.bottom-nav-more .nav-label {
    font-size: 10px;
    line-height: 1.2;
    white-space: nowrap;
}
.bottom-nav-slot:hover,
.bottom-nav-more:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}
.bottom-nav-slot.active {
    background: var(--bg-active);
    color: var(--accent);
}
.top-drawer,
.more-drawer {
    position: absolute;
    z-index: 65;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
/* v2.1.1: the drawer itself never scrolls — only its inner recent/queue
   lists do, so a long history cannot push the menu off the screen. */
.more-drawer .recent-list,
.more-drawer .queue-list {
    max-height: 22vh;
    overflow-y: auto;
}
.top-drawer {
    top: calc(100% - 4px);
    right: 8px;
    min-width: 180px;
}
.more-drawer {
    bottom: calc(100% + 6px);
    left: 8px;
    right: 8px;
}
.drawer-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    border-radius: 6px;
    text-align: left;
    font-family: var(--font);
    transition:
        background var(--transition),
        color var(--transition);
}
.drawer-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}
.drawer-item i {
    width: 20px;
    text-align: center;
    color: var(--text-muted);
}
.drawer-section {
    border-top: 1px solid var(--border-color);
    margin-top: 4px;
    padding-top: 8px;
}
.drawer-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    padding: 6px 8px 4px;
}
