* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

html, body {
    background-color: #121214;
    color: #E1E1E6;
    height: 100%;
    width: 100%;
    overflow: hidden;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
    background-color: #121214;
}

/* 頂部導覽列 (自動換行排版) */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 18px;
    background: #18181B;
    border-bottom: 1px solid #27272A;
    z-index: 10;
}

.brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: #00B37E;
}

.header-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
}

.status-badge {
    background: #04D36122;
    color: #04D361;
    border: 1px solid #04D36166;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
}

.file-upload-btn {
    display: inline-flex;
    align-items: center;
    margin-bottom: 0;
}

/* 按鈕風格 */
.btn {
    padding: 6px 11px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.84rem;
    font-weight: 600;
    transition: 0.2s ease;
}

.btn-primary {
    background: #00B37E;
    color: #FFFFFF;
}

    .btn-primary:hover {
        background: #00875F;
    }

.btn-secondary {
    background: #27272A;
    color: #E1E1E6;
}

    .btn-secondary:hover {
        background: #323238;
    }

/* 彈唱自動滾動按鈕 */
.autoscroll-control-box {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #202024;
    padding: 2px 6px;
    border-radius: 6px;
    border: 1px solid #323238;
}

.btn-scroll-active {
    background: #10B981;
    color: white;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

.scroll-speed-label {
    font-size: 0.72rem;
    color: #94A3B8;
}

.scroll-speed-val {
    font-size: 0.8rem;
    font-weight: bold;
    color: #10B981;
    min-width: 14px;
    text-align: center;
}

.btn-ctrl-sm {
    background: #323238;
    color: white;
    border: none;
    width: 18px;
    height: 18px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: bold;
}

/* 押韻按鈕 */
.btn-rhyme-active {
    background: #8B5CF6;
    color: white;
    box-shadow: 0 0 8px rgba(139, 92, 246, 0.5);
}

/* A4 列印專用按鈕 */
.btn-print {
    background: #F8FAFC;
    color: #0F172A;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(255, 255, 255, 0.15);
}

    .btn-print:hover {
        background: #E2E8F0;
    }

.btn-tuner {
    background: #1E293B;
    color: #38BDF8;
    border: 1px solid #0284C7;
}

    .btn-tuner:hover {
        background: #0369A1;
        color: white;
    }

.btn-tuner-active {
    background: #0284C7;
    color: white;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
}

.btn-ai {
    background: linear-gradient(135deg, #7928CA, #FF0080);
    color: #FFFFFF;
    box-shadow: 0 2px 8px rgba(121, 40, 202, 0.4);
}

    .btn-ai:hover {
        opacity: 0.9;
        transform: translateY(-1px);
    }

.btn-danger-sm {
    background: #381a1d;
    color: #ff6b6b;
    border: 1px solid #5c2429;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
}

    .btn-danger-sm:hover {
        background: #e53e3e;
        color: white;
    }

/* 主工作區 */
.main-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* 側邊欄 */
.song-sidebar {
    width: 260px;
    background: #18181B;
    border-right: 1px solid #27272A;
    padding: 14px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.sidebar-header h3 {
    font-size: 0.8rem;
    color: #82828C;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.song-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

    .song-list li {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 12px;
        border-radius: 8px;
        cursor: pointer;
        background: #202024;
        border: 1px solid transparent;
        transition: 0.2s ease;
    }

        .song-list li:hover {
            border-color: #323238;
        }

        .song-list li.active {
            background: #00875F;
            border-color: #00B37E;
        }

.song-info {
    flex: 1;
    overflow: hidden;
}

    .song-info strong {
        display: block;
        font-size: 0.92rem;
        color: #FFFFFF;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .song-info .meta {
        display: block;
        font-size: 0.75rem;
        color: #A8A8B3;
        margin-top: 3px;
    }

.btn-trash {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    padding: 4px;
    opacity: 0.5;
    transition: 0.2s;
}

    .btn-trash:hover {
        opacity: 1;
        transform: scale(1.15);
    }

/* 編輯主工作區 */
.editor-workspace {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #121214;
}

/* 吉他調音器 HUD */
.tuner-hud-container {
    background: #0B0F19;
    border-bottom: 2px solid #0284C7;
    padding: 12px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    animation: fadeIn 0.25s ease;
}

.tuner-gauge-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    width: 100%;
    max-width: 650px;
}

.tuner-note-display {
    min-width: 65px;
    text-align: right;
}

.tuner-note-txt {
    font-size: 2.6rem;
    font-weight: 900;
    font-family: "Consolas", monospace;
    color: #94A3B8;
}

    .tuner-note-txt.in-tune {
        color: #00B37E;
        text-shadow: 0 0 15px rgba(0, 179, 126, 0.6);
    }

    .tuner-note-txt.flat {
        color: #38BDF8;
    }

    .tuner-note-txt.sharp {
        color: #F87171;
    }

.tuner-octave-txt {
    font-size: 1.1rem;
    color: #64748B;
    margin-left: 2px;
}

.tuner-meter-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tuner-scale {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    color: #64748B;
    font-weight: 700;
    padding: 0 2px;
}

    .tuner-scale .center-mark {
        color: #00B37E;
        font-weight: 900;
    }

.tuner-track {
    position: relative;
    height: 10px;
    background: #1E293B;
    border-radius: 5px;
    overflow: hidden;
}

    .tuner-track::after {
        content: '';
        position: absolute;
        top: 0;
        left: 50%;
        width: 2px;
        height: 100%;
        background: #00B37E;
        transform: translateX(-50%);
    }

.tuner-needle {
    position: absolute;
    top: -2px;
    left: 50%;
    width: 6px;
    height: 14px;
    border-radius: 3px;
    background: #94A3B8;
    transform: translateX(-50%);
    transition: left 0.05s linear;
}

    .tuner-needle.in-tune {
        background: #00B37E;
        box-shadow: 0 0 8px #00B37E;
    }

    .tuner-needle.flat {
        background: #38BDF8;
    }

    .tuner-needle.sharp {
        background: #F87171;
    }

.tuner-info-box {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 90px;
    font-size: 0.75rem;
    gap: 2px;
}

.tuner-status {
    font-weight: 700;
    font-size: 0.82rem;
    color: #94A3B8;
}

    .tuner-status.in-tune {
        color: #00B37E;
    }

    .tuner-status.flat {
        color: #38BDF8;
    }

    .tuner-status.sharp {
        color: #F87171;
    }

.tuner-hz {
    color: #CBD5E1;
    font-family: monospace;
}

.tuner-cents {
    color: #64748B;
}

.tuner-guitar-reference {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.75rem;
}

.ref-title {
    color: #64748B;
    font-weight: bold;
}

.guitar-string-chip {
    background: #1E293B;
    color: #94A3B8;
    padding: 2px 7px;
    border-radius: 4px;
    font-family: monospace;
    border: 1px solid #334155;
}

/* 歌曲控制列 */
.song-meta-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 18px;
    background: #18181B;
    border-bottom: 1px solid #27272A;
}

.title-edit-group {
    flex: 1;
    min-width: 180px;
}

.input-title {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 2px solid #323238;
    color: #FFFFFF;
    font-size: 1.25rem;
    font-weight: 700;
    outline: none;
    padding: 2px 4px;
}

    .input-title:focus {
        border-color: #00B37E;
    }

.meta-controls {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.85rem;
    color: #A8A8B3;
}

.input-sm {
    background: #202024;
    border: 1px solid #323238;
    color: #FFFFFF;
    padding: 4px 6px;
    border-radius: 6px;
    outline: none;
    text-align: center;
}

/* 節拍器與 TAP */
.metronome-box {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #202024;
    padding: 3px 8px;
    border-radius: 6px;
    border: 1px solid #323238;
}

.bpm-input {
    width: 55px;
}

.btn-tap {
    background: #2D3748;
    color: #E2E8F0;
    border: 1px solid #4A5568;
    border-radius: 4px;
    padding: 3px 8px;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.75rem;
}

    .btn-tap:active {
        background: #00B37E;
        color: white;
        transform: scale(0.95);
    }

.btn-metro {
    background: #323238;
    color: #FFFFFF;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.8rem;
}

    .btn-metro.metro-active {
        background: #E53E3E;
        animation: pulse 0.5s infinite alternate;
    }

.beat-dots {
    display: flex;
    gap: 4px;
    margin-left: 4px;
}

.dot {
    width: 18px;
    height: 18px;
    font-size: 0.65rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #27272A;
    color: #71717A;
    border-radius: 50%;
}

.dot-accent {
    background: #00B37E;
    color: white;
    font-weight: bold;
    transform: scale(1.15);
}

.dot-sub {
    background: #3B82F6;
    color: white;
}

/* 轉調框 */
.transpose-box {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #202024;
    padding: 3px 6px;
    border-radius: 6px;
    border: 1px solid #323238;
}

.btn-ctrl {
    background: #323238;
    color: #FFFFFF;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

.key-offset {
    font-weight: bold;
    color: #00B37E;
    min-width: 22px;
    text-align: center;
}

.btn-link {
    background: none;
    border: none;
    color: #82828C;
    font-size: 0.75rem;
    cursor: pointer;
    text-decoration: underline;
}

/* 錄音軌控制列 */
.audio-track-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 18px;
    background: #141416;
    border-bottom: 1px solid #27272A;
    overflow-x: auto;
}

.recorder-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-record {
    background: #27202A;
    border: 1px solid #7D2845;
    color: #FF7597;
    font-size: 0.82rem;
    font-weight: 700;
    white-space: nowrap;
}

    .btn-record:hover {
        background: #381B28;
    }

.btn-record-stop {
    background: #E53E3E;
    color: white;
    font-size: 0.82rem;
    font-weight: 700;
    animation: recordBlink 1s infinite;
    white-space: nowrap;
}

@keyframes recordBlink {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }

    100% {
        opacity: 1;
    }
}

.input-select-sm {
    background: #202024;
    border: 1px solid #323238;
    color: #E1E1E6;
    font-size: 0.8rem;
    padding: 4px 8px;
    border-radius: 6px;
    outline: none;
}

.memos-list {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    overflow-x: auto;
}

.memo-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #202024;
    border: 1px solid #323238;
    padding: 4px 8px;
    border-radius: 20px;
    flex-shrink: 0;
}

