:root {
    --bg: #0d1117;
    --surface: #161b22;
    --card: #1c2128;
    --border: #30363d;
    --text: #e6edf3;
    --muted: #7d8590;
    --accent: #e8a84b;
    --accent2: #d63e3e;
    --success: #3fb950;
    --blue: #58a6ff;
    --purple: #bc8cff;
    --hero-top: #1a1030;
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}
html,
body {
    height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
    overflow: hidden;
}
/* 修复移动端 100vh 包含地址栏的问题 */
.page {
    height: 100vh;
    height: 100dvh;
}

/* ─── 页面容器 ──────────────────────────────── */
.page {
    display: none;
    height: 100vh;
    height: var(--app-height, 100vh);
    flex-direction: column;
}
.page.active {
    display: flex;
}
.page-scroll {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* 神经时代线索标记 */
.clue-neural-badge {
    display: inline-flex;
    align-items: center;
    margin-right: 6px;
    padding: 1px 7px;
    border-radius: 999px;
    border: 1px solid rgba(88, 166, 255, 0.45);
    background: rgba(88, 166, 255, 0.12);
    color: var(--blue);
    font-size: 10px;
    font-weight: 600;
    line-height: 1.6;
    vertical-align: middle;
}

.clue-neural-meaning {
    margin-top: 6px;
    padding-left: 10px;
    border-left: 2px solid rgba(88, 166, 255, 0.45);
    color: var(--muted);
    font-size: 11px;
    line-height: 1.6;
}

/* 成就解锁 toast */
.achievement-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 500;
    background: rgba(28, 33, 40, 0.96);
    border: 1px solid var(--accent);
    border-radius: 12px;
    padding: 14px 20px;
    max-width: 320px;
    animation:
        achSlideIn 0.4s ease,
        achFadeOut 0.5s ease 4.5s forwards;
}
.ach-toast-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 8px;
}
.ach-toast-item {
    font-size: 12px;
    color: var(--text);
    line-height: 1.6;
}
@keyframes achSlideIn {
    from {
        transform: translateX(-50%) translateY(-30px);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}
@keyframes achFadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* ─── 通用顶部 ─────────────────────────────── */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    min-height: 56px;
}
.topbar h1 {
    font-size: 17px;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 1px;
}
.profile-btn {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 13px;
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s;
}
.profile-btn:active {
    border-color: var(--accent);
    color: var(--accent);
}
.topbar .badge {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 12px;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 5px;
}
.dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--success);
    animation: blink 2s infinite;
}
@keyframes blink {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.3;
    }
}

/* ─── 通知铃铛 ─────────────────────────────── */
.notif-bell {
    position: relative;
    font-size: 22px;
    cursor: pointer;
    padding: 4px;
}
.notif-badge {
    position: absolute;
    top: 0;
    right: -4px;
    min-width: 16px;
    height: 16px;
    line-height: 16px;
    padding: 0 4px;
    background: #e8a84b;
    color: #fff;
    font-size: 10px;
    border-radius: 8px;
    text-align: center;
}
.notif-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
}
.notif-modal-content {
    background: var(--surface);
    border-radius: 16px;
    width: 90%;
    max-width: 400px;
    max-height: 70vh;
    overflow-y: auto;
    padding: 20px;
}
.notif-item {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}
.notif-item:last-child {
    border-bottom: none;
}
.notif-body {
    font-size: 14px;
    color: var(--text);
}
.notif-time {
    font-size: 11px;
    color: var(--muted);
    margin-top: 4px;
}
.notif-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}
.notif-actions .btn-small {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    border: none;
    cursor: pointer;
}
.notif-actions .btn-primary {
    background: var(--primary);
    color: #fff;
}
.notif-actions .btn-danger {
    background: #dc3545;
    color: #fff;
}

/* ─── 个人中心 ─────────────────────────────── */
#page-profile {
    justify-content: flex-start;
    overflow-y: auto;
}
.profile-header {
    text-align: center;
    padding: 40px 24px 30px;
    background: linear-gradient(180deg, var(--hero-top) 0%, var(--bg) 100%);
}
.profile-avatar {
    font-size: 72px;
    margin-bottom: 12px;
    display: block;
}
.nickname-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 6px;
}
.profile-name {
    font-size: 22px;
    font-weight: 600;
    color: var(--text);
}
.profile-level-badge {
    font-size: 12px;
    color: var(--accent);
    background: var(--accent-15);
    border-radius: 20px;
    padding: 2px 12px;
}
.nickname-dice {
    cursor: pointer;
    font-size: 18px;
    opacity: 0.5;
    transition:
        opacity 0.2s,
        transform 0.3s;
    background: none;
    border: none;
    padding: 2px 4px;
}
.nickname-dice:hover {
    opacity: 0.8;
}
.nickname-dice.spinning {
    animation: spin 0.6s ease;
}
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}
.profile-id-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}
.profile-id {
    font-size: 12px;
    color: var(--muted);
}
.copy-id-btn {
    cursor: pointer;
    font-size: 12px;
    color: var(--accent);
    opacity: 0.8;
    padding: 2px 10px;
    background: var(--accent-10);
    border-radius: 16px;
}
.profile-stats {
    display: flex;
    justify-content: space-around;
    padding: 20px 16px;
    background: var(--card);
    border-radius: 16px;
    margin: 0 16px;
}
.stat-item {
    text-align: center;
}
.stat-val {
    font-size: 28px;
    font-weight: 700;
    color: var(--accent);
}
.stat-label {
    font-size: 12px;
    color: var(--muted);
    margin-top: 4px;
}
.stat-item.small .stat-val {
    font-size: 20px;
}
.streak-hint {
    text-align: center;
    font-size: 12px;
    color: var(--warning);
    padding: 6px 16px 10px;
    margin: 0 16px;
}

.profile-achievements {
    margin: 16px 16px 0;
    padding: 16px;
    background: var(--card);
    border-radius: 12px;
}
.ach-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.ach-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--accent);
}
.ach-view-all {
    font-size: 12px;
    color: var(--accent);
    opacity: 0.9;
    cursor: pointer;
}
.ach-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.ach-item {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 6px 14px;
}
.ach-item.locked {
    opacity: 0.35;
}
.ach-icon {
    font-size: 18px;
}
.ach-name {
    font-size: 12px;
    color: var(--text);
}
.ach-empty {
    padding: 8px 0;
    font-size: 12px;
    color: var(--muted);
}

/* 成就弹层 */
.ach-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 200;
    display: flex;
    align-items: flex-end;
}
.ach-sheet {
    width: 100%;
    background: var(--card);
    border-radius: 20px 20px 0 0;
    padding-bottom: env(safe-area-inset-bottom);
    max-height: 75vh;
}
.ach-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 12px;
    border-bottom: 1px solid var(--border);
}
.ach-sheet-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
}
.ach-sheet-count {
    font-size: 12px;
    color: var(--muted);
}
.ach-sheet-close {
    font-size: 20px;
    color: var(--muted);
    cursor: pointer;
    padding: 4px 8px;
}
.ach-sheet-scroll {
    max-height: 60vh;
    overflow-y: auto;
    padding: 16px 24px 24px;
}
.ach-section {
    margin-bottom: 20px;
}
.ach-section-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.ach-full-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.ach-full-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--surface);
    border-radius: 10px;
    border: 1px solid var(--border);
}
.ach-full-item.ach-unlocked {
    border-color: rgba(232, 168, 75, 0.3);
    background: rgba(232, 168, 75, 0.05);
}
.ach-full-item.ach-locked {
    opacity: 0.5;
}
.ach-full-icon {
    font-size: 28px;
    width: 36px;
    text-align: center;
    flex-shrink: 0;
}
.ach-locked-icon {
    filter: grayscale(100%);
    opacity: 0.5;
}
.ach-full-info {
    flex: 1;
}
.ach-full-name {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
}
.ach-full-desc {
    display: block;
    font-size: 12px;
    color: var(--muted);
}
.ach-full-check {
    font-size: 16px;
    color: var(--success);
    flex-shrink: 0;
}

