/* ==========================================================================
   Kalimba Online - 最终完整版 CSS (2025 Integrated Version)
   Contains: Global, Header, Footer, Scores, Mobile Drawer Nav, & Lang UI
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. 全局布局修正 (Global Layout)
   -------------------------------------------------------------------------- */
body {
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: var(--background-color);
}

/* 关键：去除 Pico.css 默认的大额顶部内边距 */
main.container {
    padding-top: 1rem !important;
    margin-top: 0 !important;
    flex: 1;
    width: 100%;
}

/* --------------------------------------------------------------------------
   2. Header & Navigation (头部与导航)
   -------------------------------------------------------------------------- */
.site-header {
    background-color: #ffffff;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 9999;
    width: 100%;
    height: 70px;
    padding: 0;
}

.header-inner {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    height: 100%;
    position: relative;
}

.site-logo {
    grid-column: 1;
    justify-self: start;
    font-size: 1.6rem;
    font-weight: 800;
    color: #e67e22 !important;
    text-decoration: none;
    line-height: 1;
    white-space: nowrap;
}

.site-nav {
    grid-column: 2;
    justify-self: center;
    height: 100%;
    display: flex;
    align-items: center;
    margin-left: 50px;
}

.site-nav > ul {
    display: flex;
    gap: 2.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
    align-items: center;
    height: 100%;
}

.site-nav > ul > li {
    height: 100%;
    display: flex;
    align-items: center;
}

.site-nav > ul > li > a {
    color: #333333 !important;
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    transition: color 0.2s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    height: 100%;
}

.site-nav > ul > li > a:hover {
    color: #e67e22 !important;
}

/* 默认隐藏移动端汉堡按钮 */
.mobile-nav-toggle {
    grid-column: 3;
    justify-self: end;
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    color: #333333;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: flex-end;
}

.mobile-nav-toggle svg {
    width: 28px;
    height: 28px;
    stroke: #333333;
    stroke-width: 2.5px;
}

/* --------------------------------------------------------------------------
   3. Dropdown Menu (桌面端下拉菜单)
   -------------------------------------------------------------------------- */
@media (min-width: 993px) {
    .site-nav li.has-dropdown {
        position: relative;
    }

    .dropdown-menu {
        position: absolute;
        top: 100%;
        left: 50%;
        transform: translateX(-50%) translateY(10px);
        background-color: #ffffff;
        min-width: 240px;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
        border-radius: 8px;
        padding: 10px 0;
        opacity: 0;
        visibility: hidden;
        transition: all 0.2s ease;
        z-index: 10000;
        display: flex;
        flex-direction: column;
        gap: 0;
        list-style: none;
        margin: 0;
    }

    .dropdown-menu::before {
        content: "";
        position: absolute;
        top: -6px;
        left: 50%;
        transform: translateX(-50%);
        border-width: 0 6px 6px 6px;
        border-style: solid;
        border-color: transparent transparent #ffffff transparent;
    }

    .site-nav li.has-dropdown:hover .dropdown-menu {
        opacity: 1;
        visibility: visible;
        transform: translateX(-50%) translateY(0);
    }

    .dropdown-menu li {
        width: 100%;
        display: block;
    }

    .dropdown-menu a {
        display: block;
        padding: 10px 20px;
        color: #555 !important;
        font-size: 0.95rem;
        font-weight: normal;
        text-align: left;
        width: 100%;
    }

    .dropdown-menu a:hover {
        background-color: #f8f9fa;
        color: #e67e22 !important;
    }
}

/* --------------------------------------------------------------------------
   3.5. Language Switcher (图标+文字 紧凑模式)
   -------------------------------------------------------------------------- */
/* 容器定位 */
.header-lang {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    margin-left: 25px;
    position: relative;
}

