/* ========================================
   超级扫雷 - Super Minesweeper
   完整样式表
   ======================================== */

/* CSS 变量定义 */
:root {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --secondary: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --bg: #0f172a;
    --bg-light: #1e293b;
    --bg-lighter: #334155;
    --bg-darker: #020617;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --border: #475569;
    --cell-size: 32px;
    --font-main: 'Noto Sans SC', sans-serif;
    --font-display: 'Orbitron', monospace;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
    --transition: all 0.2s ease;
    --cell-hidden: #334155;
    --cell-hover: #475569;
    --cell-revealed: #1e293b;
    --text-secondary: #94a3b8;
}

/* 主题变体 */
[data-theme="classic"] {
    --primary: #3b82f6;
    --bg: #f8fafc;
    --bg-light: #e2e8f0;
    --cell-hidden: #cbd5e1;
    --cell-hover: #94a3b8;
    --cell-revealed: #e2e8f0;
    --text-secondary: #64748b;
    --bg-lighter: #cbd5e1;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #94a3b8;
}

[data-theme="dark"] {
    --primary: #8b5cf6;
    --primary-dark: #7c3aed;
    --bg: #020617;
    --bg-light: #0f172a;
    --bg-lighter: #1e293b;
    --text: #f8fafc;
    --text-muted: #64748b;
    --border: #334155;
}

[data-theme="nature"] {
    --primary: #22c55e;
    --primary-dark: #16a34a;
    --bg: #f0fdf4;
    --bg-light: #dcfce7;
    --bg-lighter: #bbf7d0;
    --text: #14532d;
    --text-muted: #166534;
    --border: #86efac;
}

[data-theme="neon"] {
    --primary: #d946ef;
    --primary-dark: #c026d3;
    --bg: #0a0a0a;
    --bg-light: #171717;
    --bg-lighter: #262626;
    --text: #fafafa;
    --text-muted: #a3a3a3;
    --border: #525252;
    --shadow: 0 0 10px rgba(217, 70, 239, 0.3);
}

[data-theme="retro"] {
    --primary: #f97316;
    --primary-dark: #ea580c;
    --bg: #292524;
    --bg-light: #44403c;
    --bg-lighter: #57534e;
    --text: #fafaf9;
    --text-muted: #a8a29e;
    --border: #78716c;
    --font-display: 'Courier New', monospace;
}

/* 基础重置 */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    font-family: var(--font-main);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    user-select: none;
}

#app {
    min-height: 100vh;
    position: relative;
}

/* ========================================
   品牌入场动画
   ======================================== */
.intro-screen {
    position: fixed;
    inset: 0;
    background: #0a0a0f;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.intro-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

.intro-screen.hidden {
    display: none;
}

.intro-content {
    text-align: center;
    animation: introContentIn 0.5s ease-out;
}

.intro-brand {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 6px;
    text-transform: uppercase;
    opacity: 0;
    animation: introBrandIn 0.8s ease-out 0.2s forwards;
    margin-bottom: 1rem;
}

.intro-divider {
    width: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    margin: 0 auto 1rem;
    opacity: 0;
    animation: introDividerExpand 0.6s ease-out 0.8s forwards;
}

.intro-game {
    opacity: 0;
    animation: introGameIn 0.8s ease-out 1.1s forwards;
}

.intro-game-en {
    font-family: var(--font-display);
    font-size: 2.2rem;
    font-weight: 900;
    color: #ffffff;
    letter-spacing: 2px;
    text-transform: lowercase;
    line-height: 1.2;
}

.intro-game-zh {
    font-family: 'Noto Sans SC', sans-serif;
    font-size: 1.4rem;
    font-weight: 500;
    color: var(--primary);
    margin-top: 0.3rem;
    text-shadow: 0 0 15px var(--primary);
}

@keyframes introFadeOut {
    from { opacity: 1; }
    to { opacity: 0; visibility: hidden; }
}

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

@keyframes introDividerExpand {
    from { width: 0; opacity: 0; }
    to { width: 120px; opacity: 1; }
}

@keyframes introGameIn {
    from { opacity: 0; transform: translateY(10px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ========================================
   启动画面
   ======================================== */
.splash-screen {
    position: fixed;
    inset: 0;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s, visibility 0.5s;
}

.splash-screen.hidden {
    display: none;
}

.splash-content {
    text-align: center;
    animation: splashIn 0.6s ease-out;
}

.splash-logo {
    font-size: 5rem;
    animation: bounce 1s infinite;
    margin-bottom: 1rem;
}

.splash-title {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--primary);
    text-shadow: 0 0 20px var(--primary);
    margin-bottom: 0.5rem;
}

.splash-subtitle {
    font-size: 1rem;
    color: var(--text-muted);
    letter-spacing: 4px;
    text-transform: uppercase;
    margin-bottom: 2rem;
}

.splash-loading {
    width: 200px;
    height: 4px;
    background: var(--bg-lighter);
    border-radius: 2px;
    margin: 0 auto;
    overflow: hidden;
}

.splash-bar {
    height: 100%;
    width: 0%;
    background: var(--primary);
    border-radius: 2px;
    animation: loadingBar 1.5s ease-in-out forwards;
}

@keyframes splashIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

@keyframes loadingBar {
    0% { width: 0%; }
    50% { width: 60%; }
    100% { width: 100%; }
}

/* ========================================
   屏幕通用样式
   ======================================== */
.screen {
    min-height: 100vh;
    padding: 1rem;
    animation: screenIn 0.3s ease-out;
}

.screen.hidden {
    display: none;
}

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

.screen-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.screen-header h2 {
    font-family: var(--font-display);
    font-size: 1.5rem;
}

.back-btn {
    background: var(--bg-light);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: var(--transition);
}

.back-btn:hover {
    background: var(--bg-lighter);
    transform: translateX(-3px);
}

/* ========================================
   主菜单
   ======================================== */
.menu-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 4vh 1.5rem 1.5rem;
    text-align: center;
}

.menu-logo {
    font-family: var(--font-display);
    font-size: 2.8rem;
    font-weight: 900;
    color: var(--primary);
    margin-bottom: 0.75rem;
    text-shadow: 0 0 40px var(--primary);
}

.menu-home-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 1.2rem;
    background: transparent;
    border: 1.5px solid var(--primary);
    border-radius: 20px;
    color: var(--primary);
    font-size: 0.85rem;
    text-decoration: none;
    transition: var(--transition);
    margin-bottom: 1.5rem;
    font-weight: 500;
    cursor: pointer;
}

.menu-home-link:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.05);
    box-shadow: 0 0 15px var(--primary);
}

.menu-home-link:active {
    transform: scale(0.98);
}

.menu-home-link:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.menu-nav {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 14px;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
}

.menu-btn {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.4rem;
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    padding: 0.6rem;
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 18px;
    color: var(--text);
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.menu-btn:hover:not(:disabled) {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: scale(1.05) translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.menu-btn-primary {
    background: linear-gradient(135deg, var(--bg-light) 0%, rgba(59, 130, 246, 0.08) 100%);
    border-color: var(--primary);
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 20px;
}

.menu-btn-primary .btn-icon {
    font-size: 2.2rem;
}

.menu-btn-primary:hover:not(:disabled) {
    background: var(--primary);
    box-shadow: 0 0 20px var(--primary), var(--shadow-lg);
}

.menu-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    background: var(--danger);
    color: white;
    font-size: 0.65rem;
    padding: 0.1rem 0.35rem;
    border-radius: 10px;
    font-weight: 700;
    animation: pulse 1.5s infinite;
}

.menu-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-icon {
    font-size: 1.6rem;
}

.btn-text {
    font-weight: 500;
}

.menu-footer {
    margin-top: 1.5rem;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.menu-footer kbd {
    background: var(--bg-lighter);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    border: 1px solid var(--border);
    font-family: monospace;
}

/* ========================================
   难度选择
   ======================================== */
.difficulty-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    max-width: 700px;
    margin: 0 auto;
}

.difficulty-card {
    background: var(--bg-light);
    border: 2px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.difficulty-card:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.diff-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.difficulty-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.difficulty-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0.2rem 0;
}

.diff-best {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
    font-size: 0.85rem;
    color: var(--secondary);
}

.custom-card {
    grid-column: 1 / -1;
}

.custom-inputs {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.custom-inputs label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.custom-inputs input {
    width: 60px;
    padding: 0.4rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    text-align: center;
    font-size: 1rem;
}

/* ========================================
   游戏界面
   ======================================== */
.game-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--bg-light);
    border-radius: 12px;
    margin-bottom: 0.75rem;
}

.game-info {
    display: flex;
    gap: 1.5rem;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
}

.info-icon {
    font-size: 1rem;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-lighter);
    color: var(--text);
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.1);
}

.game-toolbar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.tool-btn {
    padding: 0.5rem 1rem;
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-main);
}

.tool-btn:hover:not(:disabled) {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.tool-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.game-board-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 400px;
    padding: 1rem;
    background: var(--bg-light);
    border-radius: 12px;
    overflow: auto;
}