/* 帮助弹层 */
.help-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 200;
    display: flex;
    align-items: flex-end;
}
.help-sheet {
    width: 100%;
    background: var(--card);
    border-radius: 20px 20px 0 0;
    padding-bottom: env(safe-area-inset-bottom);
    max-height: 80vh;
}
.help-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 12px;
    border-bottom: 1px solid var(--border);
}
.help-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
}
.help-close {
    font-size: 20px;
    color: var(--muted);
    cursor: pointer;
    padding: 4px 8px;
}
.help-scroll {
    max-height: 68vh;
    overflow-y: auto;
    padding: 16px 24px 24px;
}
.help-section {
    margin-bottom: 20px;
}
.help-section:last-child {
    margin-bottom: 0;
}
.help-section-title {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}
.help-section-text {
    display: block;
    font-size: 13px;
    color: var(--muted);
    line-height: 1.7;
}

.profile-menu {
    padding: 24px 16px;
}
.menu-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: var(--card);
    border-radius: 12px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s;
}
.menu-item:active {
    background: var(--surface);
}
.menu-icon {
    font-size: 24px;
    width: 32px;
    text-align: center;
    flex-shrink: 0;
}
.menu-text {
    flex: 1;
}
.menu-title {
    font-size: 15px;
    color: var(--text);
}
.menu-arrow {
    color: var(--muted);
    font-size: 18px;
    flex-shrink: 0;
}

/* ─── 排行榜 ───────────────────────────────── */
#page-leaderboard {
    justify-content: flex-start;
    overflow-y: auto;
}
.leaderboard-tabs {
    display: flex;
    padding: 16px;
    gap: 8px;
}
.lb-tab {
    flex: 1;
    padding: 10px;
    text-align: center;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    color: var(--muted);
    cursor: pointer;
}
.lb-tab.active {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(232, 168, 75, 0.1);
}
.lb-list {
    padding: 0 16px 24px;
}
.lb-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--card);
    border-radius: 12px;
    margin-bottom: 10px;
}
.lb-rank {
    width: 28px;
    font-size: 16px;
    font-weight: 600;
    color: var(--muted);
    text-align: center;
}
.lb-rank.top1 {
    color: #ffd700;
    font-size: 22px;
}
.lb-rank.top2 {
    color: #c0c0c0;
    font-size: 20px;
}
.lb-rank.top3 {
    color: #cd7f32;
    font-size: 18px;
}
.lb-avatar {
    font-size: 32px;
}
.lb-info {
    flex: 1;
}
.lb-name {
    font-size: 15px;
    font-weight: 500;
    color: var(--text);
}
.lb-meta {
    font-size: 12px;
    color: var(--muted);
}
.lb-score {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent);
}
.lb-me {
    background: rgba(232, 168, 75, 0.15);
    border: 1px solid var(--accent);
}
.lb-sort-tabs {
    display: flex;
    padding: 0 16px 12px;
    gap: 6px;
}
.lb-sort {
    padding: 4px 12px;
    font-size: 12px;
    color: var(--muted);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    cursor: pointer;
}
.lb-sort.active {
    color: var(--accent);
    border-color: var(--accent);
    background: rgba(232, 168, 75, 0.1);
}
.lb-pager {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    padding: 12px 16px 24px;
}
.lb-page-btn {
    padding: 6px 16px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 13px;
    cursor: pointer;
}
.lb-page-info {
    font-size: 13px;
    color: var(--muted);
}

/* ─── 历史记录 ──────────────────────────────── */
.history-list {
    padding: 0 16px 24px;
}
.history-item {
    padding: 14px 16px;
    background: var(--card);
    border-radius: 12px;
    margin-bottom: 10px;
}
.history-title {
    font-size: 14px;
    color: var(--text);
    margin-bottom: 8px;
}
.history-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--muted);
    flex-wrap: wrap;
}
.history-win {
    color: var(--success);
}
.history-lose {
    color: var(--accent2);
}
.history-score {
    font-weight: 600;
    color: var(--accent);
}

/* ─── 首页 ─────────────────────────────────── */
#page-home {
    justify-content: flex-start;
    overflow-y: auto;
}
.hero {
    text-align: center;
    padding: 40px 24px 30px;
    background: linear-gradient(180deg, var(--hero-top) 0%, var(--bg) 100%);
}
.hero-icon {
    font-size: 60px;
    margin-bottom: 12px;
}
.hero h2 {
    font-size: 26px;
    color: var(--accent);
    margin-bottom: 8px;
    letter-spacing: 2px;
}
.hero p {
    font-size: 14px;
    color: var(--muted);
    line-height: 1.6;
    max-width: 300px;
    margin: 0 auto 24px;
}
.hero-tags {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 28px;
}

/* ─── 广播跑马灯 ─────────────────────────── */
.broadcast-bar {
    display: flex;
    align-items: center;
    background: var(--card);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 8px 16px;
    margin-bottom: 12px;
    overflow: hidden;
}
.broadcast-icon {
    flex-shrink: 0;
    font-size: 14px;
    margin-right: 8px;
}
.broadcast-scroll {
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
}
.broadcast-text {
    display: inline-block;
    white-space: nowrap;
    animation: broadcast-marquee 12s linear infinite;
    font-size: 13px;
    color: var(--muted);
}
@keyframes broadcast-marquee {
    0% {
        transform: translateX(100%);
    }
    100% {
        transform: translateX(-100%);
    }
}
.tag {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 5px 12px;
    font-size: 12px;
    color: var(--muted);
}
.tag.active {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(232, 168, 75, 0.1);
}

.difficulty-select {
    padding: 0 24px 20px;
}
.difficulty-select label {
    display: block;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 10px;
}
.diff-btns {
    display: flex;
    gap: 8px;
}
.diff-btn {
    flex: 1;
    padding: 10px 0;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--muted);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}
.diff-btn.sel {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(232, 168, 75, 0.1);
}
.diff-btn.locked {
    opacity: 0.35;
    cursor: not-allowed;
    position: relative;
}
.diff-btn.locked::after {
    content: "🔒";
    font-size: 10px;
    position: absolute;
    top: 2px;
    right: 2px;
}

.source-select {
    padding: 0 24px 20px;
}
.source-select label {
    display: block;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 10px;
}
.source-btns {
    display: flex;
    gap: 8px;
}
.source-btn {
    flex: 1;
    padding: 10px 8px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--muted);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}
.source-btn .icon {
    display: block;
    font-size: 20px;
    margin-bottom: 4px;
}
.source-btn .desc {
    font-size: 10px;
    color: var(--muted);
}
.source-btn.sel {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(232, 168, 75, 0.1);
}
.source-btn.sel .desc {
    color: var(--accent);
    opacity: 0.8;
}

.start-btn {
    display: block;
    width: calc(100% - 48px);
    margin: 0 auto 24px;
    padding: 15px;
    border-radius: 14px;
    border: none;
    background: linear-gradient(135deg, var(--accent), #d4852b);
    color: #fff;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 2px;
    box-shadow: 0 4px 20px rgba(232, 168, 75, 0.3);
}
.start-btn:active {
    transform: scale(0.97);
}
.start-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.mode-btn {
    display: block;
    width: calc(100% - 48px);
    margin: 0 auto 12px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(232, 168, 75, 0.55);
    background: linear-gradient(135deg, rgba(232, 168, 75, 0.22), rgba(88, 166, 255, 0.12));
    color: var(--text);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.16);
    transition: all 0.2s;
}
.mode-btn:active { transform: scale(0.97); }
.mode-picker {
    display: none;
    width: calc(100% - 48px);
    margin: 0 auto 16px;
    padding: 12px;
    border-radius: 12px;
    background: var(--card);
    border: 1px solid var(--border);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.14);
}
.mode-picker button {
    display: block;
    width: 100%;
    margin: 6px 0;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid rgba(232, 168, 75, 0.32);
    background: linear-gradient(135deg, rgba(232, 168, 75, 0.16), rgba(88, 166, 255, 0.08));
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s;
}
.mode-picker button:active { background: var(--border); transform: scale(0.98); }