/* 核心下拉框 - 图标文字并存优化 */
.header-lang select.clean-select {
    /* 基础重置 */
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    
    /* 尺寸与排版 */
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    
    /* 【核心排版】左边留出32px给地球仪，右边留10px呼吸感 */
    padding: 6px 10px 6px 32px !important; 
    
    /* 字体样式 - 精致小字体 */
    font-size: 0.85rem !important; /* 您建议的小字体 */
    font-weight: 700 !important;
    font-family: inherit;
    line-height: 1.5;
    color: #555555 !important; /* 文字颜色恢复可见 */
    
    /* 背景：地球仪图标固定在左侧 */
    background-color: transparent !important;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23555555' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3e%3ccircle cx='12' cy='12' r='10'%3e%3c/circle%3e%3cline x1='2' y1='12' x2='22' y2='12'%3e%3c/line%3e%3cpath d='M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z'%3e%3c/path%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    /* 位置：垂直居中，距离左边5px */
    background-position: center left 5px !important; 
    background-size: 18px !important; /* 图标稍微小一点，精致 */
    
    /* 边框与圆角 - 胶囊状 */
    border: 1px solid transparent !important;
    border-radius: 20px !important;
    box-shadow: none !important;
    cursor: pointer;
    
    transition: all 0.2s ease-in-out;
}

/* 悬停状态 */
.header-lang select.clean-select:hover {
    color: #e67e22 !important; /* 文字变橙 */
    background-color: rgba(0, 0, 0, 0.04) !important; /* 淡淡的背景 */
    
    /* 悬停时图标也变橙 */
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e67e22' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3e%3ccircle cx='12' cy='12' r='10'%3e%3c/circle%3e%3cline x1='2' y1='12' x2='22' y2='12'%3e%3c/line%3e%3cpath d='M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z'%3e%3c/path%3e%3c/svg%3e") !important;
}

/* 聚焦状态 (点击时) */
.header-lang select.clean-select:focus {
    outline: none !important;
    background-color: #ffffff !important;
    box-shadow: 0 0 0 2px rgba(230, 126, 34, 0.15) !important;
    border: 1px solid rgba(230, 126, 34, 0.3) !important;
}

/* --------------------------------------------------------------------------
   4. Footer Styles (全宽底部)
   -------------------------------------------------------------------------- */
.site-footer {
    background-color: #f8f9fa;
    border-top: 1px solid #e9ecef;
    padding: 4rem 0 2rem;
    margin-top: auto;
    width: 100%;
    color: #333;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 3rem;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

.footer-col h4 {
    font-size: 1.2rem;
    margin-bottom: 1.2rem;
    color: #333;
    font-weight: 700;
}

.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-col li {
    margin-bottom: 0.8rem;
}

.footer-col a {
    color: #666;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-col a:hover {
    color: #e67e22;
}

.footer-bottom {
    text-align: center;
    margin-top: 4rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e9ecef;
    color: #888;
    font-size: 0.9rem;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

/* --------------------------------------------------------------------------
   5. SEO Modules & Content Styles (SEO 模块样式)
   -------------------------------------------------------------------------- */
.compact-title {
    margin-bottom: 0.5rem !important;
    margin-top: 0 !important;
    color: var(--h1-color);
}

.compact-text {
    margin-bottom: 1.5rem;
}

.controls-guide {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.control-item {
    display: flex;
    align-items: center;
    background: var(--card-background-color);
    padding: 10px 15px;
    border-radius: var(--border-radius);
    box-shadow: var(--card-box-shadow);
    flex: 1 1 150px;
}

.icon-mock {
    width: 32px;
    height: 32px;
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: var(--primary);
    color: var(--primary-inverse);
}

.icon-mock svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.kb-instruction-container {
    background: var(--code-background-color);
    padding: 15px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    border: 1px solid var(--muted-border-color);
}

fieldset.integrated {
    border: none;
    margin: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
}

#keyboard_schemes label {
    padding-right: 1.5em;
    cursor: pointer;
}

/* 选项面板 - 垂直布局 */
.advanced-options-list .option-block {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px dashed var(--muted-border-color);
}

.advanced-options-list .option-block:last-child {
    border-bottom: none;
}

/* 选项面板 - 横向排列 (3个一行) */
.radio-group-horizontal {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 25px;
    width: 100%;
    margin-bottom: 0.5rem;
}

.radio-group-horizontal label {
    display: inline-flex;
    align-items: center;
    margin-bottom: 0 !important;
    cursor: pointer;
    white-space: nowrap;
    font-weight: normal;
}

.radio-group-horizontal input[type="radio"] {
    margin-right: 8px;
    margin-bottom: 0;
    margin-top: 0;
}

/* 修复 1/C 垂直排列 */
.option-labeltype label span {
    display: inline-block;
    vertical-align: middle;
}

.option-labeltype label span[style*="font-size"] {
    line-height: 0.9 !important;
    text-align: center;
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    transform: translateY(2px);
}

/* --------------------------------------------------------------------------
   6. Score System & Buttons (乐谱系统与按钮)
   -------------------------------------------------------------------------- */
.buttons-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.text-button {
    width: auto !important;
    padding: 0 15px !important;
    height: 40px;
    font-weight: bold;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    white-space: nowrap;
    border-radius: 20px;
}

.text-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background-color: #e0e0e0;
    color: #999;
    border: none;
}

.text-button.active {
    background-color: #e74c3c;
    border-color: #e74c3c;
    color: #fff;
}

.buttons-separator {
    width: 1px;
    height: 24px;
    background-color: rgba(0, 0, 0, 0.2);
    margin: 0 5px;
}

/* 提示框 (Tooltips) */
.buttons-container button {
    position: relative;
}

.buttons-container button[title]:hover::before {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    background-color: #222;
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    white-space: nowrap;
    line-height: 1.2;
    z-index: 99999;
    pointer-events: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    opacity: 0;
    animation: fadeInTooltip 0.2s forwards;
}

.buttons-container button[title]:hover::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-4px);
    border-width: 6px;
    border-style: solid;
    border-color: #222 transparent transparent transparent;
    z-index: 99999;
    opacity: 0;
    animation: fadeInTooltip 0.2s forwards;
}