.memo-title-edit {
    background: transparent;
    border: none;
    border-bottom: 1px dashed #52525B;
    color: #E1E1E6;
    font-size: 0.8rem;
    width: 90px;
    outline: none;
}

.memo-duration {
    font-size: 0.75rem;
    color: #71717A;
}

.memo-audio-player {
    height: 26px;
    width: 170px;
    outline: none;
}

.btn-trash-memo {
    background: transparent;
    border: none;
    color: #71717A;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.85rem;
    padding: 0 4px;
}

    .btn-trash-memo:hover {
        color: #FF6B6B;
    }

.no-memo-tip {
    font-size: 0.8rem;
    color: #52525B;
    white-space: nowrap;
}

/* 字幕看板 */
.live-subtitle-hud {
    background: #171B26;
    border-bottom: 1px solid #28334E;
    padding: 10px 18px;
    animation: fadeIn 0.3s ease;
}

.hud-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.hud-status {
    font-size: 0.8rem;
    font-weight: 700;
    color: #38BDF8;
}

.hud-actions {
    display: flex;
    gap: 6px;
}

.btn-primary-sm {
    background: #00B37E;
    color: white;
    border: none;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
}

.btn-clear-sm {
    background: #27272A;
    color: #A8A8B3;
    border: none;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.78rem;
    cursor: pointer;
}

