/* ================================================================
   components.css — 组件库
   按钮 · 卡片 · 导航 · 标签 · 表单 · 弹窗
   ------------------------------------------------
   MusicMath AI 去 AI 化视觉重构
   设计原则：实色 + 细边框 + 克制动效，无渐变无发光
   ================================================================ */

/* ================================================================
   1. 按钮系统
   ================================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: 0.625rem 1.25rem;  /* 10px 20px */
    font-family: var(--font-sans);
    font-size: var(--fs-sm);
    font-weight: 500;
    line-height: 1.4;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.btn:active {
    transform: scale(0.97);
    filter: brightness(0.92);
    transition: transform 80ms ease-out, filter 80ms ease-out;
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
    transform: none;
}

/* 主按钮 */
.btn-primary {
    background: var(--accent-primary);
    color: var(--text-inverse);
    border-color: var(--accent-primary);
}

.btn-primary:hover {
    background: var(--accent-primary-hover);
    border-color: var(--accent-primary-hover);
}

.btn-primary:active {
    background: var(--accent-primary-active);
    border-color: var(--accent-primary-active);
}

/* 次按钮 */
.btn-secondary {
    background: transparent;
    color: var(--accent-primary);
    border-color: var(--border-default);
}

.btn-secondary:hover {
    background: var(--accent-primary-soft);
    border-color: var(--accent-primary);
}

/* 幽灵按钮（纯文字） */
.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: transparent;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.btn-ghost:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

/* 危险按钮 */
.btn-danger {
    background: transparent;
    color: var(--accent-red);
    border-color: var(--border-default);
}

.btn-danger:hover {
    background: var(--accent-red-soft);
    border-color: var(--accent-red);
}

/* 琥珀色按钮（用于强调操作） */
.btn-amber {
    background: var(--accent-amber);
    color: var(--text-inverse);
    border-color: var(--accent-amber);
}

.btn-amber:hover {
    filter: brightness(1.1);
}

/* 按钮尺寸 */
.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: var(--fs-xs);
}

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: var(--fs-body);
}

/* ================================================================
   2. 卡片系统（实色 + 细边框，无毛玻璃）
   ================================================================ */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    transition: border-color var(--transition-fast), background-color var(--transition-fast);
}

.card-hover:hover {
    border-color: var(--border-strong);
    background: var(--bg-hover);
}

.card-header {
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--border-subtle);
}

.card-body {
    padding: var(--space-5);
}

.card-footer {
    padding: var(--space-4) var(--space-5);
    border-top: 1px solid var(--border-subtle);
}

/* 带左侧色条的卡片（用于模块入口/公式卡片） */
.card-accent {
    position: relative;
    padding-left: var(--space-5);
}

.card-accent::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
    background: var(--accent-primary);
}

.card-accent-amber::before { background: var(--accent-amber); }
.card-accent-purple::before { background: var(--accent-purple); }
.card-accent-pink::before { background: var(--accent-pink); }
.card-accent-green::before { background: var(--accent-green); }
.card-accent-red::before { background: var(--accent-red); }

/* ================================================================
   3. 导航栏
   ================================================================ */

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    height: 56px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-default);
    transition: background-color var(--transition-base), border-color var(--transition-base);
}

.navbar-inner {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 var(--space-4);
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    cursor: pointer;
}

.navbar-brand-name {
    font-family: var(--font-serif);
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.navbar-brand-sub {
    font-size: var(--fs-xs);
    color: var(--text-tertiary);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-family: var(--font-mono);
}

.navbar-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
}
.navbar-nav::-webkit-scrollbar { display: none; }

.navbar-link {
    padding: 0.42rem 0.55rem;
    font-size: 0.82rem;
    font-weight: 500;
    white-space: nowrap;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: color var(--transition-fast), background-color var(--transition-fast);
    position: relative;
}

.navbar-link:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.navbar-link.active {
    color: var(--accent-primary);
    background: var(--accent-primary-soft);
}