@keyframes fadeInTooltip {
    to {
        opacity: 1;
    }
}

/* 琴键触控优化 (去蓝框) */
.kalimba-container > div {
    -webkit-tap-highlight-color: transparent !important;
    user-select: none;
    cursor: pointer;
}

.active-key-simulated {
    transform: scale(0.95) translateY(3px) !important;
    filter: brightness(0.9);
    transition: transform 0.05s;
}

/* 乐谱显示区域 */
#score-display-area {
    width: 100%;
    background: var(--card-background-color);
    border-bottom: 1px solid var(--muted-border-color);
    padding: 10px 15px;
    margin-bottom: 10px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 50;
}

.score-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    border-bottom: 1px dashed var(--muted-border-color);
    padding-bottom: 5px;
}

#score-current-title {
    margin: 0;
    font-size: 1.1rem;
    color: var(--primary);
    font-weight: bold;
    flex-grow: 1;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#btn-score-close {
    flex-grow: 0;
    flex-shrink: 0;
    width: auto !important;
    min-width: auto !important;
    padding: 2px 10px !important;
    margin-left: 15px;
    background: transparent;
    border: 1px solid var(--muted-border-color);
    color: var(--muted-color);
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    border-radius: 4px;
}

#btn-score-close:hover {
    color: #e74c3c;
    border-color: #e74c3c;
}

.score-scroll-wrapper {
    max-height: 100px;
    overflow-y: auto;
    text-align: center;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 4px;
    padding: 10px;
    position: relative;
}

.score-notation {
    font-family: "Courier New", monospace;
    font-size: 1.3rem;
    line-height: 2;
    letter-spacing: 3px;
    word-wrap: break-word;
}

.s-note {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    cursor: default;
    transition: all 0.1s;
}

.s-note.active {
    background-color: #e67e22;
    color: #fff;
    font-weight: bold;
}

.s-note.correct {
    color: #2ecc71;
    font-weight: bold;
    border-bottom: 3px solid #2ecc71;
}

.s-note.wrong {
    color: #e74c3c;
}

.bar-line {
    color: #ddd;
    margin: 0 8px;
    font-weight: 300;
}

/* 弹窗 (Modal) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-card {
    background: var(--card-background-color);
    width: 90%;
    max-width: 500px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.modal-header {
    padding: 15px 20px;
    background: var(--primary);
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: #fff;
    font-weight: bold;
    flex-grow: 1;
    white-space: nowrap;
    text-align: left;
}

.modal-close {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.8rem;
    line-height: 1;
    width: auto !important;
    min-width: auto !important;
    padding: 0;
    margin-left: 15px;
    flex-grow: 0;
    cursor: pointer;
}

.modal-close:hover {
    opacity: 0.8;
}

.modal-body {
    padding: 0;
    max-height: 60vh;
    overflow-y: auto;
}

/* --- 修复列表前的黑点 --- */
.score-list {
    list-style: none !important;      /* 【核心修复】强制去除列表前的点 */
    list-style-type: none !important; /* 双重保险 */
    padding: 0 !important;            /* 去除左侧默认缩进 */
    margin: 0;
}