.story-btn {
    display: block;
    width: calc(100% - 48px);
    margin: 0 auto 12px;
    padding: 12px;
    border-radius: 14px;
    border: 1px solid rgba(88, 166, 255, 0.4);
    background: linear-gradient(135deg, rgba(88, 166, 255, 0.15), rgba(188, 140, 255, 0.15));
    color: var(--blue);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 1px;
    box-shadow: 0 2px 12px rgba(88, 166, 255, 0.15);
}
.story-btn:active {
    transform: scale(0.97);
}
.story-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 剧情模式介绍 */
.story-intro {
    margin: 0 24px 12px;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
}
.story-header {
    font-size: 16px;
    font-weight: 700;
    color: var(--blue);
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}
.story-synopsis {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.8;
    margin-bottom: 12px;
}
.story-chars {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.story-char {
    display: flex;
    gap: 10px;
    padding: 10px;
    background: var(--card);
    border-radius: 10px;
    border: 1px solid var(--border);
}
.story-char-avatar {
    font-size: 28px;
    flex-shrink: 0;
    width: 40px;
    text-align: center;
    line-height: 40px;
}
.story-char-info {
    flex: 1;
    min-width: 0;
}
.story-char-name {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 1px;
}
.story-char-role {
    display: block;
    font-size: 11px;
    color: var(--blue);
    margin-bottom: 4px;
}
.story-char-desc {
    display: block;
    font-size: 12px;
    color: var(--muted);
    line-height: 1.5;
}

/* 神经同步状态标记 */
.neural-sync-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    border: 1px solid rgba(88, 166, 255, 0.5);
    background: rgba(88, 166, 255, 0.1);
    color: var(--blue);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* 案件介绍弹层 - 神经时代元信息 */
.intro-neural-meta {
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(88, 166, 255, 0.08);
    border: 1px solid rgba(88, 166, 255, 0.2);
    font-size: 12px;
    color: var(--blue);
    line-height: 1.6;
}

/* 好友对比 */
#friend-compare-box {
    margin: 12px 0;
    padding: 12px;
    background: var(--card);
    border-radius: 10px;
}
.compare-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}
.compare-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}
.compare-item:last-child {
    border-bottom: none;
}
.compare-name {
    flex: 1;
    color: var(--text);
}
.compare-result.win {
    color: var(--success);
}
.compare-result.lose {
    color: #d63e3e;
}
.compare-score {
    color: var(--muted);
    font-size: 11px;
}
.daily-btn {
    display: block;
    width: calc(100% - 48px);
    margin: 4px auto 8px;
    padding: 12px;
    border-radius: 14px;
    border: 1px solid #d63e3e;
    background: rgba(214, 62, 62, 0.12);
    color: #d63e3e;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 1px;
}
.daily-btn:active { transform: scale(0.97); }
.weekly-btn {
    display: block;
    width: calc(100% - 48px);
    margin: 4px auto 8px;
    padding: 12px;
    border-radius: 14px;
    border: 1px solid #58a6ff;
    background: rgba(88, 166, 255, 0.12);
    color: #58a6ff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 1px;
}
.weekly-btn:active { transform: scale(0.97); }

.save-case-btn {
    display: block;
    width: 100%;
    margin-top: 12px;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--muted);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}
.save-case-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.save-case-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.library-btn {
    display: block;
    width: calc(100% - 48px);
    margin: 0 auto 24px;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--muted);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ─── 案件库 ───────────────────────────────── */
#page-library {
    justify-content: flex-start;
    overflow-y: auto;
}
.back-btn {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 15px;
    cursor: pointer;
    padding: 4px 8px;
}
.library-filters {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}
.filter-btns {
    display: flex;
    gap: 8px;
}
.filter-btn {
    flex: 1;
    padding: 8px 0;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--muted);
    font-size: 13px;
    cursor: pointer;
}
.filter-btn.sel {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(232, 168, 75, 0.1);
}
.library-list {
    padding: 12px 16px;
}
.lib-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 10px;
}
.lib-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.lib-card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}
.lib-card-tags {
    display: flex;
    gap: 6px;
}
.lib-tag {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 6px;
}
.lib-tag.easy {
    background: rgba(63, 185, 80, 0.15);
    color: var(--success);
}
.lib-tag.medium {
    background: rgba(232, 168, 75, 0.15);
    color: var(--accent);
}
.lib-tag.hard {
    background: rgba(214, 62, 62, 0.15);
    color: var(--accent2);
}
.lib-tag.hell {
    background: rgba(163, 53, 248, 0.15);
    color: #a335f8;
}
.lib-tag.preset {
    background: rgba(88, 166, 255, 0.15);
    color: var(--blue);
}
.lib-tag.ai {
    background: rgba(188, 140, 255, 0.15);
    color: var(--purple);
}
.lib-card-brief {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.5;
    margin-bottom: 10px;
}
.lib-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.lib-card-time {
    font-size: 11px;
    color: var(--muted);
}
.lib-card.played {
    border-left: 3px solid var(--success);
}
.lib-section-title {
    font-size: 13px;
    color: var(--muted);
    margin: 16px 0 8px;
    padding-left: 4px;
    font-weight: 600;
}
.played-mark {
    font-size: 13px;
}
.lib-card-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}
.lib-play-btn {
    padding: 6px 16px;
    border-radius: 6px;
    border: none;
    background: var(--accent);
    color: #fff;
    font-size: 12px;
    cursor: pointer;
    font-weight: 600;
}
.lib-play-btn:hover {
    opacity: 0.9;
}
.lib-records-btn {
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--muted);
    font-size: 12px;
    cursor: pointer;
}
.lib-records-btn:hover {
    color: var(--accent);
    border-color: var(--accent);
}
.lib-records-panel {
    border-top: 1px solid var(--border);
    margin-top: 10px;
    padding-top: 8px;
}
.lib-record-item {
    display: flex;
    gap: 10px;
    font-size: 12px;
    color: var(--muted);
    padding: 6px 0;
    border-bottom: 1px dashed var(--border);
}
.lib-record-item:last-child {
    border-bottom: none;
}
.lib-record-date {
    margin-left: auto;
    font-size: 11px;
}
.lib-empty {
    text-align: center;
    padding: 60px 24px;
    color: var(--muted);
}
.lib-empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
}
.lib-empty-text {
    font-size: 14px;
}

/* 商店 */
.shop-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 16px 24px;
}
.shop-card {
    background: var(--card);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    position: relative;
    transition:
        border-color 0.3s,
        box-shadow 0.3s;
}
.shop-card .item-icon {
    font-size: 32px;
    display: block;
    margin-bottom: 8px;
}
.shop-card .item-name {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 4px;
}
.shop-card .item-desc {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 8px;
}
.shop-card .item-price {
    color: var(--accent);
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 8px;
}
.shop-owned-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--accent);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 10px;
    padding: 2px 8px;
    min-width: 20px;
    text-align: center;
}
.shop-buy-btn {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 6px 16px;
    font-size: 12px;
    cursor: pointer;
    font-weight: 600;
    transition:
        opacity 0.2s,
        transform 0.15s;
    box-sizing: border-box;
    display: inline-block;
}
.shop-gift-btn {
    background: var(--surface);
    color: var(--muted);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 16px;
    font-size: 12px;
    cursor: pointer;
    margin-left: 6px;
    transition: opacity 0.2s;
    box-sizing: border-box;
    display: inline-block;
}
.shop-buy-btn:hover {
    opacity: 0.9;
    transform: scale(1.03);
}
.shop-buy-btn:active {
    transform: scale(0.97);
}
.shop-buy-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}
/* 购买成功动画 */
.score-flash {
    animation: scoreFlash 0.6s ease;
}
@keyframes scoreFlash {
    0% {
        color: #ff4444;
        transform: scale(1.15);
    }
    100% {
        color: inherit;
        transform: scale(1);
    }
}
.card-flash {
    border-color: var(--accent) !important;
    box-shadow: 0 0 16px rgba(232, 168, 75, 0.5);
}
.badge-pop {
    animation: badgePop 0.35s ease;
}
@keyframes badgePop {
    0% {
        transform: scale(1);
    }
    40% {
        transform: scale(1.5);
    }
    100% {
        transform: scale(1);
    }
}
.shop-inventory {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
}
.shop-inventory h3 {
    font-size: 16px;
    margin-bottom: 12px;
}
.inv-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
}
.inv-item {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    font-size: 12px;
}
.inv-item .inv-icon {
    font-size: 24px;
    display: block;
}
.inv-item .inv-name {
    margin: 4px 0;
    font-weight: 600;
}
.inv-item .inv-qty {
    color: var(--accent);
    font-weight: 700;
}
.inv-gift-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--muted);
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 10px;
    cursor: pointer;
    margin-top: 4px;
}
.inv-gift-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}
/* 赠送弹窗 */
.modal-bg {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-box {
    background: var(--card);
    border-radius: 16px;
    padding: 24px;
    width: 90%;
    max-width: 400px;
}
.modal-box h3 {
    margin-bottom: 12px;
}
.gift-friend-list {
    max-height: 200px;
    overflow-y: auto;
    margin: 12px 0;
}
.gift-friend-item {
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
}
.gift-friend-item.sel {
    border-color: var(--accent);
    background: rgba(232, 168, 75, 0.1);
}
/* 添加好友 */
.add-friend-section {
    margin: 12px 0;
}
.af-label {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 6px;
}
.af-id-row {
    display: flex;
    gap: 8px;
    align-items: center;
}
.af-id-row code {
    flex: 1;
    background: var(--bg);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    word-break: break-all;
    color: var(--accent);
}
.af-copy-btn {
    background: var(--border);
    color: var(--text);
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 12px;
}
.af-input {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--text);
    font-size: 13px;
    margin-bottom: 8px;
    box-sizing: border-box;
}
.af-add-btn {
    width: 100%;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px;
    font-size: 14px;
    cursor: pointer;
    font-weight: 600;
}
.af-add-btn:hover {
    opacity: 0.9;
}
/* 好友列表 */
.friend-list {
    padding: 16px 24px;
}
.friend-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--muted);
}
.friend-empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
}
.friend-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 8px;
}
.friend-item-icon {
    font-size: 32px;
}
.friend-item-info {
    flex: 1;
}
.friend-item-name {
    font-size: 14px;
    font-weight: 600;
}
.friend-item-score {
    font-size: 12px;
    color: var(--accent);
}
.friend-remove-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--muted);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 11px;
    cursor: pointer;
}
.friend-tab {
    flex: 1;
    text-align: center;
    padding: 6px 0;
    font-size: 14px;
    color: var(--muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
}
.friend-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}
.friend-accept-btn {
    background: var(--accent);
    border: none;
    color: #fff;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 11px;
    cursor: pointer;
}
.friend-reject-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--muted);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 11px;
    cursor: pointer;
}
.friend-req-badge {
    display: inline-block;
    background: #e74c3c;
    color: #fff;
    border-radius: 10px;
    padding: 1px 5px;
    font-size: 10px;
    margin-left: 4px;
}
/* 邀请链接 */
.invite-link-box {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px;
    margin: 12px 0;
    font-size: 11px;
    word-break: break-all;
    color: var(--muted);
    max-height: 80px;
    overflow-y: auto;
}
.case-code-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 12px;
}
.case-code-label {
    font-size: 12px;
    color: var(--muted);
    white-space: nowrap;
}
.case-code-box code {
    flex: 1;
    font-size: 16px;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 2px;
}