.navbar-link.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    background: var(--accent-primary);
    border-radius: 1px;
}

/* 更多下拉 */
.navbar-more {
    position: relative;
}

.navbar-more-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 180px;
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: var(--space-2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: all var(--transition-fast);
    z-index: 100;
}

.navbar-more-menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.navbar-more-divider {
    height: 1px;
    margin: 4px 8px;
    background: var(--border-subtle);
}

.navbar-more-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: 0.5rem 0.75rem;
    font-size: var(--fs-sm);
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    width: 100%;
    text-align: left;
    background: none;
    border: none;
}

.navbar-more-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.navbar-more-item .item-num {
    font-family: var(--font-mono);
    font-size: var(--fs-xs);
    color: var(--text-muted);
    min-width: 24px;
}

/* 设置菜单按钮 */
.navbar-settings-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.navbar-settings-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-strong);
}

/* ===== 导航栏响应式（不依赖 Tailwind CDN） ===== */
/* 桌面端（≥768px）：显示完整导航，隐藏汉堡按钮 */
@media (min-width: 768px) {
    .nav-desktop {
        display: flex;
    }
    .nav-mobile-btn {
        display: none;
    }
    .nav-mobile-menu {
        display: none !important;
    }
}

/* 移动端（<768px）：隐藏桌面导航，显示汉堡按钮 */
@media (max-width: 767px) {
    .nav-desktop {
        display: none;
    }
    .nav-mobile-btn {
        display: flex;
    }
}

/* ================================================================
   4. 标签 / Badge
   ================================================================ */

.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: 0.25rem 0.625rem;
    font-size: var(--fs-xs);
    font-weight: 500;
    line-height: 1.4;
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
    white-space: nowrap;
}

.badge-primary {
    background: var(--accent-primary-soft);
    color: var(--accent-primary);
    border-color: transparent;
}

.badge-amber {
    background: var(--accent-amber-soft);
    color: var(--accent-amber);
    border-color: transparent;
}

.badge-purple {
    background: var(--accent-purple-soft);
    color: var(--accent-purple);
    border-color: transparent;
}

.badge-green {
    background: var(--accent-green-soft);
    color: var(--accent-green);
    border-color: transparent;
}

.badge-red {
    background: var(--accent-red-soft);
    color: var(--accent-red);
    border-color: transparent;
}

.badge-pink {
    background: var(--accent-pink-soft);
    color: var(--accent-pink);
    border-color: transparent;
}

/* 模块编号标签 */
.module-tag {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-family: var(--font-sans);
    font-size: 12.5px;
    font-weight: 400;
    letter-spacing: 0.02em;
    text-transform: none;
    color: var(--accent-primary);
}

.module-tag::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 2px;
    background: var(--accent-primary);
    border-radius: 1px;
}

/* ================================================================
   5. 表单元素
   ================================================================ */

.input,
.select,
.textarea {
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-family: var(--font-sans);
    font-size: var(--fs-sm);
    color: var(--text-primary);
    background: var(--bg-secondary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    outline: none;
    transition: border-color var(--transition-fast), background-color var(--transition-fast);
}

.input:focus,
.select:focus,
.textarea:focus {
    border-color: var(--accent-primary);
    background: var(--bg-tertiary);
}

.input::placeholder,
.textarea::placeholder {
    color: var(--text-muted);
}

.textarea {
    resize: vertical;
    min-height: 80px;
    line-height: var(--lh-normal);
}

.select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236e7681' d='M3 4.5l3 3 3-3'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2rem;
}

/* 滑块 */
.slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent-primary);
    cursor: pointer;
    transition: transform var(--transition-fast);
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent-primary);
    cursor: pointer;
    border: none;
}

/* ================================================================
   6. 进度条
   ================================================================ */

.progress {
    width: 100%;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--accent-primary);
    border-radius: 3px;
    transition: width var(--transition-base) ease-out;
}