.hud-text-body {
    background: #0E121B;
    border: 1px solid #1E293B;
    padding: 10px 14px;
    border-radius: 6px;
    min-height: 48px;
    font-size: 1.05rem;
    line-height: 1.6;
}

.final-text {
    color: #F8FAFC;
    font-weight: 600;
}

.interim-text {
    color: #38BDF8;
    font-style: italic;
    opacity: 0.85;
    margin-left: 4px;
}

/* ================= 押韻字典面板樣式 ================= */
.rhyme-finder-bar {
    background: #1C1927;
    border-bottom: 2px solid #8B5CF6;
    padding: 10px 18px;
    animation: fadeIn 0.2s ease;
}

.rhyme-bar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.rhyme-title-box {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: #DDD6FE;
}

.rhyme-tip {
    font-size: 0.75rem;
    color: #A78BFA;
}

.btn-close-sm {
    background: none;
    border: none;
    color: #A78BFA;
    cursor: pointer;
    font-size: 1rem;
}

.rhyme-chips-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-height: 90px;
    overflow-y: auto;
}

.rhyme-word-chip {
    background: #2E2548;
    color: #F5F3FF;
    border: 1px solid #7C3AED;
    padding: 3px 9px;
    border-radius: 12px;
    font-size: 0.82rem;
    cursor: pointer;
    transition: 0.15s;
}

    .rhyme-word-chip:hover {
        background: #7C3AED;
        transform: translateY(-1px);
    }

