/* ===================== 化学王者 · 复古实验室风格 ===================== */

:root {
    /* 核心色彩 - 墨绿鎏金 */
    --ink-black: #070d0a;
    --forest-deep: #0a1f12;
    --forest-mid: #132a1c;
    --forest-light: #1a3d28;
    --forest-glass: rgba(19, 42, 28, 0.75);
    --amber: #d4a574;
    --amber-bright: #e8c9a0;
    --amber-dim: #a07850;
    --gold: #c9a961;
    --cream: #f5f0e1;
    --cream-dim: #c8c4b8;
    --cream-muted: #8a8578;
    --success: #5a9e6e;
    --success-glow: rgba(90, 158, 110, 0.3);
    --danger: #c45c5c;
    --danger-glow: rgba(196, 92, 92, 0.3);

    /* 字体 */
    --font-serif: 'Noto Serif SC', 'Songti SC', Georgia, serif;
    --font-sans: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;

    /* 尺寸 */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-gold: 0 0 30px rgba(212, 165, 116, 0.15);
}

* {
    box-sizing: border-box;
    user-select: none;
    margin: 0;
    padding: 0;
}

/* ========== 背景层 ========== */
body {
    background: var(--ink-black);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    font-family: var(--font-sans);
    color: var(--cream);
    line-height: 1.6;
    padding: 24px 16px;
    overflow-x: hidden;
    position: relative;
}

.bg-decoration {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

/* 六边形网格背景 */
.hex-grid {
    position: absolute;
    inset: -50%;
    background-image:
        linear-gradient(30deg, var(--forest-light) 12%, transparent 12.5%, transparent 87%, var(--forest-light) 87.5%, var(--forest-light)),
        linear-gradient(150deg, var(--forest-light) 12%, transparent 12.5%, transparent 87%, var(--forest-light) 87.5%, var(--forest-light)),
        linear-gradient(30deg, var(--forest-light) 12%, transparent 12.5%, transparent 87%, var(--forest-light) 87.5%, var(--forest-light)),
        linear-gradient(150deg, var(--forest-light) 12%, transparent 12.5%, transparent 87%, var(--forest-light) 87.5%, var(--forest-light)),
        linear-gradient(60deg, rgba(26, 61, 40, 0.5) 25%, transparent 25.5%, transparent 75%, rgba(26, 61, 40, 0.5) 75%, rgba(26, 61, 40, 0.5)),
        linear-gradient(60deg, rgba(26, 61, 40, 0.5) 25%, transparent 25.5%, transparent 75%, rgba(26, 61, 40, 0.5) 75%, rgba(26, 61, 40, 0.5));
    background-size: 80px 140px;
    background-position: 0 0, 0 0, 40px 70px, 40px 70px, 0 0, 40px 70px;
    opacity: 0.12;
}

/* 浮动光球（静态） */
.floating-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.12;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: var(--amber);
    top: -100px;
    right: -100px;
}

.orb-2 {
    width: 300px;
    height: 300px;
    background: var(--success);
    bottom: 10%;
    left: -80px;
}

.orb-3 {
    width: 250px;
    height: 250px;
    background: var(--gold);
    top: 40%;
    right: 10%;
}

/* ========== 主容器 ========== */
.game-container {
    position: relative;
    z-index: 1;
    max-width: 980px;
    width: 100%;
    background: var(--forest-glass);
    backdrop-filter: blur(24px);
    border: 1px solid rgba(212, 165, 116, 0.12);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft), var(--shadow-gold), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    padding: 0;
    overflow: hidden;
    animation: containerReveal 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes containerReveal {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 顶部装饰线 */
.top-border-accent {
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--amber), var(--gold), var(--amber), transparent);
    position: relative;
}

.top-border-accent::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--cream);
    filter: blur(8px);
    opacity: 0.5;
}

/* ========== 头部 ========== */
.game-header {
    text-align: center;
    padding: 36px 24px 28px;
    position: relative;
}