.progress-bar.amber { background: var(--accent-amber); }
.progress-bar.purple { background: var(--accent-purple); }
.progress-bar.green { background: var(--accent-green); }

/* ================================================================
   7. 分隔线
   ================================================================ */

.divider {
    height: 1px;
    background: var(--border-subtle);
    margin: var(--space-5) 0;
}

.divider-vertical {
    width: 1px;
    background: var(--border-subtle);
    align-self: stretch;
}

/* ================================================================
   8. 模态弹窗
   ================================================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(2, 6, 23, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
    padding: var(--space-5);
}

.modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    max-width: 480px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: translateY(16px) scale(0.96);
    transition: transform var(--transition-slow);
}

.modal-overlay.open .modal {
    transform: translateY(0) scale(1);
}

.modal-header {
    padding: var(--space-5) var(--space-5) var(--space-4);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-4);
}

.modal-title {
    font-family: var(--font-serif);
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.modal-close {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text-tertiary);
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.modal-body {
    padding: var(--space-5);
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: var(--space-4) var(--space-5);
    border-top: 1px solid var(--border-subtle);
    display: flex;
    justify-content: flex-end;
    gap: var(--space-3);
}

/* ================================================================
   9. Toast 通知（非模态横幅）
   ================================================================ */

.toast {
    position: fixed;
    top: 72px;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    z-index: 200;
    padding: 0.75rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    font-size: var(--fs-sm);
    color: var(--text-primary);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
    max-width: 90vw;
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.toast-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 12px;
    flex-shrink: 0;
}

.toast.success .toast-icon {
    background: var(--accent-green-soft);
    color: var(--accent-green);
}

.toast.info .toast-icon {
    background: var(--accent-primary-soft);
    color: var(--accent-primary);
}

.toast.warning .toast-icon {
    background: var(--accent-amber-soft);
    color: var(--accent-amber);
}

.toast.error .toast-icon {
    background: var(--accent-red-soft);
    color: var(--accent-red);
}

/* ================================================================
   10. 加载动画（音频波形条，呼应音乐主题）
   ================================================================ */

.wave-loader {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 3px;
    height: 32px;
}

.wave-loader-bar {
    width: 4px;
    background: var(--accent-primary);
    border-radius: 2px;
    animation: wave-bar 1.2s ease-in-out infinite;
}

.wave-loader-bar:nth-child(1) { animation-delay: 0s; height: 40%; }
.wave-loader-bar:nth-child(2) { animation-delay: 0.15s; height: 70%; }
.wave-loader-bar:nth-child(3) { animation-delay: 0.3s; height: 50%; }
.wave-loader-bar:nth-child(4) { animation-delay: 0.45s; height: 80%; }
.wave-loader-bar:nth-child(5) { animation-delay: 0.6s; height: 45%; }

@keyframes wave-bar {
    0%, 100% { transform: scaleY(0.5); opacity: 0.5; }
    50% { transform: scaleY(1); opacity: 1; }
}

/* 圆形 Spinner（通用加载指示器） */
.spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 2px solid var(--border-subtle);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spinner-rotate 0.8s linear infinite;
}

.spinner-sm { width: 16px; height: 16px; border-width: 2px; }
.spinner-lg { width: 32px; height: 32px; border-width: 3px; }

.spinner-white {
    border-color: rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
}

.spinner-amber {
    border-color: rgba(245, 158, 11, 0.2);
    border-top-color: var(--accent-amber);
}

@keyframes spinner-rotate {
    to { transform: rotate(360deg); }
}

/* 按钮内加载态 */
.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.btn-loading .btn-text {
    visibility: hidden;
}

.btn-loading::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spinner-rotate 0.8s linear infinite;
}

/* 模块切换加载 */
.module-loading {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-4);
    background: var(--bg-primary);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-base), visibility var(--transition-base);
}

.module-loading.show {
    opacity: 1;
    visibility: visible;
}