.tips {
    padding: 0 24px 32px;
}
.tip-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 10px;
}
.tip-card h4 {
    font-size: 13px;
    color: var(--accent);
    margin-bottom: 4px;
}
.tip-card p {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.5;
}

/* ─── 加载状态 ─────────────────────────────── */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(13, 17, 23, 0.92);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
    display: none;
}
.loading-overlay.show {
    display: flex;
}
.spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 16px;
}
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
.loading-text {
    font-size: 15px;
    color: var(--text);
    margin-bottom: 6px;
}
.loading-sub {
    font-size: 12px;
    color: var(--muted);
    max-width: 240px;
    text-align: center;
    line-height: 1.6;
}
.loading-dots {
    display: inline-block;
}
.loading-dots::after {
    content: "";
    animation: ld 1.5s infinite;
}
@keyframes ld {
    0% {
        content: ".";
    }
    33% {
        content: "..";
    }
    66% {
        content: "...";
    }
}

/* ─── 游戏页 ───────────────────────────────── */
#page-game {
    justify-content: flex-start;
}

/* 右上角信息按钮 */
.info-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 4px 8px;
    font-size: 16px;
    cursor: pointer;
    color: var(--muted);
    line-height: 1;
}
.info-btn:active {
    background: var(--card);
}

/* 嫌疑人快选栏 */
.suspect-quick-bar {
    display: flex;
    gap: 6px;
    padding: 6px 12px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    overflow-x: auto;
    scrollbar-width: none;
}
.suspect-quick-bar::-webkit-scrollbar {
    display: none;
}
.sq-card {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 16px;
    border: 2px solid var(--border);
    background: var(--card);
    font-size: 12px;
    color: var(--text);
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
    flex-wrap: wrap;
    position: relative;
}
.sq-card.sel {
    border-color: var(--accent);
    background: rgba(232, 168, 75, 0.12);
    color: var(--accent);
}
/* NPC 状态边框颜色 */
.sq-card[data-state="guarded"] {
    border-color: #58a6ff;
}
.sq-card[data-state="nervous"] {
    border-color: #e8a84b;
}
.sq-card[data-state="defensive"] {
    border-color: #f47067;
}
.sq-card[data-state="angry"] {
    border-color: #d63e3e;
    box-shadow: 0 0 6px rgba(214, 62, 62, 0.3);
}
.sq-card[data-state="slipping"] {
    border-color: #f47067;
    animation: slipPulse 1.5s infinite;
}
.sq-card[data-state="shut_down"] {
    border-color: #484f58;
    opacity: 0.6;
}
@keyframes slipPulse {
    0%,
    100% {
        box-shadow: 0 0 4px rgba(244, 112, 103, 0.3);
    }
    50% {
        box-shadow: 0 0 10px rgba(244, 112, 103, 0.6);
    }
}
/* NPC 状态图标 */
.suspect-state-icon {
    font-size: 12px;
    margin-left: 2px;
    animation: stateIn 0.3s ease;
}
@keyframes stateIn {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}
.sq-avatar {
    font-size: 16px;
}
.sq-name {
    font-weight: 600;
}
.sq-suspicion-bar {
    height: 3px;
    background: var(--border);
    border-radius: 2px;
    margin-top: 3px;
    overflow: hidden;
    width: 100%;
}
.sq-suspicion-fill {
    height: 100%;
    border-radius: 2px;
    transition:
        width 0.5s ease,
        background 0.3s;
}

.sq-progress-bars {
    display: flex;
    gap: 2px;
    margin-top: 3px;
    width: 100%;
    flex-basis: 100%;
}
.sq-pbar {
    display: flex;
    align-items: center;
    gap: 1px;
    flex: 1;
    min-width: 0;
}
.sq-plabel {
    font-size: 7px;
    color: var(--muted);
    flex-shrink: 0;
    width: 16px;
}
.sq-ptrack {
    flex: 1;
    height: 2px;
    background: var(--border);
    border-radius: 1px;
    overflow: hidden;
}
.sq-pfill {
    height: 100%;
    border-radius: 1px;
    transition: width 0.5s ease;
}

/* 案件介绍弹层 */
.intro-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
    padding: 20px;
}
.intro-overlay.show {
    display: flex;
}
.intro-modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    max-height: 80vh;
    overflow-y: auto;
    padding: 20px;
}
.intro-modal h2 {
    color: var(--accent);
    font-size: 18px;
    margin-bottom: 12px;
}
.intro-brief {
    font-size: 13px;
    line-height: 1.7;
    color: var(--text);
    margin-bottom: 16px;
    padding: 12px;
    background: var(--card);
    border-radius: 10px;
    border: 1px solid var(--border);
}
.intro-suspects {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 16px;
}
.intro-suspect {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px;
    text-align: center;
}
.intro-suspect .is-avatar {
    font-size: 28px;
}
.intro-suspect .is-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-top: 4px;
}
.intro-suspect .is-role {
    font-size: 11px;
    color: var(--muted);
}
.intro-start-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 10px;
    background: var(--accent);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}