.header-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(212, 165, 116, 0.1);
    border: 1px solid rgba(212, 165, 116, 0.2);
    border-radius: 100px;
    padding: 8px 20px;
    margin-bottom: 16px;
    animation: badgeIn 0.6s 0.2s both;
}

@keyframes badgeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.badge-icon {
    color: var(--amber);
    display: flex;
}

.badge-icon svg {
    width: 20px;
    height: 20px;
}

.badge-text {
    font-family: var(--font-serif);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--amber);
    letter-spacing: 0.1em;
}

.main-title {
    font-family: var(--font-serif);
    font-size: 2.8rem;
    font-weight: 900;
    color: var(--cream);
    margin: 0 0 8px;
    line-height: 1.2;
    animation: titleIn 0.8s 0.3s both;
}

@keyframes titleIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.title-line {
    display: block;
    background: linear-gradient(135deg, var(--cream) 0%, var(--amber-bright) 50%, var(--gold) 100%);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
}

.subtitle {
    font-size: 0.9rem;
    color: var(--cream-muted);
    font-weight: 300;
    letter-spacing: 0.15em;
    animation: fadeIn 0.8s 0.5s both;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 管理员按钮 */
.admin-btn {
    position: absolute;
    right: 20px;
    top: 20px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(212, 165, 116, 0.15);
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    font-size: 0.75rem;
    color: var(--cream-muted);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-sans);
}

.admin-btn:hover {
    border-color: var(--amber-dim);
    color: var(--amber);
    background: rgba(212, 165, 116, 0.1);
}

.admin-btn svg {
    opacity: 0.7;
}

/* ========== 主内容区 ========== */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1.7fr;
    gap: 20px;
    padding: 0 28px;
    margin-bottom: 20px;
}

/* 面板通用样式 */
.panel {
    background: rgba(10, 31, 18, 0.6);
    border: 1px solid rgba(212, 165, 116, 0.1);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all 0.4s ease;
}

.panel:hover {
    border-color: rgba(212, 165, 116, 0.18);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.panel-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 20px 14px;
    border-bottom: 1px solid rgba(212, 165, 116, 0.08);
}

.panel-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.panel-icon svg {
    width: 20px;
    height: 20px;
}

.player-icon {
    background: rgba(90, 158, 110, 0.15);
    color: var(--success);
}

.trophy-icon {
    background: rgba(212, 165, 116, 0.15);
    color: var(--amber);
}

.panel-title {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--cream);
    flex: 1;
}

.panel-badge {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--amber);
    background: rgba(212, 165, 116, 0.1);
    padding: 4px 10px;
    border-radius: 100px;
    letter-spacing: 0.05em;
}

.panel-body {
    padding: 20px;
}

/* ========== 玩家输入区 ========== */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.input-label {
    font-size: 0.8rem;
    color: var(--cream-muted);
    font-weight: 500;
    letter-spacing: 0.05em;
}

#playerName {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1.5px solid rgba(212, 165, 116, 0.15);
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    color: var(--cream);
    font-family: var(--font-sans);
    font-weight: 500;
    outline: none;
    transition: all 0.3s ease;
}

#playerName::placeholder {
    color: rgba(138, 133, 120, 0.5);
}

#playerName:focus {
    border-color: var(--amber-dim);
    box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.1);
    background: rgba(0, 0, 0, 0.4);
}

.btn-start {
    width: 100%;
    background: linear-gradient(135deg, var(--amber) 0%, var(--amber-dim) 100%);
    border: none;
    padding: 16px 24px;
    border-radius: var(--radius-sm);
    color: var(--forest-deep);
    font-family: var(--font-serif);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
}

.btn-start::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s ease;
}

.btn-start:hover::before {
    left: 100%;
}

.btn-start:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(212, 165, 116, 0.3);
}

.btn-start:active {
    transform: translateY(0);
}