/* 针对列表项的修复 */
.score-list li {
    list-style: none !important;      /* 确保 li 也不显示点 */
    padding: 15px; 
    border-bottom: 1px solid var(--muted-border-color);
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    transition: background 0.2s;
}

.score-list li::marker {
    display: none;
    content: "";
}

/* 保持原来的 hover 效果 */
.score-list li:hover { 
    background: rgba(0,0,0,0.05); 
}

.score-icon {
    margin-right: 10px;
    font-size: 1.2rem;
}

.score-name {
    font-weight: bold;
    font-size: 1rem;
}

.empty-state {
    padding: 20px;
    text-align: center;
    color: var(--muted-color);
}

/* H1 标题 */
.app-main-title {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0.5rem 0 1rem 0;
    line-height: 1.2;
    color: #2c3e50;
    padding: 0 10px;
}

/* --------------------------------------------------------------------------
   7. Score Detail Page Styles (乐谱详情页 - 核心美化)
   -------------------------------------------------------------------------- */
.score-detail-header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 2rem 0;
    background: var(--card-background-color);
    border-bottom: 1px solid var(--muted-border-color);
}

.score-meta-badges {
    display: flex;
    justify-content: center;
    gap: 0.8rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.meta-badge {
    background: var(--background-color);
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.meta-badge strong {
    color: var(--h1-color);
    margin-right: 5px;
}

.score-preview-container {
    margin-top: 3rem;
    text-align: center;
}

.score-preview-box {
    background: var(--code-background-color);
    padding: 2.5rem;
    border-radius: 12px;
    font-family: "Courier New", monospace;
    font-size: 1.5rem;
    line-height: 2.5;
    text-align: center;
    margin: 2rem auto;
    border: 1px solid var(--muted-border-color);
    color: var(--color);
    word-wrap: break-word;
    max-width: 900px;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.03);
}

.preview-note {
    display: inline-block;
    padding: 0 0.4rem;
    color: #2c3e50;
    font-weight: 600;
    position: relative;
    line-height: 1.5;
    vertical-align: baseline; 
}

/* 1. 休止符 (0) - 颜色变淡，表示静音 */
.preview-note.is-rest {
    color: #95a5a6;
    font-weight: normal;
}
/* 2. 延音线 (-) - 稍微拉宽一点 */
.preview-note.is-dash {
    color: #7f8c8d;
    padding: 0 0.2rem;
    font-weight: normal;
}

/* 半拍 (0.5) - 单下划线 */
.preview-note.half-beat {
   border-bottom: 2px solid #333;
    padding-bottom: 2px;
}

/* 十六分音符 (0.25) - 双下划线 (视觉模拟) */
.preview-note.quarter-beat {
    border-bottom: 4px double #555;
    padding-bottom: 2px;
}

/* 深色模式适配 */
[data-theme="dark"] .preview-note { color: #ecf0f1; }
[data-theme="dark"] .preview-note.is-rest { color: #666; }
[data-theme="dark"] .preview-note.is-dash { color: #888; }
[data-theme="dark"] .preview-note.half-beat { border-bottom-color: #aaa; }
[data-theme="dark"] .preview-note.quarter-beat { border-bottom-color: #aaa; }

.preview-bar {
    display: inline-block;
    color: #bbb;
    margin: 0 1em;
    font-weight: 300;
    transform: scaleY(1.2);
}

/* 强力行动区 (CTA Gradient Card) - 强制居中修复 */
.cta-section {
    margin: 4rem auto !important; /* 强制居中 */
    padding: 0 1rem;
    max-width: 800px;
    width: 100%;
    text-align: center;
}

.cta-play-card {
    background: linear-gradient(135deg, #3498db 0%, #2c3e50 100%);
    color: white;
    padding: 3rem 2rem;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(52, 152, 219, 0.3);
    transition: transform 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.cta-play-card:hover {
    transform: translateY(-5px);
}

.cta-play-card h3 {
    color: #fff;
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.cta-play-card p {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

/* 大号跳转按钮 */
.btn-big-play {
    background: #ffffff !important;
    color: #3498db !important;
    border: none;
    padding: 1rem 3rem;
    font-size: 1.2rem;
    font-weight: 800;
    border-radius: 50px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.2s;
    opacity: 1 !important;
}

.btn-big-play:hover {
    background: #f8f9fa !important;
    transform: scale(1.05);
    color: #2980b9 !important;
    text-decoration: none;
}

/* --------------------------------------------------------------------------
   8. Mobile Responsive & Drawer Menu (移动端抽屉菜单修复)
   -------------------------------------------------------------------------- */
@media (max-width: 992px) {
    
    /* 1. 汉堡按钮：固定右上角 */
    .mobile-nav-toggle {
        display: block !important;
        position: fixed !important;
        top: 20px;
        right: 20px;
        z-index: 20002 !important;
        background: transparent;
        border: none;
        padding: 0;
        margin: 0;
    }

    /* 2. 菜单容器：强制块级布局，消除任何 Flex 对齐影响 */
    .site-nav {
        display: block !important; /* 关键：禁用 Flex */
        position: fixed !important;
        top: 0;
        bottom: 0;
        right: 0;
        width: 300px !important;
        background: #fff !important;
        padding: 80px 0 0 0 !important; /* 顶部留白 */
        z-index: 20000 !important;
        overflow-y: auto !important; /* 允许滚动 */
        transform: translateX(100%);
        transition: transform 0.3s;
        box-shadow: -5px 0 15px rgba(0,0,0,0.1);
        height: 100vh !important;
    }

    .site-nav[data-visible="true"] {
        transform: translateX(0%);
        box-shadow: -100vw 0 0 rgba(0,0,0,0.6);
    }

    /* 3. 列表容器：强制紧凑排列 */
    .site-nav ul {
        display: block !important; /* 关键：禁用 Flex */
        padding: 0 !important;
        margin: 0 !important;
        height: auto !important; /* 禁止撑满高度 */
    }

    /* 4. 列表项：像砖块一样垂直堆叠 */
    .site-nav li {
        display: block !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        border-bottom: 1px solid #eee !important;
        position: relative !important; /* 保证子元素正常流式排列 */
    }

    /* 5. 链接样式 */
    .site-nav a {
        display: block !important;
        padding: 15px 25px !important;
        color: #333 !important;
        font-weight: 600 !important;
        text-decoration: none !important;
        line-height: 1.5 !important;
        text-align: left !important;
    }

    /* 6. 修复重叠的关键：下拉菜单强制挤开下方内容 */
    .site-nav li.has-dropdown {
        height: auto !important;
        border-bottom: none !important; /* 下拉菜单和父级合并 */
    }

    /* Play 标题 */
    .site-nav li.has-dropdown > a {
        color: #999 !important;
        font-size: 12px !important;
        text-transform: uppercase;
        padding-bottom: 5px !important;
        pointer-events: none;
    }

    /* 下拉子菜单 */
    .dropdown-menu {
        position: static !important; /* 关键：取消绝对定位，让它占据空间！ */
        display: block !important;
        width: 100% !important;
        background: transparent !important;
        box-shadow: none !important;
        padding: 0 !important;
        margin: 0 !important;
        transform: none !important;
        visibility: visible !important;
        opacity: 1 !important;
        border: none !important;
    }

    .dropdown-menu::before { display: none !important; }
    
    .dropdown-menu li {
        border: none !important;
    }

    /* 子菜单链接 */
    .dropdown-menu a {
        padding: 10px 25px 10px 45px !important; /* 缩进 */
        font-weight: 400 !important;
        font-size: 14px !important;
        color: #555 !important;
    }
    
    /* 针对移动端的语言切换适配 */
    .header-lang {
        display: block;
        margin: 15px 25px; /* 与其他菜单项保持对齐 */
        width: calc(100% - 50px);
    }
    
    .header-lang select.clean-select {
        width: 100% !important; /* 移动端占满宽度 */
        border: 1px solid #eee !important; /* 移动端给个淡边框，增加点击区域可见性 */
        border-radius: 8px !important;
        padding: 10px 15px !important;
        text-align: left;
        /* 移动端恢复默认显示，不强制左侧图标，保证易用性 */
        color: #333 !important; 
        background-image: none !important; 
        height: auto !important;
    }
    
    /* 7. 隐藏不需要的元素 */
    .buttons-container, .buttons-separator {
        display: none !important; /* 暂时隐藏按钮组，避免它们捣乱 */
    }
    
    /* 深色模式 */
    [data-theme="dark"] .site-nav { background: #1a1a1a !important; }
    [data-theme="dark"] .site-nav a { color: #eee !important; }
    [data-theme="dark"] .site-nav li { border-color: #333 !important; }
    [data-theme="dark"] .header-lang select.clean-select { color: #eee !important; border-color: #444 !important; }
}
/* --------------------------------------------------------------------------
   9. Dark Mode Support (深色模式适配)
   -------------------------------------------------------------------------- */
[data-theme="dark"] body {
    background-color: var(--background-color);
}

[data-theme="dark"] .site-header,
[data-theme="dark"] .site-footer {
    background-color: var(--card-background-color);
    border-color: var(--muted-border-color);
}

/* 链接与文字颜色 */
[data-theme="dark"] .site-nav a,
[data-theme="dark"] .footer-col h4 {
    color: var(--contrast) !important;
}

[data-theme="dark"] .site-nav a:hover {
    color: #e67e22 !important;
}

[data-theme="dark"] .mobile-nav-toggle svg {
    stroke: var(--contrast);
}

/* 移动端侧滑菜单 - 深色模式 */
@media (max-width: 992px) {
    [data-theme="dark"] .site-nav {
        background: rgba(30, 30, 40, 0.98); /* 深色抽屉 */
        border-left: 1px solid rgba(255,255,255,0.1);
    }
    
    [data-theme="dark"] .site-nav[data-visible="true"] {
        box-shadow: -100vw 0 0 rgba(0, 0, 0, 0.8); /* 更黑的遮罩 */
    }
    
    [data-theme="dark"] .site-nav li {
        border-bottom-color: rgba(255,255,255,0.1);
    }
    
    [data-theme="dark"] .site-nav li.has-dropdown > a {
        color: #777 !important; /* Play 标题 */
    }
    
    [data-theme="dark"] .dropdown-menu {
        background: rgba(0, 0, 0, 0.25); /* 子菜单背景 */
    }
    
    [data-theme="dark"] .dropdown-menu a {
        color: #ccc !important;
    }
}

/* 桌面端下拉菜单 - 深色模式 */
@media (min-width: 993px) {
    [data-theme="dark"] .dropdown-menu {
        background-color: var(--card-background-color);
        border: 1px solid var(--muted-border-color);
    }
    
    [data-theme="dark"] .dropdown-menu::before {
        border-bottom-color: var(--card-background-color);
    }
    
    [data-theme="dark"] .dropdown-menu a {
        color: var(--contrast) !important;
    }
    
    [data-theme="dark"] .dropdown-menu a:hover {
        background-color: rgba(255,255,255,0.05);
    }
}

/* 其他组件的深色模式 */
[data-theme="dark"] .score-preview-box {
    background-color: #1a1a1a;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .preview-note {
    color: #ecf0f1;
}

[data-theme="dark"] .app-main-title {
    color: #fff;
}

[data-theme="dark"] .buttons-separator {
    background-color: rgba(255, 255, 255, 0.3);
}

[data-theme="dark"] #score-display-area {
    background-color: var(--card-background-color);
}

[data-theme="dark"] .score-scroll-wrapper {
    background-color: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .s-note.active {
    color: #fff;
}

[data-theme="dark"] .meta-badge {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--muted-border-color);
}

/* 语言切换按钮 - 深色模式 (图标+文字模式适配) */
@media (min-width: 993px) {
    [data-theme="dark"] .header-lang select.clean-select {
        color: var(--contrast) !important;
        /* 深色模式下图标变白 */
        background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23eeeeee' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3e%3ccircle cx='12' cy='12' r='10'%3e%3c/circle%3e%3cline x1='2' y1='12' x2='22' y2='12'%3e%3c/line%3e%3cpath d='M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z'%3e%3c/path%3e%3c/svg%3e") !important;
    }
    
    [data-theme="dark"] .header-lang select.clean-select:hover {
        /* 悬停时图标变橙 */
        background-color: rgba(255, 255, 255, 0.08) !important;
        background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e67e22' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3e%3ccircle cx='12' cy='12' r='10'%3e%3c/circle%3e%3cline x1='2' y1='12' x2='22' y2='12'%3e%3c/line%3e%3cpath d='M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z'%3e%3c/path%3e%3c/svg%3e") !important;
    }

    [data-theme="dark"] .header-lang select.clean-select:focus {
        background-color: var(--card-background-color) !important;
        border-color: #e67e22 !important;
        box-shadow: 0 0 0 2px rgba(230, 126, 34, 0.4) !important;
    }
    
    [data-theme="dark"] .header-lang select.clean-select option {
        color: #333 !important; 
    }
}