/**
 * game.css — 化学不难学 游戏化UI样式 v1.0
 * 游戏化元素：顶部进度条、打卡按钮、成就面板、等级徽章
 * 学习内容区保持原有暖白护眼风格
 */

/* ===== 游戏化进度条 ===== */
.game-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #0f172a;
    border: 1px solid #1e3a5f;
    border-radius: 12px;
    padding: 12px 18px;
    margin: 0 0 0 0;
}

.game-bar-lv {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: linear-gradient(135deg, #7c3aed, #4f46e5);
    color: #f0abfc;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
    flex-shrink: 0;
    border: 2px solid #4f46e5;
}

.game-bar-info {
    flex: 1;
    min-width: 0;
}

.game-bar-name {
    font-size: 13px;
    font-weight: 700;
    color: #f0abfc;
    margin-bottom: 5px;
    letter-spacing: 1px;
}

.game-bar-track {
    height: 6px;
    background: #1e293b;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 4px;
}

.game-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #7c3aed, #22d3ee);
    border-radius: 3px;
    transition: width 0.6s ease;
}

.game-bar-nums {
    font-size: 11px;
    color: #64748b;
}

.game-bar-stats {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0;
}

.game-stat {
    font-size: 12px;
    color: #94a3b8;
    background: #1e293b;
    padding: 3px 10px;
    border-radius: 8px;
    white-space: nowrap;
}

.game-stat.hot {
    color: #fb923c;
    background: rgba(251,146,60,0.1);
}

/* ===== 打卡按钮区 ===== */
.game-checkin {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 0 0;
    margin-top: 4px;
}