.rhyme-char-chip {
    background: #201A33;
    color: #C4B5FD;
    border: 1px dashed #6D28D9;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
}

    .rhyme-char-chip:hover {
        background: #6D28D9;
        color: white;
    }

/* 快速工具列 */
.chord-quick-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: #141416;
    border-bottom: 1px solid #27272A;
    overflow-x: auto;
    white-space: nowrap;
}

.bar-title {
    font-size: 0.75rem;
    color: #71717A;
}

.divider {
    color: #323238;
    margin: 0 4px;
}

.tag-btn {
    background: #202024;
    color: #E1E1E6;
    border: 1px solid #323238;
    padding: 3px 9px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
}

    .tag-btn:hover {
        background: #00875F;
        border-color: #00B37E;
        color: white;
    }

.tag-section {
    background: #272038;
    border-color: #553C9A;
    color: #D6BCFA;
}

.tag-mod {
    background: #1C2833;
    border-color: #2E4053;
    color: #85C1E9;
}

/* 雙欄工作區 */
.view-panels {
    display: flex;
    flex: 1;
    gap: 14px;
    padding: 14px;
    overflow: hidden;
}

.panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #18181B;
    border-radius: 8px;
    border: 1px solid #27272A;
    overflow: hidden;
}

.panel-header {
    padding: 8px 12px;
    background: #202024;
    font-size: 0.8rem;
    color: #A8A8B3;
    font-weight: 600;
    border-bottom: 1px solid #27272A;
}

.chord-editor {
    flex: 1;
    background: transparent;
    border: none;
    padding: 14px;
    color: #E1E1E6;
    font-family: "Consolas", "Courier New", monospace;
    font-size: 1.05rem;
    line-height: 1.8;
    resize: none;
    outline: none;
    overflow-y: auto;
}

/* 樂譜預覽區 */
.chord-preview {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    background: #151518;
    scroll-behavior: smooth;
}

.sheet-line {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    margin-bottom: 12px;
    position: relative;
    padding-right: 90px;
}

.chord-lyric-pair {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    margin-right: 1px;
}

.chord-text {
    font-family: "Consolas", monospace;
    font-weight: 700;
    color: #00B37E;
    font-size: 0.95rem;
    min-height: 1.2rem;
}

.chord-clickable {
    cursor: pointer;
    border-radius: 3px;
    padding: 0 2px;
}

    .chord-clickable:hover {
        background: rgba(0, 179, 126, 0.25);
        color: #4EFA9D;
        text-decoration: underline;
    }

.lyric-text {
    font-size: 1.1rem;
    color: #FFFFFF;
}

.empty-line {
    height: 1.4rem;
}

/* 行尾小工具 (尾字押韻按鈕 + 字數統計) */
.line-tail-tools {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    align-self: center;
}

.rhyme-trigger-btn {
    background: #2E2548;
    color: #C4B5FD;
    border: 1px solid #6D28D9;
    border-radius: 4px;
    padding: 1px 5px;
    font-size: 0.72rem;
    cursor: pointer;
}

    .rhyme-trigger-btn:hover {
        background: #7C3AED;
        color: white;
    }

.char-counter {
    font-size: 0.72rem;
    color: #52525B;
    background: #18181B;
    padding: 1px 5px;
    border-radius: 3px;
}

.section-header-banner {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    margin: 14px 0 6px 0;
}

.badge-verse {
    background: rgba(59, 130, 246, 0.2);
    color: #60A5FA;
    border: 1px solid rgba(59, 130, 246, 0.4);
}