.intro-challenges {
    margin-bottom: 14px;
}
.challenge-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 8px;
}
.challenge-tag {
    font-size: 12px;
    color: var(--text);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 10px;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.challenge-bonus {
    margin-left: auto;
    color: var(--warning);
    font-weight: 600;
    font-size: 11px;
}
.challenge-result-item {
    font-size: 13px;
    padding: 6px 10px;
    border-radius: 8px;
    margin-bottom: 4px;
    background: var(--card);
    border: 1px solid var(--border);
}
.challenge-result-item.completed {
    border-color: var(--success);
}
.challenge-result-item.failed {
    border-color: var(--danger);
    opacity: 0.7;
}
.challenge-total-mult {
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    color: var(--warning);
    padding: 6px 0;
}
/* ── 游戏中挑战条件横幅 ── */
.challenge-banner {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 12px;
    background: rgba(232, 168, 75, 0.08);
    border-bottom: 1px solid rgba(232, 168, 75, 0.2);
    flex-shrink: 0;
}
.challenge-banner-label {
    font-size: 12px;
    color: var(--accent);
    flex-shrink: 0;
}
#challenge-banner-tags {
    display: flex;
    gap: 4px;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
}
#challenge-banner-tags::-webkit-scrollbar { display: none; }
.challenge-banner-tag {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px 7px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 11px;
    color: var(--fg);
    white-space: nowrap;
    flex-shrink: 0;
}
.challenge-banner-tag .cb-bonus {
    color: var(--warning);
    font-weight: 600;
    font-size: 10px;
}
/* ── 首页挑战模式卡片 ── */
.challenge-btn {
    display: block;
    width: calc(100% - 48px);
    margin: 8px auto;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid var(--accent);
    background: rgba(232, 168, 75, 0.1);
    color: var(--accent);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
}
.challenge-btn:active { transform: scale(0.97); }
.challenge-btn.open { border-radius: 12px 12px 0 0; border-bottom: none; margin-bottom: 0; }
.challenge-detail {
    max-width: 400px;
    width: calc(100% - 48px);
    margin: -1px auto 8px;
    padding: 0 14px 12px;
    background: #1c2128;
    border: 1px solid var(--accent);
    border-top: none;
    border-radius: 0 0 12px 12px;
    animation: slideDown 0.2s ease;
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}
.chd-desc {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 8px;
    padding-top: 8px;
}
.chd-cond {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    background: var(--surface);
    border-radius: 8px;
    font-size: 12px;
    margin-bottom: 4px;
}
.chd-cond-icon { flex-shrink: 0; }
.chd-cond-name { font-weight: 500; }
.chd-cond-desc { color: var(--muted); flex: 1; }
.chd-cond-bonus { color: var(--warning); font-weight: 600; font-size: 11px; flex-shrink: 0; }
.suspect-cards {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.suspect-cards::-webkit-scrollbar {
    display: none;
}
.suspect-card {
    flex-shrink: 0;
    width: 80px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--card);
    padding: 8px 6px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}
.suspect-card.sel {
    border-color: var(--accent);
    background: rgba(232, 168, 75, 0.12);
}
.suspect-card.sel .s-name {
    color: var(--accent);
}
.s-avatar {
    font-size: 24px;
    margin-bottom: 2px;
}
.s-name {
    font-size: 11px;
    font-weight: 600;
    color: var(--text);
}
.s-role {
    font-size: 9px;
    color: var(--muted);
    margin-top: 1px;
}
.s-status {
    font-size: 9px;
    color: var(--blue);
    margin-top: 2px;
}

.game-body {
    flex: 1;
    overflow-y: auto;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
    padding-bottom: 120px;
}

.msg {
    display: flex;
    gap: 8px;
    max-width: 85%;
}
.msg.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}
.msg-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--card);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.msg.user .msg-avatar {
    background: var(--accent);
}
.bubble {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px 14px 14px 4px;
    padding: 10px 14px;
    font-size: 14px;
    line-height: 1.6;
    word-break: break-word;
}
.msg.user .bubble {
    background: rgba(232, 168, 75, 0.15);
    border-color: rgba(232, 168, 75, 0.3);
    border-radius: 14px 14px 4px 14px;
}
.typing .bubble {
    display: flex;
    align-items: center;
    gap: 4px;
}
.typing-dots span {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--muted);
    animation: td 1.2s infinite;
}
.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}
.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}
@keyframes td {
    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: 0.5;
    }
    30% {
        transform: translateY(-4px);
        opacity: 1;
    }
}

.clue-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 12px;
}
.clue-label {
    color: var(--purple);
    font-size: 11px;
    flex-shrink: 0;
}
.clue-toggle {
    color: var(--accent);
    font-size: 11px;
    cursor: pointer;
    flex-shrink: 0;
    margin-left: 4px;
}
.clue-bar.clue-bar-hint {
    border-color: rgba(232, 168, 75, 0.55);
    box-shadow: 0 0 0 2px rgba(232, 168, 75, 0.12) inset;
}
.clue-bar.clue-bar-hint .clue-toggle {
    color: #e8a84b;
    font-weight: 700;
}
.clue-tags {
    display: none;
    flex-wrap: wrap;
    gap: 4px;
    width: 100%;
}
.clue-tag {
    background: rgba(188, 140, 255, 0.15);
    border: 1px solid rgba(188, 140, 255, 0.3);
    border-radius: 6px;
    padding: 2px 8px;
    color: var(--purple);
    font-size: 11px;
}
.clue-tabs {
    display: none;
    gap: 4px;
    width: 100%;
    margin-top: 4px;
    overflow-x: auto;
}
.clue-tab {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    color: var(--muted);
    background: var(--surface);
    border: 1px solid var(--border);
    cursor: pointer;
    white-space: nowrap;
}
.clue-tab.active {
    background: var(--purple);
    color: #fff;
    border-color: var(--purple);
}
.clue-tab-count {
    font-size: 9px;
    margin-left: 2px;
    opacity: 0.7;
}
.clue-card {
    background: rgba(188, 140, 255, 0.08);
    border: 1px solid rgba(188, 140, 255, 0.2);
    border-radius: 8px;
    padding: 5px 10px;
    margin: 2px 0;
    display: flex;
    gap: 6px;
    align-items: baseline;
}
.clue-source {
    font-size: 10px;
    color: var(--accent);
    font-weight: 600;
    flex-shrink: 0;
}
.clue-text {
    font-size: 12px;
    color: var(--purple);
}
.suspicion-badge {
    font-size: 11px;
    font-weight: 600;
    margin-top: 2px;
}
.clue-challenge-btn {
    margin-left: auto;
    padding: 4px 10px;
    border-radius: 8px;
    border: 1px solid var(--purple);
    background: rgba(188, 140, 255, 0.12);
    color: var(--purple);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
    white-space: nowrap;
}
.clue-challenge-btn:active { transform: scale(0.95); }
.tutorial-overlay {
    position: fixed;
    inset: 0;
    z-index: 300;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.tutorial-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    max-width: 340px;
    text-align: center;
}
.tutorial-box h3 {
    color: var(--accent);
    margin-bottom: 12px;
}
.tutorial-box p {
    font-size: 13px;
    line-height: 1.7;
    color: var(--text);
    margin-bottom: 16px;
}
.tutorial-box button {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 10px;
    background: var(--accent);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

/* 新手引导步骤 */
.tutorial-walkthrough {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 28px 24px;
    max-width: 360px;
    text-align: center;
}
.tw-progress {
    font-size: 16px;
    color: var(--accent);
    letter-spacing: 6px;
    margin-bottom: 16px;
}
.tw-icon {
    font-size: 48px;
    margin-bottom: 12px;
}
.tw-title {
    color: var(--accent);
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 10px;
}
.tw-desc {
    font-size: 13px;
    line-height: 1.8;
    color: var(--text);
    margin-bottom: 20px;
}
.tw-btns {
    display: flex;
    gap: 12px;
}
.tw-btns button {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
.tw-next {
    background: var(--accent);
    color: #fff;
}
.tw-prev {
    background: var(--card);
    color: var(--muted);
    border: 1px solid var(--border);
}
.tw-skip {
    margin-top: 12px;
    background: none;
    border: none;
    color: var(--muted);
    font-size: 12px;
    cursor: pointer;
    text-decoration: underline;
}

.qtag-tooltip {
    position: absolute;
    top: -70px;
    left: 0;
    right: 0;
    z-index: 100;
    cursor: pointer;
}
.qtag-tooltip-box {
    background: var(--surface);
    border: 1px solid var(--accent);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 11px;
    color: var(--text);
    line-height: 1.5;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    position: relative;
}
.qtag-tooltip-box::after {
    content: "";
    position: absolute;
    bottom: -6px;
    left: 20px;
    width: 12px;
    height: 12px;
    background: var(--surface);
    border-right: 1px solid var(--accent);
    border-bottom: 1px solid var(--accent);
    transform: rotate(45deg);
}

/* 游戏底部固定输入区 */
.game-bottom-fixed {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--surface);
    z-index: 50;
    border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}
.input-area {
    flex: 1;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 14px;
    color: var(--text);
    resize: none;
    min-height: 44px;
    max-height: 100px;
    overflow-y: auto;
    outline: none;
    line-height: 1.5;
}
.input-area:focus {
    border-color: var(--accent);
}
.input-area::placeholder {
    color: var(--muted);
}
.send-btn {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: none;
    background: var(--accent);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.send-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.accuse-btn {
    height: 44px;
    padding: 0 14px;
    border-radius: 12px;
    border: 1px solid var(--accent2);
    background: rgba(214, 62, 62, 0.12);
    color: var(--accent2);
    font-size: 13px;
    cursor: pointer;
    flex-shrink: 0;
    font-weight: 600;
    transition: all 0.15s;
}
.accuse-btn:active { transform: scale(0.96); }
.accuse-btn:hover { background: rgba(214, 62, 62, 0.2); }

/* ─── 道具栏 ─────────────────────────────── */
.item-bar {
    display: flex;
    gap: 8px;
    padding: 6px 14px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.item-btn {
    flex: 1;
    padding: 6px 0;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--muted);
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: all 0.2s;
}
.item-btn:hover {
    border-color: var(--blue);
    color: var(--blue);
}
.item-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.item-btn .item-icon {
    font-size: 16px;
}
.qtype-bar {
    display: flex;
    gap: 4px;
    padding: 4px 12px;
    overflow-x: auto;
    flex-shrink: 0;
    -webkit-overflow-scrolling: touch;
}
.qtype-tag {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    color: var(--muted);
    background: var(--card);
    border: 1px solid var(--border);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s;
}
.qtype-tag.active {
    background: var(--blue);
    color: #fff;
    border-color: var(--blue);
}
.item-btn .item-count {
    background: var(--accent);
    color: #fff;
    border-radius: 10px;
    padding: 1px 6px;
    font-size: 10px;
    font-weight: 600;
}

/* ─── 分享卡片预览 ────────────────────────── */
.share-card-preview {
    margin: 0 24px 12px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
}
.share-card-preview img {
    width: 100%;
    display: block;
}
.share-card-toggle {
    text-align: center;
    padding: 8px;
    font-size: 12px;
    color: var(--muted);
    cursor: pointer;
}

.timer-num.warn {
    color: var(--accent2) !important;
    animation: pulse 1s infinite;
}
@keyframes pulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}
.timer-num {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

/* ─── 指控弹窗 ─────────────────────────────── */
.modal-bg {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 200;
    display: none;
    align-items: flex-end;
    justify-content: center;
}
.modal-bg.show {
    display: flex;
}
.modal {
    background: var(--surface);
    border-radius: 20px 20px 0 0;
    width: 100%;
    max-width: 500px;
    padding: 28px 24px 40px;
    max-height: 85vh;
    overflow-y: auto;
}
.modal h3 {
    font-size: 18px;
    color: var(--accent);
    margin-bottom: 20px;
    text-align: center;
}
.accuse-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s;
}
.accuse-option.sel {
    border-color: var(--accent2);
    background: rgba(214, 62, 62, 0.1);
}
.accuse-option .av {
    font-size: 28px;
}
.accuse-option .info .name {
    font-size: 15px;
    font-weight: 600;
}
.accuse-option .info .role {
    font-size: 12px;
    color: var(--muted);
}
.radio {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--border);
    margin-left: auto;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.accuse-option.sel .radio {
    border-color: var(--accent2);
    background: var(--accent2);
}
.radio::after {
    content: "✓";
    color: #fff;
    font-size: 12px;
    display: none;
}
.accuse-option.sel .radio::after {
    display: block;
}

.clue-summary {
    margin: 10px 0;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    border: 1px solid var(--border);
    max-height: 200px;
    overflow-y: auto;
}
.clue-summary-title {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 6px;
}
.clue-summary-more {
    font-size: 11px;
    color: var(--accent);
    margin-bottom: 4px;
}
.clue-summary-item {
    font-size: 12px;
    color: var(--text);
    padding: 2px 0;
    line-height: 1.5;
}
.clue-summary-item .clue-src {
    color: var(--muted);
    font-size: 11px;
}

.reason-box {
    margin: 16px 0;
}
.reason-box label {
    display: block;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 8px;
}
.reason-box textarea {
    width: 100%;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
    font-size: 13px;
    color: var(--text);
    resize: none;
    height: 80px;
    outline: none;
    line-height: 1.6;
}
.reason-box textarea:focus {
    border-color: var(--accent);
}

.modal-btns {
    display: flex;
    gap: 10px;
}
.modal-cancel {
    flex: 1;
    padding: 13px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--muted);
    font-size: 15px;
    cursor: pointer;
}
.modal-confirm {
    flex: 2;
    padding: 13px;
    border-radius: 12px;
    border: none;
    background: var(--accent2);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}
