/* ==========================================================
   数学星球 · 全局样式
   字体：Fredoka（数字/标题）+ Noto Sans SC（中文）
   ========================================================== */
:root {
    --brand: #6C63FF;
    --brand-dark: #5A52E0;
    --brand-light: #8B85FF;
    --brand-bg: #EEEDFF;
    --success: #10B981;
    --success-bg: #D1FAE5;
    --danger: #EF4444;
    --danger-bg: #FEE2E2;
    --warning: #F59E0B;
    --warning-bg: #FEF3C7;
    --cyan: #06B6D4;
    --pink: #EC4899;
    --text: #1F2430;
    --text-light: #6B7280;
    --border: #ECECF5;
    --card-bg: #FFFFFF;
    --bg: #F5F5FF;
    --shadow-sm: 0 2px 8px rgba(108, 99, 255, 0.06);
    --shadow: 0 8px 24px rgba(108, 99, 255, 0.10);
    --shadow-lg: 0 16px 48px rgba(108, 99, 255, 0.16);
    --radius: 18px;
    --radius-sm: 12px;
    --radius-lg: 28px;
    --transition: all .25s cubic-bezier(.4, 0, .2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

/* 背景装饰 */
body::before {
    content: '';
    position: fixed;
    top: -180px; right: -120px;
    width: 420px; height: 420px;
    background: radial-gradient(circle, rgba(108,99,255,.14), transparent 70%);
    border-radius: 50%;
    z-index: 0;
    pointer-events: none;
}
body::after {
    content: '';
    position: fixed;
    bottom: -160px; left: -100px;
    width: 380px; height: 380px;
    background: radial-gradient(circle, rgba(245,158,11,.12), transparent 70%);
    border-radius: 50%;
    z-index: 0;
    pointer-events: none;
}

.hidden { display: none !important; }

h1, h2, h3, .question-text, .stat-num, .logo, .coin-count, .level-name {
    font-family: 'Fredoka', 'Noto Sans SC', sans-serif;
}

.lucide { width: 1em; height: 1em; stroke-width: 2; }

/* ==========================================================
   导航栏
   ========================================================== */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 28px;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
}

.nav-left { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }

.logo-mark {
    width: 40px; height: 40px;
    display: grid; place-items: center;
    background: linear-gradient(135deg, var(--brand-light), var(--brand-dark));
    border-radius: 12px;
    color: #fff;
    font-size: 22px;
    box-shadow: 0 4px 12px rgba(108, 99, 255, .35);
}

.logo {
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* 标签过多时横向滚动，绝不挤压右侧的金币/头像/退出按钮 */
.nav-tabs { display: flex; gap: 4px; background: var(--bg); padding: 4px; border-radius: 14px; min-width: 0; flex: 1 1 auto; overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; }
.nav-tabs::-webkit-scrollbar { display: none; }

.nav-tab {
    display: flex; align-items: center; gap: 6px;
    padding: 8px 14px;
    border: none;
    background: transparent;
    color: var(--text-light);
    font-size: 13.5px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    border-radius: 10px;
    flex: 0 0 auto;
    transition: var(--transition);
}
.nav-tab .lucide { font-size: 17px; }
.nav-tab:hover { color: var(--brand); }
.nav-tab.active {
    background: #fff;
    color: var(--brand);
    font-weight: 700;
    box-shadow: var(--shadow-sm);
}

.nav-right { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }

/* 笔记本等中等宽度（≤1500px）：导航栏分两行——第一行 logo+右侧信息，第二行标签独占整行，彻底不挤 */
@media (max-width: 1500px) {
    .navbar { flex-wrap: wrap; gap: 8px 16px; }
    .nav-tabs { order: 3; width: 100%; flex: 1 1 100%; }
}

.coin-display {
    display: flex; align-items: center; gap: 6px;
    padding: 7px 14px 7px 8px;
    background: linear-gradient(135deg, #FFF7E0, #FFE9A8);
    border: 1.5px solid #FCD34D;
    border-radius: 30px;
    font-weight: 700;
    color: #92400E;
}
.coin-img { width: 24px; height: 24px; }
.coin-count { font-size: 16px; min-width: 20px; text-align: center; }
.coin-plus { font-size: 13px; opacity: .55; }

.level-badge {
    display: flex; align-items: center; gap: 7px;
    padding: 6px 14px 6px 7px;
    background: linear-gradient(135deg, var(--brand-bg), #E0DFFF);
    border: 1.5px solid #C7C4FF;
    border-radius: 30px;
    font-weight: 600;
    color: var(--brand-dark);
}
.level-icon-wrap {
    width: 26px; height: 26px;
    display: grid; place-items: center;
    background: #fff;
    border-radius: 50%;
    color: var(--brand);
    font-size: 15px;
}
.level-name { font-size: 13.5px; }

/* ==========================================================
   主内容
   ========================================================== */
.main-content {
    position: relative;
    z-index: 1;
    max-width: 960px;
    margin: 0 auto;
    padding: 28px 20px 60px;
}

.page { display: none; animation: fadeUp .35s ease both; }
.page.active { display: block; }

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

/* ==========================================================
   按钮
   ========================================================== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    padding: 11px 22px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}
.btn .lucide { font-size: 17px; }
.btn-lg { padding: 14px 30px; font-size: 16px; border-radius: 14px; }

.btn-primary {
    background: linear-gradient(135deg, var(--brand-light), var(--brand));
    background-size: 140% 140%;
    color: #fff;
    box-shadow: 0 6px 16px rgba(108, 99, 255, .32);
}
.btn-primary:hover { background-position: 100% 0; transform: translateY(-2px); box-shadow: 0 10px 24px rgba(108, 99, 255, .4); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
    background: #fff;
    color: var(--brand);
    border: 2px solid var(--brand);
}
.btn-secondary:hover { background: var(--brand-bg); transform: translateY(-2px); }

.btn-ghost { background: transparent; color: var(--text-light); }
.btn-ghost:hover { background: rgba(108, 99, 255, .08); color: var(--brand); }

.btn:disabled { opacity: .45; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

/* ==========================================================
   欢迎横幅
   ========================================================== */
.hero-banner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 34px 40px;
    margin-bottom: 28px;
    background: linear-gradient(120deg, #6C63FF 0%, #8B85FF 55%, #A5A0FF 100%);
    border-radius: var(--radius-lg);
    color: #fff;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}
.hero-banner::before {
    content: '';
    position: absolute;
    top: -60px; right: 30%;
    width: 200px; height: 200px;
    background: rgba(255,255,255,.08);
    border-radius: 50%;
}
.hero-banner::after {
    content: '';
    position: absolute;
    bottom: -70px; left: 38%;
    width: 160px; height: 160px;
    background: rgba(255,255,255,.06);
    border-radius: 50%;
}
.hero-text { position: relative; z-index: 1; }
.hero-text h2 { font-size: 30px; font-weight: 700; margin-bottom: 8px; }
.hero-text p { font-size: 15px; opacity: .92; margin-bottom: 16px; }
.hero-text strong { color: #FFE9A8; }
.hero-chips { display: flex; gap: 9px; flex-wrap: wrap; }
.hero-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 13px;
    background: rgba(255, 255, 255, .16);
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 30px;
    font-size: 12.5px;
    font-weight: 500;
}
.hero-chip .lucide { font-size: 14px; }
.hero-img {
    position: relative;
    z-index: 1;
    width: 230px;
    flex-shrink: 0;
    filter: drop-shadow(0 12px 24px rgba(40, 30, 120, .25));
}

/* ==========================================================
   题型选择
   ========================================================== */
.section-title { margin-bottom: 16px; }
.section-title h3 {
    display: flex; align-items: center; gap: 8px;
    font-size: 19px; font-weight: 700;
}
.section-title h3 .lucide { color: var(--brand); font-size: 22px; }

.topic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(205px, 1fr));
    gap: 16px;
}

.topic-card {
    position: relative;
    padding: 22px 18px;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
    overflow: hidden;
}
.topic-card::after {
    content: '';
    position: absolute;
    top: -30px; right: -30px;
    width: 80px; height: 80px;
    border-radius: 50%;
    background: var(--tc, var(--brand-bg));
    opacity: .5;
    transition: var(--transition);
}
.topic-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
    border-color: var(--tc, var(--brand-light));
}
.topic-card:hover::after { transform: scale(1.6); opacity: .8; }

.topic-icon {
    position: relative;
    z-index: 1;
    width: 52px; height: 52px;
    display: grid; place-items: center;
    background: var(--tc, var(--brand-bg));
    color: var(--tci, var(--brand));
    border-radius: 15px;
    font-size: 26px;
    margin-bottom: 13px;
}
.topic-card h4 { position: relative; z-index: 1; font-size: 16.5px; font-weight: 700; margin-bottom: 4px; }
.topic-card p { position: relative; z-index: 1; font-size: 12.5px; color: var(--text-light); margin-bottom: 10px; }
.topic-accuracy {
    position: relative; z-index: 1;
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 12px;
    font-weight: 700;
    color: var(--brand);
    background: var(--brand-bg);
    padding: 3px 10px;
    border-radius: 20px;
}
.topic-accuracy .lucide { font-size: 12px; }

/* ==========================================================
   答题区
   ========================================================== */
.quiz-area {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.quiz-header {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 16px 26px;
    background: linear-gradient(120deg, #6C63FF, #8B85FF);
    color: #fff;
}
.quiz-info { flex: 0 0 auto; }
.quiz-type {
    display: inline-flex; align-items: center;
    font-weight: 700;
    font-size: 15px;
    background: rgba(255,255,255,.18);
    padding: 6px 14px;
    border-radius: 30px;
    border: 1px solid rgba(255,255,255,.25);
}
.quiz-progress-wrap { flex: 1; display: flex; align-items: center; gap: 12px; }
.quiz-progress-bar {
    flex: 1; height: 8px;
    background: rgba(255,255,255,.25);
    border-radius: 4px;
    overflow: hidden;
}
.quiz-progress-fill {
    height: 100%;
    width: 20%;
    background: linear-gradient(90deg, #FFE9A8, #FBBF24);
    border-radius: 4px;
    transition: width .4s ease;
}
.quiz-progress { font-size: 13px; font-weight: 600; opacity: .95; white-space: nowrap; }
.btn-exit { color: #fff; background: rgba(255,255,255,.14); padding: 8px 14px; font-size: 13px; }
.btn-exit:hover { background: rgba(255,255,255,.26); color: #fff; }

.question-card { padding: 44px 32px 48px; text-align: center; }

.question-badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 16px;
    background: var(--brand-bg);
    color: var(--brand);
    border-radius: 30px;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 22px;
}

.question-text {
    font-size: 30px;
    font-weight: 600;
    margin-bottom: 34px;
    line-height: 1.6;
    color: var(--text);
}

/* 标准竖排分数排版 */
.frac {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    vertical-align: middle;
    margin: 0 2px;
    line-height: 1.1;
}
.frac .num {
    font-size: 0.65em;
    padding: 0 4px 1px;
    border-bottom: 2px solid currentColor;
}
.frac .den {
    font-size: 0.65em;
    padding: 1px 4px 0;
}
.question-text, .pk-question-text, .hint-box, .pk-hint-box {
    font-size: 30px;
}

.answer-area {
    display: flex;
    gap: 12px;
    justify-content: center;
    max-width: 460px;
    margin: 0 auto;
}

.answer-input {
    flex: 1;
    padding: 14px 20px;
    border: 2.5px solid var(--border);
    border-radius: 14px;
    font-size: 20px;
    font-family: 'Fredoka', 'Noto Sans SC', sans-serif;
    text-align: center;
    outline: none;
    transition: var(--transition);
    background: #FAFAFF;
}
.answer-input:focus {
    border-color: var(--brand);
    background: #fff;
    box-shadow: 0 0 0 5px rgba(108, 99, 255, .12);
}

.btn-submit { border-radius: 14px; padding: 14px 26px; }

/* ==========================================================
   批改结果
   ========================================================== */
.result-card { padding: 30px 32px 34px; animation: fadeUp .3s ease both; }

.result-status {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    font-size: 22px;
    font-weight: 700;
    padding: 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 22px;
}
.result-status .lucide { font-size: 28px; }
.result-status.correct { background: var(--success-bg); color: var(--success); }
.result-status.wrong { background: var(--danger-bg); color: var(--danger); }

.result-detail { margin-bottom: 24px; }

.result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 4px;
    border-bottom: 1px dashed var(--border);
}
.result-label {
    display: inline-flex; align-items: center; gap: 7px;
    color: var(--text-light);
    font-size: 14px;
}
.result-label .lucide { font-size: 16px; }
.result-value {
    font-family: 'Fredoka', 'Noto Sans SC', sans-serif;
    font-weight: 600;
    font-size: 19px;
    padding: 3px 14px;
    background: var(--bg);
    border-radius: 10px;
}
.result-value.correct { color: var(--success); background: var(--success-bg); }

.result-explanation {
    margin-top: 18px;
    padding: 18px 20px;
    background: linear-gradient(135deg, #FFFBEB, #FEF9C3);
    border: 1px solid #FDE68A;
    border-radius: var(--radius-sm);
}
.result-explanation h4 {
    display: flex; align-items: center; gap: 7px;
    font-size: 15px;
    margin-bottom: 10px;
    color: #92400E;
}
.result-explanation h4 .lucide { font-size: 18px; }
.explanation-content {
    font-size: 14px;
    line-height: 1.9;
    color: #713F12;
    white-space: pre-line;
}

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

/* ==========================================================
   练习完成
   ========================================================== */
.complete-card { padding: 38px 32px 40px; text-align: center; animation: popIn .4s cubic-bezier(.34,1.56,.64,1) both; }

@keyframes popIn {
    from { opacity: 0; transform: scale(.92); }
    to { opacity: 1; transform: scale(1); }
}

.complete-illu { width: 180px; margin: 0 auto 8px; }
.complete-illu img { width: 100%; }
.complete-card h3 { font-size: 26px; font-weight: 700; margin-bottom: 24px; }

.complete-stats {
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 28px;
}
.stat-pill {
    display: flex; align-items: center; gap: 10px;
    padding: 13px 18px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    min-width: 110px;
}
.stat-pill .lucide { font-size: 24px; color: var(--text-light); }
.stat-pill img { width: 26px; height: 26px; }
.stat-pill > div { display: flex; flex-direction: column; align-items: flex-start; }
.stat-pill .stat-value { font-family: 'Fredoka', sans-serif; font-size: 22px; font-weight: 700; line-height: 1.1; }
.stat-pill .stat-label { font-size: 12px; color: var(--text-light); }
.stat-pill.correct .lucide, .stat-pill.correct .stat-value { color: var(--success); }
.stat-pill.wrong .lucide, .stat-pill.wrong .stat-value { color: var(--danger); }
.stat-pill.coin .stat-value { color: var(--warning); }

.complete-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ==========================================================
   错题推荐提示
   ========================================================== */
.wrong-practice-prompt {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    background: linear-gradient(135deg, #FFF7ED, #FFEDD5);
    border: 1.5px solid #FDBA74;
    border-radius: var(--radius);
    margin-top: 20px;
}
.prompt-icon {
    width: 48px; height: 48px; flex-shrink: 0;
    display: grid; place-items: center;
    background: #fff;
    border-radius: 14px;
    color: #EA580C;
    font-size: 24px;
    box-shadow: var(--shadow-sm);
}
.prompt-text { flex: 1; }
.prompt-text h3 { font-size: 16px; color: #9A3412; margin-bottom: 3px; }
.prompt-text p { font-size: 13.5px; color: #C2410C; }

/* ==========================================================
   页面通用标题
   ========================================================== */
.page-header { margin-bottom: 22px; }
.page-header h2 {
    display: flex; align-items: center; gap: 10px;
    font-size: 26px;
    font-weight: 700;
}
.page-header h2 .lucide { color: var(--brand); font-size: 28px; }
.subtitle { color: var(--text-light); margin-top: 5px; font-size: 14px; }

/* ==========================================================
   错题本
   ========================================================== */
.wrong-list { display: flex; flex-direction: column; gap: 14px; }

.wrong-item {
    padding: 18px 22px;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border-left: 5px solid var(--danger);
    transition: var(--transition);
}
.wrong-item:hover { box-shadow: var(--shadow); transform: translateX(4px); }
.wrong-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.wrong-item-type {
    display: inline-flex; align-items: center;
    font-size: 12.5px;
    color: var(--brand);
    font-weight: 700;
    background: var(--brand-bg);
    padding: 4px 12px;
    border-radius: 20px;
}
.wrong-item-date { font-size: 12px; color: var(--text-light); }
.wrong-item-question { font-size: 18px; font-weight: 700; margin-bottom: 10px; }
.wrong-item-answers { display: flex; gap: 18px; font-size: 13.5px; flex-wrap: wrap; margin-bottom: 10px; }
.wrong-item-answers .wrong-answer { color: var(--danger); font-weight: 500; }
.wrong-item-answers .right-answer { color: var(--success); font-weight: 700; }
.wrong-item-explanation {
    font-size: 13px;
    color: var(--text-light);
    line-height: 1.8;
    padding-top: 11px;
    border-top: 1px dashed var(--border);
    white-space: pre-line;
}

.empty-state { text-align: center; padding: 50px 0 30px; color: var(--text-light); }
.empty-img { width: 230px; margin-bottom: 14px; }
.empty-state h3 { font-size: 19px; color: var(--text); margin-bottom: 6px; }
.empty-state p { font-size: 14px; }

/* ==========================================================
   商城
   ========================================================== */
.shop-tabs { display: flex; gap: 8px; margin-bottom: 22px; }
.shop-tab {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 10px 22px;
    border: none;
    background: var(--card-bg);
    color: var(--text-light);
    font-size: 14.5px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}
.shop-tab .lucide { font-size: 17px; }
.shop-tab:hover { color: var(--brand); transform: translateY(-2px); }
.shop-tab.active {
    background: linear-gradient(135deg, var(--brand-light), var(--brand));
    color: #fff;
    box-shadow: 0 6px 16px rgba(108, 99, 255, .3);
}

.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 18px;
}

.shop-item {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}
.shop-item:hover { transform: translateY(-5px); box-shadow: var(--shadow); }

.shop-item-preview {
    height: 130px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--brand-bg), #F8F7FF);
}
.shop-item-preview img { width: 86px; height: 86px; }
.shop-item-preview .lucide { font-size: 52px; color: var(--brand); }
.shop-item-preview.title-preview .lucide { color: #D97706; }
.shop-item-preview.item-preview .lucide { color: var(--cyan); }

.shop-item-info { padding: 14px 16px 17px; display: flex; flex-direction: column; flex: 1; }
.shop-item h4 { font-size: 15.5px; font-weight: 700; margin-bottom: 3px; }
.shop-item p { font-size: 12px; color: var(--text-light); margin-bottom: 12px; min-height: 32px; }
.shop-item-price {
    display: flex; align-items: center; gap: 5px;
    font-family: 'Fredoka', sans-serif;
    font-weight: 700;
    font-size: 17px;
    color: #B45309;
    margin-bottom: 11px;
}
.shop-item-price img { width: 20px; height: 20px; }

.btn-buy {
    width: 100%;
    padding: 9px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--brand-light), var(--brand));
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    margin-top: auto;
}
.btn-buy:hover { box-shadow: 0 6px 14px rgba(108, 99, 255, .35); }
.btn-buy:disabled { cursor: not-allowed; }
.btn-buy.not-enough { background: #E5E7EB; color: var(--text-light); box-shadow: none; }
.btn-buy.owned { background: var(--success); }
.btn-buy.owned:hover { background: #059669; }
.btn-buy.equipped { background: #E5E7EB; color: var(--text-light); cursor: default; box-shadow: none; }

/* ==========================================================
   个人中心
   ========================================================== */
.profile-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(120deg, #6C63FF 0%, #8B85FF 60%, #A5A0FF 100%);
    border-radius: var(--radius-lg);
    color: #fff;
    margin-bottom: 22px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}
.profile-card::before {
    content: '';
    position: absolute;
    width: 220px; height: 220px;
    top: -100px; right: -40px;
    background: rgba(255,255,255,.09);
    border-radius: 50%;
}

.profile-avatar {
    width: 84px; height: 84px;
    border-radius: 50%;
    background: #fff;
    padding: 5px;
    border: 3px solid rgba(255,255,255,.6);
    box-shadow: 0 8px 20px rgba(40, 30, 120, .3);
    flex-shrink: 0;
}
.profile-info { position: relative; z-index: 1; }
.profile-info h2 { font-size: 24px; font-weight: 700; }
.profile-title {
    display: inline-flex; align-items: center;
    font-size: 13.5px;
    background: rgba(255,255,255,.2);
    padding: 4px 13px;
    border-radius: 20px;
    margin-top: 7px;
    border: 1px solid rgba(255,255,255,.3);
}
.profile-coin-card {
    margin-left: auto;
    position: relative;
    z-index: 1;
    display: flex; align-items: center; gap: 8px;
    background: rgba(255,255,255,.18);
    border: 1.5px solid rgba(255,255,255,.35);
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 20px;
}
.profile-coin-card img { width: 28px; height: 28px; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}
.stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 18px 12px;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.stat-icon-box {
    width: 42px; height: 42px;
    display: grid; place-items: center;
    border-radius: 13px;
    font-size: 20px;
    margin-bottom: 3px;
}
.stat-icon-box img { width: 24px; height: 24px; }
.stat-icon-box.amber { background: #FEF3C7; color: #D97706; }
.stat-icon-box.indigo { background: var(--brand-bg); color: var(--brand); }
.stat-icon-box.green { background: var(--success-bg); color: var(--success); }
.stat-icon-box.red { background: var(--danger-bg); color: var(--danger); }
.stat-icon-box.cyan { background: #CFFAFE; color: var(--cyan); }
.stat-icon-box.orange { background: #FFEDD5; color: #EA580C; }
.stat-num { font-size: 24px; font-weight: 700; }
.stat-name { font-size: 12.5px; color: var(--text-light); }

.level-progress-card,
.titles-section,
.avatars-section {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 22px 24px;
    margin-bottom: 22px;
}
.level-progress-card h3,
.titles-section h3,
.avatars-section h3 {
    display: flex; align-items: center; gap: 8px;
    font-size: 16.5px;
    font-weight: 700;
    margin-bottom: 15px;
}
.level-progress-card h3 .lucide,
.titles-section h3 .lucide,
.avatars-section h3 .lucide { color: var(--brand); font-size: 19px; }

.level-progress-bar {
    width: 100%; height: 14px;
    background: var(--bg);
    border-radius: 7px;
    overflow: hidden;
}
.level-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--brand-light), var(--brand));
    border-radius: 7px;
    transition: width .6s ease;
    position: relative;
}
.level-progress-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.4), transparent);
    animation: shimmer 2s infinite;
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.level-progress-text { text-align: right; font-size: 12.5px; color: var(--text-light); margin-top: 7px; }

.titles-list { display: flex; flex-wrap: wrap; gap: 10px; }

.title-badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #FEF3C7, #FDE68A);
    border: 1.5px solid #FCD34D;
    border-radius: 30px;
    font-size: 13.5px;
    font-weight: 700;
    color: #92400E;
    cursor: pointer;
    transition: var(--transition);
}
.title-badge .lucide { font-size: 15px; }
.title-badge:hover { transform: translateY(-2px); }
.title-badge.locked {
    background: var(--bg);
    border-color: var(--border);
    color: var(--text-light);
    opacity: .65;
    cursor: not-allowed;
}
.title-badge.equipped {
    background: linear-gradient(135deg, var(--success), #34D399);
    border-color: var(--success);
    color: #fff;
    box-shadow: 0 4px 12px rgba(16, 185, 129, .35);
}

.avatars-list { display: flex; flex-wrap: wrap; gap: 14px; }
.avatar-item {
    width: 68px; height: 68px;
    padding: 4px;
    background: var(--bg);
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    border: 3px solid transparent;
}
.avatar-item img { width: 100%; height: 100%; border-radius: 50%; }
.avatar-item:hover { transform: scale(1.1); }
.avatar-item.equipped {
    border-color: var(--brand);
    background: var(--brand-bg);
    box-shadow: 0 0 0 4px rgba(108, 99, 255, .15);
}
.avatar-item.locked { opacity: .4; cursor: not-allowed; filter: grayscale(.7); }
/* 自定义头像未上传：占位图标（替代图片） */
.avatar-item .lucide { width: 30px; height: 30px; color: var(--text-light); display: block; margin: 12px auto 0; }
.avatar-item.equipped .lucide { color: var(--brand); }

/* ==========================================================
   Toast
   ========================================================== */
.toast-container {
    position: fixed;
    top: 84px; right: 22px;
    z-index: 1500;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.toast {
    display: flex; align-items: center; gap: 9px;
    padding: 13px 20px;
    border-radius: 13px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    animation: slideIn .35s cubic-bezier(.34,1.4,.64,1) both;
}
.toast .lucide { font-size: 18px; }
.toast.success { background: linear-gradient(135deg, #10B981, #34D399); }
.toast.warning { background: linear-gradient(135deg, #F59E0B, #FBBF24); }
.toast.error { background: linear-gradient(135deg, #EF4444, #F87171); }
.toast.info { background: linear-gradient(135deg, var(--brand), var(--brand-light)); }
.toast.leaving { animation: slideOut .3s ease both; }
@keyframes slideIn { from { transform: translateX(120%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slideOut { to { transform: translateX(120%); opacity: 0; } }

/* ==========================================================
   金币飞动画
   ========================================================== */
.coin-animation-container {
    position: fixed; inset: 0;
    pointer-events: none;
    z-index: 1400;
}
.coin-fly {
    position: fixed;
    display: flex; align-items: center; gap: 5px;
    font-family: 'Fredoka', sans-serif;
    font-weight: 700;
    font-size: 20px;
    color: #D97706;
    animation: coinFly 1s ease-in forwards;
    pointer-events: none;
}
.coin-fly img { width: 28px; height: 28px; }
@keyframes coinFly {
    0% { opacity: 1; transform: scale(1) translateY(0); }
    50% { opacity: 1; transform: scale(1.25) translateY(-60px); }
    100% { opacity: 0; transform: scale(.7) translateY(-180px); }
}

/* ==========================================================
   弹窗
   ========================================================== */
.modal {
    position: fixed; inset: 0;
    background: rgba(31, 36, 48, .55);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
    animation: fadeInBg .25s ease;
}
@keyframes fadeInBg { from { opacity: 0; } to { opacity: 1; } }

.modal-content {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 34px 32px;
    max-width: 410px;
    width: 100%;
    text-align: center;
    box-shadow: var(--shadow-lg);
    animation: popIn .35s cubic-bezier(.34,1.56,.64,1) both;
}
.modal-content h2 { font-size: 24px; font-weight: 700; margin-bottom: 14px; }

.levelup-content {
    background: linear-gradient(180deg, #FFFBEB 0%, #fff 55%);
    position: relative;
    overflow: hidden;
}
.levelup-rays { position: absolute; inset: 0; pointer-events: none; }
.levelup-rays .ray { position: absolute; color: #FBBF24; opacity: .5; }
.levelup-rays .r1 { font-size: 26px; top: 34px; left: 48px; animation: spin 6s linear infinite; }
.levelup-rays .r2 { font-size: 20px; top: 56px; right: 54px; animation: spin 8s linear infinite reverse; }
.levelup-rays .r3 { font-size: 18px; bottom: 90px; left: 60px; animation: spin 7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.levelup-icon {
    width: 92px; height: 92px;
    margin: 6px auto 16px;
    display: grid; place-items: center;
    background: linear-gradient(135deg, #FEF3C7, #FBBF24);
    border-radius: 50%;
    color: #B45309;
    font-size: 46px;
    box-shadow: 0 10px 30px rgba(245, 158, 11, .45);
    animation: bounce 1.2s ease infinite;
}
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}
.levelup-text { font-size: 17px; font-weight: 700; margin-bottom: 18px; color: var(--text); }
.levelup-reward {
    display: inline-flex; align-items: center; gap: 9px;
    padding: 11px 22px;
    background: #FFF7E0;
    border: 1.5px solid #FCD34D;
    border-radius: 30px;
    margin-bottom: 24px;
    font-weight: 700;
    color: #92400E;
}
.levelup-reward img { width: 26px; height: 26px; }

/* ========== 成就解锁弹窗（三角钢笔尖徽章） ========== */
.achievement-content {
    background: linear-gradient(180deg, #FFFBF2 0%, #fff 58%);
    text-align: center;
}
.achievement-eyebrow {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 3px;
    color: #B45309;
    margin-bottom: 14px;
}
.achievement-badge {
    width: 188px;
    margin: 0 auto 18px;
    padding: 10px;
    border-radius: 18px;
    background: linear-gradient(160deg, #F4D47C 0%, #C9962F 45%, #8A5A12 100%);
    box-shadow: 0 12px 28px rgba(160, 110, 20, .4);
    animation: bounce 1.4s ease infinite;
}
.achievement-badge img {
    display: block;
    width: 100%;
    border-radius: 10px;
    background: #fff;
}
.achievement-content h2 {
    font-size: 26px;
    background: linear-gradient(90deg, #B8860B, #E3B341 50%, #B8860B);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
}
.achievement-desc {
    font-size: 14.5px;
    color: var(--text-light);
    line-height: 1.7;
    margin-bottom: 22px;
}

/* ========== 商城：成就限定称号卡片 ========== */
.shop-item.achievement-item { position: relative; }
.achievement-ribbon {
    position: absolute;
    top: 10px; right: -30px;
    transform: rotate(38deg);
    background: linear-gradient(90deg, #D4A437, #E8C468);
    color: #fff;
    font-size: 10.5px;
    font-weight: 700;
    padding: 3px 34px;
    letter-spacing: 1px;
    box-shadow: 0 2px 6px rgba(160, 110, 20, .35);
    pointer-events: none;
}
.shop-item-price.achievement-tag {
    color: #B45309;
    font-weight: 700;
    font-size: 13px;
}
.shop-item-price.achievement-tag .lucide { width: 15px; height: 15px; margin-right: 3px; }
.btn-buy.achievement-locked {
    background: #F3EDE2;
    color: #9A7B4F;
    cursor: not-allowed;
}

/* 个人中心：成就称号徽章（未解锁时金色提示） */
.title-badge.achievement-badge.locked {
    border-color: #E8D3A8;
    color: #B08A45;
    background: #FDF8EE;
}

/* 称号使用真实徽章图片的各处尺寸 */
.shop-item-preview.title-preview .title-img-preview {
    width: 88%;
    height: 88%;
    object-fit: contain;
    border-radius: 10px;
}
.title-badge-img {
    width: 26px; height: 26px;
    object-fit: contain;
    border-radius: 6px;
    vertical-align: middle;
}
.profile-title-img {
    width: 20px; height: 20px;
    object-fit: contain;
    border-radius: 5px;
    margin-right: 2px;
    vertical-align: middle;
}

.purchase-preview {
    width: 96px; height: 96px;
    margin: 0 auto 14px;
    display: grid; place-items: center;
    background: linear-gradient(135deg, var(--brand-bg), #F8F7FF);
    border-radius: 22px;
    overflow: hidden;
}
.purchase-preview img { width: 78px; height: 78px; }
.purchase-preview .lucide { font-size: 48px; color: var(--brand); }

.purchase-info { margin-bottom: 24px; }
.purchase-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 4px;
    font-size: 14.5px;
    color: var(--text-light);
    border-bottom: 1px dashed var(--border);
}
.purchase-row:last-child { border-bottom: none; }
.price-display {
    display: inline-flex; align-items: center; gap: 5px;
    font-family: 'Fredoka', sans-serif;
    font-size: 18px;
    color: #B45309;
}
.price-display img { width: 21px; height: 21px; }
.modal-actions { display: flex; gap: 12px; justify-content: center; }

/* ==========================================================
   响应式
   ========================================================== */
@media (max-width: 760px) {
    .navbar { flex-wrap: wrap; padding: 9px 14px; gap: 8px; }
    .nav-left { order: 1; }
    .nav-right { order: 2; }
    .nav-tabs { order: 3; width: 100%; justify-content: center; overflow-x: auto; }
    .nav-tab { padding: 7px 13px; font-size: 13px; }
    .nav-tab span { display: none; }
    .nav-tab .lucide { font-size: 19px; }
    .nav-tab.active span { display: inline; }

    .hero-banner { flex-direction: column-reverse; text-align: center; padding: 26px 22px; }
    .hero-img { width: 170px; }
    .hero-text h2 { font-size: 23px; }
    .hero-chips { justify-content: center; }

    .question-text { font-size: 23px; }
    .answer-area { flex-direction: column; }
    .answer-input { font-size: 18px; }

    .quiz-header { flex-wrap: wrap; gap: 10px; padding: 14px 18px; }
    .quiz-progress-wrap { order: 3; width: 100%; flex-basis: 100%; }

    .profile-card { flex-wrap: wrap; padding: 24px 22px; }
    .profile-coin-card { margin-left: 0; width: 100%; justify-content: center; }

    .complete-stats { gap: 10px; }
    .stat-pill { min-width: 44%; padding: 11px 14px; }

    .toast-container { right: 12px; left: 12px; }
    .toast { width: 100%; }

    .grade-pills { overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
    .grade-knowledge-bar { font-size: 12px; }
    .grade-knowledge-bar span { white-space: normal; }
}

/* ==========================================================
   年级选择器
   ========================================================== */
.grade-selector {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
}

.grade-selector-label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 14.5px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
}
.grade-selector-label .lucide { font-size: 19px; color: var(--brand); }

.grade-selector-label-sub { margin-top: 10px; }

.grade-pills {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.grade-pill {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 64px;
    padding: 9px 16px;
    border: 2px solid var(--border);
    background: var(--card-bg);
    color: var(--text-light);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border-radius: 30px;
    transition: var(--transition);
    white-space: nowrap;
}
.grade-pill:hover {
    border-color: var(--gc, var(--brand-light));
    color: var(--gc, var(--brand));
    transform: translateY(-2px);
}
.grade-pill.active {
    background: linear-gradient(135deg, var(--gc, var(--brand-light)), var(--gcd, var(--brand)));
    border-color: transparent;
    color: #fff;
    box-shadow: 0 6px 16px rgba(108, 99, 255, .28);
}
.grade-pill.active:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(108, 99, 255, .35);
}

/* 单元胶囊（按教材单元筛选题型，比年级/学期胶囊小一号） */
.unit-pill {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 7px 13px;
    border: 2px solid var(--border);
    background: var(--card-bg);
    color: var(--text-light);
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border-radius: 30px;
    transition: var(--transition);
    white-space: nowrap;
}
.unit-pill:hover {
    border-color: var(--gc, var(--brand-light));
    color: var(--gc, var(--brand));
    transform: translateY(-2px);
}
.unit-pill.active {
    background: linear-gradient(135deg, var(--gc, var(--brand-light)), var(--gcd, var(--brand)));
    border-color: transparent;
    color: #fff;
    box-shadow: 0 6px 16px rgba(108, 99, 255, .28);
}
.unit-pill.active:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(108, 99, 255, .35);
}

.grade-knowledge-bar {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 11px 18px;
    background: var(--brand-bg);
    border: 1px solid #D9D6FF;
    border-radius: 12px;
    margin-bottom: 22px;
    font-size: 13.5px;
    color: var(--brand-dark);
    font-weight: 500;
}
.grade-knowledge-bar .lucide { font-size: 17px; color: var(--brand); flex-shrink: 0; }
.grade-knowledge-bar span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 答题页年级显示 */
.quiz-grade-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(255,255,255,.18);
    padding: 4px 11px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,.25);
    margin-right: 8px;
}
.quiz-grade-chip .lucide { font-size: 13px; }

/* ==========================================================
   导航栏用户胶囊
   ========================================================== */
.user-chip {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 4px 10px 4px 5px;
    background: #fff;
    border: 1.5px solid var(--border);
    border-radius: 30px;
    cursor: pointer;
    transition: var(--transition);
}
.user-chip:hover { border-color: var(--brand-light); box-shadow: var(--shadow-sm); }
.user-avatar-circle {
    width: 30px; height: 30px;
    display: grid; place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-light), var(--brand));
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}
.user-chip-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
/* 退出登录按钮：独立加大的可点击区域 */
.logout-btn {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1.5px solid var(--border);
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-light);
    transition: var(--transition);
    flex-shrink: 0;
}
.logout-btn .lucide { font-size: 17px; }
.logout-btn:hover {
    border-color: var(--danger);
    color: var(--danger);
    background: var(--danger-bg);
}

.profile-account {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    font-weight: 600;
    color: var(--brand);
    margin: 3px 0 2px;
}
.profile-account .lucide { font-size: 14px; }

/* ==========================================================
   登录 / 注册遮罩页
   ========================================================== */
.auth-overlay {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, #5A52E0 0%, #6C63FF 45%, #8B85FF 100%);
    overflow: hidden;
}
.auth-overlay.hidden { display: none; }

.auth-card {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 400px;
    background: #fff;
    border-radius: 26px;
    padding: 36px 34px 28px;
    box-shadow: 0 30px 80px rgba(30, 20, 90, .35);
    animation: popIn .4s cubic-bezier(.34,1.56,.64,1) both;
}

.auth-brand { text-align: center; margin-bottom: 24px; }
.auth-logo {
    width: 60px; height: 60px;
    font-size: 32px;
    border-radius: 18px;
    margin: 0 auto 13px;
}
.auth-brand h1 {
    font-size: 27px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.auth-brand p { font-size: 13.5px; color: var(--text-light); margin-top: 5px; }

.auth-tabs {
    display: flex;
    background: var(--bg);
    border-radius: 13px;
    padding: 4px;
    margin-bottom: 22px;
}
.auth-tab {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition);
}
.auth-tab.active {
    background: #fff;
    color: var(--brand);
    box-shadow: var(--shadow-sm);
}

.auth-form { display: flex; flex-direction: column; gap: 15px; }
.auth-field label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
}
.auth-field label .lucide { font-size: 15px; color: var(--brand); }
.auth-field input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: var(--transition);
    background: #FAFAFF;
}
.auth-field input:focus {
    border-color: var(--brand);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(108, 99, 255, .12);
}

.auth-error {
    display: none;
    font-size: 13px;
    font-weight: 600;
    color: var(--danger);
    background: var(--danger-bg);
    padding: 9px 13px;
    border-radius: 10px;
}
.auth-error.show { display: block; }

.auth-submit { width: 100%; margin-top: 4px; }
.spin { animation: spin 1s linear infinite; }

.auth-tip {
    text-align: center;
    font-size: 12px;
    color: var(--text-light);
    margin-top: 18px;
}

.auth-conn {
    text-align: center;
    font-size: 12px;
    margin-top: 8px;
    min-height: 16px;
    color: var(--text-light);
}
.auth-conn.connecting { color: #b58900; }
.auth-conn.online { color: #2a9d5f; }
.auth-conn.offline { color: #c0563f; }

/* 背景漂浮数学符号 */
.auth-decor {
    position: absolute;
    color: rgba(255, 255, 255, .14);
    z-index: 1;
    pointer-events: none; /* 纯装饰：浮动时会掠过表单区域，不能拦截点击 */
    animation: floatY 7s ease-in-out infinite;
}
.auth-decor .lucide { width: 100%; height: 100%; stroke-width: 1.5; }
.auth-decor-1 { width: 90px; height: 90px; top: 12%; left: 10%; animation-delay: 0s; }
.auth-decor-2 { width: 70px; height: 70px; top: 20%; right: 12%; animation-delay: 1.2s; }
.auth-decor-3 { width: 110px; height: 110px; bottom: 14%; left: 14%; animation-delay: 2.1s; }
.auth-decor-4 { width: 80px; height: 80px; bottom: 18%; right: 10%; animation-delay: .6s; }
@keyframes floatY {
    0%, 100% { transform: translateY(0) rotate(-6deg); }
    50% { transform: translateY(-22px) rotate(6deg); }
}

/* ==========================================================
   排行榜
   ========================================================== */
.podium {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 14px;
    margin-bottom: 26px;
}

.podium-item {
    flex: 1;
    max-width: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.podium-card {
    width: 100%;
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px 14px 16px;
    text-align: center;
    box-shadow: var(--shadow);
    position: relative;
}
.podium-item.first .podium-card {
    background: linear-gradient(160deg, #FFF7E0, #FDE68A);
    border: 2px solid #FBBF24;
    transform: scale(1.06);
    box-shadow: 0 14px 34px rgba(245, 158, 11, .28);
}
.podium-item.second .podium-card {
    border: 2px solid #D1D5DB;
}
.podium-item.third .podium-card {
    border: 2px solid #D6A679;
}

.podium-medal {
    position: absolute;
    top: -16px; left: 50%;
    transform: translateX(-50%);
    width: 34px; height: 34px;
    display: grid; place-items: center;
    border-radius: 50%;
    color: #fff;
    font-size: 17px;
    box-shadow: 0 4px 10px rgba(0,0,0,.18);
}
.podium-item.first .podium-medal { background: linear-gradient(135deg, #FBBF24, #D97706); }
.podium-item.second .podium-medal { background: linear-gradient(135deg, #D1D5DB, #6B7280); }
.podium-item.third .podium-medal { background: linear-gradient(135deg, #D6A679, #92603A); }

.rank-avatar-circle {
    width: 56px; height: 56px;
    margin: 8px auto 9px;
    display: grid; place-items: center;
    border-radius: 50%;
    color: #fff;
    font-size: 23px;
    font-weight: 700;
    font-family: 'Fredoka', sans-serif;
}
.podium-item.first .rank-avatar-circle { width: 66px; height: 66px; font-size: 27px; }

.podium-name {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 4px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.podium-coins {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: 'Fredoka', sans-serif;
    font-weight: 700;
    font-size: 15px;
    color: #B45309;
}
.podium-coins img { width: 17px; height: 17px; }

.podium-base {
    width: 100%;
    margin-top: 10px;
    border-radius: 12px 12px 0 0;
    display: grid;
    place-items: center;
    color: #fff;
    font-family: 'Fredoka', sans-serif;
    font-size: 26px;
    font-weight: 700;
}
.podium-item.first .podium-base { height: 74px; background: linear-gradient(180deg, #FBBF24, #D97706); }
.podium-item.second .podium-base { height: 54px; background: linear-gradient(180deg, #9CA3AF, #6B7280); }
.podium-item.third .podium-base { height: 38px; background: linear-gradient(180deg, #C28A5A, #92603A); font-size: 21px; }

.rank-list { display: flex; flex-direction: column; gap: 9px; }

.rank-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px 20px;
    background: var(--card-bg);
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}
.rank-row:hover { transform: translateX(4px); box-shadow: var(--shadow); }
.rank-row.is-me {
    border: 2px solid var(--brand-light);
    background: linear-gradient(135deg, #FAFAFF, var(--brand-bg));
}

.rank-num {
    width: 34px;
    text-align: center;
    font-family: 'Fredoka', sans-serif;
    font-size: 19px;
    font-weight: 700;
    color: var(--text-light);
    flex-shrink: 0;
}
.rank-row.is-me .rank-num { color: var(--brand); }

.rank-avatar-circle.small {
    width: 42px; height: 42px;
    font-size: 17px;
    margin: 0;
    flex-shrink: 0;
}

.rank-name {
    flex: 1;
    font-size: 15px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.rank-name .me-tag {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    background: var(--brand);
    border-radius: 6px;
    padding: 1px 7px;
    margin-left: 7px;
    vertical-align: middle;
}

.rank-stats {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-shrink: 0;
}
.rank-stat {
    text-align: right;
    font-size: 12px;
    color: var(--text-light);
}
.rank-stat b {
    display: block;
    font-family: 'Fredoka', sans-serif;
    font-size: 17px;
    color: var(--text);
}
.rank-stat.coins b { color: #B45309; display: flex; align-items: center; gap: 4px; justify-content: flex-end; }
.rank-stat.coins img { width: 16px; height: 16px; }

.rank-loading, .rank-empty {
    text-align: center;
    padding: 40px 0;
    color: var(--text-light);
    font-size: 14px;
}
.rank-loading .lucide { font-size: 24px; margin-bottom: 8px; display: inline-block; }

@media (max-width: 760px) {
    .user-chip-name { display: none; }
    .user-chip { padding: 4px; }
    .podium { gap: 8px; }
    .podium-card { padding: 16px 8px 12px; }
    .podium-name { font-size: 13px; }
    .rank-row { padding: 11px 14px; gap: 10px; }
    .rank-stats { gap: 11px; }
    .rank-stat { font-size: 11px; }
    .rank-stat b { font-size: 15px; }
    .auth-card { padding: 28px 22px 22px; }
}

/* ==========================================================
   作业自动批改
   ========================================================== */
.hw-setup {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 26px 28px;
    display: flex;
    flex-direction: column;
    gap: 22px;
}
.hw-setup-block { display: flex; flex-direction: column; gap: 12px; }
.hw-setup-label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 14.5px;
    font-weight: 700;
    color: var(--text);
}
.hw-setup-label .lucide { font-size: 18px; color: var(--brand); }

.hw-topic-pills { display: flex; flex-wrap: wrap; gap: 10px; }
.hw-topic-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 18px;
    border: 2px solid var(--border);
    background: #fff;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition);
}
.hw-topic-pill .lucide { font-size: 16px; }
.hw-topic-pill:hover { transform: translateY(-2px); border-color: var(--tc, var(--brand)); color: var(--tc, var(--brand)); }
.hw-topic-pill.active {
    background: var(--tcb, var(--brand-bg));
    border-color: var(--tc, var(--brand));
    color: var(--tc, var(--brand-dark));
    box-shadow: 0 6px 16px rgba(108, 99, 255, .18);
}

.hw-count-pills { display: flex; gap: 10px; }
.hw-count-pill {
    padding: 9px 22px;
    border: 2px solid var(--border);
    background: #fff;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition);
}
.hw-count-pill:hover { border-color: var(--brand-light); color: var(--brand); }
.hw-count-pill.active {
    background: linear-gradient(135deg, var(--brand-light), var(--brand));
    border-color: transparent;
    color: #fff;
    box-shadow: 0 6px 16px rgba(108, 99, 255, .28);
}

/* 作业卷 */
.hw-sheet {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.hw-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 20px 26px;
    background: linear-gradient(135deg, var(--brand-light), var(--brand));
    color: #fff;
}
.hw-sheet-title {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 17px;
    font-weight: 700;
}
.hw-sheet-title .lucide { font-size: 21px; }
.hw-sheet-head .btn-ghost {
    background: rgba(255,255,255,.16);
    color: #fff;
    border-color: rgba(255,255,255,.3);
}
.hw-sheet-head .btn-ghost:hover { background: rgba(255,255,255,.28); }

.hw-questions { padding: 10px 26px; }
.hw-question {
    display: flex;
    gap: 15px;
    padding: 20px 0;
    border-bottom: 1.5px dashed var(--border);
}
.hw-question:last-child { border-bottom: none; }
.hw-q-index {
    flex-shrink: 0;
    width: 32px; height: 32px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--brand-bg);
    color: var(--brand-dark);
    font-family: 'Fredoka', sans-serif;
    font-weight: 700;
    font-size: 16px;
}
.hw-q-body { flex: 1; display: flex; flex-direction: column; gap: 11px; }
.hw-q-text {
    font-size: 16.5px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.6;
}
.hw-answer-input {
    width: 100%;
    max-width: 320px;
    padding: 11px 16px;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 16px;
    font-family: inherit;
    outline: none;
    transition: var(--transition);
    background: #FAFAFF;
}
.hw-answer-input:focus {
    border-color: var(--brand);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(108, 99, 255, .12);
}

.hw-sheet-footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 26px 24px;
    background: var(--bg);
}

/* 批改报告 */
.hw-report-summary {
    display: flex;
    align-items: center;
    gap: 30px;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px 32px;
    margin-bottom: 22px;
}
.hw-score-ring {
    flex-shrink: 0;
    width: 130px; height: 130px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: conic-gradient(var(--score-color, var(--brand)) 0deg, var(--bg) 0deg);
    position: relative;
}
.hw-score-ring::before {
    content: '';
    position: absolute;
    inset: 9px;
    background: var(--card-bg);
    border-radius: 50%;
}
.hw-score-num {
    position: relative;
    z-index: 1;
    font-family: 'Fredoka', sans-serif;
    font-size: 38px;
    font-weight: 700;
    color: var(--score-color, var(--brand));
    line-height: 1;
}
.hw-score-num small { font-size: 15px; margin-left: 1px; }
.hw-score-label {
    position: relative;
    z-index: 1;
    font-size: 12px;
    color: var(--text-light);
    margin-top: 4px;
}
.hw-score-detail { flex: 1; }
.hw-score-detail h3 { font-size: 20px; margin-bottom: 13px; }
.hw-score-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}
.hw-score-pills span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13.5px;
    font-weight: 600;
    background: var(--bg);
    padding: 6px 13px;
    border-radius: 20px;
    color: var(--text-light);
}
.hw-score-pills .lucide { font-size: 15px; }
.hw-score-pills .ok { background: #D1FAE5; color: #047857; }
.hw-score-pills .no { background: #FEE2E2; color: #B91C1C; }
.hw-score-pills .coin { background: #FEF3C7; color: #B45309; }
.hw-score-pills .coin img { width: 16px; height: 16px; }
.hw-score-tip {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13.5px;
    color: var(--brand-dark);
    font-weight: 500;
}
.hw-score-tip .lucide { font-size: 16px; color: var(--brand); }
.hw-score-tip.ok { color: #047857; }
.hw-score-tip.ok .lucide { color: #10B981; }

.hw-report-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 17px;
    margin-bottom: 14px;
}
.hw-report-section-title .lucide { color: var(--brand); }

.hw-graded-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 22px; }
.hw-graded-item {
    background: var(--card-bg);
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
    border-left: 5px solid #10B981;
    padding: 18px 22px;
}
.hw-graded-item.wrong { border-left-color: #EF4444; }
.hw-graded-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}
.hw-graded-mark {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    font-weight: 700;
    color: #047857;
}
.hw-graded-item.wrong .hw-graded-mark { color: #B91C1C; }
.hw-graded-mark .lucide { font-size: 17px; }
.hw-graded-answers {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-top: 10px;
    font-size: 14px;
    color: var(--text-light);
}
.hw-graded-answers .lucide { font-size: 15px; }
.hw-ans { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.hw-ans b { color: var(--text); font-weight: 700; }
.hw-ans.right b { color: #047857; }
.hw-ans-explain {
    margin-top: 6px;
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 11px 15px;
    font-size: 13.5px;
    line-height: 1.7;
    color: #78350F;
}
.hw-ans-explain h5 {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    margin-bottom: 4px;
    color: #B45309;
}
.hw-ans-explain .lucide { font-size: 15px; }

.hw-report-actions {
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
}

@media (max-width: 760px) {
    .hw-setup { padding: 20px 16px; gap: 18px; }
    .hw-sheet-head { padding: 16px 18px; flex-direction: column; align-items: flex-start; }
    .hw-questions { padding: 6px 18px; }
    .hw-question { gap: 11px; padding: 16px 0; }
    .hw-q-text { font-size: 15.5px; }
    .hw-sheet-footer { padding: 14px 18px 20px; }
    .hw-report-summary { flex-direction: column; gap: 18px; text-align: center; padding: 24px 18px; }
    .hw-score-pills { justify-content: center; }
    .hw-score-tip { justify-content: center; text-align: left; }
    .hw-graded-item { padding: 15px 16px; }
}

/* ==========================================================
   拍照批改模式
   ========================================================== */
.hw-mode-toggle {
    display: flex;
    gap: 0;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 5px;
    margin-bottom: 22px;
}
.hw-mode-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 20px;
    border: none;
    background: transparent;
    border-radius: calc(var(--radius) - 4px);
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition);
}
.hw-mode-btn .lucide { font-size: 18px; }
.hw-mode-btn:hover { color: var(--brand); background: var(--brand-bg); }
.hw-mode-btn.active {
    background: linear-gradient(135deg, var(--brand-light), var(--brand));
    color: #fff;
    box-shadow: 0 6px 16px rgba(108, 99, 255, .28);
}

/* 上传区 */
.hw-photo-upload {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 26px 28px;
}
.hw-photo-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 48px 20px;
    border: 3px dashed var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}
.hw-photo-dropzone:hover {
    border-color: var(--brand-light);
    background: var(--brand-bg);
}
.hw-photo-dropzone-icon {
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--brand-bg);
    border-radius: 50%;
}
.hw-photo-dropzone-icon .lucide { font-size: 32px; color: var(--brand); }
.hw-photo-dropzone h3 { font-size: 18px; color: var(--text); }
.hw-photo-dropzone p { font-size: 14px; color: var(--text-light); }

/* 标注区 */
.hw-photo-annotate {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.hw-annotate-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}
.hw-annotate-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.hw-annotate-tools .btn { padding: 9px 16px; font-size: 14px; }
.hw-annotate-tools .btn .lucide { font-size: 16px; }
.hw-annotate-tools .btn.active {
    background: linear-gradient(135deg, var(--brand-light), var(--brand));
    color: #fff;
    border-color: transparent;
}
.hw-annotate-hint {
    font-size: 13px;
    color: var(--text-light);
    padding: 4px 12px;
    background: var(--brand-bg);
    border-radius: 20px;
}
.hw-canvas-wrap {
    position: relative;
    background: #f0f0f0;
    overflow: auto;
    max-height: 520px;
    display: flex;
    justify-content: center;
}
#hwPhotoCanvas {
    display: block;
    cursor: default;
    max-width: 100%;
}
#hwPhotoCanvas.drawing { cursor: crosshair; }

/* 错题标记列表 */
.hw-marks-section {
    padding: 18px 20px;
    border-top: 1px solid var(--border);
}
.hw-marks-section h4 {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 15px;
    margin-bottom: 14px;
    color: var(--text);
}
.hw-marks-section h4 .lucide { font-size: 18px; color: var(--brand); }
.hw-marks-count {
    background: var(--brand-bg);
    color: var(--brand);
    font-size: 13px;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 20px;
    margin-left: 4px;
}
.hw-marks-list { display: flex; flex-direction: column; gap: 10px; }
.hw-mark-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 2px solid var(--border);
    border-radius: 12px;
    transition: var(--transition);
}
.hw-mark-card:hover { border-color: var(--brand-light); }
.hw-mark-num {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #FEE2E2;
    color: #B91C1C;
    border-radius: 50%;
    font-weight: 700;
    font-size: 15px;
    flex-shrink: 0;
}
.hw-mark-type-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    flex: 1;
}
.hw-mark-type-pill {
    padding: 6px 12px;
    border: 1.5px solid var(--border);
    background: #fff;
    border-radius: 20px;
    font-size: 12.5px;
    font-weight: 600;
    font-family: inherit;
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition);
}
.hw-mark-type-pill:hover { transform: translateY(-1px); border-color: var(--tc, var(--brand)); }
.hw-mark-type-pill.active {
    background: var(--tcb, var(--brand-bg));
    border-color: var(--tc, var(--brand));
    color: var(--tc, var(--brand));
}
.hw-mark-delete {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    border-radius: 50%;
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}
.hw-mark-delete:hover { background: #FEE2E2; color: #B91C1C; }
.hw-mark-delete .lucide { font-size: 16px; }
.hw-marks-empty {
    text-align: center;
    padding: 20px;
    color: var(--text-light);
    font-size: 14px;
}

.hw-photo-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: center;
}

/* 拍照批改报告 */
.hw-photo-report {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 26px 28px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.hw-photo-report-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.hw-photo-report-head h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 20px;
}
.hw-photo-report-head .lucide { color: #10B981; font-size: 24px; }
.hw-photo-report-stats {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.hw-photo-stat {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 10px 18px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
}
.hw-photo-stat .lucide { font-size: 16px; }
.hw-photo-stat.wrong { background: #FEE2E2; color: #B91C1C; }
.hw-photo-stat.types { background: var(--brand-bg); color: var(--brand); }
.hw-photo-stat.coin { background: #FEF3C7; color: #B45309; }
.hw-photo-stat.coin img { width: 16px; height: 16px; }
.hw-photo-report-image {
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
}
.hw-photo-report-image img { display: block; width: 100%; }

@media (max-width: 600px) {
    .hw-annotate-toolbar { flex-direction: column; align-items: stretch; }
    .hw-annotate-tools { justify-content: center; }
    .hw-photo-report-head { flex-direction: column; gap: 12px; }
}

/* AI 识别加载态 */
.hw-ai-loading {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 22px 24px;
    background: linear-gradient(135deg, #EEEDFF, #FCE7F3);
    border-bottom: 1px solid var(--border);
}
.hw-ai-spinner {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    border: 4px solid rgba(108, 99, 255, .18);
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: hw-spin 0.8s linear infinite;
}
@keyframes hw-spin { to { transform: rotate(360deg); } }
.hw-ai-loading-text h4 { font-size: 16px; color: var(--brand-dark); margin-bottom: 3px; }
.hw-ai-loading-text p { font-size: 13.5px; color: var(--text-light); }

/* AI 结果摘要条 */
.hw-ai-summary {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    background: #FAFAFF;
}
.hw-ai-summary-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13.5px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 20px;
}
.hw-ai-summary-badge .lucide { font-size: 16px; }
.hw-ai-summary-badge.total { background: var(--brand-bg); color: var(--brand); }
.hw-ai-summary-badge.ok { background: #D1FAE5; color: #047857; }
.hw-ai-summary-badge.no { background: #FEE2E2; color: #B91C1C; }
.hw-ai-summary-badge.perfect { background: linear-gradient(135deg, #FEF3C7, #FDE68A); color: #B45309; }
.hw-ai-retry-link {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: none;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    color: var(--brand);
    cursor: pointer;
    padding: 4px 8px;
}
.hw-ai-retry-link .lucide { font-size: 14px; }
.hw-ai-retry-link:hover { text-decoration: underline; }

/* AI 识别失败提示 */
.hw-ai-error {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: #FEF2F2;
    border-bottom: 1px solid #FECACA;
}
.hw-ai-error .lucide { color: #DC2626; font-size: 22px; flex-shrink: 0; }
.hw-ai-error-text { flex: 1; font-size: 13.5px; color: #991B1B; }
.hw-ai-error-actions { display: flex; gap: 8px; }
.hw-ai-error-actions .btn { padding: 8px 14px; font-size: 13px; }

/* 错题卡片：答案对比 */
.hw-mark-info { flex: 1; min-width: 0; }
.hw-mark-question {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.hw-mark-answers {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 13px;
    margin-bottom: 8px;
}
.hw-mark-ans { display: inline-flex; align-items: center; gap: 4px; }
.hw-mark-ans .label { color: var(--text-light); }
.hw-mark-ans .val { font-weight: 700; font-family: 'Fredoka', sans-serif; }
.hw-mark-ans.wrong .val { color: #DC2626; text-decoration: line-through; }
.hw-mark-ans.right .val { color: #059669; }
.hw-mark-ans .lucide { font-size: 14px; }
.hw-mark-ans.wrong .lucide { color: #DC2626; }
.hw-mark-ans.right .lucide { color: #059669; }
.hw-mark-type-row {
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 5px;
}
.hw-mark-type-row .hw-mark-type-pills { margin-top: 4px; }
.hw-mark-card.ai-mark { border-color: #FECACA; background: #FFFAFA; }
.hw-mark-card.manual-mark { border-style: dashed; }

/* ================= 答题道具栏 ================= */
.item-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 14px 0 4px;
}
.item-use-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: #FAFAFF;
    color: var(--text-light);
    font-size: 13px;
    cursor: pointer;
    transition: all .15s;
}
.item-use-btn i { width: 15px; height: 15px; }
.item-use-btn:not(:disabled):hover { border-color: var(--brand-light); color: var(--brand); background: var(--brand-bg); }
.item-use-btn:disabled { opacity: .42; cursor: not-allowed; }
.item-use-btn.armed {
    background: var(--warning-bg);
    border-color: var(--warning);
    color: #B45309;
    font-weight: 700;
}
.item-use-btn .item-count {
    background: var(--brand);
    color: #fff;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    min-width: 17px;
    height: 17px;
    line-height: 17px;
    text-align: center;
    padding: 0 4px;
}
.item-use-btn.armed .item-count { background: var(--warning); }
.hint-box {
    margin-top: 10px;
    padding: 12px 14px;
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 12px;
    color: #92400E;
    font-size: 14px;
    line-height: 1.7;
    white-space: pre-line;
}
.hint-box .hint-label {
    display: inline-flex; align-items: center; gap: 4px;
    font-weight: 700; margin-bottom: 4px;
}

/* ================= 徽章墙（我的） ================= */
.badge-wall-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 22px 24px;
    box-shadow: var(--shadow-sm);
    margin-top: 18px;
}
.badge-wall-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.badge-wall-head h3 {
    display: flex; align-items: center; gap: 8px;
    font-size: 17px; margin: 0;
}
.btn-sm { padding: 6px 14px; font-size: 13px; }
.badge-wall {
    display: flex;
    align-items: center;
    gap: 22px;
    flex-wrap: wrap;
}
.badge-wall-level {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 96px;
}
.badge-wall-level-icon {
    width: 74px; height: 74px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8B85FF, #6C63FF);
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    box-shadow: 0 8px 20px rgba(108,99,255,.3);
}
.badge-wall-level-icon i { width: 34px; height: 34px; }
.badge-wall-level-name { font-size: 13px; color: var(--text-light); font-weight: 600; }
.badge-slots-box {
    flex: 1;
    min-width: 260px;
    display: flex;
    gap: 14px;
    background: #F7F7FD;
    border: 2px solid #fff;
    outline: 1px solid var(--border);
    border-radius: 18px;
    padding: 14px;
    box-shadow: inset 0 2px 8px rgba(108,99,255,.06);
}
.badge-slot {
    width: 78px; height: 78px;
    border-radius: 16px;
    background: #fff;
    border: 2px dashed #D8D8EE;
    display: flex; align-items: center; justify-content: center;
    overflow: visible;
    cursor: pointer;
    transition: transform .15s, border-color .15s;
}
.badge-slot:hover { border-color: var(--brand-light); transform: translateY(-2px); }
.badge-slot img {
    width: 100%; height: 100%;
    object-fit: contain;
    border-radius: 14px;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,.12));
}
.badge-slot.empty::after {
    content: '+';
    color: #C3C3DE;
    font-size: 28px;
    font-weight: 300;
}
.badge-slot.lg { width: 88px; height: 88px; position: relative; }
.badge-slot.lg .slot-remove {
    position: absolute; top: -8px; right: -8px;
    width: 22px; height: 22px; border-radius: 50%;
    background: var(--danger); color: #fff;
    border: 2px solid #fff;
    font-size: 12px; line-height: 1;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    z-index: 2;
}

/* 徽章自定义弹窗 */
.badge-modal-content { max-width: 520px; }
.badge-modal-tip { color: var(--text-light); font-size: 13px; margin: 6px 0 14px; }
.badge-edit-slots { display: flex; gap: 14px; justify-content: center; margin-bottom: 20px; }
.badge-edit-owned {
    display: flex; gap: 12px; flex-wrap: wrap;
    justify-content: center;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    max-height: 240px; overflow-y: auto;
}
.badge-edit-item {
    width: 70px; text-align: center; cursor: pointer;
    padding: 6px; border-radius: 14px;
    transition: background .15s;
}
.badge-edit-item:hover { background: var(--brand-bg); }
.badge-edit-item.used { opacity: .35; pointer-events: none; }
.badge-edit-item img { width: 58px; height: 58px; object-fit: contain; }
.badge-edit-item span { display: block; font-size: 12px; color: var(--text-light); margin-top: 4px; }
.badge-edit-empty { color: var(--text-light); font-size: 14px; padding: 18px 0; }

/* ================= PK 对战 ================= */
.pk-panel {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 32px;
    box-shadow: var(--shadow-sm);
    max-width: 720px;
    margin: 0 auto;
    text-align: center;
}
.pk-setup-head h2 {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    font-size: 24px; margin-bottom: 10px;
}
.pk-setup-head p { color: var(--text-light); line-height: 1.8; margin-bottom: 24px; }
.pk-setup-row {
    display: flex; align-items: flex-start; gap: 14px;
    text-align: left; margin-bottom: 18px;
}
.pk-setup-label {
    display: inline-flex; align-items: center; gap: 6px;
    font-weight: 700; font-size: 14px;
    min-width: 64px; padding-top: 8px;
    color: var(--text);
}
.pk-pills { display: flex; gap: 8px; flex-wrap: wrap; flex: 1; }
.pk-pill {
    padding: 7px 16px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: #FAFAFF;
    color: var(--text);
    font-size: 14px;
    cursor: pointer;
    transition: all .15s;
}
.pk-pill:hover { border-color: var(--brand-light); }
.pk-pill.active { background: var(--brand); color: #fff; border-color: var(--brand); font-weight: 700; }
.pk-start-btn { margin-top: 18px; }

.pk-matching h2 { margin: 18px 0 8px; font-size: 20px; }
.pk-matching-sub { color: var(--text-light); margin-bottom: 22px; }
.pk-matching-hint {
    min-height: 20px; margin: -10px 0 18px;
    font-size: 13.5px; font-weight: 600; color: var(--brand-dark);
    text-align: center;
}
.pk-matching-spinner {
    width: 54px; height: 54px;
    margin: 0 auto;
    border: 4px solid var(--brand-bg);
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: pk-spin .8s linear infinite;
}
@keyframes pk-spin { to { transform: rotate(360deg); } }

.pk-battle { max-width: 760px; margin: 0 auto; }
.pk-versus {
    background: var(--card-bg);
    border-radius: 18px;
    padding: 16px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    gap: 12px;
}
.pk-fighter { display: flex; align-items: center; gap: 10px; flex: 1; }
.pk-fighter.opp { justify-content: flex-end; }
.pk-fighter-avatar {
    width: 46px; height: 46px; border-radius: 50%;
    background: linear-gradient(135deg, #8B85FF, #6C63FF);
    color: #fff; font-weight: 800;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.pk-fighter-avatar.ai { background: linear-gradient(135deg, #34D399, #059669); }
.pk-fighter-meta { display: flex; flex-direction: column; gap: 3px; }
.pk-fighter-name { font-weight: 700; font-size: 15px; }
.pk-tag {
    align-self: flex-start;
    font-size: 11px; font-weight: 700;
    padding: 1px 8px; border-radius: 999px;
    background: #D1FAE5; color: #047857;
}
.pk-tag.pk-tag-real, .pk-tag-real { background: #DBEAFE; color: #1D4ED8; }
.pk-tag.ai { background: #D1FAE5; color: #047857; }
.pk-fighter-score { font-size: 20px; font-weight: 800; color: var(--brand); min-width: 52px; text-align: center; }
.pk-fighter.opp .pk-fighter-score { color: #059669; }
.pk-vs {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    font-weight: 900; color: var(--text-light);
}
.pk-timer {
    font-variant-numeric: tabular-nums;
    font-size: 15px;
    color: var(--danger);
    font-weight: 800;
}
.pk-bars { display: flex; flex-direction: column; gap: 5px; margin: 10px 2px 14px; }
.pk-bar { height: 8px; border-radius: 99px; background: #ECECF8; overflow: hidden; }
.pk-bar-fill { height: 100%; width: 0; border-radius: 99px; transition: width .3s; }
.pk-bar.me .pk-bar-fill { background: linear-gradient(90deg, #8B85FF, #6C63FF); }
.pk-bar.opp .pk-bar-fill { background: linear-gradient(90deg, #6EE7B7, #059669); }

.pk-question-card { margin-top: 0; }
.pk-flash {
    min-height: 22px;
    margin-top: 8px;
    font-size: 13px;
    font-weight: 700;
}
.pk-flash.ok { color: var(--success); }
.pk-flash.no { color: var(--danger); }

.pk-result h2 { font-size: 30px; margin-bottom: 6px; }
.pk-result h2.win { color: var(--success); }
.pk-result h2.draw { color: var(--warning); }
.pk-result h2.lose { color: var(--text-light); }
.pk-result-tag { color: var(--text-light); font-size: 14px; margin-bottom: 22px; }
.pk-result-scores {
    display: flex; align-items: center; justify-content: center; gap: 30px;
    margin-bottom: 22px;
}
.pk-result-side {
    background: #F7F7FD;
    border-radius: 16px;
    padding: 18px 26px;
    display: flex; flex-direction: column; gap: 4px;
    min-width: 130px;
}
.pk-result-name { font-weight: 700; }
.pk-result-correct { font-size: 24px; font-weight: 800; color: var(--brand); }
.pk-result-time { font-size: 13px; color: var(--text-light); }
.pk-result-swords { width: 30px; height: 30px; color: var(--text-light); }
.pk-result-bonus {
    font-size: 16px; font-weight: 700; color: #B45309;
    background: var(--warning-bg);
    display: inline-block; padding: 8px 20px; border-radius: 999px;
    margin-bottom: 22px;
}
.pk-result-actions { display: flex; gap: 12px; justify-content: center; }

/* 商城：称号成就图鉴进度 */
.shop-item .achievement-progress {
    height: 6px; border-radius: 99px; background: #ECECF8;
    overflow: hidden; margin: 6px 0 2px;
}
.shop-item .achievement-progress i {
    display: block; height: 100%;
    background: linear-gradient(90deg, #FBBF24, #F59E0B);
    border-radius: 99px;
}
.shop-item .achievement-progress-text {
    font-size: 12px; color: var(--text-light); margin-bottom: 8px;
}
.btn-buy.achievement-locked {
    background: #F2F2FA; color: var(--text-light); border-color: var(--border);
}
.btn-buy.item-owned-count {
    background: var(--brand-bg); color: var(--brand); border-color: transparent;
}

/* 免错盾抵挡结果态 */
.result-status.shielded {
    background: var(--warning-bg);
    color: #B45309;
}

/* ==========================================================
   数学冒险岛
   ========================================================== */
.adv-map {
    display: flex;
    flex-direction: column;
    gap: 22px;
    padding: 8px 0 24px;
}
.adv-map-row {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    justify-content: flex-start;
}
.adv-map-row.adv-row-r2l {
    justify-content: flex-end;
    flex-direction: row-reverse;
}
.adv-stage-card {
    position: relative;
    width: 170px;
    min-height: 180px;
    padding: 18px 14px 14px;
    border-radius: 22px;
    background: linear-gradient(160deg, #6C63FF 0%, #8B5CF6 100%);
    color: #fff;
    cursor: pointer;
    overflow: hidden;
    box-shadow: 0 12px 28px rgba(108, 99, 255, .28);
    transition: transform .22s ease, box-shadow .22s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    user-select: none;
}
.adv-stage-card:nth-child(3n+2) { background: linear-gradient(160deg, #F59E0B 0%, #F97316 100%); box-shadow: 0 12px 28px rgba(249, 115, 22, .28); }
.adv-stage-card:nth-child(3n+3) { background: linear-gradient(160deg, #10B981 0%, #059669 100%); box-shadow: 0 12px 28px rgba(16, 185, 129, .28); }
.adv-stage-card:hover {
    transform: translateY(-6px) scale(1.03);
    box-shadow: 0 18px 34px rgba(108, 99, 255, .38);
}
.adv-stage-card.locked {
    background: linear-gradient(160deg, #9CA3AF 0%, #6B7280 100%);
    box-shadow: 0 6px 14px rgba(107, 114, 128, .25);
    cursor: not-allowed;
    filter: grayscale(.6);
}
.adv-stage-card.locked:hover {
    transform: none;
    filter: grayscale(.6) brightness(.95);
}
.adv-stage-card.current {
    animation: adv-glow 1.6s ease-in-out infinite;
    border: 3px solid #FEF3C7;
}
.adv-stage-emoji {
    font-size: 38px;
    line-height: 1;
    margin-bottom: 6px;
    filter: drop-shadow(0 3px 5px rgba(0,0,0,.18));
}
.adv-stage-name {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 4px;
    text-shadow: 0 2px 4px rgba(0,0,0,.18);
}
.adv-stage-enemy {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12.5px;
    opacity: .92;
    margin-bottom: 8px;
}
.adv-enemy-mini { font-size: 18px; }
.adv-stage-stars {
    display: flex;
    gap: 3px;
    margin-top: auto;
}
.adv-star {
    font-size: 18px;
    color: rgba(255,255,255,.45);
    text-shadow: 0 1px 2px rgba(0,0,0,.2);
    transition: color .2s, transform .2s;
}
.adv-star.on {
    color: #FDE68A;
    text-shadow: 0 0 8px rgba(254, 215, 80, .9), 0 1px 2px rgba(0,0,0,.2);
    transform: scale(1.08);
}
.adv-lock {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,.35);
    border-radius: 50%;
}
.adv-lock .lucide { width: 14px; height: 14px; color: #fff; }

/* 冒险岛剧情：地图顶部总剧情横幅 */
.adv-story-banner {
    background: linear-gradient(135deg, #EEF2FF 0%, #F5F3FF 100%);
    border: 1px solid #E0E7FF;
    border-radius: 18px;
    padding: 16px 20px;
}
.adv-story-banner-title {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 14px;
    font-weight: 700;
    color: #4F46E5;
    margin-bottom: 6px;
}
.adv-story-banner-title .lucide { width: 16px; height: 16px; }
.adv-story-banner p {
    font-size: 13px;
    line-height: 1.8;
    color: #55566E;
    margin: 0;
}

/* 关卡卡：适合年龄段标签 */
.adv-stage-band {
    font-size: 11px;
    font-weight: 600;
    padding: 1px 8px;
    border-radius: 999px;
    background: rgba(255,255,255,.22);
    color: #fff;
    margin-bottom: 6px;
    white-space: nowrap;
}

/* 战斗界面：本关剧情条 */
.adv-story {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 12px;
    padding: 10px 14px;
    margin-bottom: 14px;
    font-size: 13px;
    line-height: 1.7;
    color: #78500F;
}
.adv-story .lucide { width: 16px; height: 16px; color: #D97706; flex-shrink: 0; margin-top: 3px; }

/* 结算界面：通关/失败剧情 */
.adv-result-story {
    max-width: 460px;
    margin: 4px auto 0;
    font-size: 13px;
    line-height: 1.8;
    color: #6B7280;
}

/* 战斗界面 */
.adv-battle {
    position: relative;
    max-width: 720px;
    margin: 0 auto;
    background: var(--card-bg);
    border-radius: 24px;
    box-shadow: var(--shadow);
    padding: 20px 26px 26px;
    overflow: hidden;
}
.adv-battle-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.adv-battle-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}
.adv-stage-label {
    font-weight: 700;
    color: var(--text);
    font-size: 15px;
}
.adv-stars {
    display: flex;
    gap: 2px;
}
.adv-stars .adv-star { font-size: 14px; color: #D1D5DB; }
.adv-stars .adv-star.on { color: #F59E0B; }

.adv-progress-bar {
    height: 6px;
    border-radius: 99px;
    background: #ECECF8;
    overflow: hidden;
    margin-bottom: 18px;
}
.adv-progress-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #8B85FF, #6C63FF);
    border-radius: 99px;
    transition: width .35s ease;
}

/* 敌人区域 */
.adv-enemy-area {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 180px;
    margin-bottom: 18px;
    background: radial-gradient(ellipse at center, #F3F0FF 0%, transparent 70%);
    border-radius: 18px;
    position: relative;
}
.adv-enemy {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.adv-enemy-emoji {
    font-size: 84px;
    line-height: 1;
    filter: drop-shadow(0 6px 10px rgba(0,0,0,.18));
    animation: adv-pop .35s ease-out;
}
.adv-enemy.hurt .adv-enemy-emoji {
    animation: adv-shake .35s ease-in-out;
    filter: drop-shadow(0 6px 10px rgba(239,68,68,.5)) brightness(1.2);
}
.adv-enemy-hp-bar {
    width: 140px;
    height: 10px;
    border-radius: 99px;
    background: #FEE2E2;
    overflow: hidden;
    border: 1px solid #FECACA;
}
.adv-enemy-hp-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #EF4444, #DC2626);
    border-radius: 99px;
    transition: width .35s ease;
}
.adv-enemy-name {
    font-size: 14px;
    color: var(--text-light);
    font-weight: 600;
}

/* 命中飘字 */
.adv-hit-fx {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 26px;
    font-weight: 800;
    color: #EF4444;
    text-shadow: 0 2px 4px rgba(0,0,0,.25);
    pointer-events: none;
    animation: adv-hit-float .7s ease-out forwards;
}
@keyframes adv-hit-float {
    0% { opacity: 1; top: -10px; }
    100% { opacity: 0; top: -50px; }
}

/* 答题卡 */
.adv-question-card {
    background: #FAFAFF;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px 22px;
}
.adv-question-card.shake {
    animation: adv-shake .4s ease-in-out;
}
.adv-question-card .question-text {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    text-align: center;
    margin-bottom: 16px;
    line-height: 1.6;
}
.adv-question-card .answer-area {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 10px;
}
.adv-question-card .answer-input {
    flex: 0 1 220px;
}
.adv-flash {
    text-align: center;
    font-size: 15px;
    font-weight: 700;
    min-height: 22px;
    padding: 4px 0;
    transition: color .15s;
}
.adv-flash.ok { color: var(--success); }
.adv-flash.no { color: var(--danger); }

/* 通关结果 */
.adv-result {
    text-align: center;
    padding: 32px 20px 12px;
}
.adv-result-stars {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 18px;
    min-height: 56px;
}
.adv-result-star {
    font-size: 48px;
    color: #D1D5DB;
    opacity: 0;
    transform: scale(.3) rotate(-60deg);
    transition: opacity .35s, transform .35s, color .35s;
}
.adv-result-star.on {
    color: #F59E0B;
    text-shadow: 0 0 14px rgba(245, 158, 11, .6), 0 2px 4px rgba(0,0,0,.18);
    animation: adv-star-pop .55s ease-out forwards;
}
@keyframes adv-star-pop {
    0% { opacity: 0; transform: scale(.3) rotate(-60deg); }
    60% { opacity: 1; transform: scale(1.25) rotate(8deg); }
    100% { opacity: 1; transform: scale(1) rotate(0); }
}
/* GSAP 接管星星点亮时关闭 CSS 动画，避免两套动画叠加 */
.adv-result-stars.gsap .adv-result-star { animation: none !important; }
/* GSAP 接手伤害飘字时关闭 CSS 漂浮动画 */
.adv-hit-fx.gsap { animation: none !important; }
.adv-result-title {
    font-size: 26px;
    margin-bottom: 8px;
}
.adv-result-title.perfect { color: #F59E0B; }
.adv-result-title.pass { color: var(--success); }
.adv-result-title.fail { color: var(--text-light); }
.adv-result-desc {
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 22px;
    line-height: 1.7;
}
.adv-coin-icon {
    width: 16px;
    height: 16px;
    vertical-align: -3px;
    display: inline-block;
}
.adv-result-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* 动画 */
@keyframes adv-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-6px); }
    80% { transform: translateX(6px); }
}
@keyframes adv-pop {
    0% { opacity: 0; transform: scale(.4); }
    60% { opacity: 1; transform: scale(1.15); }
    100% { opacity: 1; transform: scale(1); }
}
@keyframes adv-glow {
    0%, 100% { box-shadow: 0 12px 28px rgba(108, 99, 255, .28), 0 0 0 0 rgba(254, 243, 199, .8); }
    50% { box-shadow: 0 12px 28px rgba(108, 99, 255, .28), 0 0 0 6px rgba(254, 243, 199, .25); }
}

/* 响应式：小屏单列 */
@media (max-width: 640px) {
    .adv-stage-card { width: 140px; min-height: 160px; padding: 14px 10px 12px; }
    .adv-stage-emoji { font-size: 30px; }
    .adv-stage-name { font-size: 13px; }
    .adv-enemy-emoji { font-size: 64px; }
    .adv-map-row { gap: 12px; }
    .adv-question-card .question-text { font-size: 19px; }
    .adv-result-star { font-size: 38px; }
}


/* ========== 竖排分数答案输入器（分子在上、分母在下） ========== */
.frac-input-wrap {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}
.frac-input {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
}
.frac-input input {
    width: 96px;
    padding: 9px 6px;
    border: 2.5px solid var(--border);
    border-radius: 12px;
    font-size: 21px;
    font-weight: 700;
    font-family: 'Fredoka', 'Noto Sans SC', sans-serif;
    text-align: center;
    outline: none;
    background: #FAFAFF;
    transition: var(--transition);
}
.frac-input input:focus {
    border-color: var(--brand);
    background: #fff;
    box-shadow: 0 0 0 5px rgba(108, 99, 255, .12);
}
.frac-input-line {
    width: 104px;
    height: 3.5px;
    border-radius: 3px;
    background: var(--text);
}
.frac-input-hint {
    grid-column: 1 / -1;
    font-size: 12px;
    color: var(--text-light);
    text-align: center;
    margin-top: 2px;
}
@media (max-width: 640px) {
    .frac-input input { width: 84px; font-size: 19px; }
    .frac-input-line { width: 92px; }
}

/* ============================================================
   社交模块：好友 / 私信 / 论坛
   ============================================================ */
.social-root { max-width: 860px; margin: 0 auto; }

/* 导航红点 */
.nav-badge {
    position: absolute; top: 4px; right: 6px;
    min-width: 17px; height: 17px; padding: 0 4px;
    background: var(--danger); color: #fff;
    border-radius: 9px; font-size: 11px; line-height: 17px;
    text-align: center; font-weight: 700;
}
.nav-tab { position: relative; }

/* 子标签页 */
.sc-tabs {
    display: flex; gap: 8px; margin-bottom: 16px;
    background: #fff; padding: 6px; border-radius: 12px;
    box-shadow: 0 2px 8px rgba(31,36,48,.05);
}
.sc-tab {
    flex: 1; border: none; background: transparent; cursor: pointer;
    padding: 9px 8px; border-radius: 9px; font-size: 14px; color: var(--text-light);
    display: inline-flex; align-items: center; justify-content: center; gap: 5px;
    font-family: inherit;
}
.sc-tab.active { background: var(--brand-bg); color: var(--brand-dark); font-weight: 600; }
.sc-tab-badge {
    min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
    background: var(--danger); color: #fff; font-size: 11px; line-height: 18px;
}
.sc-tab-badge.hidden { display: none; }

.sc-loading { padding: 36px 0; text-align: center; color: var(--text-light); font-size: 14px; }

/* 空状态 / 行内提示 */
.sc-empty { text-align: center; padding: 48px 20px; color: var(--text-light); }
.sc-empty-icon { width: 52px; height: 52px; color: #C7C9D9; margin-bottom: 10px; }
.sc-empty h3 { margin: 6px 0; color: var(--text); }
.sc-empty p { font-size: 14px; }
.sc-inline {
    padding: 11px 14px; border-radius: 10px; font-size: 14px; margin: 10px 0;
}
.sc-inline.info { background: var(--brand-bg); color: var(--brand-dark); }
.sc-inline.warning { background: var(--warning-bg); color: #B45309; }
.sc-inline.error { background: var(--danger-bg); color: #B91C1C; }

/* 通用头像圈 */
.sc-avatar {
    width: 44px; height: 44px; border-radius: 50%; flex: 0 0 auto;
    background: linear-gradient(135deg, #8B85FF, #6C63FF);
    color: #fff; font-weight: 700; font-size: 18px;
    display: flex; align-items: center; justify-content: center;
}
.sc-avatar.sm { width: 36px; height: 36px; font-size: 15px; }
.sc-avatar.xs {
    width: 24px; height: 24px; font-size: 12px;
    display: inline-flex; vertical-align: middle; margin-right: 4px;
}

/* 好友列表 */
.sc-friend-list, .sc-req-list { display: flex; flex-direction: column; gap: 10px; }
.sc-friend-item {
    display: flex; align-items: center; gap: 12px;
    background: #fff; border-radius: 14px; padding: 12px 16px;
    box-shadow: 0 2px 8px rgba(31,36,48,.05);
}
.sc-friend-meta { flex: 1; min-width: 0; }
.sc-friend-name { font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 8px; }
.sc-friend-sub { font-size: 13px; color: var(--text-light); margin-top: 2px; }
.sc-unread {
    min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
    background: var(--danger); color: #fff; font-size: 12px; line-height: 20px; text-align: center;
}
.sc-req-actions { display: flex; gap: 8px; }
.sc-section-label { margin: 18px 2px 10px; color: var(--text-light); font-size: 14px; }
.sc-rel-tag { font-size: 13px; color: var(--text-light); white-space: nowrap; }
.sc-rel-tag.friend { color: var(--success); font-weight: 600; }
.sc-rel-tag.pending { color: var(--warning); }
.sc-self-tag { font-size: 13px; color: var(--text-light); }
.sc-tip { font-size: 12px; color: var(--text-light); margin-top: 10px; }

/* 搜索 / 输入 */
.sc-add-box {
    background: #fff; border-radius: 14px; padding: 18px;
    box-shadow: 0 2px 8px rgba(31,36,48,.05);
}
.sc-search-row { display: flex; gap: 10px; }
.sc-input {
    flex: 1; border: 1.5px solid var(--border); border-radius: 10px;
    padding: 10px 14px; font-size: 15px; font-family: inherit; outline: none;
    background: #FAFAFE;
}
.sc-input:focus { border-color: var(--brand); background: #fff; }

/* 聊天 */
.sc-chat {
    background: #fff; border-radius: 16px; overflow: hidden;
    box-shadow: 0 2px 12px rgba(31,36,48,.06);
    display: flex; flex-direction: column; height: calc(100vh - 170px); min-height: 420px;
}
.sc-chat-head {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px; border-bottom: 1px solid var(--border); background: #FAFAFE;
}
.sc-chat-title { flex: 1; min-width: 0; }
.sc-chat-title .sc-friend-name { font-size: 15px; }
.sc-chat-title .sc-friend-sub { font-size: 12px; }
.sc-chat-del { color: var(--text-light); }
.sc-chat-body {
    flex: 1; overflow-y: auto; padding: 18px 16px;
    background: #F7F7FC; display: flex; flex-direction: column; gap: 12px;
}
.sc-chat-empty {
    margin: auto; text-align: center; color: var(--text-light); font-size: 14px; line-height: 2;
}
.sc-chat-empty span { font-size: 12px; }
.sc-bubble-row { display: flex; }
.sc-bubble-row.me { justify-content: flex-end; }
.sc-bubble {
    max-width: 72%; padding: 9px 13px; border-radius: 14px; font-size: 15px;
    line-height: 1.5; word-break: break-word; position: relative;
}
.sc-bubble-row.other .sc-bubble { background: #fff; color: var(--text); border-top-left-radius: 4px; }
.sc-bubble-row.me .sc-bubble { background: var(--brand); color: #fff; border-top-right-radius: 4px; }
.sc-bubble-time {
    display: block; font-size: 10px; margin-top: 3px; opacity: .75; text-align: right;
}
.sc-chat-foot { display: flex; gap: 10px; padding: 12px 14px; border-top: 1px solid var(--border); }

/* 论坛 */
.forum-head {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
}
.sc-post-list { display: flex; flex-direction: column; gap: 12px; }
.sc-post-card {
    background: #fff; border-radius: 14px; padding: 16px 18px;
    box-shadow: 0 2px 8px rgba(31,36,48,.05); cursor: pointer;
    transition: transform .12s, box-shadow .12s;
}
.sc-post-card:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(31,36,48,.09); }
.sc-post-card.is-removed { opacity: .65; background: #F7F7F8; }
.sc-post-card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.sc-post-time { font-size: 12px; color: var(--text-light); margin-left: auto; }
.sc-post-title { margin: 2px 0 8px; font-size: 17px; color: var(--text); }
.sc-post-preview {
    font-size: 14px; color: var(--text-light); line-height: 1.6;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.sc-post-card-foot {
    display: flex; align-items: center; justify-content: space-between;
    margin-top: 12px; font-size: 13px; color: var(--text-light);
}
.sc-post-author { display: flex; align-items: center; }
.sc-post-replies { display: inline-flex; align-items: center; gap: 4px; }

.sc-tag {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 12px; padding: 3px 9px; border-radius: 20px; font-weight: 600;
    white-space: nowrap;
}
.sc-tag.sm { font-size: 11px; padding: 1px 7px; }
.sc-tag.math { background: #E7F6EC; color: #15803D; }
.sc-tag.risk { background: var(--warning-bg); color: #B45309; }
.sc-tag.removed { background: var(--danger-bg); color: #B91C1C; }
.sc-tag.pending { background: #FEF3C7; color: #B45309; }

/* 发帖 / 详情 */
.sc-compose, .sc-detail {
    background: #fff; border-radius: 14px; padding: 20px;
    box-shadow: 0 2px 8px rgba(31,36,48,.05);
}
.sc-compose > .btn, .sc-detail > .btn { margin-bottom: 12px; }
.sc-label { display: block; margin: 14px 0 6px; font-size: 14px; font-weight: 600; color: var(--text); }
.sc-textarea {
    width: 100%; border: 1.5px solid var(--border); border-radius: 10px;
    padding: 11px 14px; font-size: 15px; font-family: inherit; outline: none;
    background: #FAFAFE; resize: vertical; box-sizing: border-box;
}
.sc-textarea:focus { border-color: var(--brand); background: #fff; }
.sc-compose-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }

.sc-risk-banner {
    display: flex; gap: 10px; align-items: flex-start;
    background: var(--warning-bg); border: 1px solid #FCD34D;
    color: #92400E; border-radius: 12px; padding: 13px 15px; margin: 12px 0;
    font-size: 14px; line-height: 1.6;
}
.sc-risk-banner.sm { padding: 9px 12px; font-size: 13px; margin: 10px 0; }
.sc-risk-banner i { flex: 0 0 auto; margin-top: 2px; }
.sc-risk-banner .btn { margin-top: 10px; }

.sc-detail-title { margin: 6px 0 10px; font-size: 22px; line-height: 1.35; }
.sc-detail-meta {
    display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
    font-size: 13px; color: var(--text-light); padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.sc-detail-body {
    padding: 16px 2px; font-size: 16px; line-height: 1.85; color: var(--text);
    white-space: normal;
}
.sc-admin-row { display: flex; gap: 8px; padding: 8px 0; }

/* 回复 */
.sc-replies-title { margin: 20px 0 12px; font-size: 15px; color: var(--text); }
.sc-replies { display: flex; flex-direction: column; gap: 14px; }
.sc-replies-empty { color: var(--text-light); font-size: 14px; padding: 6px 0 14px; }
.sc-reply { display: flex; gap: 10px; }
.sc-reply.is-removed .sc-reply-text { color: var(--text-light); font-style: italic; }
.sc-reply-body { flex: 1; min-width: 0; }
.sc-reply-head {
    display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-light);
}
.sc-reply-head b { color: var(--text); }
.sc-reply-text { font-size: 15px; line-height: 1.7; margin-top: 3px; word-break: break-word; }
.sc-mini, .sc-mini-danger {
    border: none; background: none; cursor: pointer; font-size: 12px;
    padding: 0 4px; font-family: inherit;
}
.sc-mini { color: var(--brand); }
.sc-mini-danger { color: var(--danger); }
.sc-reply-box {
    display: flex; gap: 10px; align-items: flex-end; margin-top: 18px;
    padding-top: 14px; border-top: 1px solid var(--border);
}
.sc-reply-box .sc-textarea { flex: 1; }
.sc-locked {
    margin-top: 18px; padding: 12px; text-align: center;
    background: #F3F4F6; color: var(--text-light); border-radius: 10px; font-size: 14px;
}

/* 社交模块 toast */
.sc-toast {
    position: fixed; top: 76px; left: 50%; transform: translate(-50%, -12px);
    background: #374151; color: #fff; padding: 11px 20px; border-radius: 12px;
    font-size: 14px; z-index: 10000; opacity: 0; pointer-events: none;
    transition: opacity .25s, transform .25s; max-width: 88vw;
    box-shadow: 0 8px 24px rgba(0,0,0,.2);
}
.sc-toast.show { opacity: 1; transform: translate(-50%, 0); }
.sc-toast.success { background: #15803D; }
.sc-toast.error { background: #B91C1C; }
.sc-toast.warning { background: #B45309; }

@media (max-width: 640px) {
    .sc-chat { height: calc(100vh - 190px); }
    .sc-bubble { max-width: 82%; }
    .forum-head .btn { padding: 8px 12px; font-size: 13px; }
    .sc-detail-title { font-size: 19px; }
}



/* ==========================================================
   账号管理：改名 / 副账号 / 注销
   ========================================================== */
.profile-account .btn-rename {
    display: inline-flex; align-items: center; justify-content: center;
    width: 22px; height: 22px; padding: 0;
    border: none; border-radius: 7px;
    background: var(--brand-bg); color: var(--brand);
    cursor: pointer; transition: var(--transition);
}
.profile-account .btn-rename:hover { background: var(--brand); color: #fff; }
.profile-account .btn-rename .lucide { font-size: 12px; }

.account-section { margin-top: 20px; }
.account-section > h3 {
    display: flex; align-items: center; gap: 8px;
    font-size: 18px; font-weight: 700; margin-bottom: 14px;
}
.account-section > h3 .lucide { color: var(--brand); font-size: 19px; }
.account-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 6px 20px;
}
.account-row {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; padding: 15px 0;
    border-bottom: 1px solid var(--border);
}
.account-row:last-child { border-bottom: none; }
.account-row-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.account-row-title { font-size: 15px; font-weight: 700; }
.account-row-desc { font-size: 12.5px; color: var(--text-light); line-height: 1.5; }
.account-row-danger .account-row-title { color: var(--danger); }

.account-sub-list {
    display: flex; flex-direction: column; gap: 8px;
    padding: 4px 0 12px;
    border-bottom: 1px solid var(--border);
}
.account-sub-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 14px;
    background: var(--bg);
    border-radius: var(--radius-sm);
}
.account-sub-name {
    flex: 1; min-width: 0;
    font-size: 14px; font-weight: 600;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* 账号管理弹窗 */
.account-modal { text-align: left; max-width: 400px; }
.account-modal h3 {
    display: flex; align-items: center; gap: 8px;
    font-size: 19px; font-weight: 700; margin-bottom: 16px;
}
.account-modal h3 .lucide { color: var(--brand); }
.account-modal-tip {
    font-size: 13px; color: var(--text-light);
    line-height: 1.6; margin-bottom: 14px;
}
.account-modal-warning {
    font-size: 13.5px; color: var(--text);
    line-height: 1.7; margin-bottom: 14px;
    background: var(--danger-bg);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
}
.account-modal-danger-title { color: var(--danger); }
.account-modal-danger-title .lucide { color: var(--danger); }
.account-modal .auth-field { margin-bottom: 13px; text-align: left; }
.account-modal-error {
    display: none;
    font-size: 13px; color: var(--danger);
    background: var(--danger-bg);
    border-radius: var(--radius-sm);
    padding: 9px 12px; margin-bottom: 13px;
    line-height: 1.5;
}
.account-modal-error.show { display: block; }
.btn-danger {
    background: var(--danger); color: #fff;
}
.btn-danger:hover { background: #DC2626; transform: translateY(-2px); }

/* 登录页快速切换 */
.auth-quick { margin-top: 14px; }
.auth-quick-label {
    font-size: 12px; color: rgba(255,255,255,.75);
    margin-bottom: 8px;
}
.auth-quick-list {
    display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
}
.auth-quick-item {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 6px 14px 6px 6px;
    background: rgba(255,255,255,.16);
    border: 1px solid rgba(255,255,255,.25);
    border-radius: 999px;
    color: #fff; font-size: 13px; font-weight: 600;
    font-family: inherit; cursor: pointer;
    transition: var(--transition);
}
.auth-quick-item:hover { background: rgba(255,255,255,.28); }
.auth-quick-item:disabled { opacity: .5; cursor: not-allowed; }
.auth-quick-avatar {
    display: inline-flex; align-items: center; justify-content: center;
    width: 24px; height: 24px;
    background: rgba(255,255,255,.9); color: var(--brand);
    border-radius: 50%;
    font-size: 13px; font-weight: 700;
}

/* ==========================================================
   管理员面板
   ========================================================== */
.page-header { position: relative; }

.admin-panel {
    padding: 22px 24px;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    text-align: left;
}
.admin-search-row {
    display: flex; gap: 8px; margin-bottom: 12px;
}
.admin-search-row input {
    flex: 1; min-width: 0;
    padding: 9px 13px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px; font-family: inherit;
    outline: none; transition: var(--transition);
}
.admin-search-row input:focus { border-color: var(--brand); }
.admin-user-list {
    display: flex; flex-direction: column; gap: 6px;
    max-height: 300px; overflow-y: auto;
    margin-bottom: 14px;
}
.admin-user-empty {
    padding: 14px; text-align: center;
    font-size: 13px; color: var(--text-light);
}
.admin-user-item {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; width: 100%;
    padding: 9px 14px;
    background: var(--bg);
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    font-family: inherit; font-size: 14px;
    cursor: pointer; text-align: left;
    transition: var(--transition);
}
.admin-user-item:hover { border-color: var(--brand-light); }
.admin-user-item.active { border-color: var(--brand); background: var(--brand-bg); }
.admin-user-name { font-weight: 700; }
.admin-user-banned {
    display: inline-block; margin-left: 6px; padding: 1px 7px;
    border-radius: 20px; background: #FEE2E2; color: var(--danger);
    font-size: 11px; font-style: normal; font-weight: 700; vertical-align: 1px;
}
.admin-user-meta { font-size: 12px; color: var(--text-light); }

.admin-target h4 { font-size: 15px; margin-bottom: 12px; }
.admin-target h4 span { color: var(--brand); }
.admin-block {
    padding: 13px 14px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
}
.admin-block-title {
    display: block;
    font-size: 13px; font-weight: 700;
    margin-bottom: 9px;
}
.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
    gap: 8px; margin-bottom: 10px;
}
.admin-stats-grid label {
    display: flex; flex-direction: column; gap: 4px;
    font-size: 12px; color: var(--text-light); font-weight: 600;
}
.admin-stats-grid input {
    padding: 7px 9px;
    border: 2px solid var(--border);
    border-radius: 9px;
    font-size: 14px; font-family: inherit;
    outline: none; min-width: 0;
}
.admin-stats-grid input:focus { border-color: var(--brand); }
.admin-item-row {
    display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
}
.admin-item-row select {
    flex: 1; min-width: 110px;
    padding: 8px 10px;
    border: 2px solid var(--border);
    border-radius: 9px;
    font-size: 14px; font-family: inherit;
    outline: none; background: #fff;
}
.admin-item-row input {
    width: 74px;
    padding: 8px 10px;
    border: 2px solid var(--border);
    border-radius: 9px;
    font-size: 14px; font-family: inherit;
    outline: none;
}
/* 发放称号行：放大热区，避免按钮太小点不中 */
.admin-title-row select {
    flex: 1; min-width: 160px; min-height: 44px;
    padding: 10px 12px;
    border-radius: 11px;
    font-size: 15px;
    cursor: pointer;
}
.admin-title-row .btn {
    flex-shrink: 0; min-height: 44px;
    padding: 11px 22px; font-size: 15px;
}
@media (max-width: 760px) {
    .admin-title-row select { flex-basis: 100%; min-width: 0; }
    .admin-title-row .btn { flex: 1; min-height: 50px; font-size: 16px; }
}
.admin-msg {
    min-height: 20px;
    font-size: 13px; font-weight: 600;
    color: var(--success);
    margin: 6px 0 10px;
    line-height: 1.5;
}
.admin-msg.error { color: var(--danger); }

/* ---- 管理员全局悬浮入口：任何界面都能打开管理面板 ---- */
.admin-fab {
    position: fixed; right: 18px; bottom: 24px; z-index: 1500;
    width: 52px; height: 52px; border: none; border-radius: 50%;
    background: linear-gradient(145deg, #7CB342, #4A8B2C);
    color: #fff; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 8px 24px rgba(74, 139, 44, .42);
    transition: var(--transition);
}
.admin-fab:hover { transform: scale(1.1); }
.admin-fab svg { width: 24px; height: 24px; }
@media (max-width: 760px) {
    .admin-fab { width: 46px; height: 46px; right: 14px; bottom: 18px; }
    .admin-fab svg { width: 21px; height: 21px; }
}

/* ---- 管理面板全局弹层 ---- */
.admin-modal-box {
    max-width: 760px; max-height: 88vh; overflow-y: auto;
    text-align: left; position: relative;
    padding: 30px 28px 20px;
}
.admin-modal-box .page-header { margin-bottom: 14px; }
.modal-close {
    position: absolute; top: 12px; right: 12px; z-index: 2;
    width: 36px; height: 36px; border: none; border-radius: 50%;
    background: var(--bg); color: var(--text-light); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: var(--transition);
}
.modal-close:hover { background: #FEE2E2; color: var(--danger); }
.modal-close svg { width: 18px; height: 18px; }

/* ---- UNO 管理员特权按钮 ---- */
.btn-admin-uno {
    background: linear-gradient(145deg, #FBBF24, #D97706);
    color: #fff; border: none;
    box-shadow: 0 4px 14px rgba(217, 119, 6, .35);
}
.btn-admin-uno:hover { filter: brightness(1.08); transform: translateY(-1px); }
/* 特权开关打开态：描边高亮，一眼看出正在用管理员特权 */
.btn-admin-uno.on {
    background: linear-gradient(145deg, #F59E0B, #B45309);
    box-shadow: 0 0 0 2px #FBBF24, 0 4px 14px rgba(217, 119, 6, .45);
}
.btn-admin-uno.on::after {
    content: ' · 开';
    font-weight: 800;
}

/* ---- UNO 窥牌 / 牌库弹层 ---- */
.uno-peek-box { max-width: 560px; text-align: left; }
.uno-peek-body { max-height: 56vh; overflow-y: auto; margin-bottom: 14px; }
.uno-peek-section { margin-bottom: 16px; }
.uno-peek-section-title {
    font-size: 14px; font-weight: 800; color: var(--text);
    margin-bottom: 8px;
}
.uno-peek-cards {
    display: flex; flex-wrap: wrap; gap: 6px;
}
.uno-peek-cards .uno-card {
    width: 52px; height: 74px; cursor: default;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .18);
}
.uno-peek-cards .uno-card-num { font-size: 22px; }
.uno-peek-cards .uno-card-kind { font-size: 12px; }
.uno-peek-cards .uno-card-corner { font-size: 9px; }
.uno-peek-cards .uno-card.uno-deck-pick { cursor: pointer; }
.uno-peek-cards .uno-card.uno-deck-pick:hover {
    transform: translateY(-6px) scale(1.06);
    box-shadow: 0 8px 18px rgba(74, 139, 44, .4);
    outline: 3px solid #4A8B2C;
}
/* 换牌弹层：对手手牌与牌库都可点；选中态绿色描边 */
.uno-peek-cards .uno-card.uno-swap-pick { cursor: pointer; }
.uno-peek-cards .uno-card.uno-swap-pick:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 6px 14px rgba(74, 139, 44, .35);
}
.uno-peek-cards .uno-card.uno-swap-sel {
    outline: 3px solid #4A8B2C;
    box-shadow: 0 6px 16px rgba(74, 139, 44, .45);
}
.uno-peek-tip {
    font-size: 13px; color: var(--text-light); line-height: 1.6;
    margin-bottom: 12px;
}
.uno-peek-actions { display: flex; justify-content: center; gap: 10px; }
@media (max-width: 760px) {
    .uno-peek-cards .uno-card { width: 44px; height: 63px; }
    .uno-peek-cards .uno-card-num { font-size: 18px; }
}

/* ==========================================================
   数学 UNO
   ========================================================== */
.uno-panel {
    max-width: 640px; margin: 24px auto;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 32px 28px;
    text-align: center;
}
.uno-setup-head h2 {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    font-size: 26px; font-weight: 800; margin-bottom: 10px;
}
.uno-setup-head h2 .lucide { color: var(--brand); }
.uno-setup-head p { color: var(--text-light); font-size: 14.5px; line-height: 1.7; margin-bottom: 18px; }
.uno-rules {
    display: flex; flex-direction: column; gap: 8px;
    text-align: left; margin-bottom: 22px;
}
.uno-rule {
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
    font-size: 13.5px; color: var(--text);
    background: var(--brand-bg);
    border-radius: 10px; padding: 8px 12px;
}
.uno-rule-chip {
    display: inline-block; padding: 2px 10px;
    border-radius: 20px; font-size: 12.5px; font-weight: 700;
    background: #fff; color: var(--text); border: 2px solid var(--border);
}
.uno-rule-chip.uno-c-red { background: #EF4444; border-color: #EF4444; color: #fff; }
.uno-rule-chip.uno-c-skip { background: #1F2937; border-color: #1F2937; color: #fff; }
.uno-rule-chip.uno-c-draw2 { background: #F59E0B; border-color: #F59E0B; color: #fff; }
.uno-rule-chip.uno-c-draw4 { background: #7C3AED; border-color: #7C3AED; color: #fff; }
.uno-rule-chip.uno-c-wild { background: #111827; border-color: #111827; color: #fff; }

/* 开局：真人对战 / AI 陪练 双入口 */
.uno-match-btns {
    display: flex; gap: 12px; justify-content: center; flex-wrap: wrap;
}
.uno-match-btns .btn-lg { flex: 1; min-width: 200px; max-width: 280px; justify-content: center; }
.uno-match {
    display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap;
    margin-top: 18px; padding: 14px 18px;
    background: var(--brand-bg); border-radius: 14px;
}
.uno-match-text { font-size: 14.5px; font-weight: 600; color: var(--text); }
.uno-match-hint {
    flex-basis: 100%; text-align: center;
    min-height: 18px; font-size: 13px; font-weight: 600; color: var(--brand-dark);
}
.uno-match .btn-sm { padding: 6px 14px; font-size: 13px; }

/* 开局：真人对战人数选择（2/3/4 人） */
.uno-size-row {
    display: flex; align-items: center; justify-content: center; gap: 12px;
    flex-wrap: wrap; margin-top: 16px;
}
.uno-size-label { font-size: 13.5px; font-weight: 700; color: var(--text-secondary, #666); }
.uno-size-pills { display: flex; gap: 8px; }
.uno-size-pill {
    padding: 7px 18px; border-radius: 20px; border: 1.5px solid #C5E1A5;
    background: #fff; color: #558B2F; font-size: 13.5px; font-weight: 700;
    cursor: pointer; transition: all .2s ease;
}
.uno-size-pill:hover { border-color: #7CB342; }
.uno-size-pill.active {
    background: #7CB342; border-color: #7CB342; color: #fff;
    box-shadow: 0 3px 10px rgba(124, 179, 66, .35);
}

/* ---- 对局桌面：3D 牌桌，视角固定在我方 ---- */
.uno-table { max-width: 1020px; margin: 16px auto 40px; }
.uno-board {
    position: relative;
    border-radius: 26px;
    background: radial-gradient(ellipse at 50% 38%, #388E3C 0%, #1B5E20 55%, #123F17 100%);
    box-shadow: 0 16px 44px rgba(18, 63, 23, .38), inset 0 2px 0 rgba(255, 255, 255, .07);
    padding: 22px 152px 32px;
    perspective: 1200px;
    overflow: hidden;
}
.uno-mat {
    position: absolute; inset: 14px;
    border: 2px dashed rgba(255, 255, 255, .16);
    border-radius: 18px;
    pointer-events: none;
}
.uno-center {
    position: relative; z-index: 2;
    display: flex; align-items: center; justify-content: center;
    gap: 38px;
    min-height: 216px;
    transform: rotateX(5deg);
    transform-style: preserve-3d;
}
.uno-pile { position: relative; }
.uno-pile-discard .uno-card { transform: rotate(3deg); }
/* 牌堆厚度：两层错位的牌背 */
#unoDeck::before, #unoDeck::after {
    content: ''; position: absolute; inset: 0;
    border-radius: 12px;
    background: repeating-linear-gradient(45deg, #1E3A8A, #1E3A8A 8px, #1D4ED8 8px, #1D4ED8 16px);
    border: 3px solid #fff;
}
#unoDeck::before { transform: translate(3px, 3px); opacity: .85; }
#unoDeck::after { transform: translate(6px, 6px); opacity: .6; }

/* 对手座位：绕桌而坐（左 / 右） */
.uno-seat {
    position: absolute; top: 50%; z-index: 3;
    transform: translateY(-50%);
    display: flex; flex-direction: column; align-items: center; gap: 5px;
    min-width: 120px; padding: 12px 14px 14px;
    background: rgba(255, 255, 255, .95);
    border-radius: 18px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, .3);
    transition: box-shadow .25s ease, transform .25s ease;
}
.uno-seat-left { left: 20px; }
.uno-seat-right { right: 20px; }
.uno-seat.active {
    box-shadow: 0 0 0 3px #FBBF24, 0 0 26px rgba(251, 191, 36, .5), 0 12px 30px rgba(0, 0, 0, .32);
    transform: translateY(-50%) scale(1.05);
}
/* 第 3 位对手（4 人局）：坐上方，桌面让出顶部空间（放在 .active 之后覆盖 transform） */
.uno-seat-top {
    top: 16px; left: 50%; transform: translateX(-50%);
    display: none;
}
.uno-board.has-top-seat { padding-top: 152px; }
.uno-board.has-top-seat .uno-seat-top { display: flex; }
.uno-seat-top.active { transform: translateX(-50%) scale(1.05); }
/* 对手人物：SVG 小人（头/身体/双臂前伸），手在牌扇上方握牌 */
.uno-person {
    width: 86px; height: 86px; display: block;
    filter: drop-shadow(0 3px 5px rgba(0, 0, 0, .2));
}
.uno-seat-name { font-size: 13.5px; font-weight: 800; color: #333; }
.uno-seat-fan {
    display: flex; justify-content: center; align-items: flex-end; height: 38px;
    margin: -14px 0 4px; position: relative; z-index: 1;
}
.uno-mini-back {
    width: 20px; height: 29px; border-radius: 5px; margin-left: -9px;
    background: repeating-linear-gradient(45deg, #1E3A8A, #1E3A8A 4px, #1D4ED8 4px, #1D4ED8 8px);
    border: 1.5px solid rgba(255, 255, 255, .95);
    box-shadow: 0 2px 5px rgba(0, 0, 0, .28);
    transform-origin: 50% 120%;
}
.uno-seat-fan .uno-mini-back:first-child { margin-left: 0; }
.uno-seat-count { font-size: 12.5px; font-weight: 700; color: #558B2F; }
.uno-seat-turn {
    font-size: 11px; font-weight: 800; color: #B45309;
    background: #FEF3C7; border-radius: 20px; padding: 2px 10px;
}
.uno-seat-done {
    font-size: 11px; font-weight: 800; color: #166534;
    background: #DCFCE7; border-radius: 20px; padding: 2px 10px;
}
.uno-dir {
    position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%);
    font-size: 12px; font-weight: 700; color: rgba(255, 255, 255, .8);
    letter-spacing: 1px; pointer-events: none;
}

.uno-status {
    display: flex; align-items: center; justify-content: center;
    gap: 14px; flex-wrap: wrap;
    font-size: 13.5px; font-weight: 600;
    margin-top: 16px; padding: 10px 14px;
    background: var(--card-bg); border-radius: 14px;
    box-shadow: var(--shadow-sm);
}
.uno-cur-color { padding: 4px 12px; border-radius: 20px; color: #fff; }
.uno-cur-color.uno-c-red { background: #EF4444; }
.uno-cur-color.uno-c-yellow { background: #F59E0B; }
.uno-cur-color.uno-c-green { background: #22C55E; }
.uno-cur-color.uno-c-blue { background: #3B82F6; }
.uno-turn-text { color: var(--text); }
.uno-deck-count { color: var(--text-light); font-size: 12px; }

.uno-flash {
    min-height: 24px; text-align: center;
    font-size: 14px; font-weight: 700; color: var(--brand);
    margin-top: 10px;
}
.uno-flash.hidden { visibility: hidden; }

/* 我的座位：手牌区高度固定，AI 回合时不跳动 */
.uno-me {
    margin-top: 6px;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 14px 18px 16px;
}
.uno-me-tag { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.uno-me-avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--brand); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px; font-weight: 800;
}
.uno-me-name { font-size: 14px; font-weight: 800; color: var(--text); }
.uno-me-count { font-size: 12.5px; font-weight: 700; color: var(--text-light); margin-left: auto; }
/* 我的手：双手从牌下两侧探出，像握着一扇牌 */
.uno-hand-wrap { position: relative; }
.uno-my-hand {
    position: absolute; bottom: -10px; width: 58px; height: 58px;
    z-index: 0; pointer-events: none;
    filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .18));
}
.uno-my-hand-l { left: 10px; transform: rotate(-16deg); }
.uno-my-hand-r { right: 10px; transform: rotate(16deg) scaleX(-1); }
.uno-hand {
    display: flex; justify-content: center; align-items: flex-end;
    flex-wrap: wrap; gap: 12px;
    min-height: 104px;
    padding: 8px 4px 2px;
    position: relative; z-index: 1;
}
.uno-actions {
    display: flex; justify-content: center; gap: 12px;
    margin-top: 16px;
}

/* ---- 牌面 ---- */
.uno-card {
    position: relative;
    width: 64px; height: 92px;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 3px 10px rgba(17, 24, 39, .18);
    display: flex; align-items: center; justify-content: center;
    user-select: none;
    transition: transform .15s ease, box-shadow .15s ease;
}
.uno-pile-discard .uno-card,
.uno-pile .uno-card { width: 76px; height: 108px; }
.uno-card.uno-c-red    { background: linear-gradient(145deg, #F87171, #DC2626); }
.uno-card.uno-c-yellow { background: linear-gradient(145deg, #FBBF24, #D97706); }
.uno-card.uno-c-green  { background: linear-gradient(145deg, #4ADE80, #16A34A); }
.uno-card.uno-c-blue   { background: linear-gradient(145deg, #60A5FA, #2563EB); }
.uno-card.uno-c-wild {
    background: conic-gradient(#EF4444 0 25%, #F59E0B 0 50%, #22C55E 0 75%, #3B82F6 0 100%);
}
.uno-card-num {
    font-size: 34px; font-weight: 900; color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, .25);
}
.uno-pile .uno-card-num { font-size: 40px; }
.uno-card-kind {
    font-size: 26px; font-weight: 900; color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, .25);
}
.uno-card-corner {
    position: absolute; top: 5px; left: 7px;
    font-size: 12px; font-weight: 800; color: rgba(255, 255, 255, .95);
    text-shadow: 0 1px 2px rgba(0, 0, 0, .25);
}
.uno-card-corner-br { top: auto; left: auto; bottom: 5px; right: 7px; transform: rotate(180deg); }
.uno-card.uno-playable {
    cursor: pointer;
    outline: 3px solid #FBBF24;
    outline-offset: 2px;
    transform: translateY(-8px);
}
.uno-card.uno-playable:hover { transform: translateY(-12px) scale(1.04); }
.uno-card-back {
    background: repeating-linear-gradient(45deg, #1E3A8A, #1E3A8A 8px, #1D4ED8 8px, #1D4ED8 16px);
    border: 3px solid #fff;
}
.uno-card-back-mark {
    width: 40px; height: 40px; border-radius: 50%;
    background: rgba(255, 255, 255, .92); color: #1D4ED8;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; font-weight: 900; transform: rotate(-20deg);
}
/* ---- 特殊牌面：白色奖章大图标 + 文字标签，一眼认出功能牌 ---- */
.uno-card-face {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.uno-card-medal {
    width: 38px; height: 38px; border-radius: 50%;
    background: rgba(255, 255, 255, .96);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .28), inset 0 -2px 4px rgba(0, 0, 0, .06);
}
.uno-card.uno-k-skip .uno-card-kind { color: #1F2937; }
.uno-card.uno-k-reverse .uno-card-kind { color: #1D4ED8; }
.uno-card.uno-k-draw2 .uno-card-kind { color: #B45309; }
.uno-card.uno-k-wild .uno-card-medal,
.uno-card.uno-k-wild4 .uno-card-medal { background: #111827; }
.uno-card.uno-k-wild .uno-card-kind,
.uno-card.uno-k-wild4 .uno-card-kind { color: #fff; }
.uno-card-label {
    font-size: 10px; font-weight: 800; color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .4);
    letter-spacing: .5px; white-space: nowrap;
}
/* ---- 新牌落到弃牌堆的动画 ---- */
.uno-card.uno-land { animation: uno-land .4s cubic-bezier(.2, 1.2, .35, 1); }
@keyframes uno-land {
    0% { transform: scale(1.5) rotate(-12deg); opacity: .3; }
    60% { transform: scale(1.05) rotate(1deg); opacity: 1; }
    100% { transform: scale(1) rotate(3deg); opacity: 1; }
}
/* ---- 飞牌动画：摸牌 / 出牌时一张牌从起点飞向终点 ---- */
.uno-fly {
    position: fixed; z-index: 1180; pointer-events: none;
    width: 54px; height: 77px;
    transition: transform .52s cubic-bezier(.35, .65, .35, 1), opacity .52s ease;
    will-change: transform, opacity;
}

/* ---- 弹层 ---- */
.uno-modal {
    position: fixed; inset: 0; z-index: 1200;
    background: rgba(17, 24, 39, .55);
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}
.uno-modal.hidden { display: none; }
.uno-modal-box {
    background: #fff; border-radius: 20px;
    width: 100%; max-width: 420px;
    padding: 28px 26px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
    text-align: center;
}
.uno-modal-badge {
    display: inline-block;
    background: var(--brand-bg); color: var(--brand);
    font-size: 13px; font-weight: 700;
    border-radius: 20px; padding: 4px 14px; margin-bottom: 14px;
}
.uno-modal-question {
    font-size: 20px; font-weight: 700; line-height: 1.6;
    margin-bottom: 18px; min-height: 32px;
}
.uno-modal-answer { display: flex; gap: 10px; }
.uno-modal-answer .answer-input { flex: 1; text-align: center; }

.uno-color-row { display: flex; gap: 12px; justify-content: center; }
.uno-color-btn {
    width: 62px; height: 62px; border: none; border-radius: 50%;
    font-size: 18px; font-weight: 800; color: #fff; cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .2);
    transition: var(--transition);
}
.uno-color-btn:hover { transform: scale(1.1); }
.uno-color-btn.uno-c-red { background: #EF4444; }
.uno-color-btn.uno-c-yellow { background: #F59E0B; }
.uno-color-btn.uno-c-green { background: #22C55E; }
.uno-color-btn.uno-c-blue { background: #3B82F6; }

/* ---- +4 质疑弹层 ---- */
.uno-challenge-tip {
    font-size: 14px; line-height: 1.7; color: var(--text);
    text-align: left; margin-bottom: 12px;
}
.uno-challenge-tip b { color: var(--brand); }
.uno-challenge-count {
    font-size: 13px; color: var(--text-light); margin-bottom: 16px;
}
.uno-challenge-count b { color: #EF4444; font-size: 16px; }

/* ---- UNO 喊名 ---- */
.uno-shout {
    position: fixed; left: 50%; bottom: 210px; transform: translateX(-50%);
    z-index: 1150;
}
.uno-shout.hidden { display: none; }
.uno-shout-box {
    background: #fff; border-radius: 18px;
    box-shadow: 0 16px 48px rgba(239, 68, 68, .35);
    border: 3px solid #EF4444;
    padding: 18px 26px; text-align: center;
    animation: uno-pop .3s ease;
}
@keyframes uno-pop {
    from { transform: scale(.6); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
.uno-shout-title {
    font-size: 30px; font-weight: 900; color: #EF4444;
    letter-spacing: 1px; margin-bottom: 4px;
}
.uno-shout-sub { font-size: 13px; color: var(--text-light); margin-bottom: 12px; }
.uno-shout-sub b { color: #EF4444; font-size: 16px; }

/* ---- 结算 ---- */
.uno-result-box { max-width: 400px; }
.uno-result-title {
    font-size: 26px; font-weight: 900; margin-bottom: 16px;
    color: var(--brand);
}
.uno-result-list { margin-bottom: 14px; }
.uno-result-row {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px; border-radius: 12px;
    background: var(--brand-bg); margin-bottom: 7px;
    font-size: 14px;
}
.uno-result-rank {
    width: 24px; height: 24px; border-radius: 50%;
    background: var(--brand); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 800; flex-shrink: 0;
}
.uno-result-name { font-weight: 700; flex: 1; text-align: left; }
.uno-result-left { color: var(--text-light); font-size: 12.5px; }
.uno-result-stats { font-size: 13.5px; color: var(--text-light); margin-bottom: 6px; }
.uno-result-coins { font-size: 22px; font-weight: 900; color: #D97706; margin-bottom: 18px; }
.uno-result-actions { display: flex; gap: 10px; justify-content: center; }

@media (max-width: 760px) {
    .uno-board {
        display: grid; grid-template-columns: 1fr 1fr;
        gap: 10px; padding: 14px;
    }
    .uno-board.has-top-seat { padding-top: 14px; }
    .uno-center {
        grid-column: 1 / -1; min-height: 168px; gap: 20px;
        transform: none;
    }
    .uno-seat {
        position: static; transform: none;
        flex-direction: row; flex-wrap: wrap; align-items: center;
        justify-content: center; gap: 4px 8px; min-width: 0; padding: 8px 10px;
    }
    .uno-seat.active { transform: none; }
    .uno-seat-fan { display: none; }
    .uno-person { width: 42px; height: 42px; }
    .uno-seat-name { font-size: 12.5px; }
    .uno-seat-count { font-size: 11.5px; }
    .uno-my-hand { width: 40px; height: 40px; bottom: -6px; }
    .uno-dir {
        position: static; transform: none; text-align: center;
        grid-column: 1 / -1; color: rgba(255, 255, 255, .75);
    }
    .uno-pile-discard .uno-card, .uno-pile .uno-card { width: 64px; height: 92px; }
    .uno-hand { gap: 8px; }
    .uno-status { gap: 8px; font-size: 12.5px; }
}

/* ==========================================================
   全站可视化编辑（管理员双击修改任意文字/图片）
   ========================================================== */
.se-pill {
    position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%);
    z-index: 3100;
    display: flex; align-items: center; gap: 10px;
    background: #1F2430; color: #fff;
    padding: 9px 12px 9px 16px; border-radius: 999px;
    box-shadow: 0 10px 30px rgba(31, 36, 48, .35);
    font-size: 13px; max-width: calc(100vw - 32px);
}
.se-pill-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: #4ADE80; flex-shrink: 0;
    box-shadow: 0 0 0 3px rgba(74, 222, 128, .25);
}
.se-pill-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.se-pill-btn {
    border: none; cursor: pointer;
    background: rgba(255, 255, 255, .16); color: #fff;
    font-size: 12.5px; font-weight: 700;
    padding: 6px 12px; border-radius: 999px; flex-shrink: 0;
}
.se-pill-btn:hover { background: rgba(255, 255, 255, .28); }

.se-panel {
    position: fixed; left: 50%; bottom: 76px; transform: translateX(-50%);
    z-index: 3500;
    width: min(560px, calc(100vw - 24px));
    max-height: min(72vh, 620px); overflow: auto;
    background: #fff; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(31, 36, 48, .35);
    padding: 16px 18px 14px;
    animation: se-pop .18s ease;
}
@keyframes se-pop {
    from { transform: translateX(-50%) translateY(10px); opacity: 0; }
    to { transform: translateX(-50%) translateY(0); opacity: 1; }
}
.se-panel-head {
    display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
    margin-bottom: 10px;
}
.se-panel-head strong { font-size: 15.5px; color: var(--text); }
.se-path {
    flex: 1; min-width: 0;
    font-size: 11.5px; color: var(--text-light);
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.se-textarea {
    width: 100%; resize: vertical;
    border: 1.5px solid #E5E7EB; border-radius: 10px;
    padding: 10px 12px; font-size: 14.5px; line-height: 1.6;
    color: var(--text); background: #FAFAFE;
    font-family: inherit;
}
.se-textarea:focus { outline: none; border-color: var(--brand); background: #fff; }
.se-controls {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    margin-top: 10px;
}
.se-controls label {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 12.5px; font-weight: 700; color: var(--text-secondary, #555);
}
.se-controls select, .se-img-row input {
    border: 1.5px solid #E5E7EB; border-radius: 8px;
    padding: 7px 9px; font-size: 13px; color: var(--text);
    background: #fff; max-width: 100%;
}
.se-controls select:focus, .se-img-row input:focus { outline: none; border-color: var(--brand); }
.se-controls input[type="color"] {
    width: 34px; height: 30px; padding: 2px;
    border: 1.5px solid #E5E7EB; border-radius: 8px; background: #fff;
    cursor: pointer;
}
.se-toggles { display: inline-flex; gap: 6px; }
.se-toggle {
    width: 32px; height: 30px;
    border: 1.5px solid #E5E7EB; border-radius: 8px;
    background: #fff; color: var(--text-secondary, #555);
    font-size: 14px; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
}
.se-toggle.on { background: var(--brand-bg); border-color: var(--brand); color: var(--brand-dark); }
.se-img-preview {
    margin-top: 4px; padding: 10px;
    background: #F6F6FB; border-radius: 10px; text-align: center;
}
.se-img-preview img { max-width: 100%; max-height: 180px; border-radius: 8px; }
.se-img-row { display: flex; gap: 8px; margin-top: 10px; align-items: center; }
.se-img-row input { flex: 1; min-width: 0; }
.se-img-row .se-btn { flex-shrink: 0; }
/* 悬停提示输入行 */
.se-title-label { flex: 1; min-width: 220px; }
.se-title-label input {
    flex: 1; min-width: 0;
    border: 1.5px #E5E7EB; border-style: solid; border-radius: 8px;
    padding: 7px 9px; font-size: 13px; color: var(--text); background: #fff;
}
.se-title-label input:focus { outline: none; border-color: var(--brand); }
/* 图标预览与选择 */
.se-icon-preview {
    display: flex; align-items: center; gap: 10px;
    margin-top: 4px; padding: 10px;
    background: #F6F6FB; border-radius: 10px;
}
.se-icon-preview svg, .se-icon-preview img {
    width: 28px; height: 28px; flex-shrink: 0;
}
.se-icon-preview span {
    font-size: 12.5px; color: var(--text-light);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.se-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.se-btn {
    border: 1.5px solid #E5E7EB; background: #fff; color: var(--text);
    font-size: 13px; font-weight: 700;
    padding: 9px 14px; border-radius: 10px; cursor: pointer;
    transition: border-color .15s, background .15s;
}
.se-btn:hover { border-color: var(--brand-light); background: var(--brand-bg); }
.se-btn-primary {
    background: var(--brand); border-color: var(--brand); color: #fff;
}
.se-btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.se-btn-ghost { color: var(--text-light); }
.se-tip {
    margin-top: 10px; font-size: 12px; line-height: 1.6;
    color: var(--text-light);
}
.se-toast {
    position: fixed; left: 50%; top: 84px; transform: translate(-50%, -10px);
    z-index: 3600;
    background: #1F2430; color: #fff;
    padding: 11px 20px; border-radius: 12px;
    font-size: 13.5px; font-weight: 600;
    box-shadow: 0 10px 30px rgba(31, 36, 48, .3);
    opacity: 0; pointer-events: none;
    transition: opacity .25s, transform .25s;
    max-width: 88vw;
}
.se-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* 管理面板：网页可视化编辑提示 */
.admin-site-edit-tip {
    font-size: 12.5px; line-height: 1.7; color: var(--text-light);
    margin: -4px 0 12px;
}

@media (max-width: 760px) {
    .se-panel { bottom: 70px; padding: 14px 14px 12px; }
    .se-pill { font-size: 12px; padding: 8px 10px 8px 13px; gap: 8px; }
    .se-pill-text { display: none; }
    .se-pill-btn { padding: 7px 10px; font-size: 12px; }
    .se-actions .se-btn { flex: 1; min-width: 44%; text-align: center; }
}

/* ==========================================================
   注册页：年级选择
   ========================================================== */
.auth-grade-row {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
}
.auth-grade-pill {
    padding: 10px 4px;
    border: 2px solid var(--border);
    background: var(--card-bg);
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    color: var(--text-light);
    cursor: pointer;
    font-family: inherit;
    transition: var(--transition);
}
.auth-grade-pill:hover { border-color: var(--brand); color: var(--brand); }
.auth-grade-pill.active {
    border-color: var(--brand);
    background: var(--brand-bg);
    color: var(--brand-dark);
}

/* ==========================================================
   站内邮箱（系统通知 / 用户反馈）
   ========================================================== */
.mb-list { display: flex; flex-direction: column; gap: 10px; }
.mb-item {
    display: flex; gap: 12px;
    background: var(--card-bg);
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(31, 36, 48, .05);
    padding: 14px 16px;
}
/* 未读：淡紫底一眼认出 */
.mb-item.unread { background: var(--brand-bg); }
.mb-icon {
    width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
    background: #fff; color: var(--brand);
    display: flex; align-items: center; justify-content: center;
}
.mb-icon.fb { color: #B45309; }
.mb-icon svg { width: 18px; height: 18px; }
.mb-main { flex: 1; min-width: 0; }
.mb-title {
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
    font-size: 14.5px; font-weight: 700; color: var(--text);
    margin-bottom: 4px;
}
.mb-tag {
    font-size: 11px; font-weight: 700;
    background: #fff; color: var(--brand-dark);
    border-radius: 20px; padding: 2px 8px;
}
.mb-tag.fb { color: #B45309; }
.mb-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--danger); flex-shrink: 0;
}
.mb-content {
    font-size: 13.5px; color: var(--text-light);
    line-height: 1.7; word-break: break-word;
}
.mb-meta { font-size: 12px; color: #9CA3AF; margin-top: 6px; }

/* ==========================================================
   意见反馈弹窗
   ========================================================== */
.feedback-box { position: relative; max-width: 420px; text-align: left; }
.feedback-title {
    display: flex; align-items: center; gap: 8px;
    font-size: 19px; font-weight: 700; margin-bottom: 8px;
}
.feedback-title svg { width: 20px; height: 20px; color: var(--brand); }
.feedback-sub {
    font-size: 13px; color: var(--text-light);
    line-height: 1.6; margin-bottom: 14px;
}
.feedback-types {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
    margin-bottom: 14px;
}
.feedback-type {
    padding: 8px 4px;
    border: 1.5px solid var(--border);
    background: #fff; color: var(--text-light);
    border-radius: 10px; font-size: 13px; font-weight: 700;
    cursor: pointer; font-family: inherit;
    transition: var(--transition);
}
.feedback-type:hover { border-color: var(--brand); color: var(--brand); }
.feedback-type.active {
    background: var(--brand); border-color: var(--brand); color: #fff;
}
.feedback-input {
    width: 100%; resize: vertical;
    border: 2px solid var(--border); border-radius: 12px;
    padding: 12px 14px; font-size: 14px; line-height: 1.6;
    color: var(--text); font-family: inherit;
    background: #FAFAFE;
}
.feedback-input:focus { outline: none; border-color: var(--brand); background: #fff; }
.feedback-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }
@media (max-width: 760px) {
    .feedback-types { grid-template-columns: repeat(2, 1fr); }
}

/* ==========================================================
   站内邮箱：管理员回复反馈
   ========================================================== */
.mb-icon.rp { background: #E8F5E9; color: #2E7D32; }
.mb-tag.rp { background: #E8F5E9; color: #2E7D32; }
.mb-actions { margin-top: 10px; }
.mb-replied {
    display: inline-flex; align-items: center; gap: 5px;
    margin-top: 10px; font-size: 12.5px; font-weight: 600; color: #2E7D32;
}
.mb-replied i { width: 14px; height: 14px; }
.mb-ai-note {
    margin-top: 8px; padding: 7px 10px; border-radius: 8px;
    background: #F5F3FF; font-size: 12.5px; line-height: 1.6; color: #5B21B6;
}
.mb-reply-box { margin-top: 10px; }
.mb-reply-box .sc-inline { margin-top: 8px; }

/* ========== 管理员：管理权限徽标 + AI 批阅助手 ========== */
.admin-user-admin {
    display: inline-block; margin-left: 6px; padding: 1px 7px;
    border-radius: 20px; background: #DCFCE7; color: #15803D;
    font-size: 11px; font-style: normal; font-weight: 700; vertical-align: 1px;
}
.ai-block .admin-item-row { flex-wrap: wrap; gap: 8px; }
.ai-result { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.ai-result-title { font-size: 13px; font-weight: 700; color: var(--text, #333); }
.ai-result-item {
    border: 1px solid #E8E8F0; border-radius: 10px; padding: 10px 12px;
    font-size: 12.5px; line-height: 1.7; color: #444; background: #FAFAFF;
    word-break: break-all;
}
.ai-result-item .ai-tag {
    display: inline-block; padding: 1px 8px; margin-right: 6px;
    border-radius: 999px; font-size: 11px; font-weight: 700;
}
.ai-tag.high { background: #FEE2E2; color: #B91C1C; }
.ai-tag.medium { background: #FEF3C7; color: #B45309; }
.ai-tag.ok { background: #DCFCE7; color: #15803D; }
.ai-tag.human { background: #DBEAFE; color: #1D4ED8; }
.ai-result-item .ai-reason { color: #888; font-size: 12px; }
.ai-empty { font-size: 12.5px; color: #999; }
.pending-count { font-size: 12px; color: #B45309; font-weight: 600; }
.pending-actions { margin-top: 6px; display: flex; gap: 8px; }
.pending-actions .btn { font-size: 12px; padding: 3px 14px; }

/* ==========================================================
   数学星球大剧场（互动动画剧）
   免费开源库本地驱动：GSAP（补间/时间轴）+ tsParticles（粒子）
   无外部图片/音频/字体请求，断网也能演
   ========================================================== */

/* 冒险岛页：剧场模式入口 */
.btn-theater {
    display: inline-flex; align-items: center; gap: 8px;
    margin-top: 14px; padding: 10px 20px;
    background: linear-gradient(135deg, #1F2430, #3A3F55);
    color: #FFD54A; border: none; border-radius: 999px;
    font-size: 14px; font-weight: 700; font-family: inherit;
    cursor: pointer; box-shadow: 0 6px 18px rgba(31, 36, 48, .28);
    transition: var(--transition);
}
.btn-theater:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(31, 36, 48, .36); }
.btn-theater .lucide { width: 17px; height: 17px; }
.btn-theater span { color: rgba(255, 255, 255, .82); font-weight: 600; }

/* 剧场全屏层：盖过站内一切弹层（modal 1500 / se 3500 之上） */
.story-overlay {
    position: fixed; inset: 0; z-index: 3000;
    background: #0B0D17; overflow: hidden;
    font-family: 'Fredoka', 'Noto Sans SC', sans-serif;
    -webkit-tap-highlight-color: transparent;
}
#storyStage {
    position: absolute; inset: 0;
    width: 100%; height: 100%; display: block;
}
#storyParticles {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    pointer-events: none; z-index: 2;
}
/* 角色木偶可点（彩蛋），其余 SVG 层不挡点击 */
#storyStage .pp-root { cursor: pointer; }

/* 章节标题卡 */
.story-title-card {
    position: absolute; inset: 0; z-index: 10;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    pointer-events: none; text-align: center; padding: 0 24px;
}
.story-title-main {
    font-size: clamp(30px, 5.2vw, 54px); font-weight: 800;
    color: #fff; letter-spacing: 2px;
    text-shadow: 0 4px 24px rgba(0, 0, 0, .55);
}
.story-title-sub {
    margin-top: 12px; font-size: clamp(14px, 2vw, 20px);
    color: #FFD54A; font-weight: 600; letter-spacing: 1px;
    text-shadow: 0 2px 12px rgba(0, 0, 0, .5);
}

/* 底部字幕胶囊 */
.story-sub {
    position: absolute; left: 50%; bottom: 40px; transform: translateX(-50%);
    z-index: 10; max-width: min(780px, 88vw);
    display: flex; align-items: baseline; gap: 10px;
    background: rgba(10, 12, 24, .78);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    border-radius: 16px; padding: 12px 22px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, .35);
}
.story-name {
    flex: 0 0 auto; font-size: 15px; font-weight: 800;
    padding: 2px 12px; border-radius: 999px;
    background: rgba(255, 255, 255, .14); color: #7CB342;
}
.story-text {
    font-size: clamp(15px, 1.7vw, 19px); line-height: 1.75;
    color: #fff; font-weight: 500;
}

/* 点击继续提示 */
.story-click-hint {
    position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%);
    z-index: 10; font-size: 12.5px; color: rgba(255, 255, 255, .75);
    letter-spacing: 1px; pointer-events: none;
    animation: story-breathe 1.6s ease-in-out infinite;
}
.story-click-hint span { display: inline-block; margin-left: 4px; }
@keyframes story-breathe {
    0%, 100% { opacity: .45; }
    50% { opacity: 1; }
}

/* 左上：章节徽标 + 总进度 */
.story-badge {
    position: absolute; top: 16px; left: 16px; z-index: 10;
    display: flex; flex-direction: column; gap: 7px;
    background: rgba(10, 12, 24, .62);
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
    border-radius: 12px; padding: 9px 14px;
    font-size: 12.5px; font-weight: 700; color: #FFD54A;
    max-width: 40vw;
}
.story-progress {
    width: 130px; height: 4px; border-radius: 4px;
    background: rgba(255, 255, 255, .18); overflow: hidden;
}
.story-progress-fill {
    height: 100%; width: 0; border-radius: 4px;
    background: linear-gradient(90deg, #FFD54A, #7CB342);
    transition: width .4s ease;
}

/* 右上：控制条 */
.story-controls {
    position: absolute; top: 16px; right: 16px; z-index: 11;
    display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px;
    max-width: 58vw;
}
.story-ctrl {
    border: none; cursor: pointer; font-family: inherit;
    background: rgba(10, 12, 24, .62); color: rgba(255, 255, 255, .92);
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
    border-radius: 9px; padding: 7px 11px;
    font-size: 12.5px; font-weight: 700; line-height: 1;
    transition: background .15s, transform .15s;
}
.story-ctrl:hover { background: rgba(108, 99, 255, .85); transform: translateY(-1px); }

/* 章节选择面板 / 章节完成卡（共用遮罩） */
.story-panel, .story-chapter-done {
    position: absolute; inset: 0; z-index: 20;
    display: flex; align-items: center; justify-content: center;
    background: rgba(5, 6, 15, .74);
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
    padding: 20px;
}
.story-panel-card {
    width: 100%; max-width: 470px; max-height: 86vh; overflow-y: auto;
    background: #fff; border-radius: 22px; padding: 28px 26px 22px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, .45);
    text-align: center;
}
.story-panel-title {
    font-size: 24px; font-weight: 800; color: var(--text);
    display: flex; align-items: center; justify-content: center; gap: 8px;
}
.story-panel-sub {
    margin: 8px 0 18px; font-size: 13px; color: var(--text-light); line-height: 1.7;
}
.story-panel-list { display: flex; flex-direction: column; gap: 9px; text-align: left; max-height: 46vh; overflow-y: auto; padding-right: 4px; }
.story-chapter-btn {
    display: flex; align-items: center; gap: 12px; width: 100%;
    border: 2px solid var(--border); background: #fff;
    border-radius: 14px; padding: 12px 14px;
    font-family: inherit; cursor: pointer;
    transition: var(--transition);
}
.story-chapter-btn:hover:not(.locked) { border-color: var(--brand); background: var(--brand-bg); }
.story-chapter-btn.locked { opacity: .5; cursor: not-allowed; }
.story-chapter-btn.done { border-color: #7CB342; }
.story-chapter-idx {
    flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%;
    background: var(--brand-bg); color: var(--brand-dark);
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 800;
}
.story-chapter-btn.done .story-chapter-idx { background: #7CB342; color: #fff; }
.story-chapter-name { flex: 1; min-width: 0; font-size: 14.5px; font-weight: 700; color: var(--text); }
.story-chapter-meta { flex: 0 0 auto; font-size: 12px; color: var(--text-light); }
.story-panel-actions {
    display: flex; flex-wrap: wrap; gap: 10px; justify-content: center;
    margin-top: 20px;
}
.story-panel-foot {
    margin-top: 16px; font-size: 11.5px; color: #B6B9C9; line-height: 1.6;
}

/* 章节完成卡 */
.story-chapter-done .story-panel-card { max-width: 400px; }
.story-done-badge {
    width: 74px; height: 74px; margin: 0 auto 12px;
    border-radius: 50%; background: linear-gradient(145deg, #FFD54A, #F59E0B);
    display: flex; align-items: center; justify-content: center;
    font-size: 34px; box-shadow: 0 10px 28px rgba(245, 158, 11, .4);
}
.story-done-title { font-size: 22px; font-weight: 800; color: var(--text); margin-bottom: 8px; }
.story-done-sub { font-size: 14px; color: var(--text-light); line-height: 1.7; margin-bottom: 20px; }

/* 小屏适配：字幕更窄、控制条更小 */
@media (max-width: 640px) {
    .story-sub { bottom: 26px; padding: 10px 16px; gap: 8px; }
    .story-name { font-size: 13px; padding: 2px 9px; }
    .story-badge { font-size: 11.5px; padding: 7px 11px; }
    .story-progress { width: 96px; }
    .story-ctrl { padding: 6px 9px; font-size: 11.5px; }
    .story-panel-card { padding: 22px 18px 18px; }
    .story-grade-tabs { gap: 5px; }
    .story-grade-tab { padding: 5px 10px; font-size: 12px; }
    /* DR 模板竖屏收窄 */
    .story-overlay.dr-theme .story-tcard { width: 32vw; }
    .story-overlay.dr-theme .story-tcard-name { font-size: 3.4vh; }
    .story-overlay.dr-theme .story-tcard-talent { font-size: 1.5vh; }
    .story-overlay.dr-theme .story-text { padding-left: 34vw; }
    .story-bust img { height: 48vh; }
}

/* ========== 年级轨切换 tab ========== */
.story-grade-tabs {
    display: flex; flex-wrap: wrap; gap: 7px; justify-content: center;
    margin-bottom: 16px;
}
.story-grade-tab {
    border: 2px solid var(--border); background: #fff; border-radius: 999px;
    padding: 6px 14px; font-family: inherit; font-size: 13px; font-weight: 700;
    color: var(--text-light); cursor: pointer; transition: var(--transition);
}
.story-grade-tab:hover { border-color: var(--brand); color: var(--brand-dark); }
.story-grade-tab.active {
    background: var(--brand-dark); border-color: var(--brand-dark); color: #fff;
}

/* ========== 「反对！」盖章（审判节拍） ========== */
.story-objection {
    position: absolute; left: 50%; top: 40%;
    transform: translate(-50%, -50%);
    z-index: 30;
    font-size: clamp(64px, 14vw, 148px); font-weight: 900;
    letter-spacing: .06em; white-space: nowrap;
    color: #FF2E7E;
    -webkit-text-stroke: 3px #FFFFFF;
    text-shadow: 0 0 36px rgba(255, 46, 126, .7), 0 10px 0 rgba(0, 0, 0, .35);
    pointer-events: none;
}

/* ========== CG 演出层（尸体发现 / 现场还原 / 审判全景） ========== */
.story-cg {
    position: absolute; inset: 0;
    z-index: 26;
    background: #050508;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    pointer-events: none;
}
.story-cg img {
    width: 100%; height: 100%;
    object-fit: cover;
    transform-origin: center;
    will-change: transform;
}
.story-cg::after {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(ellipse at center, transparent 58%, rgba(0, 0, 0, .55) 100%);
    pointer-events: none;
}
.story-cg-cap {
    position: absolute; left: 50%; bottom: 12%;
    transform: translateX(-50%);
    max-width: 82%;
    padding: 12px 26px;
    background: rgba(10, 10, 14, .88);
    border: 2px solid #FF2E7E;
    border-radius: 14px;
    color: #F5F5F5;
    font-size: clamp(15px, 2.2vw, 21px);
    font-weight: 700;
    text-align: center;
    letter-spacing: .04em;
    box-shadow: 0 0 30px rgba(255, 46, 126, .35);
    opacity: 0;
}
.story-overlay.dr-theme .story-cg-cap { border-color: #FF2E7E; }

/* ========== 3D 互动场景（free 节拍：环形站位 · 拖拽旋转 · 点击对话） ========== */
.story-free-hint {
    position: absolute; top: 14px; left: 50%;
    transform: translateX(-50%);
    z-index: 28;
    display: flex; align-items: center; gap: 12px;
    padding: 8px 20px;
    background: rgba(10, 10, 14, .88);
    border: 1.5px solid rgba(255, 46, 126, .7);
    border-radius: 999px;
    color: #F5F5F5;
    font-size: 14px; font-weight: 700; letter-spacing: .04em;
    box-shadow: 0 0 22px rgba(255, 46, 126, .28);
    pointer-events: none;
    white-space: nowrap;
}
.story-free-count {
    display: inline-block;
    min-width: 52px; text-align: center;
    padding: 2px 10px;
    background: #FF2E7E;
    border-radius: 999px;
    color: #fff;
    font-size: 13px;
}
.free-badge { pointer-events: none; }

/* ========== 投票环节（vote 节拍）：点名牌指认真凶 ========== */
.story-vote {
    position: absolute; inset: 0;
    z-index: 30;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 22px;
    background: rgba(5, 5, 8, .82);
    backdrop-filter: blur(2px);
}
.story-vote-title {
    color: #FFFFFF;
    font-size: clamp(22px, 4vw, 38px);
    font-weight: 900; letter-spacing: .08em;
    text-shadow: 0 0 26px rgba(255, 46, 126, .65);
}
.story-vote-grid {
    display: flex; flex-wrap: wrap; justify-content: center;
    gap: 12px;
    max-width: 900px;
    padding: 0 24px;
}
.story-vote-card {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 22px;
    background: #12121a;
    border: 2px solid rgba(255, 46, 126, .45);
    border-radius: 12px;
    color: #F5F5F5;
    font-family: inherit; font-size: 17px; font-weight: 700;
    cursor: pointer;
    transition: border-color .15s, transform .12s, box-shadow .15s;
}
.story-vote-card:hover {
    border-color: #FF2E7E;
    transform: translateY(-3px);
    box-shadow: 0 6px 22px rgba(255, 46, 126, .3);
}
.story-vote-card.wrong {
    border-color: #555; color: #777;
    animation: voteWrong .5s ease;
}
.story-vote-card.correct {
    border-color: #FFD54A;
    background: #2A1F33;
    box-shadow: 0 0 34px rgba(255, 213, 74, .55);
}
@keyframes voteWrong {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-7px); }
    75% { transform: translateX(7px); }
}
.story-vote-dot {
    width: 12px; height: 12px; border-radius: 50%;
    flex: 0 0 auto;
}
.story-vote-tip {
    color: #B9B9C4;
    font-size: 15px; font-weight: 700;
    min-height: 22px;
}

/* ========== 现场调查（img clues）：点击翻线索 ========== */
.story-clue-tag {
    position: absolute; top: 62px; left: 50%;
    transform: translateX(-50%);
    z-index: 29;
    padding: 7px 18px;
    background: rgba(10, 10, 14, .9);
    border: 1.5px solid rgba(255, 46, 126, .7);
    border-radius: 999px;
    color: #F5F5F5;
    font-size: 14px; font-weight: 700; letter-spacing: .04em;
    box-shadow: 0 0 22px rgba(255, 46, 126, .3);
    pointer-events: none;
    white-space: nowrap;
}
.story-clue-card {
    position: absolute; left: 50%; bottom: 20%;
    transform: translateX(-50%);
    z-index: 29;
    max-width: 72%;
    padding: 16px 28px;
    background: rgba(10, 10, 14, .94);
    border: 2px solid #FF2E7E;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 0 34px rgba(255, 46, 126, .4);
    pointer-events: none;
}
.story-clue-name {
    color: #FF7AB5;
    font-size: 18px; font-weight: 900;
    margin-bottom: 8px;
    letter-spacing: .04em;
}
.story-clue-text {
    color: #F5F5F5;
    font-size: 15px; line-height: 1.6;
}
.story-cg[data-hunt='1'] { cursor: crosshair; }

/* ========== 自由活动时间（ft 节拍 · 第一人称伪 3D 环视） ========== */
.story-ft-hud {
    position: absolute; left: 52px; right: 52px; top: 30px; z-index: 60;
    display: flex; align-items: baseline; gap: 18px;
    pointer-events: none;
}
.story-ft-title {
    font-size: 25px; font-weight: 800; letter-spacing: 3px; color: #FF2E7E;
    text-shadow: 0 0 20px rgba(255, 46, 126, .5); white-space: nowrap;
}
.story-ft-hint { color: #C9C9D4; font-size: 14px; letter-spacing: .5px; }
.story-ft-count {
    margin-left: auto; color: #FF7AB5; font-size: 17px; font-weight: 800;
    background: rgba(10, 10, 14, .8); border: 1px solid rgba(255, 46, 126, .5);
    border-radius: 999px; padding: 4px 16px; letter-spacing: 1px;
}
.story-ft-end {
    position: absolute; right: 52px; bottom: 118px; z-index: 60;
    background: rgba(12, 12, 16, .9); color: #F5F5F5;
    border: 2px solid rgba(255, 255, 255, .4); border-radius: 999px;
    font-size: 15px; font-weight: 700; letter-spacing: 1px;
    padding: 10px 26px; cursor: pointer; transition: .22s;
}
.story-ft-end:hover { border-color: #FF2E7E; color: #FF7AB5; }
.story-ft-end.ready {
    border-color: #FF2E7E; color: #FFFFFF;
    animation: ft-ready 1.2s ease-in-out infinite;
}
.story-ft-3d { right: auto; left: 52px; border-color: rgba(255, 46, 126, .55); }
/* 3D 漫游全屏覆盖层 */
.story-3d-wrap { position: fixed; inset: 0; z-index: 4000; background: #050507; display: flex; flex-direction: column; }
.story-3d-bar {
    flex: none; height: 46px; display: flex; align-items: center; justify-content: space-between;
    padding: 0 14px 0 22px; background: linear-gradient(180deg, #121218, #0a0a0d);
    border-bottom: 1px solid rgba(255, 46, 126, .35);
}
.story-3d-title { color: #CFCFDA; font-size: 13px; letter-spacing: 5px; }
.story-3d-x {
    cursor: pointer; color: #9A9AA8; font-size: 13px; letter-spacing: 2px;
    padding: 7px 18px; border-radius: 999px;
    border: 1px solid rgba(255,255,255,.3); background: rgba(12,12,14,.72);
}
.story-3d-x:hover { color: #FF7AB5; border-color: #FF2E7E; }
.story-3d-wrap iframe { flex: 1; width: 100%; border: 0; display: block; }
@keyframes ft-ready {
    0%, 100% { box-shadow: 0 0 0 rgba(255,46,126,0); }
    50% { box-shadow: 0 0 22px rgba(255,46,126,.55); }
}

/* ========== DR 对话名片（贴边大块名牌：红黑斜纹 · 名字 + 称号） ========== */
.story-tcard { position: absolute; left: 0; top: 0; z-index: 38; width: 236px; pointer-events: none; }
.story-tcard.hidden { display: none; }
.story-tcard-name {
    background:
        repeating-linear-gradient(135deg, rgba(0,0,0,.30) 0 11px, transparent 11px 26px),
        linear-gradient(160deg, #c01434, #6e0a1c 88%);
    color: #FFFFFF;
    font-size: 31px; font-weight: 900; letter-spacing: 7px;
    min-height: 92px;
    display: flex; align-items: center;
    padding: 20px 22px 16px 24px;
    box-sizing: border-box;
    text-shadow: 0 3px 0 rgba(0, 0, 0, .55), 0 0 18px rgba(255, 255, 255, .18);
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 26px), calc(100% - 34px) 100%, 0 100%);
    filter: drop-shadow(4px 8px 14px rgba(0, 0, 0, .55));
    white-space: nowrap;
}
.story-tcard-talent {
    background: linear-gradient(180deg, #14141a, #050508);
    color: #FF7AB5;
    font-size: 15px; font-weight: 700; letter-spacing: 4px;
    padding: 10px 24px;
    width: 86%;
    box-sizing: border-box;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 12px), calc(100% - 16px) 100%, 0 100%);
    filter: drop-shadow(4px 8px 12px rgba(0, 0, 0, .5));
}

/* ========== DR 对话模板（用户定版）：CASE 黑标 + 红黑斜纹名牌 + 通栏橙红条/米黄线 + 棋盘格渐隐黑底 ========== */
/* 说话者半身像：从通栏黑条后升起，水平居中，z 低于对话框 */
.story-bust {
    position: absolute; left: 0; right: 0; bottom: 24.5vh;
    z-index: 9; display: flex; justify-content: center;
    pointer-events: none;
}
.story-bust.hidden { display: none; }
.story-bust img {
    height: 60vh; width: auto; display: block;
    filter: drop-shadow(0 12px 26px rgba(0, 0, 0, .55));
}
/* DR 定版：半身像限定在对话框右侧绿色区域（左起 18.6vw），从橙红条后升起 */
.story-overlay.dr-theme .story-bust {
    left: 18.6vw; right: 0; bottom: 30vh;
    justify-content: center;
}
.story-overlay.dr-theme .story-bust img {
    height: 68vh;
}

/* CASE 黑色斜切标（贴在名牌左上） */
.story-overlay.dr-theme .story-tcard { width: 23.5vw; }
.story-overlay.dr-theme .story-tcard::before {
    content: 'CASE';
    position: absolute; left: 0; top: 0; z-index: 4;
    width: 12.5vw; height: 7vh; box-sizing: border-box;
    background: #0A0A0D; color: #F5F5F5;
    font-size: 3vh; font-weight: 900; letter-spacing: .25vw;
    display: flex; align-items: center; padding-left: 1.3vw;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 2.4vh), calc(100% - 2.8vh) 100%, 0 100%);
}
/* 红黑斜纹名字面板：满版人物图 + 外红内米双层描边，底部渐黑名字区 */
.story-overlay.dr-theme .story-tcard-name {
    position: relative; overflow: hidden;
    margin-top: 7vh; min-height: 0; height: 57.5vh; box-sizing: border-box;
    padding: 0; justify-content: center; text-align: center;
    background:
        repeating-linear-gradient(135deg, rgba(0, 0, 0, .42) 0 1.1vh, transparent 1.1vh 2.4vh),
        linear-gradient(160deg, #d4202e, #8f1020);
    clip-path: none; border: none;
    box-shadow: 0 0 0 2px #c01434, 4px 8px 14px rgba(0, 0, 0, .55);
}
/* 满版人物图（每人 1 张，无图时回退斜纹底） */
.story-tcard-img { display: none; }
.story-overlay.dr-theme .story-tcard-img {
    display: block; position: absolute; inset: 0; z-index: 0;
    width: 100%; height: 100%; object-fit: cover; object-position: center top;
}
/* 底部黑色渐隐名字区 + 米色内框（盖在图上） */
.story-overlay.dr-theme .story-tcard-name::after {
    content: ''; position: absolute; inset: 0; z-index: 2; pointer-events: none;
    background: linear-gradient(180deg, rgba(8, 8, 11, 0) 44%, rgba(8, 8, 11, .55) 70%, rgba(6, 6, 9, .97) 100%);
    box-shadow: inset 0 0 0 2px rgba(232, 223, 192, .92);
}
/* 名字落在黑色名字区 */
.story-overlay.dr-theme .story-tcard-nametext {
    position: absolute; left: 0; right: 0; bottom: 4.6vh; z-index: 3;
    color: #FFFFFF;
    font-size: 4.2vh; font-weight: 900; letter-spacing: .4vw; line-height: 1.25;
    white-space: nowrap;
    text-shadow: 0 3px 0 rgba(0, 0, 0, .6), 0 0 18px rgba(255, 255, 255, .18);
}
/* 称号落在名字下方黑色区 */
.story-overlay.dr-theme .story-tcard-talent {
    position: absolute; left: 0; bottom: 1.4vh; z-index: 3; width: 100%; box-sizing: border-box;
    background: none; box-shadow: none; filter: none; clip-path: none;
    color: #FF9EC2; font-size: 1.65vh; font-weight: 700; letter-spacing: .12vw;
    padding: 0 1vw; text-align: center;
}

/* 通栏黑底对话框 */
.story-overlay.dr-theme .story-sub {
    left: 0; right: 0; bottom: 0; transform: none;
    width: 100%; max-width: none;
    display: flex; align-items: center;
    min-height: 27vh; padding: 0;
    background: #0A0A0D;
    border: none; border-radius: 0;
    box-shadow: 0 -10px 34px rgba(0, 0, 0, .62);
}
/* 橙红横条（65%~68.4%，右端渐隐）+ 米黄细线 */
.story-overlay.dr-theme .story-sub::before {
    content: '';
    position: absolute; left: 0; right: 0; top: -7.8vh; height: 3.2vh;
    background: linear-gradient(90deg, #FF5243 0%, #FF5243 58%, rgba(255, 82, 67, 0) 92%);
    border-bottom: .55vh solid #E7DEBE;
}
/* 左侧黑灰棋盘格，向右渐隐为纯黑 */
.story-overlay.dr-theme .story-sub::after {
    content: '';
    position: absolute; left: 0; top: 0; width: 48vw; height: 13.5vh;
    background: conic-gradient(#2B2B31 90deg, #0C0C10 90deg 180deg, #2B2B31 180deg 270deg, #0C0C10 270deg) 0 0 / 6.75vh 6.75vh;
    -webkit-mask-image: linear-gradient(90deg, #000 55%, transparent 97%);
    mask-image: linear-gradient(90deg, #000 55%, transparent 97%);
    pointer-events: none;
}
.story-overlay.dr-theme .story-name { display: none; }
.story-overlay.dr-theme .story-text {
    position: relative; z-index: 1;
    margin-left: 0; padding-left: 25.5vw; padding-right: 5vw;
    color: #F2F2F2;
    font-size: clamp(15px, 1.9vh, 21px); line-height: 1.65;
}
/* 点击提示落在黑盒右下角 */
.story-overlay.dr-theme .story-click-hint {
    left: auto; right: 2vw; bottom: 2vh; transform: none;
}

/* ========== 弹丸论破主题（六年级审判轨） ========== */
/* overlay 层：黑白粉（字幕条样式见上方「DR 对话框」块） */
.story-overlay.dr-theme .story-text { color: #F5F5F5; }
.story-overlay.dr-theme .story-title-main {
    color: #FFFFFF; text-shadow: 0 0 22px rgba(255, 46, 126, .55), 0 4px 18px rgba(0, 0, 0, .8);
}
.story-overlay.dr-theme .story-title-sub { color: #FF2E7E; }
.story-overlay.dr-theme .story-badge {
    background: rgba(12, 12, 14, .85); color: #FF2E7E;
    border: 1px solid rgba(255, 46, 126, .5);
}
.story-overlay.dr-theme .story-progress { background: rgba(255, 255, 255, .16); }
.story-overlay.dr-theme .story-progress-fill { background: linear-gradient(90deg, #FF2E7E, #FF7AB5); }
.story-overlay.dr-theme .story-ctrl {
    background: rgba(12, 12, 14, .85); color: #F5F5F5;
    border: 1px solid rgba(255, 255, 255, .35);
}
.story-overlay.dr-theme .story-ctrl:hover { background: #FF2E7E; border-color: #FF2E7E; }
.story-overlay.dr-theme .story-click-hint { color: #FF7AB5; }
.story-overlay.dr-theme .story-panel, .story-overlay.dr-theme .story-chapter-done {
    background: rgba(8, 8, 10, .88);
}
.story-overlay.dr-theme .story-panel-card {
    background: #101014; color: #F5F5F5;
    border: 2px solid #FF2E7E;
    box-shadow: 0 0 44px rgba(255, 46, 126, .3);
}
.story-overlay.dr-theme .story-panel-title { color: #FFFFFF; }
.story-overlay.dr-theme .story-panel-sub { color: #B9B9C4; }
.story-overlay.dr-theme .story-grade-tab {
    background: #17171D; border-color: rgba(255, 255, 255, .28); color: #CFCFDA;
}
.story-overlay.dr-theme .story-grade-tab:hover { border-color: #FF2E7E; color: #FF7AB5; }
.story-overlay.dr-theme .story-grade-tab.active {
    background: #FF2E7E; border-color: #FF2E7E; color: #FFFFFF;
}
.story-overlay.dr-theme .story-chapter-btn {
    background: #17171D; border-color: rgba(255, 255, 255, .22);
}
.story-overlay.dr-theme .story-chapter-btn:hover:not(.locked) {
    border-color: #FF2E7E; background: rgba(255, 46, 126, .12);
}
.story-overlay.dr-theme .story-chapter-name { color: #F5F5F5; }
.story-overlay.dr-theme .story-chapter-meta { color: #9A9AA8; }
.story-overlay.dr-theme .story-chapter-idx {
    background: rgba(255, 46, 126, .18); color: #FF7AB5;
}
.story-overlay.dr-theme .story-chapter-btn.done { border-color: #FF2E7E; }
.story-overlay.dr-theme .story-chapter-btn.done .story-chapter-idx { background: #FF2E7E; color: #fff; }
.story-overlay.dr-theme .story-panel-foot { color: #7E7E8C; }
.story-overlay.dr-theme .story-done-title { color: #FFFFFF; }
.story-overlay.dr-theme .story-done-text { color: #CFCFDA; }

/* 战斗界面：审判进行中也走黑白粉（body 类名由引擎挂载） */
body.dr-theme .adv-battle {
    background: #101014; border: 2px solid #FF2E7E;
    box-shadow: 0 0 44px rgba(255, 46, 126, .3);
}
body.dr-theme .adv-stage-label { color: #F5F5F5; }
body.dr-theme .adv-progress-bar { background: rgba(255, 255, 255, .14); }
body.dr-theme .adv-progress-fill { background: linear-gradient(90deg, #FF2E7E, #FF7AB5); }
body.dr-theme .adv-enemy-area { background: radial-gradient(ellipse at center, rgba(255, 46, 126, .16) 0%, transparent 70%); }
body.dr-theme .adv-enemy-name { color: #FF7AB5; }
body.dr-theme .adv-question-card {
    background: #17171D; border-color: rgba(255, 46, 126, .45);
}
body.dr-theme .adv-question-card .question-text { color: #F5F5F5; }
body.dr-theme .adv-result-title.perfect { color: #FF2E7E; }
body.dr-theme .adv-result-title.pass { color: #FF7AB5; }
body.dr-theme .adv-result-title.fail { color: #B9B9C4; }
body.dr-theme .adv-result-desc { color: #CFCFDA; }
body.dr-theme .adv-result-star { color: rgba(255, 255, 255, .22); }
body.dr-theme .adv-result-star.on {
    color: #FF2E7E; text-shadow: 0 0 16px rgba(255, 46, 126, .7), 0 2px 4px rgba(0, 0, 0, .4);
}