.btn-arrow {
    transition: transform 0.3s ease;
}

.btn-start:hover .btn-arrow {
    transform: translateX(4px);
}

.btn-restart {
    width: 100%;
    background: transparent;
    border: 1.5px solid rgba(212, 165, 116, 0.25);
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    color: var(--amber);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
}

.btn-restart:hover {
    background: rgba(212, 165, 116, 0.1);
    border-color: var(--amber-dim);
}

.btn-restart svg {
    transition: transform 0.5s ease;
}

.btn-restart:hover svg {
    transform: rotate(180deg);
}

/* ========== 排行榜 ========== */
.rank-list {
    max-height: 260px;
    overflow-y: auto;
    padding-right: 6px;
}

.rank-list::-webkit-scrollbar {
    width: 4px;
}

.rank-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 2px;
}

.rank-list::-webkit-scrollbar-thumb {
    background: var(--amber-dim);
    border-radius: 2px;
}

.empty-state {
    text-align: center;
    padding: 32px 0;
    color: var(--cream-muted);
}

.empty-icon {
    margin-bottom: 12px;
    opacity: 0.3;
}

.empty-icon svg {
    width: 36px;
    height: 36px;
    margin: 0 auto;
}

.empty-state p {
    font-size: 0.85rem;
    font-family: var(--font-serif);
}

.rank-item {
    display: grid;
    grid-template-columns: 32px 1fr 60px 50px 55px;
    gap: 8px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    align-items: center;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    margin-bottom: 4px;
}

.rank-item:hover {
    background: rgba(212, 165, 116, 0.05);
}

/* 前三名特殊样式 */
.rank-item:nth-child(1) {
    background: linear-gradient(90deg, rgba(212, 165, 116, 0.15), transparent);
    border-left: 2px solid var(--amber);
}

.rank-item:nth-child(2) {
    background: linear-gradient(90deg, rgba(200, 196, 184, 0.1), transparent);
    border-left: 2px solid var(--cream-dim);
}

.rank-item:nth-child(3) {
    background: linear-gradient(90deg, rgba(160, 120, 80, 0.1), transparent);
    border-left: 2px solid var(--amber-dim);
}

.rank-num {
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--cream-muted);
    text-align: center;
}

.rank-item:nth-child(1) .rank-num { color: var(--amber); font-size: 1rem; }
.rank-item:nth-child(2) .rank-num { color: var(--cream-dim); }
.rank-item:nth-child(3) .rank-num { color: var(--amber-dim); }

.rank-name {
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--cream);
}

.rank-score {
    font-family: var(--font-serif);
    font-weight: 700;
    text-align: center;
    color: var(--amber);
    font-size: 0.8rem;
}

.rank-duration {
    font-size: 0.7rem;
    color: var(--cream-muted);
    text-align: right;
}

.rank-ago {
    font-size: 0.7rem;
    color: rgba(138, 133, 120, 0.5);
    text-align: right;
}