.modal-confirm:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ─── 结算页 ───────────────────────────────── */
#page-result {
    justify-content: flex-start;
    overflow-y: auto;
}
.result-hero {
    text-align: center;
    padding: 40px 24px 20px;
}
.result-icon {
    font-size: 72px;
    margin-bottom: 16px;
}
.result-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}
.result-title.win {
    color: var(--success);
}
.result-title.lose {
    color: var(--accent2);
}
.result-sub {
    font-size: 14px;
    color: var(--muted);
    line-height: 1.6;
}
.result-score {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin: 24px 0;
}
.score-item {
    text-align: center;
}
.score-num {
    font-size: 28px;
    font-weight: 700;
    color: var(--accent);
}
.score-label {
    font-size: 12px;
    color: var(--muted);
    margin-top: 4px;
}
.result-divider {
    height: 1px;
    background: var(--border);
    margin: 0 24px 24px;
}
.result-section {
    padding: 0 24px 20px;
}
.result-section h4 {
    font-size: 14px;
    color: var(--accent);
    margin-bottom: 12px;
}
.answer-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
}
.answer-card .name {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
}
.answer-card .role {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 10px;
}
.answer-card .reason {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.6;
}
.answer-card.culprit {
    border-color: var(--success);
}
.answer-card.culprit .name {
    color: var(--success);
}

.share-btn {
    display: block;
    width: calc(100% - 48px);
    margin: 0 auto 12px;
    padding: 14px;
    border-radius: 12px;
    border: none;
    background: var(--accent);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 1px;
}
.replay-btn {
    display: block;
    width: calc(100% - 48px);
    margin: 0 auto;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--muted);
    font-size: 15px;
    cursor: pointer;
}

/* ─── API状态提示 ─────────────────────────── */
.api-tip {
    text-align: center;
    padding: 8px 16px;
    font-size: 12px;
    color: var(--muted);
    background: var(--card);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.api-tip.error {
    color: var(--accent2);
}

/* ─── 底部 TabBar ────────────────────────────── */
.tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-around;
    height: 56px;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: var(--surface);
    border-top: 1px solid var(--border);
    z-index: 60;
}
.tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    flex: 1;
    cursor: pointer;
    transition: color 0.2s;
    color: var(--muted);
    padding: 6px 0;
}
.tab-item.active {
    color: var(--accent);
}
.tab-icon {
    font-size: 20px;
}
.tab-label {
    font-size: 10px;
}
/* 默认隐藏剧情Tab，只有JS明确启用时才显示 */
#story-tab { display: none !important; }
#story-tab.visible { display: flex !important; }
/* tabBar 页面底部留出空间 */
#page-home {
    padding-bottom: 56px;
}
#page-library {
    padding-bottom: 56px;
}
#page-story {
    padding-bottom: 56px;
}
#page-profile {
    padding-bottom: 56px;
}