.module-loading-text {
    font-size: var(--fs-sm);
    color: var(--text-tertiary);
    letter-spacing: 0.2em;
    font-family: var(--font-mono);
}

/* ================================================================
   11. 空状态
   ================================================================ */

.empty-state {
    padding: var(--space-8) var(--space-5);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
}

.empty-state-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
    background: var(--bg-tertiary);
    border: 1px dashed var(--border-default);
    color: var(--text-tertiary);
    font-size: 20px;
}

.empty-state-title {
    font-size: var(--fs-body);
    font-weight: 500;
    color: var(--text-secondary);
    margin: 0;
}

.empty-state-desc {
    font-size: var(--fs-sm);
    color: var(--text-tertiary);
    max-width: 280px;
    line-height: var(--lh-normal);
}

/* ================================================================
   12. 音游工坊增强样式
   ================================================================ */

/* --- 游戏颜色变量 --- */
:root {
    --game-perfect-color: #FBBF24;
    --game-good-color: #2DD4BF;
    --game-miss-color: #EF4444;
    --game-combo-color: #A78BFA;
    --game-shake-x: 0px;
    --game-shake-y: 0px;
}

/* --- 屏幕震动效果 --- */
.game-shake-container {
    position: relative;
}

.game-shake-container.shake {
    animation: game-shake 0.2s ease-out;
}

@keyframes game-shake {
    0%, 100% { transform: translate(0, 0); }
    10% { transform: translate(-3px, 2px); }
    20% { transform: translate(3px, -2px); }
    30% { transform: translate(-2px, -1px); }
    40% { transform: translate(2px, 1px); }
    50% { transform: translate(-1px, 2px); }
    60% { transform: translate(1px, -2px); }
    70% { transform: translate(-2px, 1px); }
    80% { transform: translate(2px, -1px); }
    90% { transform: translate(-1px, 1px); }
}

/* --- 判定文字弹出 --- */
.game-judgment {
    position: absolute;
    font-size: 28px;
    font-weight: 900;
    font-family: var(--font-sans);
    letter-spacing: 0.05em;
    pointer-events: none;
    z-index: 30;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    animation: judgment-pop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    left: 50%;
    top: 40%;
    transform: translate(-50%, -50%);
}

.game-judgment-perfect {
    color: var(--game-perfect-color);
    font-size: 32px;
}

.game-judgment-good {
    color: var(--game-good-color);
    font-size: 26px;
}

.game-judgment-miss {
    color: var(--game-miss-color);
    font-size: 24px;
    animation: judgment-shake 0.5s ease-out forwards;
}

@keyframes judgment-pop {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }
    30% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.2);
    }
    60% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -70%) scale(0.9);
    }
}

@keyframes judgment-shake {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    20% {
        opacity: 1;
        transform: translate(-55%, -50%) scale(1.1);
    }
    40% {
        transform: translate(-45%, -50%) scale(1);
    }
    60% {
        transform: translate(-52%, -50%) scale(1);
    }
    80% {
        transform: translate(-48%, -50%) scale(0.95);
        opacity: 0.8;
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -40%) scale(0.9);
    }
}

/* --- 分数弹出 --- */
.game-score-popup {
    position: absolute;
    font-size: 18px;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--accent-amber);
    pointer-events: none;
    z-index: 25;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
    animation: score-float 0.8s ease-out forwards;
    transform: translate(-50%, -50%);
}

@keyframes score-float {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) translateY(0) scale(0.6);
    }
    20% {
        opacity: 1;
        transform: translate(-50%, -50%) translateY(-10px) scale(1.1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) translateY(-40px) scale(0.9);
    }
}