.badge-chorus {
    background: rgba(245, 158, 11, 0.2);
    color: #FBBF24;
    border: 1px solid rgba(245, 158, 11, 0.4);
}

.badge-bridge {
    background: rgba(168, 85, 247, 0.2);
    color: #C084FC;
    border: 1px solid rgba(168, 85, 247, 0.4);
}

.badge-general {
    background: rgba(113, 113, 122, 0.2);
    color: #A1A1AA;
    border: 1px solid rgba(113, 113, 122, 0.4);
}

/* 指法彈窗樣式 */
.chord-modal-window {
    background: #18181B;
    border: 1px solid #38BDF8;
    border-radius: 12px;
    width: 320px;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.7);
    overflow: hidden;
}

.chord-modal-title {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.chord-badge {
    font-size: 1.4rem;
    font-weight: 900;
    color: #38BDF8;
    font-family: "Consolas", monospace;
}

.chord-desc {
    font-size: 0.75rem;
    color: #94A3B8;
}

.chord-modal-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #121214;
}

.chord-switcher-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: #94A3B8;
    margin-bottom: 14px;
    width: 100%;
}

    .chord-switcher-row select {
        flex: 1;
    }

.fretboard-wrap {
    width: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.nut-status-row {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    width: 100%;
    text-align: center;
    font-size: 0.9rem;
    font-weight: bold;
    height: 22px;
    margin-bottom: 4px;
}

.mute-x {
    color: #EF4444;
}

.open-o {
    color: #00B37E;
}

.nut-bar {
    width: 100%;
    height: 6px;
    background: #475569;
    border-radius: 2px;
    position: relative;
}

    .nut-bar.nut-open {
        background: #F8FAFC;
        height: 7px;
    }

    .nut-bar.nut-fret {
        background: #334155;
    }

.base-fret-tag {
    position: absolute;
    left: -65px;
    top: -6px;
    font-size: 0.75rem;
    color: #38BDF8;
    font-weight: bold;
    background: #1E293B;
    padding: 2px 6px;
    border-radius: 4px;
}

.fretboard-grid {
    width: 100%;
    border-left: 2px solid #64748B;
    border-right: 2px solid #64748B;
    background: rgba(30, 41, 59, 0.35);
}

.fret-row {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    height: 42px;
    border-bottom: 2px solid #64748B;
    position: relative;
}

.fret-cell {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.string-line {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    background: #94A3B8;
    z-index: 1;
}

.string-col-0 .string-line {
    width: 3.5px;
}

.string-col-1 .string-line {
    width: 3.0px;
}

.string-col-2 .string-line {
    width: 2.5px;
}

.string-col-3 .string-line {
    width: 2.0px;
}

.string-col-4 .string-line {
    width: 1.5px;
}

.string-col-5 .string-line {
    width: 1.0px;
}

.finger-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #00B37E;
    box-shadow: 0 0 8px rgba(0, 179, 126, 0.8);
    border: 2px solid #FFFFFF;
    z-index: 2;
}

.string-names-row {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    width: 100%;
    text-align: center;
    font-size: 0.68rem;
    color: #64748B;
    margin-top: 8px;
    font-family: monospace;
}

/* 通用彈窗樣式 */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    backdrop-filter: blur(4px);
}

.modal-window {
    background: #18181B;
    border: 1px solid #323238;
    border-radius: 12px;
    width: 90%;
    max-width: 680px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    background: #202024;
    border-bottom: 1px solid #27272A;
}

.btn-close {
    background: none;
    border: none;
    color: #A8A8B3;
    font-size: 1.2rem;
    cursor: pointer;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
}

.modal-settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 8px;
}

.setting-item label {
    display: block;
    font-size: 0.8rem;
    color: #A8A8B3;
    margin-bottom: 4px;
}

.input-select, .input-text {
    width: 100%;
    background: #202024;
    border: 1px solid #323238;
    color: white;
    padding: 8px 10px;
    border-radius: 6px;
    outline: none;
    font-size: 0.9rem;
}

.ai-result-card {
    background: #202024;
    border: 1px solid #323238;
    border-radius: 8px;
    padding: 16px;
    margin-top: 14px;
}