/* ─── 滚动条 ──────────────────────────────── */
::-webkit-scrollbar {
    width: 4px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

/* ─── 自定义 Toast ─────────────────────────────── */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 24px;
    font-size: 14px;
    color: var(--text);
    z-index: 999;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s;
    text-align: center;
    max-width: 280px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.toast.show {
    opacity: 1;
}

/* ─── 自定义 Dialog ─────────────────────────────── */
.dialog-bg {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 300;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.dialog-bg.show {
    display: flex;
}
.dialog {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    width: 100%;
    max-width: 340px;
    padding: 24px;
}
.dialog-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 16px;
    text-align: center;
}
.dialog-input {
    width: 100%;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
    font-size: 14px;
    color: var(--text);
    outline: none;
}
.dialog-input:focus {
    border-color: var(--accent);
}
.dialog-msg {
    font-size: 14px;
    color: var(--text);
    line-height: 1.6;
    text-align: center;
    margin-bottom: 20px;
}
.dialog-btns {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}
.dialog-btn {
    flex: 1;
    padding: 12px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
}
.dialog-btn.cancel {
    background: var(--card);
    border: 1px solid var(--border);
    color: var(--muted);
}
.dialog-btn.ok {
    background: var(--accent);
    border: none;
    color: #fff;
}
.dialog-btn.danger {
    background: var(--accent2);
    border: none;
    color: #fff;
}

/* ─── 破案复盘 ─────────────────────────────── */
.review-timeline {
    margin-top: 8px;
}
.review-stats {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 11px;
    color: var(--muted);
    margin-bottom: 10px;
    padding: 8px 10px;
    background: var(--card);
    border-radius: 8px;
}
.review-step {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
}
.review-step-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}
.review-step-body {
    flex: 1;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 10px;
}
.review-step-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}
.review-suspect {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}
.review-qtype {
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 8px;
    background: rgba(88, 166, 255, 0.15);
    color: var(--blue);
}
.review-delta {
    font-size: 12px;
    font-weight: 700;
    margin-left: auto;
}
.review-input {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.4;
}
.review-clues {
    font-size: 11px;
    color: var(--purple);
    margin-top: 4px;
}
.wrong-analysis {
    font-size: 12px;
    color: var(--accent);
    margin-top: 10px;
    line-height: 1.6;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

/* ─── 页面切换动画 ──────────────────────────── */
.page {
    transition:
        transform 0.28s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.28s ease;
}
.page.slide-in {
    animation: slideIn 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes slideIn {
    from {
        transform: translateX(30px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ─── 骨架屏加载 ─────────────────────────────── */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--card) 25%,
        var(--surface) 50%,
        var(--card) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}
@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}
.skeleton-card {
    height: 72px;
    margin-bottom: 10px;
}
.skeleton-text {
    height: 14px;
    margin-bottom: 8px;
    width: 70%;
}
.skeleton-text.w60 {
    width: 60%;
}
.skeleton-text.w80 {
    width: 80%;
}
.skeleton-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}
.skeleton-shop {
    height: 140px;
    border-radius: 12px;
}

/* ─── 空状态 ─────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 48px 24px;
}
.empty-state-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.8;
}
.empty-state-text {
    font-size: 14px;
    color: var(--muted);
    margin-bottom: 16px;
    line-height: 1.6;
}
.empty-state-btn {
    display: inline-block;
    padding: 10px 24px;
    border-radius: 10px;
    background: var(--accent);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
}

/* ─── 网络错误提示条 ─────────────────────────── */
.error-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(214, 62, 62, 0.12);
    border-bottom: 1px solid rgba(214, 62, 62, 0.25);
    color: var(--accent2);
    font-size: 13px;
    flex-shrink: 0;
}
.error-banner button {
    background: var(--accent2);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 4px 12px;
    font-size: 12px;
    cursor: pointer;
    font-weight: 600;
}

/* ─── 计时器增强 ─────────────────────────────── */
.timer-num.danger {
    color: #ff4444 !important;
    animation: timerPulse 0.5s infinite;
    text-shadow: 0 0 8px rgba(255, 68, 68, 0.5);
}
@keyframes timerPulse {
    0%,
    100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.15);
    }
}

/* ─── 消息动画 ─────────────────────────────── */
.msg {
    animation: msgIn 0.25s ease-out;
}
@keyframes msgIn {
    from {
        transform: translateY(10px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ─── 按钮点击反馈 ──────────────────────────── */
.menu-item:active,
.lib-card:active {
    transform: scale(0.98);
    transition: transform 0.1s;
}
.start-btn:active,
.share-btn:active,
.replay-btn:active {
    transform: scale(0.97);
}

/* 季度卡片 */
.season-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 20px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: transform 0.15s;
}
.season-card:active { transform: scale(0.98); }
.season-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.season-card-title { font-size: 18px; font-weight: 700; color: var(--accent); }
.season-card-arrow { font-size: 14px; color: var(--muted); }
.season-card-subtitle { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.season-card-desc { font-size: 13px; color: var(--muted); line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* 章节选择 */
.chapter-list-h5 {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 4px 0;
}
.chapter-item-h5 {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: var(--card);
    border-radius: 12px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: transform 0.1s;
}
.chapter-item-h5:active { transform: scale(0.98); }
.chapter-item-h5.locked {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}
.chapter-item-h5.completed { border-color: #3fb950; }
.chapter-item-h5.available { border-color: var(--accent); }
.chapter-num-h5 {
    font-size: 12px;
    color: var(--muted);
    min-width: 56px;
    text-align: center;
}
.chapter-info-h5 { flex: 1; min-width: 0; }
.chapter-title-h5 {
    font-size: 14px;
    font-weight: 600;
    color: var(--fg);
    margin-bottom: 2px;
}
.chapter-synopsis-h5 {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.5;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.chapter-meta-h5 {
    font-size: 11px;
    color: var(--accent);
}
.chapter-status-h5 {
    min-width: 28px;
    text-align: center;
    font-size: 18px;
}

/* ─── 智能提问建议 ─────────────────────────── */
.suggestion-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(88, 166, 255, 0.06);
    border-top: 1px solid rgba(88, 166, 255, 0.12);
    min-height: 36px;
}
.suggestion-label {
    font-size: 11px;
    color: #58a6ff;
    white-space: nowrap;
    font-weight: 600;
}
.suggestion-chip {
    background: rgba(88, 166, 255, 0.12);
    border: 1px solid rgba(88, 166, 255, 0.25);
    color: #58a6ff;
    border-radius: 14px;
    padding: 3px 10px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}
.suggestion-chip:hover {
    background: rgba(88, 166, 255, 0.2);
}
.suggestion-refresh {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 13px;
    padding: 2px 4px;
}

/* ─── 道具推荐 ─────────────────────────── */
.item-rec-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(232, 168, 75, 0.06);
    border-top: 1px solid rgba(232, 168, 75, 0.12);
}
.item-rec-chip {
    background: rgba(232, 168, 75, 0.1);
    border: 1px solid rgba(232, 168, 75, 0.2);
    color: var(--accent);
    border-radius: 12px;
    padding: 3px 10px;
    font-size: 12px;
}

/* ─── 底部工具栏 ─────────────────────────── */
.bottom-toolbar {
    display: flex;
    gap: 6px;
    padding: 4px 12px;
}
.toolbar-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    color: var(--muted);
    border-radius: 8px;
    padding: 4px 12px;
    font-size: 13px;
    cursor: pointer;
}
.toolbar-btn:hover {
    background: rgba(255,255,255,0.08);
    color: var(--text);
}

/* ─── 三步指控 ─────────────────────────── */
.accuse-steps {
    display: flex;
    justify-content: center;
    gap: 0;
    margin-bottom: 12px;
    font-size: 12px;
}
.accuse-step {
    color: var(--muted);
    padding: 4px 8px;
    border-bottom: 2px solid transparent;
}
.accuse-step.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    font-weight: 600;
}
.accuse-step.done {
    color: var(--success);
}
.accuse-step-hint {
    font-size: 12px;
    color: var(--muted);
    margin: 8px 0;
}
.accuse-step-empty {
    font-size: 13px;
    color: var(--muted);
    text-align: center;
    padding: 16px 0;
}
.accuse-clue-select {
    max-height: 260px;
    overflow-y: auto;
    padding: 4px 0;
}
.accuse-clue-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s;
}
.accuse-clue-item:hover {
    background: rgba(255,255,255,0.04);
}
.accuse-clue-item.sel {
    background: rgba(88, 166, 255, 0.1);
    border-color: rgba(88, 166, 255, 0.25);
}
.accuse-clue-check {
    min-width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #58a6ff;
    background: transparent;
}
.accuse-clue-item.sel .accuse-clue-check {
    background: rgba(88, 166, 255, 0.15);
    border-color: #58a6ff;
}
.accuse-clue-body { flex: 1; }
.accuse-clue-type {
    font-size: 10px;
    color: #58a6ff;
    background: rgba(88, 166, 255, 0.1);
    display: inline-block;
    padding: 1px 6px;
    border-radius: 8px;
    margin-bottom: 2px;
}
.accuse-clue-text {
    font-size: 13px;
    color: var(--text);
    line-height: 1.4;
}
.accuse-clue-source {
    font-size: 11px;
    color: var(--muted);
    margin-top: 2px;
}
.accuse-confirm-summary {
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
}
.confirm-item {
    margin-bottom: 10px;
}
.confirm-label {
    font-size: 11px;
    color: var(--muted);
    margin-bottom: 2px;
}
.confirm-value {
    font-size: 13px;
    color: var(--text);
}
.confirm-hint {
    font-size: 11px;
    color: var(--accent);
    text-align: center;
    margin-top: 8px;
}
.suspect-state-label {
    font-size: 11px;
    color: var(--muted);
    margin-top: 2px;
}

/* ─── 章节目标弹层 ─────────────────────────── */
.chapter-objective-overlay {
    position: fixed; inset: 0; z-index: 999;
    background: rgba(0,0,0,0.6);
    display: flex; align-items: flex-end;
}
.chapter-objective-sheet {
    background: var(--card-bg);
    border-radius: 16px 16px 0 0;
    width: 100%; max-height: 70vh;
    overflow-y: auto; padding: 16px;
}
.chapter-obj-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 12px;
}
.chapter-obj-title { font-size: 15px; font-weight: 600; }
.chapter-obj-close { color: var(--muted); cursor: pointer; font-size: 18px; }
.chapter-obj-body {}
.chapter-obj-section { margin-bottom: 16px; }
.chapter-obj-section-title { font-size: 12px; color: #58a6ff; margin-bottom: 6px; font-weight: 600; }
.chapter-obj-text { font-size: 14px; color: var(--text); line-height: 1.5; }
.chapter-obj-char { font-size: 13px; color: var(--text); margin: 4px 0; }

/* ─── 复盘增强 ─────────────────────────── */
.review-section { margin-top: 10px; }
.review-section-title { font-size: 13px; color: var(--accent); font-weight: 600; margin-bottom: 8px; }
.review-sub-title { font-size: 11px; color: var(--muted); margin: 6px 0 4px; }
.review-item { font-size: 12px; padding: 4px 0; line-height: 1.4; }
.review-item.error { color: #f47067; }
.review-item.suggestion { color: var(--accent); }

/* ─── 案件板线索分类增强 ─────────────────── */
.clue-type-badge {
    font-size: 10px;
    background: rgba(88, 166, 255, 0.1);
    color: #58a6ff;
    border-radius: 8px;
    padding: 1px 5px;
    margin-right: 4px;
}
.chapter-obj-preview {
    font-size: 11px;
    color: #58a6ff;
    cursor: pointer;
    margin-top: 3px;
    text-decoration: underline;
}

/* ─── 好友挑战结果卡 ─────────────────────────── */
.friend-challenge-card-area { width: 100%; }
.fc-card {
    background: linear-gradient(135deg, rgba(88,166,255,0.08), rgba(188,140,255,0.08));
    border: 1px solid rgba(88, 166, 255, 0.15);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 0;
}
.fc-card-header {
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 10px;
}
.fc-card-icon { font-size: 18px; }
.fc-card-title { font-size: 14px; font-weight: 600; color: var(--accent); }
.fc-card-body {}
.fc-case { font-size: 13px; color: var(--text); margin-bottom: 6px; }
.fc-result { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.fc-result.win { color: var(--success); }
.fc-result.lose { color: #f47067; }
.fc-stats { display: flex; gap: 16px; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.fc-challenge-text { font-size: 12px; color: var(--muted); }
.fc-card-footer { margin-top: 10px; }
.fc-case-code { font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.fc-case-code code { background: rgba(255,255,255,0.06); padding: 2px 6px; border-radius: 4px; font-size: 12px; }
.fc-copy-btn {
    background: none; border: 1px solid var(--border); color: var(--muted);
    border-radius: 4px; padding: 1px 6px; font-size: 11px; cursor: pointer; margin-left: 4px;
}
.fc-invite-row { margin-top: 6px; }
.fc-invite-btn {
    background: rgba(88, 166, 255, 0.15);
    border: 1px solid rgba(88, 166, 255, 0.3);
    color: var(--accent); border-radius: 8px;
    padding: 6px 14px; font-size: 13px; cursor: pointer; width: 100%;
}
.fc-invite-btn:hover { background: rgba(88, 166, 255, 0.25); }
.fc-copy-btn:hover { background: rgba(255,255,255,0.05); }

/* ─── 案件板线索类型徽章 ───────────────────── */
.clue-type-badge {
    font-size: 10px;
    background: rgba(88, 166, 255, 0.1);
    color: #58a6ff;
    border-radius: 8px;
    padding: 1px 5px;
    margin-right: 4px;
    display: inline-block;
}

/* ─── 嫌疑人状态叙事文字 ───────────────────── */
.suspect-state-narrative {
    font-size: 10px;
    color: var(--muted);
    display: block;
    margin-top: 1px;
}

/* ─── 侦探档案变化（结算页）───────────────── */
#profile-impact-box {
    background: var(--card);
    border-radius: 12px;
    margin: 12px 24px;
    padding: 12px 16px;
}
#profile-impact-box h4 {
    font-size: 14px;
    margin-bottom: 10px;
    color: var(--accent);
}
.pi-change-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    padding: 4px 0;
}
.pi-dim-name { color: var(--text); min-width: 80px; }
.pi-delta { font-weight: 600; }
.pi-delta.pos { color: var(--success); }
.pi-delta.neg { color: var(--accent2); }
.pi-relation-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 6px;
}
.pi-relation-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--border);
}