/* --- 连击显示 --- */
.game-combo-popup {
    position: absolute;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    pointer-events: none;
    z-index: 25;
    animation: combo-enter 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.game-combo-popup.pop .game-combo-number {
    animation: combo-number-pop 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.game-combo-popup.milestone .game-combo-number {
    color: var(--game-perfect-color);
    text-shadow: 0 0 20px rgba(251, 191, 36, 0.6);
    animation: combo-milestone 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.game-combo-number {
    font-size: 48px;
    font-weight: 900;
    font-family: var(--font-mono);
    color: var(--game-combo-color);
    line-height: 1;
    text-shadow: 0 2px 8px rgba(167, 139, 250, 0.4);
}

.game-combo-label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.2em;
    color: var(--text-secondary);
    margin-top: 2px;
}

.game-combo-popup.fade-out {
    animation: combo-exit 0.3s ease-out forwards;
}

@keyframes combo-enter {
    0% { opacity: 0; transform: translateX(-50%) scale(0.5); }
    100% { opacity: 1; transform: translateX(-50%) scale(1); }
}

@keyframes combo-exit {
    0% { opacity: 1; transform: translateX(-50%) scale(1); }
    100% { opacity: 0; transform: translateX(-50%) scale(0.8); }
}

@keyframes combo-number-pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

@keyframes combo-milestone {
    0% { transform: scale(1); }
    30% { transform: scale(1.5); }
    60% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* --- COMBO BREAK --- */
.game-combo-break {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 32px;
    font-weight: 900;
    font-family: var(--font-sans);
    color: var(--game-miss-color);
    letter-spacing: 0.1em;
    pointer-events: none;
    z-index: 30;
    text-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
    animation: combo-break-flash 0.8s ease-out forwards;
}

@keyframes combo-break-flash {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.3);
    }
    20% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.3);
    }
    40% {
        transform: translate(-50%, -50%) scale(1);
    }
    80% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1.1);
    }
}

/* --- 难度选择器 --- */
.game-difficulty-selector {
    margin: 12px 0;
}

.game-diff-label {
    font-size: 12px;
    color: var(--text-tertiary);
    text-align: center;
    margin-bottom: 8px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.game-diff-buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.game-diff-btn {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: center;
    min-width: 70px;
}

.game-diff-btn:hover {
    border-color: var(--border-strong);
    color: var(--text-primary);
    background: var(--bg-hover);
}

.game-diff-btn.active {
    border-color: var(--accent-primary);
    background: var(--accent-primary-soft);
    color: var(--accent-primary);
}

.game-diff-name {
    display: block;
    font-size: 13px;
    font-weight: 600;
}

.game-diff-sub {
    display: block;
    font-size: 10px;
    font-family: var(--font-mono);
    opacity: 0.7;
    margin-top: 1px;
}

/* --- 暂停覆盖层 --- */
.game-pause-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    animation: pause-fade-in 0.2s ease;
}

.game-pause-overlay.hidden {
    display: none;
}

.game-pause-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
    padding: 32px 40px;
    text-align: center;
    min-width: 260px;
    animation: pause-panel-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.game-pause-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 24px;
    font-family: var(--font-serif);
}

.game-pause-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.game-pause-buttons .ctrl-btn {
    width: 100%;
}

.game-pause-hint {
    font-size: 11px;
    color: var(--text-tertiary);
    font-family: var(--font-mono);
}

@keyframes pause-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes pause-panel-in {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(10px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* --- 游戏进度条 --- */
.game-progress-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.05);
    z-index: 20;
}

.game-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--game-combo-color));
    transition: width 0.3s ease;
    border-radius: 0 2px 2px 0;
}

/* --- 连击倍率指示器 --- */
.game-combo-mult {
    font-size: 11px;
    font-family: var(--font-mono);
    color: var(--game-perfect-color);
    background: rgba(251, 191, 36, 0.15);
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
    margin-left: 8px;
    vertical-align: middle;
}

/* --- 移动端触摸优化 --- */
@media (hover: none) and (pointer: coarse) {
    .game-diff-btn {
        padding: 10px 14px;
        min-width: 60px;
    }

    .game-judgment {
        font-size: 22px;
    }

    .game-judgment-perfect {
        font-size: 26px;
    }

    .game-combo-number {
        font-size: 36px;
    }
}