/* ========== 管理员面板 ========== */
.admin-panel {
    margin-top: 16px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: var(--radius-sm);
    padding: 16px;
    border: 1px solid rgba(212, 165, 116, 0.15);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.admin-panel h4 {
    font-family: var(--font-serif);
    color: var(--amber);
    font-size: 0.95rem;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(212, 165, 116, 0.1);
}

.full-rank-list {
    max-height: 200px;
    overflow-y: auto;
    margin: 10px 0;
}

.full-rank-item {
    display: grid;
    grid-template-columns: 28px 1fr 50px 50px 45px 44px;
    gap: 6px;
    background: rgba(255, 255, 255, 0.02);
    margin: 5px 0;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    align-items: center;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.full-rank-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.full-rank-item .fr-rank {
    font-family: var(--font-serif);
    font-weight: 600;
    color: var(--cream-muted);
    font-size: 0.8rem;
    text-align: center;
}

.full-rank-item .fr-name {
    color: var(--cream);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.full-rank-item .fr-score {
    text-align: center;
    color: var(--amber);
    font-weight: 600;
    font-family: var(--font-serif);
    font-size: 0.8rem;
}

.full-rank-item .fr-duration,
.full-rank-item .fr-ago {
    text-align: right;
    color: var(--cream-muted);
    font-size: 0.7rem;
}

.admin-del-btn {
    background: var(--danger) !important;
    padding: 4px 10px !important;
    border-radius: 6px !important;
    font-size: 0.7rem !important;
    color: white !important;
    border: none !important;
    cursor: pointer;
    box-shadow: none !important;
    font-family: var(--font-sans) !important;
}

.admin-del-btn:hover {
    background: #d66 !important;
}

/* 管理员操作按钮 */
.admin-action-btn {
    background: rgba(212, 165, 116, 0.1);
    border: 1px solid rgba(212, 165, 116, 0.2);
    border-radius: var(--radius-sm);
    padding: 8px 16px;
    font-size: 0.8rem;
    color: var(--cream-dim);
    font-family: var(--font-sans);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.admin-action-btn:hover {
    background: rgba(212, 165, 116, 0.2);
    border-color: var(--amber-dim);
    color: var(--cream);
}

/* ========== 答题区 ========== */
.quiz-section {
    margin: 0 28px 24px;
    background: rgba(10, 31, 18, 0.5);
    border: 1px solid rgba(212, 165, 116, 0.1);
    border-radius: var(--radius-md);
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.quiz-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--amber), transparent);
    opacity: 0.3;
}

/* 统计数据 */
.quiz-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 20px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 24px;
}

.stat-label {
    font-size: 0.7rem;
    color: var(--cream-muted);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 4px;
}

.stat-value {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--cream);
    line-height: 1;
}

.stat-total {
    font-size: 1rem;
    color: var(--cream-muted);
    font-weight: 400;
}

.timer-value {
    color: var(--amber);
}

.timer-unit {
    font-size: 0.9rem;
    color: var(--amber-dim);
    margin-left: 2px;
}

.timer-row {
    display: flex;
    align-items: baseline;
    justify-content: center;
}

/* 化学式高亮 */
.chem-formula {
    color: var(--amber-bright);
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-weight: 600;
    font-size: 1.05em;
    text-shadow: 0 0 8px rgba(212, 165, 116, 0.25);
    letter-spacing: 0.02em;
}

.stat-divider {
    width: 1px;
    height: 40px;
    background: rgba(212, 165, 116, 0.15);
}

/* 计时器轨道 */
.timer-track {
    width: 100%;
    height: 4px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 24px;
    position: relative;
}

.timer-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--success), var(--amber), var(--danger));
    border-radius: 2px;
    transition: width 0.1s linear;
    position: relative;
}

.timer-progress::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background: var(--cream);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--amber);
}

/* 问题卡片 */
.question-card {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(212, 165, 116, 0.08);
    border-radius: var(--radius-md);
    padding: 32px 28px;
    text-align: center;
    margin-bottom: 24px;
    position: relative;
}

.question-number {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--amber-dim);
    letter-spacing: 0.3em;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.question-text {
    font-family: var(--font-serif);
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--cream);
    line-height: 1.6;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 答案按钮区 */
.answer-area {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.answer-btn {
    flex: 1;
    max-width: 200px;
    padding: 18px 28px;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
    font-family: var(--font-sans);
}

.answer-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.answer-btn:hover::before {
    opacity: 1;
}

.btn-icon {
    width: 32px;
    height: 32px;
}

.btn-icon svg {
    width: 100%;
    height: 100%;
}

.btn-label {
    font-size: 1rem;
    font-weight: 700;
}

.btn-correct {
    background: linear-gradient(135deg, rgba(90, 158, 110, 0.2), rgba(90, 158, 110, 0.1));
    border: 1.5px solid rgba(90, 158, 110, 0.4);
    color: var(--success);
    box-shadow: 0 4px 16px var(--success-glow);
}

.btn-correct:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 28px var(--success-glow);
    border-color: var(--success);
}