/* ─── NPC 反馈文案（Luna / WDC）───────────────── */
.pi-npc-feedback {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}
.pi-npc-line {
    font-size: 12px;
    line-height: 1.6;
    padding: 4px 0;
    color: var(--text);
}
.pi-npc-line strong {
    font-weight: 600;
}
.pi-npc-line.luna strong { color: #a78bfa; }
.pi-npc-line.wdc strong { color: #60a5fa; }

/* ─── 档案影响提示（剧情模式开场）───────────── */
.intro-branch-hints {
    background: rgba(232, 168, 75, 0.08);
    border: 1px solid rgba(232, 168, 75, 0.25);
    border-radius: 8px;
    padding: 10px 12px;
    margin-top: 8px;
}
.branch-hints-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 6px;
}
.branch-hint-line {
    font-size: 12px;
    line-height: 1.6;
    color: var(--text);
    padding: 2px 0;
    padding-left: 8px;
    border-left: 2px solid var(--accent);
    margin-bottom: 2px;
}

/* ─── 侦探档案卡片（个人中心）───────────────── */
.detective-profile-card {
    margin: 0 24px 16px;
    background: linear-gradient(135deg, #1a1030 0%, #161b22 100%);
    border: 1px solid rgba(232,168,75,0.3);
    border-radius: 16px;
    padding: 16px;
    cursor: pointer;
}
.dp-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}
.dp-icon { font-size: 28px; }
.dp-title { font-size: 18px; font-weight: 600; color: var(--accent); }
.dp-style-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}
.dp-style-chip {
    font-size: 11px;
    padding: 2px 10px;
    border-radius: 999px;
    background: rgba(232,168,75,0.15);
    border: 1px solid rgba(232,168,75,0.4);
    color: var(--accent);
}
.dp-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.dp-relation-badge {
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 4px;
    background: var(--surface);
    color: var(--muted);
}

/* ─── 侦探档案弹层尺寸调整 ─────────────────── */
#detective-profile-modal .notif-modal-content {
    max-height: 80vh;
    overflow-y: auto;
}
.dp-modal-dim-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
}
.dp-modal-dim-row:last-child { border-bottom: none; }
.dp-modal-dim-label { font-size: 13px; color: var(--text); }
.dp-modal-dim-val { font-size: 13px; color: var(--accent); font-weight: 600; }
.dp-branch-chip {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 8px; border-radius: 12px;
    background: rgba(139,92,246,0.1); border: 1px solid rgba(139,92,246,0.3);
    font-size: 12px;
}
.dp-branch-key { color: var(--muted); }
.dp-branch-val { color: #8b5cf6; font-weight: 600; }
.growth-panel {
  margin: 10px 16px 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.08);
}

.growth-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.growth-panel-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.growth-panel-meta {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.growth-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.growth-action {
  min-height: 58px;
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  color: var(--text);
  text-align: left;
}

.growth-action.done {
  opacity: 0.72;
}

.growth-action-title {
  display: block;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
}

.growth-action-sub {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.3;
}

.growth-invite-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.growth-invite-text {
  min-width: 0;
  font-size: 12px;
  color: var(--muted);
}

.growth-invite-btn {
  flex: 0 0 auto;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 10px;
}

@media (max-width: 380px) {
  .growth-actions {
    grid-template-columns: 1fr;
  }
}