.result-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.score-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
}

.score-high {
    background: rgba(0, 179, 126, 0.2);
    color: #00B37E;
    border: 1px solid #00B37E;
}

.score-mid {
    background: rgba(245, 158, 11, 0.2);
    color: #FBBF24;
    border: 1px solid #FBBF24;
}

.review-box {
    background: #141416;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 14px;
    font-size: 0.85rem;
    line-height: 1.6;
}

.review-section {
    margin-bottom: 8px;
}

    .review-section:last-child {
        margin-bottom: 0;
    }

    .review-section strong {
        color: #A8A8B3;
        display: block;
        margin-bottom: 2px;
    }

    .review-section p {
        color: #E1E1E6;
    }

.translated-lyrics-preview {
    margin-bottom: 14px;
}

.sub-header {
    font-size: 0.8rem;
    color: #82828C;
    margin-bottom: 6px;
}

.lyrics-box {
    background: #121214;
    padding: 12px;
    border-radius: 6px;
    color: #00B37E;
    font-family: "Consolas", monospace;
    font-size: 0.9rem;
    line-height: 1.7;
    white-space: pre-wrap;
    max-height: 180px;
    overflow-y: auto;
}

.modal-footer-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* 預設非列印時隱藏列印抬頭 */
.print-only {
    display: none;
}

/* ================= 專業出版級 A4 黑白列印 / PDF 樣式 ================= */
@media print {
    /* 隱藏網頁所有無關控制列、側邊欄、按鈕 */
    .no-print, .no-print * {
        display: none !important;
        height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    body, html, .app-container, .main-layout, .editor-workspace, .view-panels {
        background-color: #FFFFFF !important;
        color: #000000 !important;
        height: auto !important;
        width: 100% !important;
        overflow: visible !important;
    }

    /* 將右欄排版樂譜全螢幕化展開 */
    .panel.sheet-panel {
        border: none !important;
        background: transparent !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .chord-preview {
        background: transparent !important;
        padding: 0 !important;
        overflow: visible !important;
    }

    /* 列印專屬抬頭顯示 */
    .print-only {
        display: block !important;
    }

    .print-score-header {
        margin-bottom: 24px;
    }

    .print-title {
        font-size: 26pt;
        font-weight: bold;
        color: #000000 !important;
        text-align: center;
        margin-bottom: 10px;
    }

    .print-meta {
        display: flex;
        justify-content: center;
        gap: 24px;
        font-size: 11pt;
        color: #333333 !important;
        font-weight: 600;
    }

    .print-divider {
        margin-top: 12px;
        border-bottom: 2px solid #000000;
    }

    /* 樂譜字型黑白高對比 */
    .chord-text {
        color: #000000 !important;
        font-weight: 800 !important;
        font-size: 12pt !important;
    }

    .lyric-text {
        color: #111111 !important;
        font-size: 14pt !important;
        font-weight: 500 !important;
    }

    .sheet-line {
        margin-bottom: 18px !important;
        padding-right: 0 !important;
        page-break-inside: avoid; /* 避免單句歌詞被印表機分頁硬生生切斷 */
    }

    /* 段落標籤轉為優雅黑框標籤 */
    .section-header-banner {
        color: #000000 !important;
        background: transparent !important;
        border: 1.5px solid #000000 !important;
        font-size: 11pt !important;
        margin: 20px 0 10px 0 !important;
        page-break-after: avoid;
    }
}

/* 平板與手機自適應 */
@media (max-width: 900px) {
    body {
        overflow-y: auto;
    }

    .app-container {
        height: auto;
        min-height: 100vh;
        overflow-y: auto;
    }

    .main-layout {
        flex-direction: column;
        overflow: visible;
    }

    .song-sidebar {
        width: 100%;
        max-height: 180px;
        border-right: none;
        border-bottom: 1px solid #27272A;
    }

    .view-panels {
        flex-direction: column;
        overflow: visible;
    }

    .panel {
        min-height: 380px;
    }

    .modal-settings-grid {
        grid-template-columns: 1fr;
    }

    .audio-track-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .memos-list {
        width: 100%;
    }

    .tuner-gauge-box {
        flex-direction: column;
        gap: 12px;
    }
}