/* --- 减少动效偏好 --- */
@media (prefers-reduced-motion: reduce) {
    .game-judgment,
    .game-score-popup,
    .game-combo-popup,
    .game-combo-break,
    .game-pause-overlay,
    .game-pause-panel,
    .game-shake-container.shake {
        animation: none !important;
    }
}

/* ================================================
   About Author — 关于作者视图（整页简历直出）
   ================================================ */
/* 剥离全局 .view-section 的 5rem/3rem 上下内边距：简历 Hero 顶到导航栏、末卡贴近页脚 */
#view-author.view-section {
    padding-top: 0;
    padding-bottom: 0;
}

/* ================================================
   个人详细简历 CV（关于作者视图 · 整页浅色呈现）
   所有规则以 .cv-scope 作用域隔离，避免与站点样式冲突
   ================================================ */
.cv-scope {
    --cv-primary: #1F3A5F;
    --cv-primary-soft: #2C537F;
    --cv-accent: #B8860B;
    --cv-accent-soft: #D4A82C;
    --cv-ink: #26292F;
    --cv-muted: #6B7280;
    --cv-bg: #F5F3EE;
    --cv-card: #FFFFFF;
    --cv-rule: #E5E0D6;
    font-family: var(--font-sans);
    background: var(--cv-bg);
    color: var(--cv-ink);
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
    min-height: calc(100vh - 56px);
}
/* 中和站点全局标题样式（衬线/浅色文字），还原简历原生排版 */
.cv-scope h1, .cv-scope h2, .cv-scope h3, .cv-scope h4 {
    font-family: inherit;
    color: inherit;
    line-height: inherit;
    letter-spacing: normal;
}
/* 中和 Tailwind preflight 的列表重置 */
.cv-scope ul { list-style: disc outside; }
.cv-scope ol { list-style: decimal outside; }