#game-board {
    display: grid;
    gap: 1px;
    background: var(--border);
    border: 3px solid var(--border);
    border-radius: 4px;
    padding: 2px;
}

.cell {
    width: var(--cell-size);
    height: var(--cell-size);
    background: var(--bg-lighter);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.1s, transform 0.1s;
    position: relative;
}

.cell:hover:not(.revealed):not(.flagged) {
    background: var(--primary);
    filter: brightness(1.3);
}

.cell:active:not(.revealed):not(.flagged) {
    transform: scale(0.92);
}

.cell.revealed {
    background: var(--bg);
    cursor: default;
    animation: cellReveal 0.2s ease-out;
}

@keyframes cellReveal {
    0% { transform: scale(0.8); opacity: 0.5; }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); opacity: 1; }
}

.cell.mine {
    background: var(--danger);
}

.cell.flagged {
    background: var(--warning);
}

.cell.question {
    background: var(--bg-lighter);
}

.cell.hint {
    animation: hintPulse 0.5s ease 3;
}

.cell.focused {
    box-shadow: inset 0 0 0 3px var(--primary), 0 0 10px var(--primary);
    z-index: 1;
}

.cell.num-1 { color: #3b82f6; }
.cell.num-2 { color: #22c55e; }
.cell.num-3 { color: #ef4444; }
.cell.num-4 { color: #a855f7; }
.cell.num-5 { color: #f97316; }
.cell.num-6 { color: #06b6d4; }
.cell.num-7 { color: #ec4899; }
.cell.num-8 { color: #64748b; }

@keyframes hintPulse {
    0%, 100% { box-shadow: inset 0 0 0 2px var(--secondary); }
    50% { box-shadow: inset 0 0 0 4px var(--secondary); }
}

.game-footer {
    margin-top: 0.75rem;
}

.progress-bar {
    height: 6px;
    background: var(--bg-light);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

#progress-fill {
    height: 100%;
    width: 0%;
    background: var(--primary);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.footer-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ========================================
   挑战模式
   ======================================== */
.challenge-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 600px;
    margin: 0 auto;
}

.challenge-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    transition: var(--transition);
}

.challenge-item:hover {
    border-color: var(--primary);
    transform: translateX(5px);
}

.challenge-icon {
    font-size: 2rem;
}

.challenge-info {
    flex: 1;
}

.challenge-info h3 {
    margin-bottom: 0.25rem;
}

.challenge-info p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.challenge-stats {
    font-size: 0.85rem;
    color: var(--secondary);
}

.challenge-play {
    padding: 0.6rem 1.2rem;
    background: var(--primary);
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.challenge-play:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

/* ========================================
   统计数据
   ======================================== */
.stats-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.stats-tab {
    padding: 0.5rem 1.2rem;
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    cursor: pointer;
    transition: var(--transition);
}

.stats-tab.active,
.stats-tab:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.stats-panel {
    display: none;
    animation: fadeIn 0.3s;
}

.stats-panel.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
}

.stat-card {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
    transition: var(--transition);
}

.stat-card:hover {
    border-color: var(--primary);
    transform: translateY(-3px);
}

.stat-value {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
}

.stats-table th,
.stats-table td {
    padding: 0.75rem;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.stats-table th {
    background: var(--bg-light);
    font-weight: 600;
}

.graph-container {
    background: var(--bg-light);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.graph-container h3 {
    margin-bottom: 1rem;
    font-size: 1rem;
}

.graph {
    height: 200px;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding-bottom: 2rem;
    position: relative;
}

.graph-bar {
    flex: 1;
    background: var(--primary);
    border-radius: 4px 4px 0 0;
    min-height: 4px;
    transition: height 0.5s ease;
    position: relative;
}

.graph-bar::after {
    content: attr(data-label);
    position: absolute;
    bottom: -1.5rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.pie-chart {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    margin: 0 auto;
    position: relative;
}

.danger-btn {
    margin-top: 2rem;
    padding: 0.75rem 1.5rem;
    background: var(--danger);
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    font-size: 0.9rem;
    transition: var(--transition);
}

.danger-btn:hover {
    filter: brightness(1.2);
    transform: scale(1.02);
}

/* ========================================
   排行榜
   ======================================== */
.leaderboard-filters {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.5rem 1.2rem;
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    cursor: pointer;
    transition: var(--transition);
}

.filter-btn.active,
.filter-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.leaderboard-table-container {
    background: var(--bg-light);
    border-radius: 12px;
    overflow: hidden;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
}

.leaderboard-table th,
.leaderboard-table td {
    padding: 0.75rem 1rem;
    text-align: center;
}

.leaderboard-table th {
    background: var(--bg-lighter);
    font-weight: 600;
    font-size: 0.9rem;
}

.leaderboard-table tbody tr {
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}

.leaderboard-table tbody tr:hover {
    background: rgba(59, 130, 246, 0.1);
}

.leaderboard-table tbody tr:nth-child(1) td:first-child {
    color: #fbbf24;
    font-weight: 700;
}

.leaderboard-table tbody tr:nth-child(2) td:first-child {
    color: #94a3b8;
    font-weight: 700;
}

.leaderboard-table tbody tr:nth-child(3) td:first-child {
    color: #b45309;
    font-weight: 700;
}

/* ========================================
   设置
   ======================================== */
.settings-list {
    max-width: 600px;
    margin: 0 auto;
}

.setting-group {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.setting-group h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: var(--primary);
}

.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-item label {
    font-size: 0.95rem;
}

.theme-selector {
    display: flex;
    gap: 0.5rem;
}

.theme-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 2px solid var(--border);
    background: var(--bg);
    cursor: pointer;
    font-size: 1.2rem;
    transition: var(--transition);
}

.theme-btn.active,
.theme-btn:hover {
    border-color: var(--primary);
    transform: scale(1.1);
}

.toggle {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--bg-lighter);
    border-radius: 26px;
    cursor: pointer;
    transition: 0.3s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
}

.toggle input:checked + .toggle-slider {
    background: var(--primary);
}

.toggle input:checked + .toggle-slider::before {
    transform: translateX(22px);
}

input[type="range"] {
    -webkit-appearance: none;
    width: 120px;
    height: 6px;
    border-radius: 3px;
    background: var(--bg-lighter);
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    transition: var(--transition);
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

/* ========================================
   新手教程
   ======================================== */
.tutorial-container {
    max-width: 640px;
    margin: 0 auto;
}

.tutorial-progress {
    height: 6px;
    background: var(--bg-light);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.tutorial-progress-bar {
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
    transition: width 0.4s ease;
}

.tutorial-step-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.tutorial-step-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    animation: bounce 1s ease infinite;
}

.tutorial-step-header h3 {
    font-family: var(--font-display);
    font-size: 1.4rem;
}

.tutorial-step-body {
    line-height: 1.8;
}

.tutorial-step-body p {
    margin-bottom: 1rem;
    color: var(--text-muted);
}

.tutorial-step-body strong {
    color: var(--text);
}

.tutorial-highlight {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1rem 0;
    text-align: center;
}

.tut-caption {
    margin-top: 0.75rem;
    font-size: 0.9rem;
    color: var(--primary);
}

.tut-demo-grid {
    display: grid;
    grid-template-columns: repeat(3, 32px);
    gap: 2px;
    justify-content: center;
    margin: 0 auto;
}

.tut-demo-grid.small {
    grid-template-columns: repeat(3, 28px);
}

.tut-cell {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: bold;
}

.tut-cell.hidden {
    background: var(--bg-lighter);
}

.tut-cell.revealed {
    background: var(--bg);
}

.tut-cell.mine {
    background: var(--danger);
    font-size: 0.75rem;
}

.tut-cell.flagged {
    background: var(--warning);
    font-size: 0.75rem;
}

.tutorial-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.tut-card {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
}

.tut-card-icon {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--primary);
}

.tut-card p {
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

.tut-card-demo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.tut-card-demo span {
    color: var(--text-muted);
}

.tutorial-tip {
    background: rgba(59, 130, 246, 0.1);
    border-left: 3px solid var(--primary);
    padding: 0.75rem 1rem;
    border-radius: 0 8px 8px 0;
    margin: 1rem 0;
}

.tut-number-demo {
    display: inline-block;
}

.tut-num-row {
    display: flex;
    gap: 2px;
    justify-content: center;
}

.tut-arrow {
    position: absolute;
    width: 0;
    height: 0;
    border-style: solid;
}

.tut-arrow.up {
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 0 4px 6px 4px;
    border-color: transparent transparent var(--primary) transparent;
}

.tut-arrow.down {
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px 4px 0 4px;
    border-color: var(--primary) transparent transparent transparent;
}

.tut-arrow.left {
    left: -6px;
    top: 50%;
    transform: translateY(-50%);
    border-width: 4px 6px 4px 0;
    border-color: transparent var(--primary) transparent transparent;
}

.tut-arrow.right {
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    border-width: 4px 0 4px 6px;
    border-color: transparent transparent transparent var(--primary);
}

.tut-arrow.up-left {
    top: -4px;
    left: -4px;
    border-width: 0 3px 4px 3px;
    border-color: transparent transparent var(--primary) transparent;
    transform: rotate(-45deg);
}

.tut-arrow.up-right {
    top: -4px;
    right: -4px;
    border-width: 0 3px 4px 3px;
    border-color: transparent transparent var(--primary) transparent;
    transform: rotate(45deg);
}

.tut-arrow.down-left {
    bottom: -4px;
    left: -4px;
    border-width: 0 3px 4px 3px;
    border-color: transparent transparent var(--primary) transparent;
    transform: rotate(-135deg);
}

.tut-arrow.down-right {
    bottom: -4px;
    right: -4px;
    border-width: 0 3px 4px 3px;
    border-color: transparent transparent var(--primary) transparent;
    transform: rotate(135deg);
}

.tutorial-examples {
    margin-top: 1rem;
}

.tutorial-examples h4 {
    margin-bottom: 0.75rem;
    color: var(--text);
}

.tut-pattern {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--bg-light);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.tut-pattern-grid {
    display: grid;
    grid-template-columns: repeat(3, 28px);
    gap: 2px;
    flex-shrink: 0;
}

.tut-pattern p {
    margin: 0;
    font-size: 0.85rem;
}

.tut-chord-demo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.tut-chord-before,
.tut-chord-after {
    text-align: center;
}

.tut-chord-before p,
.tut-chord-after p {
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.tut-chord-arrow {
    font-size: 1.5rem;
    color: var(--primary);
}

.tutorial-task {
    text-align: center;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--primary) !important;
    padding: 0.75rem;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 8px;
}

.tutorial-practice-board {
    display: grid;
    gap: 2px;
    justify-content: center;
}

.tut-practice-cell:hover {
    filter: brightness(1.3);
    transform: scale(1.05);
}

.tutorial-practice-hint {
    text-align: center;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

.tutorial-summary {
    background: var(--bg-light);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1rem 0;
}

.tut-check {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    font-size: 1rem;
}

.tut-check span {
    font-size: 1.2rem;
}

.tutorial-nav {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-top: 2rem;
}

.tutorial-btn {
    padding: 0.75rem 2rem;
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-main);
}

.tutorial-btn:hover:not(:disabled) {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-2px);
}

.tutorial-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.tutorial-btn.primary {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.tutorial-btn.primary:hover {
    background: var(--primary-dark);
}

.tut-recommend {
    text-align: center;
}

/* ========================================
   帮助
   ======================================== */
.help-content {
    max-width: 600px;
    margin: 0 auto;
}

.help-content section {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.help-content h3 {
    margin-bottom: 0.75rem;
    color: var(--primary);
}

.help-content p,
.help-content li {
    line-height: 1.7;
    color: var(--text-muted);
}

.help-content ul {
    padding-left: 1.5rem;
}

.help-content kbd {
    background: var(--bg-lighter);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    border: 1px solid var(--border);
    font-family: monospace;
    font-size: 0.9em;
    color: var(--text);
}

/* ========================================
   遮罩层
   ======================================== */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s;
}

.overlay.hidden {
    display: none;
}

.overlay-content {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2.5rem;
    text-align: center;
    max-width: 400px;
    width: 90%;
    animation: scaleIn 0.3s;
}

.overlay-content.small {
    padding: 1.5rem;
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.overlay-content h2 {
    font-family: var(--font-display);
    margin-bottom: 1.5rem;
}

.overlay-btn {
    display: block;
    width: 100%;
    padding: 0.875rem;
    margin: 0.5rem 0;
    background: var(--bg-lighter);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
}

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

.overlay-btn.primary {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.overlay-btn.primary:hover {
    background: var(--primary-dark);
}

#gameover-icon {
    font-size: 4rem;
    margin-bottom: 0.5rem;
}

#gameover-title {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.gameover-stats {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.go-stat {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.go-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.go-value {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

#new-record {
    font-size: 1.2rem;
    color: var(--warning);
    margin-bottom: 1rem;
    animation: bounce 0.6s infinite;
}

.gameover-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.gameover-buttons .overlay-btn {
    flex: 1;
    min-width: 100px;
}

/* ========================================
   粒子效果
   ======================================== */
#particles {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9998;
}

.particle {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    pointer-events: none;
    animation: particleFall 1s ease-out forwards;
}

@keyframes particleFall {
    0% { opacity: 1; transform: translateY(0) scale(1); }
    100% { opacity: 0; transform: translateY(100px) scale(0); }
}

/* ========================================
   响应式
   ======================================== */
@media (max-width: 640px) {
    :root {
        --cell-size: 28px;
    }

    .splash-title {
        font-size: 1.8rem;
    }

    .menu-logo {
        font-size: 1.6rem;
    }

    .menu-nav {
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
    }

    .menu-btn {
        font-size: 0.75rem;
        border-radius: 14px;
    }

    .menu-btn-primary {
        font-size: 0.85rem;
        border-radius: 16px;
    }

    .menu-btn-primary .btn-icon {
        font-size: 1.8rem;
    }

    .btn-icon {
        font-size: 1.5rem;
    }

    .game-header {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .game-info {
        gap: 0.75rem;
    }

    .info-item {
        font-size: 1rem;
    }

    .challenge-item {
        flex-direction: column;
        text-align: center;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .gameover-stats {
        gap: 0.75rem;
    }

    .go-value {
        font-size: 1.2rem;
    }
}

@media (max-width: 400px) {
    :root {
        --cell-size: 24px;
    }

    .menu-nav {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
}

/* ========================================
   滚动条
   ======================================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-lighter);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border);
}

/* ========================================
   工具类
   ======================================== */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }


/* ========================================
   新版设置页面 - 项目设置
   ======================================== */

.settings-layout {
    display: flex;
    gap: 1.5rem;
    max-width: 1000px;
    margin: 0 auto;
    min-height: 60vh;
}

.settings-sidebar {
    width: 180px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    position: sticky;
    top: 1rem;
    align-self: flex-start;
}

.settings-tab {
    padding: 0.7rem 1rem;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 0.95rem;
    text-align: left;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-main);
}

.settings-tab:hover {
    background: var(--bg-light);
    color: var(--text);
}

.settings-tab.active {
    background: var(--primary);
    color: white;
    font-weight: 500;
}

.settings-panels {
    flex: 1;
    min-width: 0;
}

.settings-panel {
    display: none;
    animation: fadeIn 0.25s ease;
}

.settings-panel.active {
    display: block;
}

.settings-section {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
}

.settings-section h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text);
}

.section-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.section-note {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.75rem;
    padding: 0.5rem;
    background: var(--bg);
    border-radius: 6px;
}

.preset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.5rem;
}

.preset-btn {
    padding: 0.6rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-main);
}

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

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

.mode-selector {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.mode-btn {
    padding: 0.6rem 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-main);
}

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

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

.slider-with-value {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.slider-with-value input[type="range"] {
    flex: 1;
}

.slider-value {
    font-family: var(--font-display);
    font-size: 0.9rem;
    color: var(--primary);
    min-width: 50px;
    text-align: right;
}

.slider-compact {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    justify-content: flex-end;
}

.slider-compact input[type="range"] {
    width: 120px;
}

.color-palette {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 0.5rem;
}

.color-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.6rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-main);
}

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

.color-btn.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary);
}

.color-btn span {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    display: inline-block;
}

.styled-select {
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.9rem;
    font-family: var(--font-main);
    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 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.6rem center;
}

.font-selector .styled-select {
    width: 100%;
    max-width: 280px;
}

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border);
    gap: 1rem;
}