.game-btn-checkin {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 10px;
    border: 2px solid #7c3aed;
    background: linear-gradient(135deg, #0f172a, #1e1e3a);
    color: #a78bfa;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s;
    letter-spacing: 0.5px;
}

.game-btn-checkin:hover:not(.done) {
    background: linear-gradient(135deg, #7c3aed, #4f46e5);
    color: #fff;
    border-color: #7c3aed;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(124,58,237,0.35);
}

.game-btn-checkin.done {
    border-color: #10b981;
    color: #10b981;
    background: rgba(16,185,129,0.08);
    cursor: default;
}

.game-checkin-hint {
    font-size: 13px;
    color: #64748b;
}

/* ===== 成就列表 ===== */
.game-achievements {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    margin-top: 16px;
}

.game-ach-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #0f172a;
    border: 1px solid #1e293b;
    border-radius: 10px;
    transition: border-color 0.2s;
}

.game-ach-item.unlocked {
    border-color: #fbbf24;
    background: rgba(251,191,36,0.05);
}

.game-ach-icon {
    font-size: 22px;
    flex-shrink: 0;
    filter: grayscale(1);
    opacity: 0.4;
}

.game-ach-item.unlocked .game-ach-icon {
    filter: none;
    opacity: 1;
}

.game-ach-name {
    font-size: 13px;
    font-weight: 700;
    color: #64748b;
}

.game-ach-item.unlocked .game-ach-name {
    color: #fbbf24;
}

.game-ach-desc {
    font-size: 11px;
    color: #475569;
    margin-top: 2px;
}

/* ===== 主城Hero区（首页用） ===== */
.game-hero {
    background: linear-gradient(135deg, #0a0a14 0%, #0f172a 50%, #0a0a14 100%);
    padding: 40px 24px 32px;
    color: #e2e8f0;
    position: relative;
    overflow: hidden;
}

.game-hero::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background:
        radial-gradient(circle at 15% 50%, rgba(124,58,237,0.12) 0%, transparent 50%),
        radial-gradient(circle at 85% 30%, rgba(34,211,238,0.08) 0%, transparent 45%);
    pointer-events: none;
}

.game-hero-inner {
    max-width: 1100px;
    margin: 0 auto;
    position: relative;
}

.game-hero-top {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.game-hero-avatar {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: linear-gradient(135deg, #7c3aed, #4f46e5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    flex-shrink: 0;
    border: 2px solid rgba(124,58,237,0.5);
    box-shadow: 0 0 20px rgba(124,58,237,0.3);
}

.game-hero-identity h1 {
    font-size: 20px;
    font-weight: 800;
    color: #f0abfc;
    margin-bottom: 4px;
}

.game-hero-identity p {
    font-size: 13px;
    color: #64748b;
}

.game-hero-stats {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.game-hero-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255,255,255,0.04);
    border: 1px solid #1e293b;
    border-radius: 10px;
    padding: 10px 16px;
    min-width: 80px;
}

.game-hero-stat-num {
    font-size: 22px;
    font-weight: 800;
    color: #22d3ee;
    line-height: 1;
}

.game-hero-stat-label {
    font-size: 11px;
    color: #64748b;
    margin-top: 4px;
}

.game-hero-streak .game-hero-stat-num { color: #fb923c; }
.game-hero-achievements .game-hero-stat-num { color: #fbbf24; }
.game-hero-exams .game-hero-stat-num { color: #f0abfc; }

/* ===== 进度总览（首页用） ===== */
.game-progress-panel {
    background: #0f172a;
    border: 1px solid #1e293b;
    border-radius: 14px;
    padding: 20px 24px;
    margin-bottom: 20px;
}

.game-progress-title {
    font-size: 13px;
    color: #64748b;
    letter-spacing: 2px;
    margin-bottom: 14px;
    text-transform: uppercase;
}

.game-progress-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.game-progress-label {
    font-size: 13px;
    color: #94a3b8;
    width: 80px;
    flex-shrink: 0;
}

.game-progress-track {
    flex: 1;
    height: 8px;
    background: #1e293b;
    border-radius: 4px;
    overflow: hidden;
}

.game-progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.8s ease;
}

.game-progress-fill.topics  { background: linear-gradient(90deg, #22d3ee, #3b82f6); }
.game-progress-fill.exams   { background: linear-gradient(90deg, #f0abfc, #ec4899); }

.game-progress-count {
    font-size: 12px;
    color: #64748b;
    width: 50px;
    text-align: right;
    flex-shrink: 0;
}

/* ===== 打卡日历（小型，仅近14天） ===== */
.game-calendar {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.game-cal-day {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    background: #1e293b;
    border: 1px solid #2d3748;
    font-size: 9px;
    color: #4a5568;
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-cal-day.checked {
    background: #10b981;
    border-color: #10b981;
    color: #fff;
}

.game-cal-day.today {
    border-color: #22d3ee;
}

/* ===== 导出/导入按钮 ===== */
.game-save-btns {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}

.game-save-btn {
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid #2d3748;
    background: #1e293b;
    color: #94a3b8;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.game-save-btn:hover {
    border-color: #22d3ee;
    color: #22d3ee;
}

/* ===== 练功房页面侧边游戏面板 ===== */
.game-side-panel {
    background: #0f172a;
    border: 1px solid #1e293b;
    border-radius: 14px;
    padding: 18px;
    color: #e2e8f0;
    font-size: 13px;
}

.game-side-title {
    font-size: 11px;
    color: #4f6080;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 14px;
}

.game-side-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid #1e293b;
    color: #94a3b8;
}

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

.game-side-item span:last-child {
    color: #22d3ee;
    font-weight: 700;
}

/* ===== 练功房页面 - 导航栏 ===== */
.game-navbar {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%);
    padding: 0 24px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 6px rgba(0,0,0,0.18);
    border-bottom: 1px solid #1e293b;
}
.game-navbar-brand {
    color: #a78bfa;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: 1px;
}
.game-navbar-links {
    display: flex;
    gap: 16px;
}
.game-navbar-links a {
    color: #94a3b8;
    text-decoration: none;
    font-size: 13px;
    transition: color 0.2s;
}
.game-navbar-links a:hover { color: #a78bfa; }
.game-navbar-status {
    font-size: 12px;
    color: #fbbf24;
    font-weight: 600;
    background: rgba(251,191,36,0.1);
    padding: 4px 12px;
    border-radius: 8px;
    border: 1px solid rgba(251,191,36,0.2);
}

/* ===== 练功房页面 - 游戏信息面板 ===== */
.game-topic-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: #0f172a;
    border: 1px solid #1e293b;
    border-radius: 12px;
    padding: 14px 18px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.game-topic-left {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
    min-width: 0;
}
.game-topic-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: linear-gradient(135deg, #7c3aed, #4f46e5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    border: 2px solid rgba(124,58,237,0.4);
}
.game-topic-info {
    flex: 1;
    min-width: 0;
}
.game-topic-name {
    font-size: 13px;
    font-weight: 700;
    color: #e2e8f0;
    margin-bottom: 6px;
}
.game-topic-exp {
    height: 6px;
    background: #1e293b;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 4px;
}
.game-topic-exp-fill {
    height: 100%;
    background: linear-gradient(90deg, #7c3aed, #22d3ee);
    border-radius: 3px;
    transition: width 0.6s ease;
}
.game-topic-exp-text {
    font-size: 11px;
    color: #64748b;
}
.game-topic-right {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}
.game-topic-status {
    font-size: 13px;
}
.game-topic-undone {
    color: #f59e0b;
    background: rgba(245,158,11,0.1);
    padding: 3px 10px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 12px;
}
.game-topic-done {
    color: #10b981;
    background: rgba(16,185,129,0.1);
    padding: 3px 10px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 12px;
}
.game-checkin-btn {
    padding: 10px 20px;
    border-radius: 10px;
    border: 2px solid #7c3aed;
    background: linear-gradient(135deg, #0f172a, #1e1e3a);
    color: #a78bfa;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s;
    letter-spacing: 0.5px;
}
.game-checkin-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #7c3aed, #4f46e5);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(124,58,237,0.35);
}
.game-checkin-btn:disabled {
    opacity: 0.5;
    cursor: default;
}

/* ===== Toast 提示 ===== */
.game-toast {
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: #0f172a;
    color: #f0abfc;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    border: 1px solid #7c3aed;
    box-shadow: 0 8px 30px rgba(124,58,237,0.3);
    opacity: 0;
    pointer-events: none;
    transition: all 0.35s ease;
    z-index: 9999;
    white-space: nowrap;
}
.game-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ===== 页脚改版 ===== */
.site-footer {
    text-align: center;
    padding: 20px 16px 28px;
    color: #64748b;
    font-size: 12px;
}

/* ===== 通关文牒 答题面板 ===== */
.game-quiz-section {
    background: #0f172a;
    border: 2px solid #7c3aed;
    border-radius: 14px;
    padding: 24px;
    margin: 28px 0 20px;
    position: relative;
}
.game-quiz-section.passed {
    border-color: #10b981;
    border-width: 2px;
}
.game-quiz-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}
.game-quiz-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #7c3aed, #4f46e5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    border: 2px solid rgba(124,58,237,0.4);
}
.game-quiz-section.passed .game-quiz-icon {
    background: linear-gradient(135deg, #10b981, #059669);
    border-color: rgba(16,185,129,0.4);
}
.game-quiz-title {
    font-size: 15px;
    font-weight: 800;
    color: #f0abfc;
    letter-spacing: 1px;
}
.game-quiz-section.passed .game-quiz-title {
    color: #10b981;
}
.game-quiz-subtitle {
    font-size: 11px;
    color: #64748b;
    margin-top: 2px;
}
.game-quiz-attempts {
    margin-left: auto;
    font-size: 12px;
    color: #f59e0b;
    background: rgba(245,158,11,0.1);
    padding: 4px 10px;
    border-radius: 8px;
    border: 1px solid rgba(245,158,11,0.2);
    white-space: nowrap;
}

.game-quiz-question {
    font-size: 14px;
    color: #e2e8f0;
    line-height: 1.7;
    margin-bottom: 16px;
    padding: 14px 16px;
    background: #1a1a2e;
    border-radius: 10px;
    border-left: 3px solid #7c3aed;
}

.game-quiz-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.game-quiz-opt {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid #1e293b;
    background: #1a1a2e;
    color: #cbd5e1;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1.5;
    text-align: left;
    font-family: inherit;
}
.game-quiz-opt:hover:not(.disabled):not(.wrong):not(.correct) {
    border-color: #7c3aed;
    background: rgba(124,58,237,0.08);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(124,58,237,0.2);
}
.game-quiz-opt .opt-letter {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #1e293b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 12px;
    color: #7c3aed;
    flex-shrink: 0;
    border: 1px solid #334155;
}
.game-quiz-opt.wrong {
    border-color: #ef4444;
    background: rgba(239,68,68,0.08);
    color: #fca5a5;
    cursor: default;
}
.game-quiz-opt.wrong .opt-letter {
    background: rgba(239,68,68,0.2);
    color: #ef4444;
    border-color: #ef4444;
}
.game-quiz-opt.correct {
    border-color: #10b981 !important;
    background: rgba(16,185,129,0.1) !important;
    color: #6ee7b7 !important;
    cursor: default;
    animation: pulseGreen 0.5s ease;
}
.game-quiz-opt.correct .opt-letter {
    background: rgba(16,185,129,0.2) !important;
    color: #10b981 !important;
    border-color: #10b981 !important;
}
.game-quiz-opt.disabled {
    opacity: 0.4;
    cursor: default;
    pointer-events: none;
}
@keyframes pulseGreen {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

/* ===== 答题结果面板 ===== */
.game-quiz-result {
    margin-top: 18px;
    padding: 16px;
    border-radius: 10px;
    background: rgba(16,185,129,0.06);
    border: 1px solid rgba(16,185,129,0.2);
    text-align: center;
}
.game-quiz-result-icon {
    font-size: 36px;
    margin-bottom: 8px;
}
.game-quiz-result-title {
    font-size: 16px;
    font-weight: 800;
    color: #f1f5f9;
    margin-bottom: 6px;
}
.game-quiz-result-exp {
    font-size: 28px;
    font-weight: 900;
    color: #fbbf24;
    margin-bottom: 4px;
}
.game-quiz-result-exp.zero {
    color: #64748b;
}
.game-quiz-result-detail {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 14px;
}
.game-quiz-next-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s;
    text-decoration: none;
    letter-spacing: 0.5px;
}
.game-quiz-next-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16,185,129,0.4);
}

/* 答错提示 */
.game-quiz-wrong-hint {
    margin-top: 14px;
    padding: 10px 14px;
    border-radius: 8px;
    background: rgba(239,68,68,0.06);
    border: 1px solid rgba(239,68,68,0.2);
    font-size: 13px;
    color: #fca5a5;
}
.game-quiz-wrong-hint strong {
    color: #ef4444;
}

/* ===== 首页锁门样式 ===== */
.topic-card.locked {
    opacity: 0.55;
    pointer-events: none;
    position: relative;
}
.topic-card.locked::after {
    content: "🔒";
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    font-size: 18px;
    opacity: 0.7;
}
.lock-badge {
    display: inline-block;
    font-size: 9px;
    background: #334155;
    color: #94a3b8;
    padding: 1px 7px;
    border-radius: 4px;
    margin-left: 6px;
    vertical-align: middle;
    border: 1px solid #475569;
}
@media (max-width: 768px) {
    .game-bar { flex-wrap: wrap; gap: 10px; }
    .game-bar-stats { flex-direction: row; }
    .game-hero-top { flex-wrap: wrap; }
    .game-hero-stats { gap: 8px; }
    .game-hero-stat { min-width: 60px; padding: 8px 10px; }
    .game-hero-stat-num { font-size: 18px; }
    .game-checkin { flex-wrap: wrap; }
    .game-achievements { grid-template-columns: 1fr 1fr; }
    .game-progress-panel { padding: 16px; }
    .game-quiz-options { grid-template-columns: 1fr; }
    .game-quiz-section { padding: 16px; }
}