.btn-wrong {
    background: linear-gradient(135deg, rgba(196, 92, 92, 0.2), rgba(196, 92, 92, 0.1));
    border: 1.5px solid rgba(196, 92, 92, 0.4);
    color: var(--danger);
    box-shadow: 0 4px 16px var(--danger-glow);
}

.btn-wrong:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 28px var(--danger-glow);
    border-color: var(--danger);
}

.btn-disabled {
    opacity: 0.35 !important;
    pointer-events: none;
    filter: grayscale(0.6);
    transform: none !important;
}

/* 结果卡片 */
.result-card {
    margin-top: 20px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(212, 165, 116, 0.12);
    border-radius: var(--radius-md);
    padding: 28px;
    text-align: center;
    animation: resultIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes resultIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.result-content {
    color: var(--cream);
}

.result-title {
    font-family: var(--font-serif);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--amber);
    margin-bottom: 12px;
}

.result-score {
    font-family: var(--font-serif);
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--cream);
    margin: 8px 0;
}

.result-score span {
    color: var(--amber);
}

.result-detail {
    font-size: 0.9rem;
    color: var(--cream-muted);
    margin: 8px 0;
}

.result-rank {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gold);
    margin: 12px 0;
    padding: 8px 20px;
    background: rgba(212, 165, 116, 0.1);
    border-radius: 100px;
    display: inline-block;
}

.result-perfect {
    font-size: 1rem;
    color: var(--amber-bright);
    margin-top: 12px;
    font-family: var(--font-serif);
}

/* ========== 解析弹窗 ========== */
.explanation-popup {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--forest-deep);
    border: 1px solid rgba(212, 165, 116, 0.2);
    border-left: 3px solid var(--amber);
    border-radius: var(--radius-md);
    padding: 16px 28px;
    max-width: 600px;
    width: 90%;
    color: var(--cream);
    font-size: 0.9rem;
    z-index: 1000;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    pointer-events: none;
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from { opacity: 0; transform: translateX(-50%) translateY(30px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ========== Toast ========== */
.toast-warn {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--danger), #a04040);
    border-radius: var(--radius-sm);
    color: white;
    padding: 14px 32px;
    font-weight: 600;
    z-index: 999;
    font-size: 0.9rem;
    box-shadow: 0 10px 30px rgba(196, 92, 92, 0.4);
    animation: slideUp 0.3s ease;
    font-family: var(--font-sans);
}

/* ========== 页脚 ========== */
.game-footer {
    padding: 0 28px 24px;
    text-align: center;
}

.footer-line {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(212, 165, 116, 0.15), transparent);
    margin-bottom: 16px;
}

.game-footer p {
    font-size: 0.8rem;
    color: var(--cream-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.footer-sep {
    color: rgba(212, 165, 116, 0.3);
}

.text-btn {
    background: none;
    border: none;
    color: var(--amber-dim);
    font-size: 0.8rem;
    cursor: pointer;
    padding: 0;
    font-family: var(--font-sans);
    font-weight: 500;
    transition: color 0.2s ease;
    box-shadow: none;
    position: relative;
}

.text-btn::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--amber);
    transition: width 0.3s ease;
}

.text-btn:hover {
    color: var(--amber);
}

.text-btn:hover::after {
    width: 100%;
}