.setting-row:last-child {
    border-bottom: none;
}

.setting-label {
    font-size: 0.9rem;
    line-height: 1.4;
}

.setting-label small {
    display: block;
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-top: 0.15rem;
}

.language-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 0.5rem;
}

.lang-btn {
    padding: 0.6rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-main);
    text-align: left;
}

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

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

.audio-preview-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0.75rem 0;
}

.preview-btn {
    padding: 0.35rem 0.7rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-main);
}

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

.collapsible .collapse-header {
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.collapse-body {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

.shortcuts-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.shortcut-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.4rem 0;
}

.shortcut-row kbd {
    background: var(--bg-lighter);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.2rem 0.5rem;
    font-family: monospace;
    font-size: 0.8rem;
    color: var(--text);
    min-width: 120px;
    text-align: center;
}

.shortcut-row span {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.settings-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.settings-action-btn {
    padding: 0.6rem 1.2rem;
    background: var(--primary);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-main);
}

.settings-action-btn:hover {
    filter: brightness(1.15);
    transform: translateY(-1px);
}

.settings-action-btn.secondary {
    background: var(--bg-lighter);
    border: 1px solid var(--border);
    color: var(--text);
}

.settings-action-btn.secondary:hover {
    background: var(--border);
}

.settings-action-btn.danger {
    background: var(--danger);
}

.settings-action-btn.danger:hover {
    filter: brightness(1.2);
}

.about-section {
    text-align: center;
    padding: 2rem 1.5rem;
}

.about-logo {
    font-size: 4rem;
    margin-bottom: 0.5rem;
}

.about-section h2 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.about-desc {
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.about-version {
    display: inline-block;
    background: var(--bg);
    padding: 0.3rem 0.8rem;
    border-radius: 12px;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.about-links {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.about-link {
    padding: 0.5rem 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    text-decoration: none;
    font-size: 0.85rem;
    transition: var(--transition);
}

.about-link:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.settings-note {
    background: rgba(59, 130, 246, 0.08);
    border-left: 3px solid var(--primary);
    padding: 0.75rem 1rem;
    border-radius: 0 8px 8px 0;
    margin: 0.75rem 0;
}

.settings-note p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0.25rem 0;
}

.about-footer {
    text-align: center;
    padding: 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

@media (max-width: 768px) {
    .settings-layout {
        flex-direction: column;
    }

    .settings-sidebar {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        position: static;
        gap: 0.4rem;
    }

    .settings-tab {
        flex: 1;
        min-width: 80px;
        text-align: center;
        padding: 0.5rem;
        font-size: 0.85rem;
    }
}


/* ========================================
   成就系统
   ======================================== */

#achievement-toasts {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}

.achievement-toast {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-left: 4px solid var(--warning);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: var(--shadow-lg);
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.4s ease, opacity 0.4s ease;
    pointer-events: auto;
    min-width: 260px;
    max-width: 320px;
}

.achievement-toast.show {
    transform: translateX(0);
    opacity: 1;
}

.ach-toast-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.ach-toast-info {
    flex: 1;
}

.ach-toast-title {
    font-size: 0.75rem;
    color: var(--warning);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.15rem;
}

.ach-toast-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.15rem;
}

.ach-toast-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* 成就页面 */
.achievements-container {
    max-width: 700px;
    margin: 0 auto;
}

.achievements-progress {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.ach-progress-bar {
    flex: 1;
    height: 10px;
    background: var(--bg);
    border-radius: 5px;
    overflow: hidden;
}

#ach-progress-fill {
    height: 100%;
    width: 0%;
    background: var(--primary);
    border-radius: 5px;
    transition: width 0.5s ease;
}

.ach-progress-text {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
}

.achievements-filters {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.ach-filter-btn {
    padding: 0.4rem 0.8rem;
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-main);
}

.ach-filter-btn:hover {
    border-color: var(--primary);
    color: var(--text);
}

.ach-filter-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.75rem;
}

.achievement-card {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    transition: var(--transition);
    opacity: 0.5;
    filter: grayscale(0.8);
}

.achievement-card.unlocked {
    opacity: 1;
    filter: grayscale(0);
    border-color: var(--warning);
}

.achievement-card.unlocked .ach-card-icon {
    filter: none;
}

.ach-card-icon {
    font-size: 2rem;
    flex-shrink: 0;
    line-height: 1;
}

.ach-card-info {
    flex: 1;
    min-width: 0;
}

.ach-card-name {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.2rem;
}

.ach-card-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.ach-card-category {
    font-size: 0.7rem;
    color: var(--primary);
    margin-top: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}


/* ========== v1.1.0 新增样式 ========== */

/* 战役模式 */
.campaign-container {
    padding: 1.5rem;
    max-width: 900px;
    margin: 0 auto;
}

.campaign-header-stats {
    margin-left: auto;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.campaign-map {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.campaign-node {
    background: var(--bg-light);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.campaign-node:hover:not(.locked) {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.campaign-node.locked {
    opacity: 0.4;
    cursor: not-allowed;
    filter: grayscale(0.8);
}

.campaign-node.completed {
    border-color: var(--secondary);
    background: rgba(34,197,94,0.08);
}

.campaign-node-num {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.3rem;
}

.campaign-node-name {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.campaign-node-stars {
    font-size: 0.9rem;
    letter-spacing: 1px;
}

/* 道具栏 */
.powerup-bar {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    justify-content: center;
    background: var(--bg-light);
    border-top: 1px solid var(--border);
}

.powerup-slot {
    position: relative;
    width: 48px;
    height: 48px;
    background: var(--bg-lighter);
    border: 2px solid var(--border);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
}

.powerup-slot:hover:not(.empty) {
    border-color: var(--primary);
    transform: scale(1.08);
}

.powerup-slot.empty {
    opacity: 0.3;
    cursor: not-allowed;
}

.powerup-icon {
    font-size: 1.4rem;
}

.powerup-count {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--danger);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.powerup-key {
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg);
    border: 1px solid var(--border);
    font-size: 0.6rem;
    padding: 0 4px;
    border-radius: 3px;
    color: var(--text-muted);
}

/* 生存模式 HUD */
.survival-hud {
    display: flex;
    gap: 1rem;
    padding: 0.4rem 1rem;
    background: var(--bg-light);
    border-top: 1px solid var(--border);
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 600;
}

.survival-hud span {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

/* 无尽模式 HUD */
.endless-hud {
    display: flex;
    gap: 1rem;
    padding: 0.4rem 1rem;
    background: var(--bg-light);
    border-top: 1px solid var(--border);
    justify-content: center;
    align-items: center;
    font-size: 0.9rem;
    font-weight: 600;
}

.endless-hud .hp-bar {
    width: 120px;
    height: 14px;
    background: var(--bg-darker);
    border-radius: 7px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.endless-hud .hp-bar-fill {
    height: 100%;
    border-radius: 7px;
    transition: width 0.3s ease, background 0.3s ease;
}

.endless-hud .hp-bar-fill.hp-high {
    background: linear-gradient(90deg, #4ade80, #22c55e);
}

.endless-hud .hp-bar-fill.hp-mid {
    background: linear-gradient(90deg, #facc15, #eab308);
}

.endless-hud .hp-bar-fill.hp-low {
    background: linear-gradient(90deg, #f87171, #ef4444);
    animation: hpPulse 1s ease-in-out infinite;
}

@keyframes hpPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* 迷雾模式 */
.cell.fog {
    background: var(--bg-darker) !important;
    opacity: 0.15;
    pointer-events: none;
}

.cell.fog::after {
    content: '🌫️';
    font-size: 0.6rem;
    opacity: 0.3;
    position: absolute;
}

/* 热力图 */
.cell.heat-low {
    background: rgba(34,197,94,0.25) !important;
    border-color: #22c55e !important;
}

.cell.heat-mid {
    background: rgba(245,158,11,0.3) !important;
    border-color: #f59e0b !important;
}

.cell.heat-high {
    background: rgba(239,68,68,0.35) !important;
    border-color: #ef4444 !important;
}

/* 模式说明浮层 */
#mode-info-overlay .overlay-content {
    text-align: center;
    max-width: 360px;
}

#mode-info-title {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

#mode-info-desc {
    color: var(--text-muted);
    margin-bottom: 1.2rem;
    line-height: 1.5;
}

/* 更新日志 */
.changelog-entry {
    margin-bottom: 1rem;
}

.changelog-version {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 0.4rem;
    color: var(--primary);
}

.changelog-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-left: 0.5rem;
}

.changelog-list {
    padding-left: 1.2rem;
    margin: 0;
}

.changelog-list li {
    margin-bottom: 0.3rem;
    font-size: 0.9rem;
    line-height: 1.5;
}

.changelog-history {
    margin-top: 1rem;
}

.changelog-history summary {
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.9rem;
    padding: 0.5rem 0;
    user-select: none;
}

.changelog-history summary:hover {
    color: var(--primary);
}

.changelog-history[open] summary {
    margin-bottom: 0.5rem;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .campaign-map {
        grid-template-columns: repeat(3, 1fr);
    }
    .powerup-bar {
        gap: 0.3rem;
        padding: 0.4rem;
    }
    .powerup-slot {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    .campaign-map {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==================== 谜题工坊 ==================== */

.puzzle-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    padding: 1.5rem;
    max-width: 1000px;
    margin: 0 auto;
}

.puzzle-panel {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    overflow: auto;
}

.puzzle-panel h3 {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
}

.puzzle-size-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.puzzle-size-controls label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.puzzle-size-controls input[type="number"] {
    width: 50px;
    padding: 0.3rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    text-align: center;
}

.puzzle-toolbar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.puzzle-editor-board {
    display: grid;
    gap: 1px;
    background: var(--border);
    border: 2px solid var(--border);
    border-radius: 4px;
    width: fit-content;
    margin: 0 auto 1rem auto;
    user-select: none;
}

.puzzle-cell {
    width: 28px;
    height: 28px;
    background: var(--cell-hidden);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.1s;
}

.puzzle-cell:hover {
    background: var(--cell-hover);
}

.puzzle-cell.mine {
    background: #ef4444;
    color: white;
}

.puzzle-cell.mine:hover {
    background: #dc2626;
}

.puzzle-cell.number {
    background: var(--cell-revealed);
}

.puzzle-cell.puzzle-num-1 { color: #3b82f6; }
.puzzle-cell.puzzle-num-2 { color: #22c55e; }
.puzzle-cell.puzzle-num-3 { color: #ef4444; }
.puzzle-cell.puzzle-num-4 { color: #a855f7; }
.puzzle-cell.puzzle-num-5 { color: #f59e0b; }
.puzzle-cell.puzzle-num-6 { color: #06b6d4; }
.puzzle-cell.puzzle-num-7 { color: #ec4899; }
.puzzle-cell.puzzle-num-8 { color: #64748b; }

[data-theme="classic"] .puzzle-cell.puzzle-num-1 { color: #2563eb; }
[data-theme="classic"] .puzzle-cell.puzzle-num-2 { color: #16a34a; }
[data-theme="classic"] .puzzle-cell.puzzle-num-3 { color: #dc2626; }
[data-theme="classic"] .puzzle-cell.puzzle-num-4 { color: #7c3aed; }
[data-theme="classic"] .puzzle-cell.puzzle-num-5 { color: #d97706; }
[data-theme="classic"] .puzzle-cell.puzzle-num-6 { color: #0891b2; }
[data-theme="classic"] .puzzle-cell.puzzle-num-7 { color: #db2777; }
[data-theme="classic"] .puzzle-cell.puzzle-num-8 { color: #475569; }

.puzzle-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.puzzle-info #puzzle-valid-status {
    font-weight: 600;
}

.puzzle-share {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.puzzle-share input[type="text"] {
    padding: 0.6rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-family: monospace;
    font-size: 0.85rem;
    text-align: center;
}

.puzzle-input-group {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.puzzle-input-group input {
    flex: 1;
    padding: 0.6rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-family: monospace;
    font-size: 0.9rem;
}

.puzzle-saved h4 {
    margin: 0 0 0.75rem 0;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.puzzle-saved-list {
    max-height: 300px;
    overflow-y: auto;
}

.puzzle-empty {
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-align: center;
    padding: 1rem;
}

.puzzle-saved-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    margin-bottom: 0.4rem;
}

.puzzle-saved-info {
    flex: 1;
    font-size: 0.85rem;
    color: var(--text);
}

.puzzle-saved-play,
.puzzle-saved-delete {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    padding: 0.2rem;
    opacity: 0.7;
    transition: opacity 0.15s;
}

.puzzle-saved-play:hover,
.puzzle-saved-delete:hover {
    opacity: 1;
}

.primary-btn {
    padding: 0.6rem 1.2rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.15s;
}

.primary-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.primary-btn:disabled {
    background: var(--bg-darker);
    color: var(--text-secondary);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

@media (max-width: 768px) {
    .puzzle-container {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1rem;
    }
    .puzzle-cell {
        width: 24px;
        height: 24px;
        font-size: 0.65rem;
    }
}

/* ==================== 每日任务 ==================== */

.quests-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 1.5rem;
}

.quests-streak {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: var(--bg-light);
    border-radius: 10px;
    border: 1px solid var(--border);
}

.streak-icon {
    font-size: 1.5rem;
}

.streak-text {
    font-size: 1rem;
    color: var(--text);
}

.streak-text b {
    color: var(--warning);
    font-size: 1.2rem;
}

.quests-progress-bar {
    width: 100%;
    height: 10px;
    background: var(--bg-darker);
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
}

.quests-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 5px;
    transition: width 0.5s ease;
}

.quests-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.quest-card {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem;
    transition: transform 0.15s, border-color 0.15s;
}

.quest-card:hover {
    transform: translateY(-1px);
    border-color: var(--primary);
}

.quest-card.completed {
    border-color: var(--secondary);
    background: rgba(16, 185, 129, 0.08);
}

.quest-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
}

.quest-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
}

.quest-status {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.quest-card.completed .quest-status {
    color: var(--secondary);
}

.quest-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.6rem;
}

.quest-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-darker);
    border-radius: 4px;
    overflow: hidden;
}

.quest-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    border-radius: 4px;
    transition: width 0.4s ease;
}

.quest-card.completed .quest-bar-fill {
    background: var(--secondary);
}

.quests-rewards {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
}

.quests-rewards h3 {
    margin: 0 0 0.75rem 0;
    font-size: 1.1rem;
    color: var(--text);
}

.quest-reward-item {
    padding: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

#quests-claim-btn {
    margin-top: 0.75rem;
}

@media (max-width: 768px) {
    .quests-container {
        padding: 1rem;
    }
}


/* ========================================
   作战日志 & 战后分析 (Battle Log)
   ======================================== */

.battle-log-container {
    max-width: 800px;
    margin: 0 auto;
}

.battle-log-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.bl-tab {
    padding: 0.5rem 1.2rem;
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-main);
}

.bl-tab.active,
.bl-tab:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.bl-panel {
    display: none;
    animation: fadeIn 0.3s;
}

.bl-panel.active {
    display: block;
}

.bl-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 3rem 1rem;
    font-size: 0.95rem;
}

/* 历史记录卡片 */
.battle-log-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.bl-card {
    background: var(--bg-light);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
    transition: var(--transition);
}

.bl-card:hover {
    border-color: var(--primary);
    transform: translateX(5px);
    box-shadow: var(--shadow);
}

.bl-card.won {
    border-left: 4px solid var(--secondary);
}

.bl-card.lost {
    border-left: 4px solid var(--danger);
}

.bl-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.bl-card-result {
    font-weight: 700;
    font-size: 1rem;
}

.bl-card-grade {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 900;
}

.bl-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.bl-card-info {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    color: var(--text);
}

.bl-card-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* 趋势图表 */
.trend-section {
    background: var(--bg-light);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.trend-section h3 {
    margin-bottom: 1rem;
    font-size: 1rem;
}

.trend-graph {
    height: 180px;
    display: flex;
    align-items: flex-end;
    gap: 6px;
    padding-bottom: 2rem;
    position: relative;
    overflow-x: auto;
    min-width: 0;
}

.trend-bar {
    flex: 1;
    background: var(--primary);
    border-radius: 4px 4px 0 0;
    min-height: 4px;
    transition: height 0.5s ease;
    position: relative;
}

.trend-bar::after {
    content: attr(data-label);
    position: absolute;
    bottom: -1.5rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.65rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* 战后分析详情 */
.battle-analysis-container {
    max-width: 700px;
    margin: 0 auto;
    padding-bottom: 2rem;
}

.ba-overview {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background: var(--bg-light);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.ba-grade-circle {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    border: 4px solid;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ba-grade-letter {
    font-family: var(--font-display);
    font-size: 2.2rem;
    font-weight: 900;
    line-height: 1;
}

.ba-grade-label {
    font-size: 0.7rem;
    margin-top: 2px;
    opacity: 0.8;
}

.ba-overview-info h3 {
    font-size: 1.2rem;
    margin-bottom: 0.3rem;
}

.ba-overview-info p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0.15rem 0;
}

/* 指标网格 */
.ba-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.ba-metric-card {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
    transition: var(--transition);
}

.ba-metric-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.ba-metric-value {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
}

.ba-metric-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.ba-metric-grade {
    font-size: 0.75rem;
    font-weight: 700;
    margin-top: 0.2rem;
}

/* 评语 */
.ba-commentary {
    background: var(--bg-light);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.ba-commentary h4 {
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.ba-commentary p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0.4rem 0;
    padding-left: 0.5rem;
    border-left: 3px solid var(--primary);
}

/* 棋盘复盘 */
.ba-board-section {
    background: var(--bg-light);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    overflow-x: auto;
}

.ba-board-section h4 {
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.ba-board-replay {
    display: grid;
    gap: 1px;
    background: var(--border);
    border: 2px solid var(--border);
    border-radius: 4px;
    padding: 2px;
    width: fit-content;
    margin: 0 auto;
}

.ba-cell {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    background: var(--cell-hidden);
}

.ba-cell.revealed {
    background: var(--cell-revealed);
}

.ba-cell.flagged {
    background: var(--secondary);
}

.ba-cell.misflagged {
    background: var(--warning);
}

.ba-cell.mine-hit {
    background: var(--danger);
}

.ba-cell.unrevealed-mine {
    background: var(--danger);
    opacity: 0.6;
}

.ba-board-legend {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.ba-legend-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 4px;
    vertical-align: middle;
}

/* 操作详情 */
.ba-stats-detail {
    background: var(--bg-light);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.ba-stats-detail h4 {
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.ba-stat-rows {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ba-stat-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.ba-stat-row:last-child {
    border-bottom: none;
}

.ba-stat-row span:first-child {
    color: var(--text-muted);
}

.ba-stat-row span:last-child {
    font-weight: 600;
    font-family: var(--font-display);
}

/* 战后分析按钮在游戏结束弹窗 */
#view-analysis-btn {
    background: var(--secondary);
    border-color: var(--secondary);
    color: white;
}

#view-analysis-btn:hover {
    filter: brightness(0.9);
}

/* 响应式 */
@media (max-width: 768px) {
    .ba-overview {
        flex-direction: column;
        text-align: center;
    }

    .ba-metrics {
        grid-template-columns: repeat(2, 1fr);
    }

    .ba-board-replay {
        transform: scale(0.85);
        transform-origin: center top;
    }

    .bl-card-info,
    .bl-card-meta {
        flex-wrap: wrap;
    }
}

/* ========================================
   影子挑战 (Shadow Challenge)
   ======================================== */

/* 作战日志卡片挑战按钮 */
.bl-card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
}

.bl-card-btn {
    padding: 0.3rem 0.8rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-main);
}

.bl-card-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.bl-card-btn.challenge-btn:hover {
    background: var(--secondary);
    border-color: var(--secondary);
}

/* 影子进度条 */
.shadow-progress-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
    padding: 0.3rem 0.5rem;
    background: var(--bg-light);
    border-radius: 6px;
    font-size: 0.8rem;
}

.shadow-progress-label {
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
}

.shadow-progress-track {
    flex: 1;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}

#shadow-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--secondary), var(--primary));
    border-radius: 3px;
    transition: width 0.3s ease;
}

.shadow-progress-text {
    min-width: 2.5rem;
    text-align: right;
    font-weight: 700;
    color: var(--secondary);
    font-family: var(--font-display);
}

/* 棋盘上影子的视觉反馈 */
.cell.shadow-flash {
    animation: shadowFlash 0.4s ease-out;
}

@keyframes shadowFlash {
    0% { box-shadow: inset 0 0 0 3px var(--secondary); }
    100% { box-shadow: inset 0 0 0 0px var(--secondary); }
}

.cell.shadow-flagged {
    position: relative;
}

.cell.shadow-flagged::after {
    content: '👻';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.65em;
    opacity: 0.5;
    pointer-events: none;
}

/* 影子竞速结果面板 */
#shadow-race-result {
    margin: 0.75rem 0;
}

.sr-result-box {
    background: var(--bg-light);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
}

.sr-result-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.sr-result-title.won {
    color: var(--secondary);
}

.sr-result-title.lost {
    color: var(--danger);
}

.sr-result-title.draw {
    color: var(--primary);
}

.sr-result-stats {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.sr-stat-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    padding: 0.3rem 0;
    border-bottom: 1px solid var(--border);
}

.sr-stat-row:last-child {
    border-bottom: none;
}

.sr-stat-row span:first-child {
    color: var(--text-muted);
}

.sr-stat-row span:last-child {
    font-weight: 700;
    font-family: var(--font-display);
}


/* ==================== 雷区热图 (Minefield Heatmap) ==================== */

.heatmap-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    align-items: center;
    justify-content: space-between;
}

.heatmap-filter-group,
.heatmap-type-group {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.heatmap-filter-btn,
.heatmap-type-btn {
    padding: 0.35rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg);
    color: var(--text-muted);
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.heatmap-filter-btn:hover,
.heatmap-type-btn:hover {
    border-color: var(--primary);
    color: var(--text);
}

.heatmap-filter-btn.active,
.heatmap-type-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    font-weight: 600;
}

/* 热图网格 */
.heatmap-grid {
    display: grid;
    grid-template-columns: repeat(20, 1fr);
    grid-template-rows: repeat(20, 1fr);
    gap: 1px;
    width: 100%;
    max-width: 400px;
    aspect-ratio: 1;
    margin: 0 auto 1rem;
    background: var(--border);
    border-radius: 8px;
    overflow: visible;
    padding: 6px;
}

.heatmap-cell {
    width: 100%;
    height: 100%;
    min-height: 4px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    cursor: crosshair;
}

.heatmap-cell:hover {
    transform: scale(1.4);
    z-index: 10;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.3);
    border-radius: 2px;
}

/* 图例 */
.heatmap-legend {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.heatmap-legend-bar {
    width: 120px;
    height: 10px;
    border-radius: 5px;
}

.heatmap-legend-bar[data-type="clicks"] {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.08), rgba(59, 130, 246, 1));
}

.heatmap-legend-bar[data-type="wins"] {
    background: linear-gradient(90deg, rgba(34, 197, 94, 0.08), rgba(34, 197, 94, 1));
}

.heatmap-legend-bar[data-type="danger"] {
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.08), rgba(239, 68, 68, 1));
}

/* 统计摘要 */
.heatmap-stats {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.heatmap-stats span {
    background: var(--bg-light);
    padding: 0.3rem 0.7rem;
    border-radius: 6px;
    border: 1px solid var(--border);
}

/* 洞察文字 */
.heatmap-insights {
    max-width: 500px;
    margin: 0 auto;
}

.heatmap-insight-item {
    background: var(--bg-light);
    border-left: 3px solid var(--primary);
    padding: 0.6rem 0.9rem;
    margin-bottom: 0.5rem;
    border-radius: 0 8px 8px 0;
    font-size: 0.85rem;
    color: var(--text);
    line-height: 1.5;
}

/* 移动端适配 */
@media (max-width: 600px) {
    .heatmap-controls {
        flex-direction: column;
        align-items: stretch;
        justify-content: center;
    }

    .heatmap-filter-group,
    .heatmap-type-group {
        justify-content: center;
    }

    .heatmap-grid {
        max-width: 280px;
    }

    .heatmap-cell:hover {
        transform: scale(1.2);
    }

    .heatmap-stats {
        gap: 0.5rem;
        font-size: 0.75rem;
    }

    .heatmap-stats span {
        padding: 0.25rem 0.5rem;
    }
}

/* ========================================
   模式训练道馆 (Pattern Dojo)
   ======================================== */

.dojo-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem;
}

.dojo-intro {
    background: var(--bg-light);
    border-left: 3px solid var(--primary);
    padding: 0.75rem 1rem;
    margin-bottom: 1.25rem;
    border-radius: 0 8px 8px 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.dojo-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.dojo-card {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
    transition: var(--transition);
}

.dojo-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.dojo-card.locked {
    opacity: 0.5;
    cursor: not-allowed;
}

.dojo-card.locked:hover {
    border-color: var(--border);
    transform: none;
    box-shadow: none;
}

.dojo-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.dojo-card-name {
    font-weight: 700;
    color: var(--text);
    font-size: 1rem;
}

.dojo-card-level {
    font-size: 0.75rem;
}

.dojo-card-desc {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.dojo-card-stats {
    display: flex;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.dojo-card-rating {
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.dojo-card-locked {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
    padding: 0.5rem 0;
}

/* 详情面板 */
.dojo-detail {
    animation: fadeIn 0.3s ease;
}

.dojo-detail-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.dojo-detail-header h3 {
    flex: 1;
    margin: 0;
}

.dojo-detail-body {
    background: var(--bg-light);
    border-radius: 12px;
    padding: 1.25rem;
}

.dojo-detail-level {
    font-size: 0.85rem;
    color: var(--warning);
    margin-bottom: 0.5rem;
}

.dojo-detail-desc {
    color: var(--text);
    margin-bottom: 1.25rem;
    line-height: 1.5;
}

.dojo-example-section {
    margin-bottom: 1.25rem;
}

.dojo-example-section h4 {
    margin-bottom: 0.75rem;
    color: var(--text);
}

.dojo-example-board {
    display: flex;
    justify-content: center;
    margin-bottom: 0.75rem;
}

.dojo-example-explanation {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.5;
    background: var(--bg);
    padding: 0.75rem;
    border-radius: 8px;
}

/* 迷你棋盘（示例用） */
.dojo-mini-board {
    display: grid;
    grid-template-columns: repeat(5, 32px);
    grid-template-rows: repeat(5, 32px);
    gap: 2px;
    background: var(--border);
    padding: 2px;
    border-radius: 6px;
}

.dojo-mini-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 2px;
    user-select: none;
}

.dojo-mini-cell.revealed {
    background: var(--cell-revealed);
}

.dojo-mini-cell.unrevealed {
    background: var(--cell-hidden);
}

.dojo-mini-cell.mine {
    background: var(--danger);
    color: #fff;
}

.dojo-mini-cell.num-1 { color: #3b82f6; }
.dojo-mini-cell.num-2 { color: #22c55e; }
.dojo-mini-cell.num-3 { color: #ef4444; }
.dojo-mini-cell.num-4 { color: #a855f7; }
.dojo-mini-cell.num-5 { color: #f97316; }
.dojo-mini-cell.num-6 { color: #06b6d4; }
.dojo-mini-cell.num-7 { color: #ec4899; }
.dojo-mini-cell.num-8 { color: #64748b; }

/* 进度统计 */
.dojo-progress-section {
    margin-bottom: 1.25rem;
}

.dojo-stat-row {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
}

.dojo-stat-row:last-child {
    border-bottom: none;
}

.dojo-stat-empty {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-align: center;
    padding: 1rem;
}

/* 训练面板 */
.dojo-training {
    animation: fadeIn 0.3s ease;
}

.dojo-training-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.dojo-training-header h3 {
    flex: 1;
    margin: 0;
}

#dojo-training-counter {
    font-size: 0.85rem;
    color: var(--text-muted);
    background: var(--bg-light);
    padding: 0.3rem 0.7rem;
    border-radius: 6px;
}

.dojo-instruction {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 1rem;
    padding: 0.5rem;
    background: var(--bg-light);
    border-radius: 8px;
}

/* 训练棋盘 */
.dojo-board {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.dojo-train-board {
    display: grid;
    grid-template-columns: repeat(5, 48px);
    grid-template-rows: repeat(5, 48px);
    gap: 2px;
    background: var(--border);
    padding: 3px;
    border-radius: 8px;
}

.dojo-train-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 3px;
    cursor: default;
    user-select: none;
    transition: all 0.15s ease;
}

.dojo-train-cell.revealed {
    background: var(--cell-revealed);
}

.dojo-train-cell.unrevealed {
    background: var(--cell-hidden);
    cursor: pointer;
}

.dojo-train-cell.unrevealed:hover {
    background: var(--cell-hover);
    transform: scale(1.05);
}

.dojo-train-cell.marked-mine {
    background: rgba(239, 68, 68, 0.6) !important;
    position: relative;
}

.dojo-train-cell.marked-mine::after {
    content: '🚩';
    position: absolute;
    font-size: 1.1rem;
}

.dojo-train-cell.correct-mine {
    background: rgba(34, 197, 94, 0.5) !important;
    animation: pulseGreen 0.6s ease;
}

.dojo-train-cell.num-1 { color: #3b82f6; }
.dojo-train-cell.num-2 { color: #22c55e; }
.dojo-train-cell.num-3 { color: #ef4444; }
.dojo-train-cell.num-4 { color: #a855f7; }
.dojo-train-cell.num-5 { color: #f97316; }
.dojo-train-cell.num-6 { color: #06b6d4; }
.dojo-train-cell.num-7 { color: #ec4899; }
.dojo-train-cell.num-8 { color: #64748b; }

/* 控制区域 */
.dojo-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.dojo-timer {
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: var(--text);
    background: var(--bg-light);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    min-width: 70px;
    text-align: center;
}

/* 反馈区域 */
.dojo-feedback {
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    animation: slideUp 0.3s ease;
}

.dojo-feedback.correct {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.dojo-feedback.wrong {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.dojo-feedback-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.dojo-feedback-text {
    color: var(--text);
    font-size: 0.9rem;
    line-height: 1.5;
}

@keyframes pulseGreen {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5); }
    70% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* 移动端适配 */
@media (max-width: 600px) {
    .dojo-cards {
        grid-template-columns: 1fr;
    }

    .dojo-train-board {
        grid-template-columns: repeat(5, 40px);
        grid-template-rows: repeat(5, 40px);
    }

    .dojo-mini-board {
        grid-template-columns: repeat(5, 28px);
        grid-template-rows: repeat(5, 28px);
    }

    .dojo-training-header {
        flex-wrap: wrap;
    }

    .dojo-controls {
        flex-wrap: wrap;
    }
}

/* ========== 雷暴突袭 (Thunder Rush) ========== */

.thunder-container {
    max-width: 500px;
    margin: 0 auto;
    padding: 1rem;
}

.thunder-panel {
    text-align: center;
}

.thunder-logo {
    font-size: 4rem;
    margin-bottom: 0.5rem;
    animation: thunder-pulse 1.5s ease-in-out infinite;
}

@keyframes thunder-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.thunder-desc {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.thunder-rules {
    background: var(--bg-light);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    text-align: left;
}

.thunder-rules p {
    margin: 0.4rem 0;
    color: var(--text);
}

.thunder-bests {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.thunder-bests span {
    color: var(--primary);
    font-weight: bold;
}

.thunder-hud {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.thunder-hud-item {
    background: var(--bg-light);
    border-radius: 8px;
    padding: 0.5rem;
}

.thunder-hud-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.thunder-hud-value {
    display: block;
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--text);
    font-family: var(--font-display);
}

.thunder-timer-bar-container {
    width: 100%;
    height: 6px;
    background: var(--bg-lighter);
    border-radius: 3px;
    margin: 0.25rem 0;
    overflow: hidden;
}

.thunder-timer-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--secondary), var(--primary));
    border-radius: 3px;
    transition: width 0.1s linear;
}

.thunder-timer-bar.warning {
    background: linear-gradient(90deg, var(--warning), var(--danger));
}

.thunder-timer-bar.danger {
    background: var(--danger);
    animation: timer-flash 0.5s ease-in-out infinite;
}

@keyframes timer-flash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.thunder-level-badge {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

.thunder-board {
    display: grid;
    grid-template-columns: repeat(5, var(--thunder-cell, 56px));
    grid-template-rows: repeat(5, var(--thunder-cell, 56px));
    gap: 3px;
    justify-content: center;
    margin: 0 auto 1rem;
    padding: 8px;
    background: var(--bg-light);
    border-radius: 8px;
    width: fit-content;
}

.thunder-cell {
    width: var(--thunder-cell, 56px);
    height: var(--thunder-cell, 56px);
    background: var(--cell-hidden);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
    transition: transform 0.1s, background 0.2s;
}

.thunder-cell:hover {
    background: var(--cell-hover);
    transform: scale(1.05);
}

.thunder-cell:active {
    transform: scale(0.95);
}

.thunder-cell.revealed {
    background: var(--cell-revealed);
    cursor: default;
}

.thunder-cell.revealed:hover {
    transform: none;
}

.thunder-cell.flagged {
    background: var(--warning);
}

.thunder-cell.mine-hit {
    background: var(--danger);
    animation: mine-flash 0.3s ease-in-out;
}

@keyframes mine-flash {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.thunder-cell.number-1 { color: #3b82f6; }
.thunder-cell.number-2 { color: #22c55e; }
.thunder-cell.number-3 { color: #ef4444; }
.thunder-cell.number-4 { color: #a855f7; }
.thunder-cell.number-5 { color: #f97316; }
.thunder-cell.number-6 { color: #14b8a6; }
.thunder-cell.number-7 { color: #f43f5e; }
.thunder-cell.number-8 { color: #64748b; }

.thunder-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.thunder-over-icon {
    font-size: 4rem;
    margin-bottom: 0.5rem;
}

.thunder-over-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin: 1.5rem 0;
}

.thunder-stat {
    background: var(--bg-light);
    border-radius: 8px;
    padding: 1rem;
}

.thunder-stat-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.thunder-stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
    font-family: var(--font-display);
}

.thunder-new-record {
    color: var(--warning);
    font-size: 1.25rem;
    font-weight: bold;
    margin-bottom: 1rem;
    animation: thunder-pulse 1s ease-in-out infinite;
}

.secondary-btn {
    padding: 0.6rem 1.2rem;
    background: var(--bg-lighter);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.15s, background 0.2s;
}

.secondary-btn:hover {
    transform: translateY(-1px);
    background: var(--bg-light);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.thunder-btn-large {
    padding: 0.8rem 2rem;
    font-size: 1.1rem;
}

/* 移动端适配 */
@media (max-width: 480px) {
    .thunder-board {
        --thunder-cell: 48px;
    }

    .thunder-hud {
        grid-template-columns: repeat(2, 1fr);
    }

    .thunder-over-stats {
        grid-template-columns: 1fr;
    }

    .thunder-bests {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* ========== 星际博物馆 (Museum) ========== */

.museum-container {
    max-width: 700px;
    margin: 0 auto;
    padding: 1rem;
}

.museum-progress {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 0.75rem 1rem;
    background: var(--bg-light);
    border-radius: 8px;
}

.museum-progress-bar {
    flex: 1;
    height: 10px;
    background: var(--bg-lighter);
    border-radius: 5px;
    overflow: hidden;
}

.museum-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--secondary), var(--primary));
    border-radius: 5px;
    transition: width 0.5s ease;
}

.museum-progress-text {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}

.museum-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.museum-card {
    background: var(--bg-light);
    border-radius: 12px;
    padding: 1.25rem 0.75rem;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 2px solid transparent;
}

.museum-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    border-color: var(--primary);
}

.museum-card.locked {
    opacity: 0.5;
    cursor: default;
}

.museum-card.locked:hover {
    transform: none;
    box-shadow: none;
    border-color: transparent;
}

.museum-card-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.museum-card-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
}

.museum-detail {
    max-width: 500px;
    margin: 0 auto;
}

.museum-detail-card {
    background: var(--bg-light);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    margin-top: 1rem;
}

.museum-detail-icon {
    font-size: 5rem;
    margin-bottom: 1rem;
}

.museum-detail h3 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--text);
}

.museum-detail-desc {
    color: var(--text-muted);
    line-height: 1.7;
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

.museum-detail-status {
    display: inline-block;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    background: var(--bg-lighter);
    color: var(--text-muted);
}

/* 移动端适配 */
@media (max-width: 600px) {
    .museum-gallery {
        grid-template-columns: repeat(2, 1fr);
    }

    .museum-detail-card {
        padding: 1.25rem;
    }

    .museum-detail-icon {
        font-size: 3.5rem;
    }
}

/* ========== 布雷大师 (Mine Architect) ========== */

.architect-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 1rem;
}

.architect-intro {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.architect-level-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.75rem;
}

.architect-level-card {
    background: var(--bg-light);
    border-radius: 10px;
    padding: 1rem 0.5rem;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 2px solid transparent;
}

.architect-level-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    border-color: var(--primary);
}

.architect-level-card.locked {
    opacity: 0.45;
    cursor: default;
}

.architect-level-card.locked:hover {
    transform: none;
    box-shadow: none;
    border-color: transparent;
}

.architect-level-num {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
    font-family: var(--font-display);
}

.architect-level-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text);
    margin: 0.25rem 0;
}

.architect-level-info {
    font-size: 0.75rem;
    color: var(--warning);
}

.architect-game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.architect-game-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.architect-game-desc {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
    width: 100%;
    flex-basis: 100%;
}

.architect-mine-counter {
    background: var(--bg-light);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background 0.2s, color 0.2s;
}

.architect-mine-counter.over-limit {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    animation: shake 0.4s ease;
}

.architect-board {
    display: grid;
    grid-template-columns: repeat(5, var(--architect-cell, 48px));
    grid-template-rows: repeat(5, var(--architect-cell, 48px));
    gap: 3px;
    justify-content: center;
    margin: 0 auto 1rem;
    padding: 8px;
    background: var(--bg-light);
    border-radius: 8px;
    width: fit-content;
}

.architect-cell {
    width: var(--architect-cell, 48px);
    height: var(--architect-cell, 48px);
    background: var(--cell-hidden);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
    transition: transform 0.1s, background 0.2s;
}

.architect-cell:hover {
    background: var(--cell-hover);
    transform: scale(1.05);
}

.architect-cell:active {
    transform: scale(0.95);
}

.architect-cell.revealed {
    background: var(--cell-revealed);
    cursor: default;
}

.architect-cell.revealed:hover {
    transform: none;
}

.architect-cell.mined {
    background: var(--warning);
}

.architect-cell.disabled {
    cursor: default;
    opacity: 0.7;
}

.architect-cell.disabled:hover {
    transform: none;
}

.architect-cell.number-1 { color: #3b82f6; }
.architect-cell.number-2 { color: #22c55e; }
.architect-cell.number-3 { color: #ef4444; }
.architect-cell.number-4 { color: #a855f7; }
.architect-cell.number-5 { color: #f97316; }
.architect-cell.number-6 { color: #14b8a6; }
.architect-cell.number-7 { color: #f43f5e; }
.architect-cell.number-8 { color: #64748b; }

.architect-game-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.architect-feedback {
    text-align: center;
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.95rem;
}

.architect-feedback.correct {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.architect-feedback.incorrect {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.architect-next-btn {
    margin-top: 0.5rem;
}

/* 移动端适配 */
@media (max-width: 600px) {
    .architect-level-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .architect-board {
        --architect-cell: 44px;
    }

    .architect-game-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ==================== 扫雷锦标赛 ==================== */

.championship-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 1.5rem;
    text-align: center;
}

.championship-intro {
    font-size: 1.05rem;
    color: var(--text);
    margin-bottom: 1.2rem;
    line-height: 1.6;
}

.championship-phases-preview {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.2rem;
    text-align: left;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
}

.champ-phase-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--text);
}

.champ-phase-icon {
    font-size: 1.2rem;
}

.championship-rules {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 1.2rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.rule-item {
    padding: 0.3rem 0;
}

.championship-best {
    font-size: 1rem;
    color: var(--warning);
    font-weight: 600;
    margin-bottom: 1.2rem;
}

.championship-start-btn {
    font-size: 1.1rem;
    padding: 0.7rem 2rem;
}

/* 阶段介绍 */
.phase-intro-content {
    max-width: 400px;
    margin: 2rem auto;
    padding: 2rem;
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.phase-intro-badge {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    background: var(--primary);
    color: var(--bg);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
}

.phase-intro-content h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
    color: var(--text);
}

.phase-intro-content p {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.phase-intro-total {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* 阶段完成 */
.phase-complete-content {
    max-width: 400px;
    margin: 2rem auto;
    padding: 2rem;
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.phase-complete-content h3 {
    margin: 0 0 1rem 0;
    color: var(--secondary);
}

.phase-complete-content p {
    margin: 0.4rem 0;
    color: var(--text);
}

/* 结束界面 */
.championship-end-content,
.championship-victory-content {
    max-width: 400px;
    margin: 2rem auto;
    padding: 2rem;
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.championship-end-content h3 {
    margin: 0 0 1rem 0;
    color: var(--danger);
}

.championship-victory-content h3 {
    margin: 0 0 1rem 0;
    color: var(--warning);
    font-size: 1.4rem;
}

.victory-stars {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.victory-phases {
    margin: 1rem 0;
    text-align: left;
    max-width: 280px;
    margin-left: auto;
    margin-right: auto;
}

.victory-phase-row {
    padding: 0.35rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
    color: var(--text);
}

.victory-phase-row:last-child {
    border-bottom: none;
}

#championship-victory-record {
    color: var(--warning);
    font-weight: 700;
    font-size: 1.1rem;
    margin: 0.5rem 0;
}

.championship-victory-actions,
.championship-end-content .primary-btn,
.championship-end-content .secondary-btn {
    margin-top: 1rem;
}

.championship-end-content .secondary-btn,
.championship-victory-actions .secondary-btn {
    margin-left: 0.5rem;
}

/* 移动端适配 */
@media (max-width: 600px) {
    .championship-container {
        padding: 1rem;
    }
    .phase-intro-content,
    .phase-complete-content,
    .championship-end-content,
    .championship-victory-content {
        margin: 1rem auto;
        padding: 1.5rem 1rem;
    }
}


/* ========================================
   禅意模式 (Zen Mode)
   ======================================== */

.zen-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 1.5rem;
    text-align: center;
}

.zen-intro {
    font-size: 1.05rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.zen-rules {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.zen-rule-item {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem;
    font-size: 0.9rem;
    color: var(--text);
}

.zen-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.zen-stats span {
    background: var(--bg-light);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: 1px solid var(--border);
}

#zen-start-btn {
    margin-bottom: 0.75rem;
}

/* 禅意模式完成界面 */
.zen-complete-content {
    max-width: 400px;
    margin: 2rem auto;
    padding: 2rem;
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 16px;
    text-align: center;
}

.zen-flower {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: zenFlowerIn 0.6s ease-out;
}

@keyframes zenFlowerIn {
    0% { transform: scale(0) rotate(-30deg); opacity: 0; }
    60% { transform: scale(1.1) rotate(5deg); opacity: 1; }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* 禅意花园 */
.zen-garden-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.zen-garden-header h3 {
    margin: 0;
    flex: 1;
}

.zen-garden-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    max-width: 800px;
    margin: 0 auto;
}

.zen-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-muted);
    padding: 3rem 1rem;
}

.zen-flower-card {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
}

.zen-flower-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.zen-flower-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
}

.zen-flower-info {
    text-align: left;
    overflow: hidden;
}

.zen-flower-name {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.zen-flower-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* 禅意模式 HUD */
.zen-hud {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 0.5rem 1rem;
    background: var(--bg-light);
    border-top: 1px solid var(--border);
    font-size: 0.9rem;
}

.zen-focus-bar {
    width: 120px;
    height: 10px;
    background: var(--border);
    border-radius: 5px;
    overflow: hidden;
}

.zen-focus-fill {
    height: 100%;
    width: 100%;
    border-radius: 5px;
    transition: width 0.3s ease, background-color 0.3s ease;
}

.zen-focus-high {
    background: linear-gradient(90deg, #4ade80, #22c55e);
}

.zen-focus-mid {
    background: linear-gradient(90deg, #facc15, #eab308);
}

.zen-focus-low {
    background: linear-gradient(90deg, #f87171, #ef4444);
}

#zen-focus-text {
    font-weight: 500;
    color: var(--text);
}

#zen-mistakes {
    color: var(--text-muted);
}

/* 移动端适配 */
@media (max-width: 600px) {
    .zen-container {
        padding: 1rem;
    }
    .zen-rules {
        grid-template-columns: 1fr;
    }
    .zen-stats {
        flex-direction: column;
        gap: 0.75rem;
    }
    .zen-garden-grid {
        grid-template-columns: 1fr;
    }
    .zen-hud {
        flex-wrap: wrap;
        gap: 0.5rem;
        font-size: 0.8rem;
    }
}


/* ========================================
   性能与可访问性设置
   ======================================== */

/* 减少动画 */
body.reduced-motion *,
body.reduced-motion *::before,
body.reduced-motion *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
}

/* 禁用模糊 */
body.no-blur .overlay {
    backdrop-filter: none !important;
}

/* 禁用粒子 */
body.no-particles #particles,
body.no-particles .particle {
    display: none !important;
}

/* 低分辨率模式（降低阴影复杂度，但保留聚焦指示器等必要效果） */
body.low-res .screen,
body.low-res .menu-btn,
body.low-res .difficulty-card,
body.low-res .achievement-card,
body.low-res .zen-flower-card,
body.low-res .campaign-node,
body.low-res .museum-card,
body.low-res .bl-card,
body.low-res .challenge-item,
body.low-res .overlay-content,
body.low-res .powerup-slot,
body.low-res .tut-practice-cell,
body.low-res .puzzle-cell,
body.low-res .thunder-cell,
body.low-res .architect-cell {
    box-shadow: none !important;
}
body.low-res .menu-logo,
body.low-res .splash-title,
body.low-res .screen-header h2 {
    text-shadow: none !important;
}

/* 禁用 Web Audio 提示 */
body.no-webaudio .audio-preview-btns {
    opacity: 0.5;
    pointer-events: none;
}