/* ---------- CV 页眉 Hero ---------- */
.cv-scope .hero {
    position: relative;
    background: linear-gradient(135deg, #F2F0EE 0%, #E6E2DF 52%, #D9D4D1 100%);
    color: var(--cv-primary);
    padding: 112px 24px 48px; /* 上部含 56px 站点固定导航栏占位，渐变顶到导航栏下缘 */
    overflow: hidden;
}
.cv-scope .hero-inner {
    position: relative;
    z-index: 1;
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 44px;
    flex-wrap: wrap;
}
.cv-scope .hero-text { flex: 1 1 420px; }
.cv-scope .hero h1 { font-size: clamp(2.2rem, 5vw, 3rem); letter-spacing: .12em; font-weight: 700; }
.cv-scope .hero h1 .en-name {
    font-size: clamp(.95rem, 2vw, 1.15rem); font-weight: 500;
    letter-spacing: .08em; color: #5A6472;
    margin-left: 14px; vertical-align: baseline;
}
.cv-scope .hero .subtitle { margin-top: 10px; font-size: .98rem; color: #5A6472; letter-spacing: .04em; }
.cv-scope .hero .subtitle b { color: var(--cv-accent); font-weight: 600; }
.cv-scope .hero .tags { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 8px; }
.cv-scope .hero .tag {
    font-size: .78rem; padding: 4px 12px;
    border: 1px solid rgba(31, 58, 95, .35);
    border-radius: 999px; color: var(--cv-primary);
}
.cv-scope .hero .contact {
    margin-top: 22px; display: flex; flex-wrap: wrap; gap: 10px 26px;
    font-size: .9rem; color: #44506B;
}
.cv-scope .hero .contact a { color: inherit; text-decoration: none; border-bottom: 1px dashed rgba(31, 58, 95, .4); }
.cv-scope .photo-frame {
    flex: 0 0 auto; width: 168px; height: 222px;
    border-radius: 12px; overflow: hidden;
    border: 3px solid rgba(255, 255, 255, .9);
    box-shadow: 0 18px 44px rgba(0, 0, 0, .35);
    transform: rotate(1.5deg); transition: transform .4s ease;
}
.cv-scope .photo-frame:hover { transform: rotate(0) scale(1.03); }
.cv-scope .photo-frame img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- CV 章节导航（吸附在站点导航栏下方） ---------- */
.cv-scope nav.toc {
    position: sticky; top: 56px; z-index: 40;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--cv-rule);
    box-shadow: 0 2px 12px rgba(31, 58, 95, .06);
}
.cv-scope nav.toc .toc-inner {
    max-width: 960px; margin: 0 auto; padding: 0 24px;
    display: flex; justify-content: space-between; gap: 6px;
    overflow-x: auto; white-space: nowrap;
}
.cv-scope nav.toc a {
    display: inline-block; padding: 13px 8px;
    font-size: .87rem; letter-spacing: .1em; font-weight: 500;
    background: linear-gradient(135deg, #1A1F3D 0%, #252E52 55%, #323D68 100%);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: transparent;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: border-color .25s ease, opacity .25s ease;
}
.cv-scope nav.toc a:hover { border-bottom-color: var(--cv-accent); opacity: .72; }

/* ---------- CV 主体布局 ---------- */
.cv-scope .container {
    max-width: 960px;
    margin: 26px auto 0;
    padding: 0 24px 40px;
    position: relative;
    z-index: 2;
}
.cv-scope section.card {
    background: var(--cv-card);
    border-radius: 14px;
    padding: 30px 34px;
    margin-bottom: 32px;
    box-shadow: 0 6px 24px rgba(31, 58, 95, .07);
    border: 1px solid var(--cv-rule);
    scroll-margin-top: 112px;
}
.cv-scope section.card:last-child { margin-bottom: 0; }
.cv-scope h2.sec-title {
    display: flex; align-items: center; gap: 12px;
    font-size: 1.22rem; color: var(--cv-primary); letter-spacing: .06em;
    margin-bottom: 18px;
}
.cv-scope h2.sec-title::before {
    content: ""; width: 5px; height: 22px; border-radius: 3px;
    background: linear-gradient(180deg, var(--cv-accent), var(--cv-primary));
}
.cv-scope h2.sec-title .en {
    font-size: .72rem; letter-spacing: .18em; color: var(--cv-muted);
    font-weight: 500; text-transform: uppercase; margin-left: auto;
}
.cv-scope h3.sub-title {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px;
    font-size: .95rem; color: var(--cv-primary);
    margin: 22px 0 10px; padding-left: 10px;
    border-left: 3px solid var(--cv-accent);
}
.cv-scope h3.sub-title .meta { margin-left: auto; font-size: .78rem; color: var(--cv-muted); font-weight: 400; }

/* ---------- CV 时间线条目 ---------- */
.cv-scope .entry { padding: 15px 0 15px 22px; border-left: 2px solid var(--cv-rule); position: relative; }
.cv-scope .entry + .entry { margin-top: 18px; }
.cv-scope .entry::before {
    content: ""; position: absolute; left: -6px; top: 22px;
    width: 10px; height: 10px; border-radius: 50%;
    background: var(--cv-accent); box-shadow: 0 0 0 3px #F4EBD8;
}
.cv-scope .entry-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; margin-bottom: 4px; }
.cv-scope .entry-head h3 { font-size: 1rem; color: var(--cv-primary); }
.cv-scope .entry-head .role { font-size: .85rem; color: var(--cv-accent); font-weight: 600; }
.cv-scope .entry-head .meta { margin-left: auto; font-size: .8rem; color: var(--cv-muted); white-space: nowrap; }
.cv-scope .entry ul, .cv-scope .entry ol { margin: 8px 0 0; padding-left: 1.3em; }
.cv-scope .entry li { margin-bottom: 5px; font-size: .9rem; }
.cv-scope .entry ul li::marker { color: var(--cv-accent); }
.cv-scope .entry ol li::marker { color: var(--cv-accent); font-weight: 600; }

.cv-scope .plain-list { padding-left: 1.3em; }
.cv-scope .plain-list li { margin-bottom: 6px; font-size: .9rem; }
.cv-scope .plain-list li::marker { color: var(--cv-accent); }
.cv-scope .num-list { padding-left: 1.6em; }
.cv-scope .num-list li { margin-bottom: 5px; font-size: .9rem; }
.cv-scope .num-list li::marker { color: var(--cv-accent); font-weight: 600; }

.cv-scope b, .cv-scope strong { color: var(--cv-primary); }
.cv-scope .kw { color: var(--cv-primary); font-weight: 600; }
.cv-scope .kw-soft { color: var(--cv-primary); }

/* ---------- CV 徽章 ---------- */
.cv-scope .badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.cv-scope .badge {
    font-size: .78rem; background: #F3F6FA; border: 1px solid #DDE6F0;
    color: var(--cv-primary); padding: 3px 11px; border-radius: 6px;
}
.cv-scope .badge.gold { background: #FBF5E4; border-color: #EBDDB8; color: #8A6508; }

/* ---------- CV 数据概览 ---------- */
.cv-scope .stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 26px; }
.cv-scope .stat {
    background: var(--cv-card); border: 1px solid var(--cv-rule); border-radius: 12px;
    padding: 18px 12px; text-align: center; box-shadow: 0 4px 16px rgba(31, 58, 95, .05);
}
.cv-scope .stat .num { font-size: 1.5rem; font-weight: 700; color: var(--cv-accent); }
.cv-scope .stat .lbl { font-size: .78rem; color: var(--cv-muted); margin-top: 2px; }

/* ---------- CV 联系方式（2 列 × 4 行 · 宽敞菜单式卡片） ---------- */
.cv-scope .contact-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}
.cv-scope .contact-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 22px;
    background: #F7F9FC;
    border: 1px solid var(--cv-rule);
    border-radius: 12px;
    text-decoration: none;
    transition: border-color .25s ease, background .25s ease, transform .2s ease, box-shadow .25s ease;
}
.cv-scope .contact-item:hover {
    border-color: var(--cv-accent);
    background: #FBF5E4;
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(31, 58, 95, .12);
}
.cv-scope .contact-item img {
    width: 56px; height: 56px;
    border-radius: 12px;
    object-fit: contain;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, .06);
    box-shadow: 0 2px 6px rgba(0, 0, 0, .08);
    flex-shrink: 0;
}
.cv-scope .contact-item .ci-body { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.cv-scope .contact-item .ci-label {
    font-size: .75rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--cv-muted);
}
.cv-scope .contact-item .ci-value {
    font-size: 1.02rem;
    font-weight: 600;
    color: var(--cv-primary);
}

@media (max-width: 640px) {
    .cv-scope .hero-inner { gap: 26px; }
    .cv-scope .photo-frame { width: 128px; height: 170px; }
    .cv-scope section.card { padding: 22px 18px; }
    .cv-scope .entry-head .meta { margin-left: 0; width: 100%; }
    .cv-scope .contact-grid { grid-template-columns: 1fr; }
}

/* 喵琴馆引导卡片：小猫+钢琴徽章 */
.piano-cat-badge {
    width: 7.5rem;
    height: 7.5rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(245,158,11,.16), rgba(45,212,191,.12));
    border: 1.5px solid rgba(245, 158, 11, 0.35);
    box-shadow: 0 0 0 6px rgba(245, 158, 11, 0.07), 0 12px 32px rgba(0,0,0,0.18);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.piano-cat-badge:hover {
    transform: translateY(-4px) rotate(-3deg);
    box-shadow: 0 0 0 8px rgba(245, 158, 11, 0.10), 0 18px 40px rgba(0,0,0,0.22);
}