/* ========== Changelog ========== */
.changelog-overlay {
    position: fixed;
    inset: 0;
    background: rgba(7, 13, 10, 0.85);
    backdrop-filter: blur(12px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.changelog-card {
    background: var(--forest-deep);
    border: 1px solid rgba(212, 165, 116, 0.15);
    border-radius: var(--radius-md);
    max-width: 520px;
    width: 90%;
    max-height: 80vh;
    padding: 28px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.7);
    overflow-y: auto;
    animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.changelog-card h2 {
    font-family: var(--font-serif);
    color: var(--cream);
    font-size: 1.3rem;
    margin: 0 0 4px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
}

.changelog-card .subtitle {
    color: var(--cream-muted);
    font-size: 0.8rem;
    margin-bottom: 20px;
}

.changelog-card .close-x {
    float: right;
    background: rgba(212, 165, 116, 0.1);
    border: 1px solid rgba(212, 165, 116, 0.15);
    color: var(--cream-muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 6px 12px;
    line-height: 1;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    font-family: var(--font-sans);
}

.changelog-card .close-x:hover {
    background: var(--danger);
    border-color: var(--danger);
    color: white;
}

.cl-entry {
    border-left: 2px solid var(--amber-dim);
    padding-left: 16px;
    margin-bottom: 18px;
}

.cl-entry .cl-version {
    font-family: var(--font-serif);
    color: var(--amber);
    font-weight: 700;
    font-size: 0.95rem;
}

.cl-entry .cl-date {
    color: var(--cream-muted);
    font-size: 0.75rem;
    margin-left: 10px;
    font-weight: 400;
}

.cl-entry ul {
    margin: 8px 0 0;
    padding-left: 18px;
    color: var(--cream-dim);
    font-size: 0.85rem;
}

.cl-entry li {
    margin-bottom: 5px;
    line-height: 1.5;
}

.cl-entry li::marker {
    color: var(--amber-dim);
}

/* 更新日志新标记 */
.changelog-new {
    color: var(--danger);
    font-weight: 800;
    margin-left: 6px;
    animation: pulse-dot 1.5s ease-in-out infinite;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: rgba(196, 92, 92, 0.15);
    border-radius: 50%;
    font-size: 0.65rem;
    font-family: var(--font-sans);
}

@keyframes pulse-dot {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(0.85); opacity: 0.6; }
}

/* ========== 隐藏类 ========== */
.hidden {
    display: none !important;
}

/* ========== 响应式 ========== */
@media (max-width: 768px) {
    body {
        padding: 16px 12px;
    }

    .game-container {
        border-radius: var(--radius-md);
    }

    .game-header {
        padding: 24px 16px 20px;
    }

    .main-title {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 0.8rem;
    }

    .admin-btn {
        position: static;
        display: inline-flex;
        margin-top: 12px;
    }

    .main-content {
        grid-template-columns: 1fr;
        padding: 0 16px;
    }

    .panel {
        padding: 0;
    }

    .quiz-section {
        margin: 0 16px 20px;
        padding: 18px;
    }

    .quiz-stats {
        gap: 0;
    }

    .stat-item {
        padding: 0 14px;
    }

    .stat-value {
        font-size: 1.4rem;
    }

    .question-card {
        padding: 24px 18px;
    }

    .question-text {
        font-size: 1.1rem;
        min-height: 60px;
    }

    .answer-area {
        gap: 12px;
    }

    .answer-btn {
        padding: 14px 20px;
    }

    .btn-icon {
        width: 24px;
        height: 24px;
    }

    .btn-label {
        font-size: 0.9rem;
    }

    .rank-item {
        grid-template-columns: 28px 1fr 55px 45px 45px;
        font-size: 0.8rem;
        padding: 8px;
    }

    .full-rank-item {
        grid-template-columns: 24px 1fr 40px 40px 40px 36px;
        font-size: 0.75rem;
        padding: 6px 8px;
    }

    .game-footer {
        padding: 0 16px 20px;
    }
}

@media (max-width: 480px) {
    .main-title {
        font-size: 1.7rem;
    }

    .stat-item {
        padding: 0 10px;
    }

    .stat-value {
        font-size: 1.2rem;
    }

    .answer-btn {
        min-width: auto;
    }
}
