/* 
* 免疫学交互课�?- 沉浸课堂 样式�?
* 设计原则: 暗黑模式、毛玻璃(Glassmorphism)、赛博朋克风医学蓝、流畅动�?
*/

:root {
    --bg-color: #efeff9; /* Light background */
    --panel-bg: rgba(255, 255, 255, 0.85);
    --panel-border: rgba(0, 0, 0, 0.08);
    --text-primary: #1e293b;
    --text-secondary: #475569;
    
    --accent-blue: #1d4ed8;
    --accent-blue-glow: rgba(59, 130, 246, 0.4);
    --accent-indigo: #4338ca;
    
    --success: #10b981;
    --warning: #4338ca;
    --danger: #ef4444;
    
    --font-heading: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
    --font-body: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
    
    --radius-lg: 20px;
    --radius-md: 12px;
    --radius-sm: 8px;
}

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

body {
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(59, 130, 246, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 85% 30%, rgba(99, 102, 241, 0.15) 0%, transparent 50%);
    color: var(--text-primary);
    font-family: var(--font-body);
    height: 100vh;
    overflow: hidden;
}

/* Glassmorphism 基础�?*/
.glass-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--panel-border);
    box-shadow: 0 8px 32px 0 rgba(255, 255, 255, 0.4);
}

/* 布局体系 */
.app-container {
    display: flex;
    height: 100vh;
    padding: 16px;
    gap: 16px;
}

/* 侧边�?*/
.sidebar {
    width: 260px;
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    transition: all 0.3s ease;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 48px;
    padding-left: 8px;
    background: linear-gradient(135deg, #60a5fa, #818cf8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo i {
    -webkit-text-fill-color: initial;
    color: #60a5fa;
}

.nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.nav-links li {
    padding: 14px 16px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-links li:hover {
    background: rgba(30, 41, 59, 0.05);
    color: var(--text-primary);
    transform: translateX(4px);
}

.nav-links li.active {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.2) 0%, transparent 100%);
    color: var(--accent-blue);
    border-left: 3px solid var(--accent-blue);
}

.nav-links li.nav-coming-soon {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
}

.nav-links li.nav-coming-soon:hover {
    transform: none;
    background: transparent;
    color: var(--text-secondary);
}

.user-profile {
    position: relative;
    margin-top: auto;
}

.ix-account-trigger {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border: 1px solid rgba(30, 41, 59, 0.08);
    background: rgba(255, 255, 255, 0.22);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    cursor: pointer;
    text-align: left;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.ix-account-trigger:hover,
.ix-account-trigger[aria-expanded="true"] {
    transform: translateY(-1px);
    border-color: rgba(59, 130, 246, 0.22);
    background: rgba(255, 255, 255, 0.34);
}

.ix-account-avatar {
    display: inline-flex;
    flex-shrink: 0;
}

.ix-account-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--accent-indigo);
}

.ix-account-copy {
    min-width: 0;
    flex: 1 1 auto;
}

.user-info h4,
.ix-account-copy h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-info .level,
.ix-account-copy .level {
    font-size: 11px;
    color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.2);
    padding: 2px 6px;
    border-radius: 4px;
}

.ix-account-caret {
    color: var(--text-secondary);
    font-size: 18px;
    line-height: 1;
    transition: transform 0.18s ease;
}

.ix-account-trigger[aria-expanded="true"] .ix-account-caret {
    transform: rotate(180deg);
}

.ix-account-menu {
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc(100% + 10px);
    z-index: 80;
    display: grid;
    gap: 4px;
    padding: 8px;
    border-radius: 18px;
    border: 1px solid rgba(30, 41, 59, 0.1);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 20px 46px rgba(15, 23, 42, 0.14);
    backdrop-filter: blur(16px);
}

.ix-account-menu-item {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    min-height: 38px;
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: #1e293b;
    padding: 8px 10px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    text-align: left;
}

.ix-account-menu-item:hover,
.ix-account-menu-item:focus-visible {
    background: rgba(59, 130, 246, 0.1);
    outline: none;
}

.ix-account-menu-item i {
    color: rgba(71, 85, 105, 0.88);
    font-size: 16px;
}

.ix-account-alert {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #ef4444;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.12);
}

.ix-account-menu-divider {
    height: 1px;
    margin: 4px 2px;
    background: rgba(148, 163, 184, 0.24);
}

.ix-account-menu-item-danger {
    color: #dc2626;
}

.ix-account-menu-item-danger i {
    color: #dc2626;
}

/* ── 访客/登录态切换按钮组 ────────────────── */
.ix-guest-actions {
    display: flex;
    gap: 10px;
    margin-top: auto;
    padding: 14px 0 0;
}

.ix-guest-actions.hidden {
    display: none !important;
}

.ix-guest-actions-left {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1.2;
}

.ix-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font-body);
    cursor: pointer;
    border: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease, background 0.18s ease;
}

/* 访客浏览：主按钮，浅色底，加亮 */
.ix-btn-guest-active {
    background: rgba(59, 130, 246, 0.12);
    color: var(--accent-blue);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.ix-btn-guest-active:hover {
    background: rgba(59, 130, 246, 0.2);
    transform: translateY(-1px);
}

.ix-btn-guest-active:active {
    transform: scale(0.97);
}

/* 登录学习：次按钮，极浅 */
.ix-btn-login {
    background: rgba(255, 255, 255, 0.3);
    color: var(--text-secondary);
    border: 1px solid rgba(30, 41, 59, 0.08);
}

.ix-btn-login:hover {
    background: rgba(255, 255, 255, 0.6);
    color: var(--text-primary);
    border-color: rgba(59, 130, 246, 0.2);
    transform: translateY(-1px);
}

.ix-guest-actions-right {
    display: flex;
    flex: 1;
}

.ix-visit-counter {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.05));
    border: 1px solid rgba(30, 41, 59, 0.06);
    border-radius: var(--radius-md);
    padding: 8px;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.ix-visit-counter:hover {
    background: rgba(255, 255, 255, 0.5);
    border-color: rgba(59, 130, 246, 0.2);
}

.ix-visit-counter i {
    font-size: 22px;
    color: var(--accent-blue);
    opacity: 0.8;
    margin-bottom: 2px;
}

.ix-visit-counter .visit-count {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
}

.ix-visit-counter .visit-label {
    font-size: 10px;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
}

/* ── 移动端/平板端 top-bar 内访客操作行（桌面端隐藏） ── */
.ix-guest-bar-mobile {
    display: none;
}

.ix-mbtn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    font-family: var(--font-body);
    border: none;
    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.18s ease, background 0.18s ease;
}

.ix-mbtn-guest {
    background: rgba(59, 130, 246, 0.12);
    color: var(--accent-blue);
    border: 1px solid rgba(59, 130, 246, 0.25);
}

.ix-mbtn-guest:hover {
    background: rgba(59, 130, 246, 0.2);
}

.ix-mbtn-guest:active {
    transform: scale(0.96);
}

.ix-mbtn-login {
    background: rgba(255, 255, 255, 0.4);
    color: var(--text-secondary);
    border: 1px solid rgba(30, 41, 59, 0.1);
}

.ix-mbtn-login:hover {
    background: rgba(255, 255, 255, 0.65);
    color: var(--text-primary);
}

.ix-mbtn-login:active {
    transform: scale(0.96);
}

/* 主内容区 */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow: hidden;
}

.classroom-view {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 0;
    flex: 1 1 auto;
}

.case-detective-view {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 0;
    flex: 1 1 auto;
    overflow: hidden;
    padding-bottom: 4px;
}

.case-detective-view::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 18% 12%, rgba(49, 46, 129, 0.16), transparent 28%),
        radial-gradient(circle at 84% 20%, rgba(56, 189, 248, 0.14), transparent 24%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.8200000000000001), rgba(255, 255, 255, 0.88));
    pointer-events: none;
    z-index: -1;
}

.knowledge-map-view {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 0;
    flex: 1 1 auto;
    overflow: hidden;
    padding-bottom: 4px;
}

.knowledge-map-view::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 16% 14%, rgba(67, 56, 202, 0.14), transparent 24%),
        radial-gradient(circle at 78% 18%, rgba(34, 211, 238, 0.16), transparent 26%),
        radial-gradient(circle at 50% 100%, rgba(59, 130, 246, 0.12), transparent 34%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.88));
    pointer-events: none;
    z-index: -2;
}

.knowledge-map-view::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(148, 163, 184, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.045) 1px, transparent 1px);
    background-size: 34px 34px;
    mask-image: radial-gradient(circle at 50% 45%, rgba(30, 41, 59, 0.65), transparent 88%);
    pointer-events: none;
    z-index: -1;
}

.knowledge-map-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 400px);
    gap: 18px;
    padding: 18px 22px;
    overflow: hidden;
}

.knowledge-map-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(125deg, rgba(67, 56, 202, 0.1), rgba(255, 252, 243, 0.0) 32%),
        linear-gradient(315deg, rgba(56, 189, 248, 0.12), rgba(255, 252, 243, 0.0) 38%);
    pointer-events: none;
}

.knowledge-hero-copy,
.knowledge-hero-stats {
    position: relative;
    z-index: 1;
}

.knowledge-kicker-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
}

.lesson-switcher {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 252, 243, 0.4);
    border: 1px solid rgba(30, 41, 59, 0.1);
    border-radius: 8px;
    padding: 6px 12px;
}

.lesson-switcher span {
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.lesson-switcher select {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
}

.lesson-switcher select:focus {
    outline: none;
}

.lesson-switcher select option {
    background: #fffcf3;
    color: #1e293b;
}

.knowledge-kicker,
.knowledge-section-kicker,
.atlas-zone-kicker {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(67, 56, 202, 0.88);
}

.knowledge-badge {
    display: inline-flex;
    align-items: center;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(67, 56, 202, 0.12);
    border: 1px solid rgba(67, 56, 202, 0.22);
    color: #4338ca;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.knowledge-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.knowledge-map-hero h2 {
    font-family: var(--font-heading);
    font-size: clamp(26px, 3vw, 36px);
    line-height: 1;
    margin-top: 0;
    margin-bottom: 0;
}

.knowledge-subtitle-inline {
    margin-top: 0;
    margin-bottom: 0;
    color: #94a3b8;
    font-size: 15px;
    font-weight: 500;
    line-height: 1;
}

.knowledge-summary {
    margin-top: 14px;
    max-width: 72ch;
    color: #cbd5e1;
    font-size: 14px;
    line-height: 1.8;
}

.knowledge-hero-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    align-content: start;
}

.knowledge-stat-card {
    border-radius: 18px;
    padding: 14px 14px 16px;
    background: linear-gradient(180deg, rgba(255, 252, 243, 0.72), rgba(255, 255, 255, 0.8200000000000001));
    border: 1px solid rgba(30, 41, 59, 0.08);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.knowledge-stat-card strong {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 800;
    color: #1e293b;
}

.knowledge-stat-label {
    color: rgba(148, 163, 184, 0.88);
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.knowledge-map-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.9fr);
    gap: 16px;
    min-height: 0;
    flex: 1 1 auto;
}

.knowledge-atlas-panel,
.knowledge-inspector,
.knowledge-learning-panel {
    padding: 18px;
    min-height: 0;
}

.knowledge-atlas-panel,
.knowledge-inspector {
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow: hidden;
}

.knowledge-tools-row {
    display: grid;
    grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
    gap: 14px;
}

.knowledge-control {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.knowledge-control span {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(148, 163, 184, 0.86);
}

.knowledge-control select,
.knowledge-search-box {
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(30, 41, 59, 0.08);
    min-height: 48px;
    color: var(--text-primary);
}

.knowledge-control select {
    appearance: none;
    -webkit-appearance: none;
    padding: 12px 14px;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    outline: none;
}

.knowledge-search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
}

.knowledge-search-box i {
    color: rgba(96, 165, 250, 0.9);
    font-size: 17px;
}

.knowledge-search-box input {
    flex: 1 1 auto;
    min-width: 0;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 14px;
    outline: none;
}

.knowledge-search-box input::placeholder {
    color: rgba(148, 163, 184, 0.64);
}

.knowledge-mode-switch {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.knowledge-mode-btn {
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid rgba(30, 41, 59, 0.08);
    background: rgba(30, 41, 59, 0.04);
    color: #cbd5e1;
    padding: 10px 14px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.knowledge-mode-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(96, 165, 250, 0.32);
}

.knowledge-mode-btn.is-active {
    background: linear-gradient(135deg, rgba(67, 56, 202, 0.18), rgba(59, 130, 246, 0.18));
    border-color: rgba(67, 56, 202, 0.3);
    color: #1e293b;
}

.knowledge-atlas-board {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    border-radius: 26px;
    padding: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.8200000000000001), rgba(255, 255, 255, 0.88));
    border: 1px solid rgba(30, 41, 59, 0.06);
}

.atlas-board-backdrop {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 18% 20%, rgba(67, 56, 202, 0.11), transparent 24%),
        radial-gradient(circle at 82% 18%, rgba(56, 189, 248, 0.11), transparent 24%),
        linear-gradient(rgba(148, 163, 184, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.04) 1px, transparent 1px);
    background-size: auto, auto, 28px 28px, 28px 28px;
    pointer-events: none;
}

.atlas-core-card,
.atlas-zone-card {
    position: relative;
    z-index: 1;
}

.atlas-core-card {
    position: relative;
    overflow: hidden;
    margin-bottom: 18px;
    padding: 22px 22px 20px;
    border-radius: 28px;
    border: 1px solid rgba(67, 56, 202, 0.18);
    background:
        linear-gradient(135deg, rgba(67, 56, 202, 0.11), transparent 36%),
        linear-gradient(315deg, rgba(34, 211, 238, 0.09), transparent 32%),
        rgba(255, 252, 243, 0.8200000000000001);
}

.atlas-core-ring {
    position: absolute;
    width: 220px;
    height: 220px;
    right: -60px;
    top: -80px;
    border-radius: 50%;
    border: 1px solid rgba(67, 56, 202, 0.2);
    box-shadow: 0 0 0 22px rgba(67, 56, 202, 0.03), 0 0 0 48px rgba(59, 130, 246, 0.04);
}

.atlas-core-copy h3 {
    font-family: var(--font-heading);
    font-size: clamp(28px, 3vw, 38px);
    line-height: 1;
    margin-top: 10px;
}

.atlas-core-copy p {
    max-width: 62ch;
    margin-top: 10px;
    color: #1e293b;
    line-height: 1.8;
    font-size: 14px;
}

.atlas-core-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.atlas-core-tags span,
.atlas-zone-count,
.inspector-chip,
.inspector-importance {
    display: inline-flex;
    align-items: center;
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.atlas-core-tags span {
    background: rgba(30, 41, 59, 0.05);
    color: #cbd5e1;
}

.atlas-zones-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.atlas-zone-card {
    padding: 16px;
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(255, 252, 243, 0.78), rgba(255, 255, 255, 0.84));
    border: 1px solid rgba(30, 41, 59, 0.07);
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 0;
}

.atlas-zone-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.atlas-zone-head p {
    margin-top: 8px;
    color: rgba(148, 163, 184, 0.86);
    font-size: 12px;
    line-height: 1.65;
}

.atlas-zone-count {
    background: rgba(30, 41, 59, 0.05);
    color: #1e293b;
}

.atlas-node-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-content: flex-start;
}

.atlas-node {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    text-align: left;
    border: 1px solid rgba(30, 41, 59, 0.08);
    background: rgba(30, 41, 59, 0.04);
    border-radius: 18px;
    padding: 12px 13px;
    color: #1e293b;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, opacity 0.18s ease;
}

.atlas-node:hover {
    transform: translateY(-2px);
    border-color: rgba(96, 165, 250, 0.28);
}

.atlas-node.is-active {
    background: linear-gradient(135deg, rgba(67, 56, 202, 0.14), rgba(59, 130, 246, 0.14));
    border-color: rgba(67, 56, 202, 0.32);
}

.atlas-node.is-related:not(.is-active) {
    border-color: rgba(34, 211, 238, 0.24);
    box-shadow: inset 0 0 0 1px rgba(34, 211, 238, 0.08);
}

.atlas-node.is-dimmed {
    opacity: 0.42;
}

.atlas-node.importance-must_know .atlas-node-title::before {
    content: '�?;
    color: #4338ca;
    margin-right: 8px;
}

.atlas-node.importance-high .atlas-node-title::before {
    content: '�?;
    color: #0369a1;
    margin-right: 8px;
}

.atlas-node-title {
    display: block;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.5;
}

.atlas-node-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 7px;
    color: rgba(148, 163, 184, 0.9);
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.knowledge-inspector {
    overflow: auto;
}

.inspector-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.inspector-head h3 {
    font-family: var(--font-heading);
    font-size: clamp(24px, 2.2vw, 32px);
    line-height: 1.02;
    margin-top: 8px;
}

.inspector-importance {
    background: rgba(30, 41, 59, 0.05);
    color: #1e293b;
}

.inspector-importance.importance-must_know {
    background: rgba(67, 56, 202, 0.16);
    color: #4338ca;
}

.inspector-importance.importance-high {
    background: rgba(34, 211, 238, 0.16);
    color: #1e293b;
}

.inspector-summary {
    margin-top: 14px;
    color: #1e293b;
    line-height: 1.85;
    font-size: 14px;
}

.inspector-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.inspector-chip {
    background: rgba(30, 41, 59, 0.05);
    color: #cbd5e1;
}

.inspector-section {
    margin-top: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.relation-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.relation-card,
.related-node-card,
.resource-btn,
.learning-step {
    border-radius: 18px;
    border: 1px solid rgba(30, 41, 59, 0.08);
    background: rgba(30, 41, 59, 0.04);
}

.relation-card {
    padding: 14px;
}

.relation-card h4 {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #1e293b;
}

.relation-list,
.related-node-grid,
.resource-list {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.relation-pill,
.related-node-card,
.resource-btn,
.learning-step {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    color: var(--text-primary);
}

.relation-pill {
    padding: 11px 12px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.64);
    border: 1px solid rgba(30, 41, 59, 0.06);
}

.relation-pill small {
    color: rgba(148, 163, 184, 0.8);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.relation-empty {
    color: rgba(148, 163, 184, 0.86);
    font-size: 13px;
    line-height: 1.7;
}

.related-node-card,
.resource-btn {
    padding: 13px 14px;
    transition: transform 0.18s ease, border-color 0.18s ease;
}

.related-node-card:hover,
.resource-btn:hover,
.learning-step:hover,
.relation-pill:hover {
    transform: translateY(-1px);
    border-color: rgba(96, 165, 250, 0.24);
}

.related-node-card strong,
.resource-btn span,
.learning-step-copy strong {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
}

.related-node-card span,
.resource-btn small,
.learning-step-copy small {
    display: block;
    margin-top: 6px;
    color: rgba(148, 163, 184, 0.88);
    line-height: 1.65;
    font-size: 12px;
}

.knowledge-learning-panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.knowledge-section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
}

.knowledge-section-head h3 {
    margin-top: 8px;
    font-family: var(--font-heading);
    font-size: 22px;
}

.knowledge-section-head p {
    max-width: 58ch;
    color: rgba(148, 163, 184, 0.88);
    font-size: 13px;
    line-height: 1.7;
}

.knowledge-learning-path {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.learning-step {
    display: flex;
    gap: 12px;
    padding: 13px 14px;
    align-items: flex-start;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.learning-step.is-active {
    background: linear-gradient(135deg, rgba(67, 56, 202, 0.14), rgba(59, 130, 246, 0.14));
    border-color: rgba(67, 56, 202, 0.28);
}

.learning-step-order {
    min-width: 40px;
    height: 40px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: rgba(67, 56, 202, 0.12);
    color: #4338ca;
    font-size: 12px;
    font-weight: 800;
    flex-shrink: 0;
}

@media (max-width: 1260px) {
    .knowledge-map-grid {
        grid-template-columns: 1fr;
    }

    .knowledge-map-hero {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 980px) {
    .knowledge-tools-row,
    .atlas-zones-grid,
    .knowledge-learning-path {
        grid-template-columns: 1fr;
    }

    .knowledge-section-head {
        flex-direction: column;
        align-items: stretch;
    }

    .knowledge-hero-stats {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

.detective-header {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(280px, 392px);
    gap: 12px;
    padding: 10px 16px;
    align-items: center;
}

.detective-title-block h2 {
    font-family: var(--font-heading);
    font-size: clamp(18px, 1.85vw, 26px);
    line-height: 1.02;
    margin-top: 4px;
}

.current-case-card {
    border-radius: 18px;
    padding: 10px 14px;
    background: linear-gradient(135deg, rgba(49, 46, 129, 0.14), rgba(255, 252, 243, 0.75));
    border: 1px solid rgba(67, 56, 202, 0.2);
    min-height: 70px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
}

.current-case-card .current-case-label {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #4338ca;
}

.current-case-card .current-case-title {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 800;
    line-height: 1.1;
}

.current-case-card .current-case-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 11px;
}

.case-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
}

.case-progress-track {
    position: relative;
    flex: 1 1 auto;
    height: 8px;
    border-radius: 999px;
    background: rgba(30, 41, 59, 0.06);
    overflow: hidden;
}

.case-progress-fill {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, rgba(49, 46, 129, 0.95), rgba(59, 130, 246, 0.9));
    box-shadow: 0 0 14px rgba(49, 46, 129, 0.22);
}

.case-progress-meta {
    min-width: 38px;
    text-align: right;
    font-size: 11px;
    font-weight: 800;
    color: #1e293b;
    opacity: 0.72;
}

/* 顶栏 */
.top-bar {
    height: 72px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: relative;
    z-index: 90;
    overflow: visible;
}

.course-info h2 {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    max-width: min(42vw, 520px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.top-bar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.lesson-switcher {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 220px;
}

.lesson-switcher span {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.lesson-switcher select {
    appearance: none;
    -webkit-appearance: none;
    background: rgba(255, 255, 255, 0.28);
    border: 1px solid rgba(30, 41, 59, 0.1);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    padding: 10px 14px;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.lesson-switcher select:hover,
.lesson-switcher select:focus {
    border-color: rgba(96, 165, 250, 0.4);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
    background: rgba(255, 252, 243, 0.75);
}

.badge {
    display: inline-block;
    background: var(--accent-blue);
    color: #1e293b;
    font-size: 10px;
    text-transform: uppercase;
    font-weight: 800;
    padding: 4px 8px;
    border-radius: 20px;
    margin-bottom: 4px;
    letter-spacing: 1px;
}

.stats {
    display: flex;
    gap: 10px;
    position: relative;
}

.stat-item {
    background: rgba(255, 255, 255, 0.3);
    padding: 8px 12px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-copy {
    min-width: 0;
}

.stat-copy strong,
.stat-copy small {
    display: block;
    white-space: nowrap;
}
.mission-trigger {
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid rgba(30, 41, 59, 0.08);
    color: var(--text-primary);
    cursor: pointer;
    min-height: 44px;
    text-align: left;
}

.mission-trigger:hover,
.mission-trigger:focus-visible,
.mission-trigger.is-open {
    background: rgba(236, 253, 245, 0.82);
    border-color: rgba(5, 150, 105, 0.28);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
    outline: none;
}

.mission-trigger.is-complete {
    background: rgba(220, 252, 231, 0.82);
}

.text-emerald {
    color: #059669;
}

.mission-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 60;
    width: min(420px, 92vw);
    padding: 14px;
    border: 1px solid rgba(30, 41, 59, 0.12);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 22px 60px rgba(15, 23, 42, 0.18);
}

.mission-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.mission-panel-head strong {
    display: block;
    font-size: 15px;
    color: #0f172a;
}

.mission-panel-head span {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.45;
}

.mission-panel-close {
    width: 30px;
    height: 30px;
    border: 1px solid rgba(30, 41, 59, 0.12);
    border-radius: 10px;
    background: rgba(248, 250, 252, 0.9);
    color: #334155;
    cursor: pointer;
}

.mission-list {
    display: grid;
    gap: 8px;
}

.mission-item {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 1px solid rgba(30, 41, 59, 0.08);
    border-radius: 12px;
    background: rgba(248, 250, 252, 0.72);
}

.mission-item.is-complete {
    border-color: rgba(5, 150, 105, 0.24);
    background: rgba(236, 253, 245, 0.78);
}

.mission-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #475569;
    font-size: 15px;
}

.mission-item.is-complete .mission-check {
    background: #059669;
    color: #fff;
}

.mission-copy strong {
    display: block;
    font-size: 13px;
    color: #0f172a;
}

.mission-copy span {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    line-height: 1.4;
    color: var(--text-secondary);
}

.mission-action {
    border: 1px solid rgba(37, 99, 235, 0.18);
    border-radius: 10px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 700;
    padding: 7px 10px;
    cursor: pointer;
    white-space: nowrap;
}

.mission-action:hover,
.mission-action:focus-visible {
    background: #dbeafe;
    outline: none;
}

.mission-recommendation {
    margin-top: 10px;
    padding: 10px;
    border-radius: 12px;
    background: #fff7ed;
    color: #9a3412;
    font-size: 12px;
    line-height: 1.5;
}

.mission-recommendation:empty {
    display: none;
}
.text-yellow { color: var(--warning); }
.text-orange { color: #f97316; }

/* 课堂核心交互�?*/
.classroom-area {
    display: flex;
    gap: 16px;
    flex-grow: 1;
    overflow: hidden;
}

/* 左侧黑板 (60%) */
.blackboard-section {
    flex: 6;
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.canvas-header {
    height: 44px;
    background: rgba(255, 255, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    border-bottom: 1px solid var(--panel-border);
}

.canvas-note-slot {
    display: flex;
    align-items: center;
    min-width: 168px;
}

.tools {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tools button,
.canvas-fullscreen-exit {
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid rgba(30, 41, 59, 0.12);
    background: rgba(255, 252, 243, 0.72);
    color: #1e293b;
    transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.tools button {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.tools button:hover,
.canvas-fullscreen-exit:hover {
    border-color: rgba(96, 165, 250, 0.45);
    background: rgba(252, 238, 225, 0.86);
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(255, 255, 255, 0.28);
}

.tools button:focus-visible,
.canvas-fullscreen-exit:focus-visible {
    outline: 2px solid rgba(30, 41, 59, 0.92);
    outline-offset: 2px;
}

.dots { display: flex; gap: 6px; }
.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot.red { background: #ff5f56; }
.dot.yellow { background: #4338ca; }
.dot.green { background: #27c93f; }

.assistant-note-anchor {
    appearance: none;
    -webkit-appearance: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px 6px 6px;
    border-radius: 999px;
    border: 1px solid rgba(16, 185, 129, 0.24);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.18), rgba(236, 253, 245, 0.94));
    color: #065f46;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(16, 185, 129, 0.12);
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.assistant-note-anchor:hover {
    transform: translateY(-1px);
    border-color: rgba(16, 185, 129, 0.4);
    box-shadow: 0 14px 28px rgba(16, 185, 129, 0.18);
}

.assistant-note-anchor img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    flex-shrink: 0;
}

.assistant-note-anchor-copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
    line-height: 1.05;
}

.assistant-note-anchor-copy strong {
    font-size: 12px;
    font-weight: 800;
    color: #064e3b;
}

.assistant-note-anchor-copy small {
    font-size: 10px;
    color: rgba(6, 95, 70, 0.74);
}

.assistant-note-anchor-count {
    min-width: 22px;
    height: 22px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    padding: 0 6px;
    background: rgba(6, 95, 70, 0.14);
    color: #065f46;
    font-size: 11px;
    font-weight: 800;
}

.canvas-title {
    font-size: 12px;
    color: var(--text-secondary);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.visualization-stage {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 28px 24px 224px;
    isolation: isolate;
    overflow: hidden;
    background:
        radial-gradient(circle at 50% 30%, rgba(226, 240, 255, 0.9), rgba(245, 250, 255, 0.82) 58%, rgba(250, 253, 255, 0.96) 100%),
        #f7fbff;
}

.whiteboard-static-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    pointer-events: none;
    opacity: 0;
    filter: saturate(0.92) brightness(1.06);
    transform: scale(1.04);
    transition: opacity 0.35s ease;
    z-index: 0;
}

.visualization-stage.is-lecture-active .whiteboard-static-bg {
    opacity: 0.18;
}

.canvas-fullscreen-exit {
    position: absolute;
    top: 18px;
    left: 18px;
    right: auto;
    z-index: 140;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 999px;
    padding: 9px 14px;
    font-size: 12px;
    font-weight: 700;
    backdrop-filter: blur(14px);
}

.canvas-fullscreen-exit i {
    font-size: 15px;
}

/* ============================================
   全息免疫视频�?- Hologram Intro Video
   ============================================ */
.hologram-effect {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #f4f9ff;
    z-index: 1;
    pointer-events: none;
}

.hologram-effect::before {
    content: '';
    position: absolute;
    inset: -36px;
    background: url('../assets/animations/home-whiteboard-poster.webp') center center / cover no-repeat;
    filter: blur(26px) saturate(0.95) brightness(1.08);
    opacity: 0.88;
    transform: scale(1.08);
    z-index: 0;
}

.hologram-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center center;
    transform: scale(1.015);
    z-index: 1;
}

/* --- 旧版 CSS 全息动画保留为回退资源样式 --- */
.holo-pulse-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(59, 130, 246, 0.25);
    animation: pulseExpand 4s ease-out infinite;
}
.ring-1 { width: 100%; height: 100%; animation-delay: 0s; }
.ring-2 { width: 100%; height: 100%; animation-delay: 1.33s; }
.ring-3 { width: 100%; height: 100%; animation-delay: 2.66s; }

@keyframes pulseExpand {
    0% {
        transform: scale(0.3);
        opacity: 0.8;
        border-color: rgba(96, 165, 250, 0.6);
        box-shadow: 0 0 20px rgba(59, 130, 246, 0.3), inset 0 0 20px rgba(59, 130, 246, 0.1);
    }
    100% {
        transform: scale(1.1);
        opacity: 0;
        border-color: rgba(59, 130, 246, 0);
        box-shadow: 0 0 0 rgba(59, 130, 246, 0);
    }
}

/* --- 轨道�?--- */
.orbit-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px dashed rgba(59, 130, 246, 0.12);
}

.orbit-1 {
    width: 340px; height: 340px;
    animation: orbitSpin 12s linear infinite;
}
.orbit-2 {
    width: 260px; height: 260px;
    animation: orbitSpin 9s linear infinite reverse;
}
.orbit-3 {
    width: 180px; height: 180px;
    animation: orbitSpin 15s linear infinite;
}

@keyframes orbitSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* --- 轨道上的免疫细胞 --- */
.orbit-cell {
    position: absolute;
    display: grid;
    place-items: center;
    backdrop-filter: blur(6px);
    border: 1px solid;
    animation: cellPulse 2.5s ease-in-out infinite;
}

.cell-svg {
    width: 100%;
    height: 100%;
    padding: 4px;
}

.orbit-1 .orbit-cell { top: -24px; left: calc(50% - 24px); }
.orbit-2 .orbit-cell { top: -26px; left: calc(50% - 26px); }
.orbit-3 .orbit-cell { top: -20px; left: calc(50% - 20px); }

/* 抗体 - 紫罗�?(Y�? 外层轨道) */
.cell-antibody {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(139, 92, 246, 0.2);
    border-color: rgba(167, 139, 250, 0.6);
    color: #c4b5fd;
    box-shadow: 0 0 18px rgba(139, 92, 246, 0.45);
    animation-delay: 0s;
}

/* 树突状细�?- 青碧 (星形分枝, 中层轨道) */
.cell-dc {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(6, 182, 212, 0.18);
    border-color: rgba(34, 211, 238, 0.55);
    color: #0369a1;
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.4);
    animation-delay: 0.8s;
}

/* T细胞 - 宝蓝 (圆形+T�? 内层轨道) */
.cell-tcell {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.25);
    border-color: rgba(96, 165, 250, 0.65);
    color: #93c5fd;
    box-shadow: 0 0 16px rgba(59, 130, 246, 0.45);
    animation-delay: 1.6s;
}

.tcell-nucleus {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(147, 197, 253, 0.85);
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.6);
}

@keyframes cellPulse {
    0%, 100% { transform: scale(1); filter: brightness(1); }
    50% { transform: scale(1.15); filter: brightness(1.3); }
}

/* --- 中心核心 --- */
.holo-core {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    z-index: 2;
}

.core-hex {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(55, 237, 247, 0.35));
    border: 2px solid rgba(248, 113, 113, 0.5);
    border-radius: 20px;
    display: grid;
    place-items: center;
    font-size: 40px;
    color: #fca5a5;
    animation: coreGlow 3s ease-in-out infinite alternate;
    box-shadow:
        0 0 30px rgba(239, 68, 68, 0.3),
        0 0 60px rgba(239, 68, 68, 0.1),
        inset 0 0 20px rgba(239, 68, 68, 0.15);
    transform: rotate(45deg);
}

.core-hex i {
    transform: rotate(-45deg);
    filter: drop-shadow(0 0 8px rgba(248, 113, 113, 0.8));
}

@keyframes coreGlow {
    0% {
        box-shadow:
            0 0 30px rgba(239, 68, 68, 0.3),
            0 0 60px rgba(239, 68, 68, 0.1),
            inset 0 0 20px rgba(239, 68, 68, 0.15);
        border-color: rgba(248, 113, 113, 0.4);
    }
    100% {
        box-shadow:
            0 0 50px rgba(239, 68, 68, 0.5),
            0 0 100px rgba(239, 68, 68, 0.2),
            inset 0 0 30px rgba(239, 68, 68, 0.25);
        border-color: rgba(248, 113, 113, 0.7);
    }
}

.core-label {
    font-family: var(--font-heading);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 3px;
    text-align: center;
    color: rgba(252, 165, 165, 0.8);
    text-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
    animation: labelFlicker 4s ease-in-out infinite;
}

@keyframes labelFlicker {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
    72% { opacity: 0.5; }
    74% { opacity: 1; }
}

/* --- 扫描光束 --- */
.scan-beam {
    position: absolute;
    width: 50%;
    height: 2px;
    left: 50%;
    top: 50%;
    transform-origin: left center;
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.8), transparent);
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.5);
    animation: beamSweep 6s linear infinite;
}

.scan-beam::after {
    content: '';
    position: absolute;
    right: 0;
    top: -4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(96, 165, 250, 0.9);
    box-shadow: 0 0 16px rgba(59, 130, 246, 0.8);
}

.scan-beam-2 {
    animation-delay: -3s;
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.6), transparent);
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.4);
    opacity: 0.6;
}

@keyframes beamSweep {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* --- 浮动粒子 (抗体/细胞因子) --- */
.holo-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: rgba(147, 197, 253, 0.8);
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.6);
    animation: particleDrift 8s ease-in-out infinite;
}

.p1 { top: 12%; left: 20%; animation-duration: 7s; animation-delay: 0s; width: 3px; height: 3px; }
.p2 { top: 25%; right: 15%; animation-duration: 9s; animation-delay: 1s; width: 5px; height: 5px; background: rgba(110, 231, 183, 0.7); box-shadow: 0 0 8px rgba(16, 185, 129, 0.5); }
.p3 { bottom: 30%; left: 10%; animation-duration: 6s; animation-delay: 2s; }
.p4 { bottom: 15%; right: 25%; animation-duration: 10s; animation-delay: 0.5s; width: 6px; height: 6px; background: rgba(252, 211, 77, 0.6); box-shadow: 0 0 8px rgba(49, 46, 129, 0.4); }
.p5 { top: 40%; left: 8%; animation-duration: 8s; animation-delay: 3s; width: 3px; height: 3px; }
.p6 { top: 60%; right: 8%; animation-duration: 7.5s; animation-delay: 1.5s; width: 5px; height: 5px; background: rgba(196, 181, 253, 0.7); box-shadow: 0 0 8px rgba(139, 92, 246, 0.5); }
.p7 { top: 80%; left: 35%; animation-duration: 11s; animation-delay: 4s; width: 3px; height: 3px; }
.p8 { top: 10%; right: 35%; animation-duration: 6.5s; animation-delay: 2.5s; width: 4px; height: 4px; background: rgba(252, 165, 165, 0.6); box-shadow: 0 0 8px rgba(239, 68, 68, 0.4); }

@keyframes particleDrift {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.4; }
    25% { transform: translate(12px, -18px) scale(1.3); opacity: 1; }
    50% { transform: translate(-8px, -30px) scale(0.8); opacity: 0.6; }
    75% { transform: translate(15px, -10px) scale(1.1); opacity: 0.9; }
}

/* --- 数据流装饰线 --- */
.data-stream {
    position: absolute;
    width: 1px;
    background: linear-gradient(180deg, transparent, rgba(59, 130, 246, 0.4), transparent);
    animation: dataFlow 3s linear infinite;
}

.stream-1 {
    height: 80px;
    left: 15%;
    top: 10%;
    animation-delay: 0s;
}

.stream-2 {
    height: 60px;
    right: 12%;
    bottom: 15%;
    animation-delay: 1.5s;
}

@keyframes dataFlow {
    0% { opacity: 0; transform: translateY(-20px); }
    30% { opacity: 0.7; }
    70% { opacity: 0.7; }
    100% { opacity: 0; transform: translateY(30px); }
}

/* --- HUD 角标 --- */
.holo-hud {
    position: absolute;
    font-family: var(--font-heading);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 2px;
    line-height: 1.4;
    color: rgba(148, 163, 184, 0.5);
    text-shadow: 0 0 6px rgba(59, 130, 246, 0.2);
}

.hud-tl {
    top: 20px;
    left: 24px;
    border-left: 2px solid rgba(59, 130, 246, 0.3);
    padding-left: 8px;
}

.hud-br {
    bottom: 20px;
    right: 24px;
    text-align: right;
    border-right: 2px solid rgba(59, 130, 246, 0.3);
    padding-right: 8px;
}

/* 交互卡片�?*/
.interactive-cards {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 14px;
    width: 90%;
    justify-content: center;
    z-index: 5;
}

.interactive-cards[data-active-deck-id="figureAtlas"] {
    justify-content: flex-start;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
    padding: 4px 4px 8px;
}

.interactive-cards[data-active-deck-id="figureAtlas"] .card {
    flex: 0 0 148px;
}

.card {
    background: rgba(255, 252, 243, 0.8);
    border: 1px solid rgba(30, 41, 59, 0.1);
    border-radius: var(--radius-md);
    padding: 14px;
    width: 148px;
    text-align: center;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    color: inherit;
    font: inherit;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(10px);
    position: relative;
}

.card:hover {
    transform: translateY(-10px) scale(1.05);
    background: rgba(245, 234, 226, 0.8);
    border-color: rgba(30, 41, 59, 0.2);
    box-shadow: 0 15px 30px rgba(255, 255, 255, 0.5);
}

.card:focus-visible {
    outline: 2px solid rgba(30, 41, 59, 0.9);
    outline-offset: 3px;
}

.card.is-completed {
    border-color: rgba(45, 212, 191, 0.65);
    background: linear-gradient(180deg, rgba(255, 197, 211, 0.78), rgba(255, 252, 243, 0.84));
    box-shadow: 0 14px 34px rgba(8, 145, 178, 0.24);
}

.card.is-locked {
    opacity: 0.52;
    background: rgba(226, 232, 240, 0.4) !important;
    border: 1px dashed rgba(30, 41, 59, 0.22) !important;
    cursor: not-allowed;
    pointer-events: none;
    box-shadow: none !important;
    transform: none !important;
}

.card.is-locked .card-emblem,
.card.is-locked i,
.card.is-locked h4,
.card.is-locked p {
    filter: grayscale(1) opacity(0.6);
}

.card.is-locked::after {
    content: '锁定';
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.18);
    border: 1px solid rgba(148, 163, 184, 0.4);
    color: #64748b;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.card.is-completed::after {
    content: '已探�?;
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(45, 212, 191, 0.18);
    border: 1px solid rgba(45, 212, 191, 0.4);
    color: #1e293b;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.card i {
    font-size: 32px;
    margin-bottom: 8px;
    display: inline-block;
}

.icon-red { color: var(--danger); text-shadow: 0 0 15px rgba(239, 68, 68, 0.4); }
.icon-green { color: var(--success); text-shadow: 0 0 15px rgba(16, 185, 129, 0.4); }
.icon-blue { color: var(--accent-blue); text-shadow: 0 0 15px rgba(59, 130, 246, 0.4); }
.icon-purple { color: #a855f7; text-shadow: 0 0 15px rgba(168, 85, 247, 0.4); filter: drop-shadow(0 0 10px rgba(168,85,247,0.4)); }
.icon-cyan { color: #06b6d4; text-shadow: 0 0 15px rgba(6, 182, 212, 0.4); filter: drop-shadow(0 0 10px rgba(6,182,212,0.4)); }

.pixel-icon {
    width: 50px;
    height: 50px;
    margin-bottom: 12px;
    fill: currentColor;
}

.card-emblem,
.viz-emblem {
    display: grid;
    place-items: center;
    margin: 0 auto 12px;
    font-family: var(--font-heading);
    font-weight: 800;
    letter-spacing: 0.04em;
    border: 1px solid rgba(30, 41, 59, 0.12);
}

.card-emblem {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    font-size: 18px;
}

.viz-emblem {
    width: 88px;
    height: 88px;
    border-radius: 24px;
    padding: 10px;
    font-size: clamp(18px, 1.7vw, 24px);
    line-height: 1;
    text-align: center;
    word-break: break-word;
    box-shadow: 0 18px 40px rgba(255, 252, 243, 0.28);
}

.caption-box {
    position: absolute;
    inset: 28px 24px 210px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(96px, 140px);
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas:
        "title media"
        "body media";
    align-items: start;
    column-gap: 28px;
    row-gap: 12px;
    min-width: 0;
    overflow: hidden;
    z-index: 3;
    pointer-events: none;
    transition: inset 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), grid-template-columns 0.4s ease;
}

.caption-box:has(.viz-figure),
.caption-box.has-figure {
    inset: 28px 24px 190px;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 300px);
    column-gap: 24px;
}

/* 小疫笔记打开时保留右侧阅读区，但图文白板不能被压成窄列�?*/
.blackboard-section:has(#assistantPopup:not(.hidden)) .caption-box {
    inset: 28px 360px 210px 24px;
}

.blackboard-section.has-assistant-note .caption-box {
    inset: 28px 360px 210px 24px;
}

.blackboard-section:has(#assistantPopup:not(.hidden)) .caption-box:has(.viz-figure),
.blackboard-section:has(#assistantPopup:not(.hidden)) .caption-box.has-figure {
    inset: 24px 360px 198px 24px;
    grid-template-columns: minmax(230px, 0.95fr) minmax(176px, 240px);
    column-gap: 18px;
}

.blackboard-section.has-assistant-note .caption-box.has-figure {
    inset: 24px 360px 198px 24px;
    grid-template-columns: minmax(230px, 0.95fr) minmax(176px, 240px);
    column-gap: 18px;
}

.caption-box h3,
.caption-box p {
    max-width: 100%;
    margin: 0;
    text-shadow: 0 8px 18px rgba(255, 255, 255, 0.45);
}

.caption-box h3 {
    grid-area: title;
    align-self: end;
    font-family: var(--font-heading);
    font-size: clamp(20px, 1.95vw, 30px);
    line-height: 1.18;
    letter-spacing: 0;
    text-wrap: balance;
    overflow-wrap: break-word;
}

.caption-box p {
    grid-area: body;
    max-width: min(760px, 100%);
    font-size: clamp(14px, 1.05vw, 17px);
    line-height: 1.42;
    color: rgba(30, 41, 59, 0.96);
    pointer-events: auto;
    touch-action: pan-y;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.caption-box .viz-emblem,
.caption-box .viz-hero,
.caption-box .viz-figure,
.caption-box > img,
.caption-box > svg {
    grid-area: media;
    align-self: center;
    justify-self: center;
}

.caption-box .viz-emblem {
    margin: 0;
}

.caption-box .viz-hero {
    width: min(110px, 100%);
    height: auto;
    margin: 0;
}

.caption-box .viz-figure {
    width: min(100%, 360px);
    max-height: 250px;
    object-fit: contain;
    margin: 0;
    align-self: end;
    justify-self: end;
    border-radius: 20px;
    padding: 10px 12px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(255, 255, 255, 0.56)),
        radial-gradient(circle at top, rgba(96, 165, 250, 0.08), transparent 58%);
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: 0 22px 48px rgba(255, 255, 255, 0.42);
}

.caption-box:has(.figure-atlas-image),
.caption-box.figure-atlas-caption {
    inset: 24px 24px 184px;
    grid-template-columns: minmax(220px, 0.34fr) minmax(320px, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas:
        "title title"
        "body media";
    align-items: stretch;
    column-gap: 22px;
    row-gap: 12px;
}

.caption-box .figure-atlas-image {
    grid-area: media;
    position: static;
    transform: none;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: 100%;
    align-self: stretch;
    justify-self: stretch;
    object-fit: contain;
    padding: 12px 14px;
}

.whiteboard-history-btn {
    position: absolute;
    top: 50%;
    z-index: 18;
    display: grid;
    place-items: center;
    width: 38px;
    height: 54px;
    border: 1px solid rgba(30, 41, 59, 0.1);
    border-radius: 14px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(255, 252, 243, 0.72)),
        radial-gradient(circle at top, rgba(45, 212, 191, 0.16), transparent 58%);
    color: rgba(30, 41, 59, 0.72);
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.08);
    cursor: pointer;
    transform: translateY(-50%);
    transition: opacity 0.18s ease, transform 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.whiteboard-history-btn i {
    font-size: 24px;
    line-height: 1;
}

.whiteboard-history-prev {
    left: 10px;
}

.whiteboard-history-next {
    right: 10px;
}

.whiteboard-history-btn:hover:not(:disabled),
.whiteboard-history-btn:focus-visible:not(:disabled) {
    color: #0f766e;
    border-color: rgba(20, 184, 166, 0.34);
    transform: translateY(-50%) scale(1.04);
}

.whiteboard-history-btn:focus-visible {
    outline: 2px solid rgba(20, 184, 166, 0.42);
    outline-offset: 2px;
}

.whiteboard-history-btn:disabled {
    opacity: 0.28;
    cursor: default;
    box-shadow: none;
}

.visualization-stage:has(.whiteboard-history-btn:not(.hidden)) .caption-box {
    left: 58px;
    right: 58px;
}

.visualization-stage:has(.whiteboard-history-btn:not(.hidden)) .caption-box.has-figure,
.visualization-stage:has(.whiteboard-history-btn:not(.hidden)) .caption-box.figure-atlas-caption {
    left: 58px;
    right: 58px;
}

.blackboard-section:has(#assistantPopup:not(.hidden)) .visualization-stage:has(.whiteboard-history-btn:not(.hidden)) .caption-box,
.blackboard-section.has-assistant-note .visualization-stage:has(.whiteboard-history-btn:not(.hidden)) .caption-box {
    left: 58px;
}

.caption-box.figure-atlas-caption h3,
.caption-box.figure-atlas-caption p {
    max-width: 100%;
}

.caption-box.figure-atlas-caption h3 {
    align-self: end;
    font-size: clamp(22px, 1.9vw, 30px);
    line-height: 1.14;
}

.caption-box.figure-atlas-caption p {
    align-self: stretch;
    overflow: auto;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(255, 252, 243, 0.64);
    border: 1px solid rgba(148, 163, 184, 0.14);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

.blackboard-section:has(#assistantPopup:not(.hidden)) .caption-box:has(.viz-figure) h3,
.blackboard-section.has-assistant-note .caption-box.has-figure h3 {
    font-size: clamp(18px, 1.45vw, 24px);
    line-height: 1.16;
}

.blackboard-section:has(#assistantPopup:not(.hidden)) .caption-box:has(.viz-figure) p,
.blackboard-section.has-assistant-note .caption-box.has-figure p {
    font-size: clamp(12.5px, 0.9vw, 15px);
    line-height: 1.48;
}

.blackboard-section:has(#assistantPopup:not(.hidden)) .caption-box:has(.viz-figure) .viz-figure,
.blackboard-section.has-assistant-note .caption-box.has-figure .viz-figure {
    width: min(100%, 250px);
    max-height: 190px;
    padding: 8px 10px;
    border-radius: 18px;
}

.blackboard-section:has(#assistantPopup:not(.hidden)) .caption-box.figure-atlas-caption,
.blackboard-section.has-assistant-note .caption-box.figure-atlas-caption {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto minmax(0, 1fr);
    grid-template-areas:
        "title"
        "body"
        "media";
    row-gap: 10px;
}

.blackboard-section:has(#assistantPopup:not(.hidden)) .caption-box.figure-atlas-caption p,
.blackboard-section.has-assistant-note .caption-box.figure-atlas-caption p {
    align-self: start;
    max-height: 72px;
}

.blackboard-section:has(#assistantPopup:not(.hidden)) .caption-box .figure-atlas-image,
.blackboard-section.has-assistant-note .caption-box .figure-atlas-image {
    width: 100%;
    height: auto;
    max-height: 180px;
}

.blackboard-section:fullscreen,
.blackboard-section.is-fullscreen {
    width: 100vw;
    height: 100vh;
    max-width: none;
    max-height: none;
    border-radius: 0;
    background:
        radial-gradient(circle at top, rgba(245, 234, 226, 0.52), transparent 48%),
        linear-gradient(180deg, rgba(255, 255, 249, 0.88), rgba(255, 252, 243, 0.88));
}

body.is-canvas-viewport-maximized {
    overflow: hidden;
}

.blackboard-section.is-viewport-maximized {
    position: fixed;
    inset: 0;
    z-index: 9990;
    width: 100vw;
    height: 100dvh;
    max-width: none;
    max-height: none;
    overflow: hidden;
}

.blackboard-section:fullscreen .glass-panel,
.blackboard-section.is-fullscreen .glass-panel {
    backdrop-filter: none;
}

.blackboard-section:fullscreen .canvas-header,
.blackboard-section.is-fullscreen .canvas-header {
    height: 56px;
    padding: 0 20px;
}

.blackboard-section:fullscreen .canvas-title,
.blackboard-section.is-fullscreen .canvas-title {
    font-size: 13px;
    letter-spacing: 0.12em;
}

.blackboard-section:fullscreen .visualization-stage,
.blackboard-section.is-fullscreen .visualization-stage {
    padding: 42px 34px 202px;
}

.blackboard-section:fullscreen .caption-box,
.blackboard-section.is-fullscreen .caption-box {
    inset: 42px 34px 182px;
}

.blackboard-section:fullscreen:has(#assistantPopup:not(.hidden)) .caption-box,
.blackboard-section.is-fullscreen:has(#assistantPopup:not(.hidden)) .caption-box {
    inset: 42px 360px 182px 34px;
}

.blackboard-section:fullscreen .caption-box:has(.viz-figure),
.blackboard-section.is-fullscreen .caption-box:has(.viz-figure),
.blackboard-section:fullscreen .caption-box.has-figure,
.blackboard-section.is-fullscreen .caption-box.has-figure {
    grid-template-columns: minmax(0, 0.9fr) minmax(320px, 520px);
    inset: 42px 34px 170px;
    column-gap: 34px;
}

.blackboard-section:fullscreen:has(#assistantPopup:not(.hidden)) .caption-box:has(.viz-figure),
.blackboard-section.is-fullscreen:has(#assistantPopup:not(.hidden)) .caption-box:has(.viz-figure),
.blackboard-section:fullscreen:has(#assistantPopup:not(.hidden)) .caption-box.has-figure,
.blackboard-section.is-fullscreen:has(#assistantPopup:not(.hidden)) .caption-box.has-figure {
    inset: 42px 360px 170px 34px;
}

.blackboard-section:fullscreen.has-assistant-note .caption-box.has-figure,
.blackboard-section.is-fullscreen.has-assistant-note .caption-box.has-figure {
    inset: 42px 360px 170px 34px;
}

.blackboard-section:fullscreen .caption-box h3,
.blackboard-section.is-fullscreen .caption-box h3 {
    font-size: clamp(28px, 2.6vw, 46px);
}

.blackboard-section:fullscreen .caption-box p,
.blackboard-section.is-fullscreen .caption-box p {
    font-size: clamp(16px, 1.2vw, 21px);
    max-width: min(860px, 100%);
}

.blackboard-section:fullscreen .caption-box .viz-figure,
.blackboard-section.is-fullscreen .caption-box .viz-figure {
    width: min(100%, 520px);
    max-height: 420px;
    border-radius: 26px;
    padding: 14px 16px;
}

.blackboard-section:fullscreen .caption-box:has(.figure-atlas-image),
.blackboard-section.is-fullscreen .caption-box:has(.figure-atlas-image),
.blackboard-section:fullscreen .caption-box.figure-atlas-caption,
.blackboard-section.is-fullscreen .caption-box.figure-atlas-caption {
    inset: 42px 34px 158px;
    grid-template-columns: minmax(300px, 0.36fr) minmax(520px, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas:
        "title title"
        "body media";
    column-gap: 30px;
    row-gap: 16px;
}

.blackboard-section:fullscreen .caption-box .figure-atlas-image,
.blackboard-section.is-fullscreen .caption-box .figure-atlas-image {
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: 100%;
}

.blackboard-section:fullscreen .caption-box.figure-atlas-caption h3,
.blackboard-section:fullscreen .caption-box.figure-atlas-caption p,
.blackboard-section.is-fullscreen .caption-box.figure-atlas-caption h3,
.blackboard-section.is-fullscreen .caption-box.figure-atlas-caption p {
    max-width: 100%;
}

.blackboard-section:fullscreen .caption-box.figure-atlas-caption h3,
.blackboard-section.is-fullscreen .caption-box.figure-atlas-caption h3 {
    font-size: clamp(24px, 2.2vw, 36px);
}

.blackboard-section:fullscreen .interactive-cards,
.blackboard-section.is-fullscreen .interactive-cards {
    width: min(1040px, calc(100% - 76px));
    bottom: 28px;
    gap: 16px;
}

.blackboard-section:fullscreen .whiteboard-history-btn,
.blackboard-section.is-fullscreen .whiteboard-history-btn {
    width: 46px;
    height: 64px;
    border-radius: 16px;
}

.blackboard-section:fullscreen .whiteboard-history-prev,
.blackboard-section.is-fullscreen .whiteboard-history-prev {
    left: 18px;
}

.blackboard-section:fullscreen .whiteboard-history-next,
.blackboard-section.is-fullscreen .whiteboard-history-next {
    right: 18px;
}

.blackboard-section:fullscreen .visualization-stage:has(.whiteboard-history-btn:not(.hidden)) .caption-box,
.blackboard-section.is-fullscreen .visualization-stage:has(.whiteboard-history-btn:not(.hidden)) .caption-box {
    left: 82px;
    right: 82px;
}

.blackboard-section:fullscreen .card,
.blackboard-section.is-fullscreen .card {
    width: 164px;
}

.blackboard-section:fullscreen .assistant-popup,
.blackboard-section.is-fullscreen .assistant-popup {
    top: 78px;
    right: 28px;
}

@media (max-width: 1500px) {
    .blackboard-section:has(#assistantPopup:not(.hidden)) .caption-box:has(.viz-figure),
    .blackboard-section.has-assistant-note .caption-box.has-figure {
        inset: 180px 24px 198px;
        grid-template-columns: 1fr;
        grid-template-rows: auto auto minmax(0, 1fr);
        grid-template-areas:
            "title"
            "body"
            "media";
        row-gap: 10px;
    }

    .blackboard-section:has(#assistantPopup:not(.hidden)) .caption-box .figure-atlas-image,
    .blackboard-section.has-assistant-note .caption-box .figure-atlas-image {
        width: 100%;
        height: auto;
        max-height: 150px;
        justify-self: center;
    }

    .blackboard-section:has(#assistantPopup:not(.hidden)) .caption-box.figure-atlas-caption p,
    .blackboard-section.has-assistant-note .caption-box.figure-atlas-caption p {
        align-self: start;
        max-height: 68px;
        padding: 10px 12px;
    }
}

@media (max-width: 1200px) {
    .blackboard-section:has(#assistantPopup:not(.hidden)) .caption-box:has(.viz-figure),
    .blackboard-section.has-assistant-note .caption-box.has-figure {
        inset: 245px 24px 198px;
        grid-template-columns: 1fr;
        grid-template-rows: auto auto minmax(0, 1fr);
        grid-template-areas:
            "title"
            "body"
            "media";
        row-gap: 10px;
    }

    .blackboard-section:has(#assistantPopup:not(.hidden)) .caption-box:has(.viz-figure) h3,
    .blackboard-section.has-assistant-note .caption-box.has-figure h3 {
        font-size: clamp(18px, 2.2vw, 22px);
        line-height: 1.16;
    }

    .blackboard-section:has(#assistantPopup:not(.hidden)) .caption-box:has(.viz-figure) p,
    .blackboard-section.has-assistant-note .caption-box.has-figure p {
        font-size: clamp(12.5px, 1.4vw, 14px);
        line-height: 1.45;
    }

    .blackboard-section:has(#assistantPopup:not(.hidden)) .caption-box:has(.viz-figure) .viz-figure,
    .blackboard-section.has-assistant-note .caption-box.has-figure .viz-figure {
        width: min(100%, 230px);
        max-height: 136px;
        justify-self: end;
        align-self: start;
    }

    .blackboard-section:not(:has(#assistantPopup:not(.hidden))) .caption-box:has(.viz-figure),
    .blackboard-section:not(.has-assistant-note) .caption-box.has-figure {
        inset: 28px 24px 198px;
        grid-template-columns: 1fr;
        grid-template-rows: auto auto minmax(0, 1fr);
        grid-template-areas:
            "title"
            "body"
            "media";
        row-gap: 12px;
    }

    .blackboard-section:not(:has(#assistantPopup:not(.hidden))) .caption-box:has(.viz-figure) h3,
    .blackboard-section:not(.has-assistant-note) .caption-box.has-figure h3 {
        font-size: clamp(20px, 2.6vw, 26px);
        line-height: 1.16;
    }

    .blackboard-section:not(:has(#assistantPopup:not(.hidden))) .caption-box:has(.viz-figure) p,
    .blackboard-section:not(.has-assistant-note) .caption-box.has-figure p {
        font-size: clamp(13px, 1.5vw, 15px);
        line-height: 1.48;
    }

    .blackboard-section:not(:has(#assistantPopup:not(.hidden))) .caption-box:has(.viz-figure) .viz-figure,
    .blackboard-section:not(.has-assistant-note) .caption-box.has-figure .viz-figure {
        width: min(100%, 260px);
        max-height: 170px;
        justify-self: end;
        align-self: start;
    }

    .caption-box.figure-atlas-caption,
    .blackboard-section:not(.has-assistant-note) .caption-box.figure-atlas-caption {
        grid-template-rows: auto auto minmax(0, 1fr);
        grid-template-areas:
            "title"
            "body"
            "media";
    }

    .caption-box.figure-atlas-caption .figure-atlas-image {
        width: 100%;
        height: auto;
        max-height: 220px;
        justify-self: center;
    }
}

.theme-amber {
    color: #fdba74;
    background: rgba(249, 115, 22, 0.15);
    border-color: rgba(249, 115, 22, 0.32);
    box-shadow: 0 0 24px rgba(249, 115, 22, 0.18);
}

.theme-rose {
    color: #fda4af;
    background: rgba(244, 63, 94, 0.15);
    border-color: rgba(244, 63, 94, 0.32);
    box-shadow: 0 0 24px rgba(244, 63, 94, 0.18);
}

.theme-cyan {
    color: #0369a1;
    background: rgba(6, 182, 212, 0.15);
    border-color: rgba(6, 182, 212, 0.32);
    box-shadow: 0 0 24px rgba(6, 182, 212, 0.18);
}

.theme-indigo {
    color: #c4b5fd;
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.32);
    box-shadow: 0 0 24px rgba(99, 102, 241, 0.18);
}

.card h4 { font-size: 13px; margin-bottom: 4px; font-weight: 700; }
.card p { font-size: 10.5px; color: var(--text-secondary); line-height: 1.35; }

.hidden { display: none !important; }

.viz-hero {
    display: block;
    width: 120px;
    height: 120px;
    margin: 0 auto 16px;
}

.pulse {
    animation: popPulse 1.6s ease-in-out infinite;
}

.rotate {
    animation: spinFloat 6s linear infinite;
}

.scan {
    animation: radarPulse 2s ease-in-out infinite;
}

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

@keyframes spinFloat {
    0% { transform: rotate(0deg) translateY(0); }
    50% { transform: rotate(180deg) translateY(-6px); }
    100% { transform: rotate(360deg) translateY(0); }
}

@keyframes radarPulse {
    0%, 100% { transform: scale(0.96); opacity: 0.85; }
    50% { transform: scale(1.08); opacity: 1; }
}

/* 右侧对话�?(40%) */
.dialogue-section {
    flex: 4;
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.participants-panel {
    height: 92px;
    min-height: 74px;
    max-height: 220px;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    border-bottom: 1px solid var(--panel-border);
    background: rgba(255, 255, 255, 0.45);
}

.participants-panel.is-resizing {
    user-select: none;
}

.participants-strip {
    display: flex;
    gap: 10px;
    padding: 12px 16px 10px;
    overflow-x: auto;
    overflow-y: hidden;
    background: transparent;
    scroll-padding-inline: 16px;
    scrollbar-color: rgba(148, 163, 184, 0.95) rgba(255, 252, 243, 0.75);
    scrollbar-width: auto;
    flex: 1;
}

.participants-strip::-webkit-scrollbar {
    height: 10px;
}

.participants-strip::-webkit-scrollbar-track {
    background: rgba(255, 252, 243, 0.75);
    border-radius: 999px;
}

.participants-strip::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, rgba(147, 197, 253, 0.92), rgba(125, 211, 252, 0.92));
    border-radius: 999px;
    border: 2px solid rgba(255, 252, 243, 0.72);
}

.participants-strip::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(90deg, rgba(30, 41, 59, 1), rgba(103, 232, 249, 1));
}

.participants-resizer {
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: ns-resize;
    flex-shrink: 0;
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.02), rgba(30, 41, 59, 0.05));
    border-top: 1px solid rgba(30, 41, 59, 0.06);
}

.participants-resizer span {
    width: 54px;
    height: 4px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.72);
    box-shadow: 0 0 16px rgba(148, 163, 184, 0.18);
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

.participants-panel.is-resizing .participants-resizer span,
.participants-resizer:hover span {
    background: rgba(30, 41, 59, 0.96);
    box-shadow: 0 0 18px rgba(96, 165, 250, 0.35);
}

.classroom-status-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--panel-border);
    background: rgba(255, 255, 254, 0.78);
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.78);
    box-shadow: 0 0 0 6px rgba(148, 163, 184, 0.08);
    flex-shrink: 0;
}

.status-copy {
    min-width: 0;
}

.status-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.02em;
}

.status-detail {
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.classroom-status-bar[data-tone="idle"] .status-dot {
    background: rgba(148, 163, 184, 0.9);
    box-shadow: 0 0 0 6px rgba(148, 163, 184, 0.1);
}

.classroom-status-bar[data-tone="lecture"] .status-dot {
    background: rgba(96, 165, 250, 0.95);
    box-shadow: 0 0 0 6px rgba(96, 165, 250, 0.14);
}

.classroom-status-bar[data-tone="choice"] .status-dot {
    background: rgba(67, 56, 202, 0.98);
    box-shadow: 0 0 0 6px rgba(67, 56, 202, 0.14);
}

.classroom-status-bar[data-tone="explore"] .status-dot {
    background: rgba(45, 212, 191, 0.98);
    box-shadow: 0 0 0 6px rgba(45, 212, 191, 0.14);
}

.classroom-status-bar[data-tone="success"] .status-dot {
    background: rgba(34, 197, 94, 0.98);
    box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.14);
}

.participant-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    min-width: 158px;
    max-width: 182px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid rgba(30, 41, 59, 0.08);
    background: rgba(30, 41, 59, 0.04);
    position: relative;
    transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease, box-shadow 0.22s ease;
    overflow: hidden;
}

.participant-status {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: rgba(30, 41, 59, 0.22);
    box-shadow: 0 0 0 0 rgba(30, 41, 59, 0);
    flex-shrink: 0;
}

.participant-chip img {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    flex-shrink: 0;
}

.participant-chip.professor {
    border-color: rgba(96, 165, 250, 0.28);
    background: rgba(59, 130, 246, 0.12);
}

.participant-chip.student {
    border-color: rgba(30, 41, 59, 0.1);
}

.participant-chip.is-active {
    transform: translateY(-2px);
    border-color: rgba(96, 165, 250, 0.45);
    background: rgba(59, 130, 246, 0.16);
    box-shadow: 0 12px 30px rgba(255, 252, 243, 0.22);
}

.participant-chip.is-active .participant-status {
    background: #22c55e;
    box-shadow: 0 0 0 8px rgba(34, 197, 94, 0.12);
    animation: speakerPulse 1.5s ease-in-out infinite;
}

.participant-copy {
    min-width: 0;
    overflow: hidden;
}

.participant-name {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.participant-role {
    font-size: 10px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.chat-container {
    flex-grow: 1;
    min-height: 0;
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chat-container::-webkit-scrollbar {
    width: 6px;
}
.chat-container::-webkit-scrollbar-thumb {
    background: rgba(30, 41, 59, 0.1);
    border-radius: 10px;
}

.message {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    animation: fadeIn 0.3s ease forwards;
    opacity: 0;
    transform: translateY(10px);
}

@keyframes fadeIn {
    to { opacity: 1; transform: translateY(0); }
}

.msg-avatar img {
    width: 36px;
    height: 36px;
    border-radius: 12px;
}

.msg-content {
    background: rgba(245, 234, 226, 0.6);
    padding: 14px 18px;
    border-radius: 0 16px 16px 16px;
    font-size: 15px;
    line-height: 1.6;
    color: #1e293b;
    border: 1px solid rgba(30, 41, 59, 0.05);
    max-width: 90%;
}

.msg-name {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 700;
    color: #1e293b;
}

.msg-name span {
    font-size: 10px;
    font-weight: 500;
    color: var(--text-secondary);
}

.message.role-professor .msg-content {
    border-color: rgba(96, 165, 250, 0.18);
    box-shadow: 0 10px 28px rgba(255, 252, 243, 0.24);
}

.message.role-student .msg-content {
    background: rgba(236, 226, 216, 0.72);
}

.message.role-student .msg-name {
    color: #f9a8d4;
}

/* 玩家自己发的消息 */
.message.player {
    flex-direction: row-reverse;
}
.message.player .msg-content {
    background: linear-gradient(135deg, rgba(219, 234, 254, 0.96), rgba(224, 242, 254, 0.94));
    border-radius: 16px 0 16px 16px;
    border: 1px solid rgba(37, 99, 235, 0.2);
    box-shadow: 0 8px 22px rgba(37, 99, 235, 0.16);
    color: #1e293b;
}

.message.player .msg-name {
    color: #1d4ed8;
}

.message.player .msg-name span {
    color: #334155;
}

/* 系统通知 */
.system-msg {
    justify-content: center;
    width: 100%;
}
.system-msg span {
    font-size: 12px;
    background: rgba(255, 255, 255, 0.4);
    padding: 4px 12px;
    border-radius: 20px;
    color: var(--text-secondary);
}

/* 操作选项�?*/
.action-area {
    padding: 16px 24px;
    background: rgba(255, 252, 243, 0.8);
    border-top: 1px solid var(--panel-border);
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 240px;
    overflow-y: auto;
    flex-shrink: 0;
}

.action-btn {
    width: 100%;
    padding: 14px 20px;
    border: 1px solid rgba(30, 41, 59, 0.1);
    background: rgba(30, 41, 59, 0.03);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 10px;
}

.action-btn:hover {
    background: rgba(30, 41, 59, 0.1);
    border-color: rgba(30, 41, 59, 0.2);
    transform: translateY(-2px);
}

.action-btn.primary {
    background: linear-gradient(135deg, rgba(219, 234, 254, 0.98), rgba(204, 251, 241, 0.94));
    border: 1px solid rgba(37, 99, 235, 0.22);
    box-shadow: 0 8px 22px rgba(37, 99, 235, 0.14);
    color: #1e3a8a;
    justify-content: center;
    text-align: center;
}

.action-btn.primary:hover {
    box-shadow: 0 10px 26px rgba(37, 99, 235, 0.18);
    filter: brightness(1.02);
}

.case-index-panel,
.case-board {
    border-radius: var(--radius-lg);
}

.detective-kicker,
.panel-kicker,
.toolbar-label,
.hero-board-label {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #4338ca;
}

.case-index-meta,
.case-index-foot,
.case-meta-row,
.round-actions,
.case-foot-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.hero-board-meta span,
.meta-chip,
.filter-chip,
.round-pill,
.signal-chip {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}

.hero-board-meta span,
.meta-chip {
    padding: 8px 12px;
    background: rgba(255, 252, 243, 0.78);
    border: 1px solid rgba(30, 41, 59, 0.08);
    color: #1e293b;
}

.meta-chip-primary {
    background: rgba(49, 46, 129, 0.16);
    color: #4338ca;
    border-color: rgba(49, 46, 129, 0.28);
}

.meta-chip-soft {
    background: rgba(14, 165, 233, 0.12);
    color: #1e293b;
    border-color: rgba(14, 165, 233, 0.24);
}

.detective-grid {
    display: grid;
    grid-template-columns: minmax(228px, 292px) minmax(0, 1fr);
    gap: 16px;
    min-height: 0;
    flex: 1 1 auto;
}

.case-index-panel,
.case-board {
    min-height: 0;
    overflow: hidden;
}

.case-index-panel {
    display: flex;
    flex-direction: column;
    padding: 16px;
    background: rgba(255, 255, 255, 0.72);
    transition: padding 0.22s ease, width 0.22s ease, background 0.22s ease;
}

.panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.panel-header-copy {
    min-width: 0;
}

.panel-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.panel-header h3 {
    font-family: var(--font-heading);
    font-size: 17px;
    margin-top: 3px;
}

.panel-count {
    min-width: 40px;
    height: 40px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: rgba(49, 46, 129, 0.18);
    color: #4338ca;
    font-weight: 800;
    border: 1px solid rgba(49, 46, 129, 0.24);
}

.case-index-toggle {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 12px;
    border: 1px solid rgba(30, 41, 59, 0.08);
    background: rgba(255, 251, 246, 0.86);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.case-index-toggle:hover {
    border-color: rgba(148, 163, 184, 0.34);
    background: rgba(253, 244, 237, 0.88);
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(255, 255, 255, 0.24);
}

.case-index-toggle-icon {
    position: relative;
    width: 18px;
    height: 18px;
    border-radius: 5px;
    border: 1.5px solid rgba(30, 41, 59, 0.82);
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.08), rgba(30, 41, 59, 0.02));
    display: block;
}

.toggle-icon-rail,
.toggle-icon-panel {
    position: absolute;
    top: 2px;
    bottom: 2px;
    border-radius: 3px;
    transition: transform 0.18s ease, opacity 0.18s ease, left 0.18s ease, right 0.18s ease;
}

.toggle-icon-rail {
    left: 2px;
    width: 4px;
    background: rgba(30, 41, 59, 0.82);
}

.toggle-icon-panel {
    left: 7px;
    right: 2px;
    background: rgba(30, 41, 59, 0.14);
}

.case-index-toggle.is-collapsed .toggle-icon-rail {
    left: auto;
    right: 2px;
}

.case-index-toggle.is-collapsed .toggle-icon-panel {
    left: 2px;
    right: 7px;
}

.case-index {
    display: flex;
    flex-direction: column;
    gap: 9px;
    overflow-y: auto;
    padding-right: 4px;
}

.case-index::-webkit-scrollbar,
.case-board::-webkit-scrollbar {
    width: 8px;
}

.case-index::-webkit-scrollbar-thumb,
.case-board::-webkit-scrollbar-thumb {
    background: rgba(30, 41, 59, 0.14);
    border-radius: 999px;
}

.case-index-card {
    width: 100%;
    text-align: left;
    border-radius: 18px;
    padding: 12px 12px 10px;
    background: linear-gradient(180deg, rgba(255, 252, 243, 0.78), rgba(255, 255, 255, 0.78));
    border: 1px solid rgba(30, 41, 59, 0.08);
    color: var(--text-primary);
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.case-index-card:hover {
    transform: translateY(-3px);
    border-color: rgba(67, 56, 202, 0.24);
    box-shadow: 0 18px 40px rgba(255, 255, 255, 0.24);
}

.case-index-card.is-selected {
    border-color: rgba(67, 56, 202, 0.36);
    box-shadow: 0 0 0 1px rgba(67, 56, 202, 0.16) inset, 0 20px 42px rgba(255, 255, 255, 0.26);
    transform: translateY(-2px);
}

.case-index-card h4 {
    font-size: 15px;
    margin: 8px 0 6px;
    line-height: 1.2;
}

.case-index-card p {
    color: var(--text-secondary);
    font-size: 11px;
    line-height: 1.6;
    min-height: 0;
}

.case-index-top,
.case-index-foot {
    justify-content: space-between;
    align-items: center;
}

.case-index-order {
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #1e293b;
    opacity: 0.72;
}

.case-index-badge {
    font-size: 11px;
    font-weight: 800;
    color: #4338ca;
    background: rgba(49, 46, 129, 0.12);
    border: 1px solid rgba(49, 46, 129, 0.18);
    padding: 4px 8px;
    border-radius: 999px;
}

.case-index-meta,
.case-index-foot {
    margin-top: 8px;
    color: var(--text-secondary);
    font-size: 11px;
}

.case-board {
    padding: 0;
    background: rgba(255, 255, 255, 0.76);
    overflow-y: auto;
    min-height: 74vh;
}

.case-detail-shell {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.case-detective-view.is-index-collapsed .detective-grid {
    grid-template-columns: 94px minmax(0, 1fr);
}

.case-detective-view.is-index-collapsed .case-index-panel {
    padding: 14px 10px;
}

.case-detective-view.is-index-collapsed .panel-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
}

.case-detective-view.is-index-collapsed .panel-header-copy h3,
.case-detective-view.is-index-collapsed .panel-header-copy .panel-kicker,
.case-detective-view.is-index-collapsed .case-index-card h4,
.case-detective-view.is-index-collapsed .case-index-card p,
.case-detective-view.is-index-collapsed .case-index-badge,
.case-detective-view.is-index-collapsed .case-progress-meta {
    display: none;
}

.case-detective-view.is-index-collapsed .panel-header-actions {
    flex-direction: column;
    align-items: stretch;
}

.case-detective-view.is-index-collapsed .case-index-toggle {
    width: 100%;
    padding: 0 8px;
    font-size: 11px;
}

.case-detective-view.is-index-collapsed .panel-count {
    width: 100%;
}

.case-detective-view.is-index-collapsed .case-index {
    gap: 8px;
    padding-right: 0;
}

.case-detective-view.is-index-collapsed .case-index-card {
    padding: 12px 8px;
    text-align: center;
}

.case-detective-view.is-index-collapsed .case-index-top {
    justify-content: center;
}

.case-detective-view.is-index-collapsed .case-index-order {
    font-size: 12px;
    letter-spacing: 0.08em;
}

.case-detective-view.is-index-collapsed .case-progress {
    margin-top: 8px;
}

.case-detective-view.is-index-collapsed .case-progress-track {
    width: 100%;
}

.case-board-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.case-board-header h3 {
    font-family: var(--font-heading);
    font-size: clamp(20px, 2vw, 28px);
    line-height: 1.1;
    margin-top: 8px;
}

.stage-rail {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 4px;
}

.stage-dot {
    width: 11px;
    height: 11px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.35);
    border: 1px solid rgba(30, 41, 59, 0.08);
}

.stage-dot.is-live {
    background: rgba(49, 46, 129, 0.95);
    box-shadow: 0 0 0 6px rgba(49, 46, 129, 0.12);
}

.stage-dot.is-solved {
    background: rgba(16, 185, 129, 0.95);
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.1);
}

.stage-dot.is-locked {
    background: rgba(148, 163, 184, 0.35);
}

.case-question-panel {
    border-radius: 22px;
    padding: 18px;
    background: linear-gradient(180deg, rgba(255, 252, 243, 0.8), rgba(255, 255, 255, 0.85));
    border: 1px solid rgba(30, 41, 59, 0.08);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.question-label {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #4338ca;
}

.question-prompt {
    font-size: 18px;
    line-height: 1.65;
    color: #1e293b;
}

.option-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.choice-btn {
    padding: 14px 16px;
    align-items: center;
    gap: 12px;
    text-align: left;
    border-radius: 18px;
    background: rgba(30, 41, 59, 0.04);
    border: 1px solid rgba(30, 41, 59, 0.08);
}

.choice-btn:hover {
    transform: translateY(-2px);
    border-color: rgba(67, 56, 202, 0.24);
}

.choice-btn.is-correct {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.18), rgba(255, 252, 243, 0.76));
    border-color: rgba(16, 185, 129, 0.34);
}

.choice-btn.is-wrong {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.12), rgba(255, 252, 243, 0.76));
    border-color: rgba(239, 68, 68, 0.26);
}

.choice-label {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: rgba(67, 56, 202, 0.12);
    color: #4338ca;
    font-size: 12px;
    font-weight: 800;
    flex-shrink: 0;
}

.choice-copy {
    flex: 1 1 auto;
    color: #1e293b;
    line-height: 1.5;
    font-size: 14px;
}

.question-helper {
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.6;
}

.case-detail-shell.tone-blue,
.case-index-card.tone-blue {
    --case-accent: #60a5fa;
    --case-soft: rgba(96, 165, 250, 0.12);
}
.case-detail-shell.tone-violet,
.case-index-card.tone-violet {
    --case-accent: #a78bfa;
    --case-soft: rgba(167, 139, 250, 0.12);
}
.case-detail-shell.tone-cyan,
.case-index-card.tone-cyan {
    --case-accent: #22d3ee;
    --case-soft: rgba(34, 211, 238, 0.12);
}
.case-detail-shell.tone-teal,
.case-index-card.tone-teal {
    --case-accent: #2dd4bf;
    --case-soft: rgba(45, 212, 191, 0.12);
}
.case-detail-shell.tone-magenta,
.case-index-card.tone-magenta {
    --case-accent: #f472b6;
    --case-soft: rgba(244, 114, 182, 0.12);
}
.case-detail-shell.tone-orange,
.case-index-card.tone-orange {
    --case-accent: #fb923c;
    --case-soft: rgba(251, 146, 60, 0.12);
}
.case-detail-shell.tone-amber,
.case-index-card.tone-amber {
    --case-accent: #4338ca;
    --case-soft: rgba(49, 46, 129, 0.12);
}
.case-detail-shell.tone-green,
.case-index-card.tone-green {
    --case-accent: #34d399;
    --case-soft: rgba(52, 211, 153, 0.12);
}

.case-signal-grid,
.case-foot-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.case-feedback-wrap {
    margin-top: -2px;
}

.feedback-shell {
    border-radius: 18px;
    padding: 14px 16px;
    border: 1px solid rgba(30, 41, 59, 0.08);
    background: rgba(255, 252, 243, 0.74);
    box-shadow: inset 0 0 0 1px rgba(30, 41, 59, 0.02);
}

.feedback-shell.tone-success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.16), rgba(255, 252, 243, 0.78));
    border-color: rgba(16, 185, 129, 0.28);
}

.feedback-shell.tone-warning {
    background: linear-gradient(135deg, rgba(49, 46, 129, 0.16), rgba(255, 252, 243, 0.78));
    border-color: rgba(49, 46, 129, 0.28);
}

.feedback-shell.tone-choice {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.14), rgba(255, 252, 243, 0.78));
    border-color: rgba(59, 130, 246, 0.28);
}

.feedback-title {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 800;
    margin-bottom: 4px;
}

.case-quest-panel {
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(255, 252, 243, 0.78), rgba(255, 255, 255, 0.8));
    border: 1px solid rgba(30, 41, 59, 0.07);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.case-stage-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.stage-card {
    position: relative;
    border-radius: 20px;
    padding: 16px;
    background: linear-gradient(180deg, rgba(255, 252, 243, 0.78), rgba(255, 255, 255, 0.86));
    border: 1px solid rgba(30, 41, 59, 0.07);
    overflow: hidden;
    min-height: 250px;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.stage-card.is-focused {
    transform: translateY(-2px);
    border-color: rgba(49, 46, 129, 0.3);
    box-shadow: 0 16px 30px rgba(255, 255, 255, 0.18);
}

.stage-card.is-live {
    background: linear-gradient(180deg, rgba(250, 240, 229, 0.84), rgba(255, 255, 255, 0.88));
    border-color: rgba(67, 56, 202, 0.22);
}

.stage-card.is-solved {
    background: linear-gradient(180deg, rgba(255, 231, 245, 0.8200000000000001), rgba(255, 255, 255, 0.86));
    border-color: rgba(16, 185, 129, 0.24);
}

.stage-card.is-locked {
    background: linear-gradient(180deg, rgba(255, 252, 243, 0.7), rgba(255, 255, 255, 0.78));
    border-color: rgba(30, 41, 59, 0.05);
}

.stage-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.stage-badge,
.stage-tag {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.stage-badge.live {
    background: rgba(49, 46, 129, 0.18);
    color: #4338ca;
}

.stage-badge.solved {
    background: rgba(16, 185, 129, 0.18);
    color: #a7f3d0;
}

.stage-badge.locked {
    background: rgba(148, 163, 184, 0.16);
    color: #cbd5e1;
}

.stage-tag {
    background: rgba(30, 41, 59, 0.04);
    color: var(--text-secondary);
}

.stage-card h4 {
    font-family: var(--font-heading);
    font-size: 18px;
    line-height: 1.2;
    margin-bottom: 10px;
}

.stage-prompt,
.stage-solved-text,
.stage-locked-text {
    line-height: 1.65;
    color: #1e293b;
    font-size: 13px;
}

.stage-solved-text {
    color: #1e293b;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(16, 185, 129, 0.1);
    margin-bottom: 12px;
}

.stage-reveal {
    margin-top: 10px;
    padding: 12px;
    border-radius: 16px;
    background: rgba(30, 41, 59, 0.03);
    border: 1px solid rgba(30, 41, 59, 0.06);
}

.stage-reveal-label {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #4338ca;
    margin-bottom: 8px;
}

.answer-console {
    border-radius: 18px;
    padding: 14px;
    background: rgba(255, 252, 243, 0.72);
    border: 1px solid rgba(30, 41, 59, 0.07);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.answer-label {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #93c5fd;
}

.answer-row {
    display: flex;
    gap: 10px;
}

.answer-input {
    flex: 1 1 auto;
    min-width: 0;
    border-radius: 14px;
    border: 1px solid rgba(30, 41, 59, 0.08);
    background: rgba(255, 255, 255, 0.78);
    color: var(--text-primary);
    padding: 14px 14px;
    font-family: var(--font-body);
    font-size: 14px;
    outline: none;
}

.answer-input::placeholder {
    color: rgba(148, 163, 184, 0.72);
}

.answer-input:focus {
    border-color: rgba(49, 46, 129, 0.28);
    box-shadow: 0 0 0 3px rgba(49, 46, 129, 0.12);
}

.answer-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.answer-submit,
.answer-hint,
.answer-reset {
    width: auto;
    justify-content: center;
    text-align: center;
    flex: 1 1 0;
}

.answer-hint,
.answer-reset {
    background: rgba(30, 41, 59, 0.04);
}

.hint-stream {
    border-radius: 18px;
    padding: 14px;
    background: rgba(30, 41, 59, 0.02);
    border: 1px solid rgba(30, 41, 59, 0.06);
}

.vault-mask {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(255, 252, 243, 0.72);
    border: 1px dashed rgba(67, 56, 202, 0.26);
    color: #4338ca;
    font-size: 12px;
    line-height: 1.6;
}

.stage-footnote {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 12px;
    color: var(--text-secondary);
    font-size: 11px;
    line-height: 1.5;
}

.stage-lock-mask {
    position: absolute;
    inset: auto 0 0 0;
    padding: 14px 16px;
    background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.86));
    color: rgba(30, 41, 59, 0.72);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.signal-panel,
.foot-card,
.round-master {
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(255, 252, 243, 0.74), rgba(255, 255, 255, 0.8));
    border: 1px solid rgba(30, 41, 59, 0.07);
    padding: 16px;
}

.signal-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.signal-chip {
    padding: 10px 12px;
    background: rgba(30, 41, 59, 0.04);
    color: #1e293b;
    border: 1px solid rgba(30, 41, 59, 0.06);
    line-height: 1.4;
}

.mechanism-steps {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

.mechanism-steps li {
    display: flex;
    gap: 12px;
    color: #1e293b;
    line-height: 1.6;
}

.mechanism-steps li span {
    min-width: 34px;
    height: 34px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: var(--case-soft, rgba(49, 46, 129, 0.12));
    color: var(--case-accent, #4338ca);
    font-size: 11px;
    font-weight: 800;
}

.round-actions,
.case-foot-grid {
    align-items: stretch;
}

.case-replay-panel {
    border-radius: 20px;
    padding: 16px 18px;
    background: rgba(255, 252, 243, 0.72);
    border: 1px solid rgba(30, 41, 59, 0.07);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.case-review-panel {
    border-radius: 20px;
    padding: 16px 18px;
    background: linear-gradient(180deg, rgba(255, 252, 243, 0.78), rgba(255, 255, 255, 0.8200000000000001));
    border: 1px solid rgba(30, 41, 59, 0.07);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.review-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.review-panel-head h4 {
    margin-top: 6px;
    font-size: 18px;
    color: #1e293b;
}

.review-toggle-btn {
    width: auto;
    min-width: 126px;
    justify-content: center;
    text-align: center;
}

.review-collapsed-copy {
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.7;
}

.review-timeline {
    display: grid;
    gap: 12px;
}

.review-round-card {
    border-radius: 18px;
    padding: 16px;
    background: rgba(30, 41, 59, 0.03);
    border: 1px solid rgba(30, 41, 59, 0.06);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.review-round-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.review-round-head h4 {
    flex: 1 1 auto;
    color: #1e293b;
    font-size: 16px;
    line-height: 1.4;
}

.review-round-index {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--case-soft, rgba(49, 46, 129, 0.12));
    color: var(--case-accent, #4338ca);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.review-round-prompt,
.review-copy p {
    color: #1e293b;
    line-height: 1.7;
}

.review-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.review-copy {
    display: grid;
    gap: 8px;
}

.case-replay-panel p {
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.6;
}

.replay-btn {
    width: 100%;
    justify-content: center;
    text-align: center;
}

.round-label {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--case-accent, #4338ca);
    margin-bottom: 8px;
}

.round-dialogue-block p,
.foot-card p,
.foot-card li {
    color: #1e293b;
    line-height: 1.7;
}

.foot-card ul {
    padding-left: 16px;
    margin-top: 10px;
    display: grid;
    gap: 8px;
}

.empty-state {
    padding: 24px;
    color: var(--text-secondary);
}

@media (max-width: 1100px) {
    .detective-grid,
    .case-signal-grid,
    .case-foot-grid {
        grid-template-columns: 1fr;
    }

    .detective-header {
        grid-template-columns: 1fr;
    }

    .current-case-card {
        min-height: 0;
    }

    .case-index-toggle {
        width: 40px;
    }

    .case-detective-view.is-index-collapsed .detective-grid {
        grid-template-columns: 1fr;
    }

    .case-detective-view.is-index-collapsed .case-index-panel {
        padding: 16px;
    }

    .case-detective-view.is-index-collapsed .panel-header {
        flex-direction: row;
        align-items: flex-start;
    }

    .case-detective-view.is-index-collapsed .panel-header-copy h3,
    .case-detective-view.is-index-collapsed .panel-header-copy .panel-kicker,
    .case-detective-view.is-index-collapsed .case-index-card h4,
    .case-detective-view.is-index-collapsed .case-index-card p,
    .case-detective-view.is-index-collapsed .case-index-badge,
    .case-detective-view.is-index-collapsed .case-progress-meta {
        display: revert;
    }

    .case-detective-view.is-index-collapsed .panel-header-actions {
        flex-direction: row;
        align-items: center;
    }

    .case-detective-view.is-index-collapsed .case-index-card {
        text-align: left;
        padding: 12px 12px 10px;
    }

    .case-detective-view.is-index-collapsed .case-index-top {
        justify-content: space-between;
    }

    .case-board-header {
        flex-direction: column;
    }

    .review-panel-head,
    .review-round-head {
        flex-direction: column;
        align-items: stretch;
    }

    .review-toggle-btn {
        width: 100%;
    }
}

@media (max-width: 900px) {
    .main-content {
        overflow: auto;
    }

    .classroom-view,
    .case-detective-view {
        min-height: auto;
    }

    .top-bar {
        height: auto;
        padding: 16px 18px;
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
    }

    .top-bar-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .lesson-switcher {
        min-width: 100%;
    }

    .visualization-stage {
        min-height: 640px;
        padding: 22px 16px 232px;
    }

    .caption-box {
        inset: 22px 16px 208px;
        grid-template-columns: 1fr;
        grid-template-areas:
            "title"
            "media"
            "body";
        row-gap: 14px;
    }

    .caption-box:has(.viz-figure),
    .caption-box.has-figure {
        inset: 22px 16px 208px;
        grid-template-columns: 1fr;
    }

    .caption-box .viz-emblem,
    .caption-box .viz-hero,
    .caption-box .viz-figure,
    .caption-box > img,
    .caption-box > svg {
        justify-self: start;
    }

    .interactive-cards {
        left: 12px;
        right: 12px;
        bottom: 16px;
        width: auto;
        transform: none;
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .whiteboard-history-btn {
        width: 34px;
        height: 48px;
        border-radius: 12px;
    }

    .whiteboard-history-prev {
        left: 6px;
    }

    .whiteboard-history-next {
        right: 6px;
    }

    .visualization-stage:has(.whiteboard-history-btn:not(.hidden)) .caption-box,
    .visualization-stage:has(.whiteboard-history-btn:not(.hidden)) .caption-box.has-figure,
    .visualization-stage:has(.whiteboard-history-btn:not(.hidden)) .caption-box.figure-atlas-caption {
        left: 46px;
        right: 46px;
    }

    .viz-emblem {
        width: 92px;
        height: 92px;
        border-radius: 24px;
        font-size: 22px;
    }

    .caption-box .viz-figure {
        width: min(100%, 320px);
        max-height: 220px;
        justify-self: start;
        align-self: start;
    }

    .caption-box.figure-atlas-caption {
        grid-template-rows: auto auto minmax(0, 1fr);
        grid-template-areas:
            "title"
            "body"
            "media";
    }

    .caption-box.figure-atlas-caption .figure-atlas-image {
        width: 100%;
        height: auto;
        max-height: 240px;
    }
}

/* 助手浮窗 (小疫) */
.assistant-popup {
    position: absolute;
    top: 60px;
    right: 20px;
    left: auto;
    bottom: auto;
    width: clamp(292px, 31vw, 344px);
    height: 184px;
    background: rgba(16, 185, 129, 0.2);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(16, 185, 129, 0.4);
    border-radius: var(--radius-lg);
    box-shadow: 0 15px 30px rgba(255, 255, 255, 0.4), 0 0 0 1px rgba(16, 185, 129, 0.2) inset;
    overflow: hidden;
    z-index: 100;
    animation: slideUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(50px) scale(0.9); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.popup-header {
    background: rgba(16, 185, 129, 0.2);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: #1e293b;
    color: #064e3b;
}

.popup-header img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.close-btn {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 18px;
}

.popup-body {
    padding: 16px;
    font-size: 13px;
    line-height: 1.6;
    color: #064e3b;
    overflow: hidden;
}

.popup-body strong {
    color: #047857;
}

.assistant-popup-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 64px;
    align-items: stretch;
    height: calc(100% - 49px);
    min-height: 0;
}

.popup-body {
    min-width: 0;
    min-height: 0;
    padding: 0;
}

.assistant-popup-timeline {
    border-left: 1px solid rgba(16, 185, 129, 0.16);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(236, 253, 245, 0.3));
    padding: 10px 6px;
    min-height: 0;
}

.assistant-note-axis {
    height: 100%;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto auto;
    gap: 8px;
    align-items: center;
    justify-items: center;
}

.assistant-note-axis-track {
    width: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 4px 0;
}

.assistant-note-axis-seq {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.12em;
    color: rgba(6, 95, 70, 0.62);
}

.assistant-note-history-range {
    -webkit-appearance: slider-vertical;
    appearance: slider-vertical;
    width: 24px;
    height: 72px;
    writing-mode: bt-lr;
    accent-color: #059669;
    cursor: pointer;
}

.assistant-note-axis-meta {
    display: grid;
    place-items: center;
    color: #065f46;
    font-size: 15px;
    line-height: 1;
    font-weight: 800;
}

.assistant-note-viewport {
    position: relative;
    height: 100%;
    overflow: hidden;
    padding: 14px;
}

.assistant-note-rail {
    display: flex;
    flex-direction: column;
    will-change: transform;
}

.assistant-note-card {
    flex: 0 0 auto;
    min-height: 0;
    opacity: 0.58;
    transition: opacity 0.18s ease;
}

.assistant-note-card.is-active {
    opacity: 1;
}

.assistant-note-card-content {
    height: 100%;
    overflow-y: auto;
    font-size: 13px;
    line-height: 1.5;
    color: #064e3b;
    padding-right: 4px;
    touch-action: pan-y;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.assistant-note-card-content strong {
    color: #047857;
}

/* ============================================
   Knowledge Map v2 - Visual Graph Redesign
   ============================================ */
.knowledge-map-view {
    gap: 14px;
}

.knowledge-map-hero {
    grid-template-columns: minmax(0, 1.9fr) minmax(260px, 360px);
    padding: 14px 18px 16px;
    border-radius: 24px;
}

.knowledge-badge {
    margin-top: 8px;
}

.knowledge-map-hero h2 {
    font-size: clamp(24px, 2.4vw, 34px);
    margin-top: 10px;
}

.knowledge-subtitle {
    font-size: 14px;
    margin-top: 8px;
}

.knowledge-summary {
    max-width: 64ch;
    margin-top: 10px;
    font-size: 13px;
    line-height: 1.75;
    color: rgba(30, 41, 59, 0.82);
}

.knowledge-summary-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.knowledge-mini-stat {
    border-radius: 18px;
    padding: 12px 12px 14px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 253, 0.86));
    border: 1px solid rgba(30, 41, 59, 0.06);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.knowledge-mini-stat span {
    color: rgba(148, 163, 184, 0.82);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.knowledge-mini-stat strong {
    font-family: var(--font-heading);
    font-size: 22px;
    line-height: 1;
}

.knowledge-legend-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.legend-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border-radius: 999px;
    border: 1px solid rgba(30, 41, 59, 0.08);
    background: rgba(30, 41, 59, 0.04);
    color: #cbd5e1;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.legend-must {
    border-color: rgba(67, 56, 202, 0.26);
    color: #4338ca;
}

.legend-high {
    border-color: rgba(34, 211, 238, 0.22);
    color: #1e293b;
}

.legend-path {
    border-color: rgba(59, 130, 246, 0.24);
    color: #1e293b;
}

.knowledge-map-grid {
    grid-template-columns: minmax(0, 1.8fr) minmax(300px, 0.8fr);
    gap: 14px;
}

.knowledge-atlas-panel {
    padding: 14px;
    gap: 12px;
}

.knowledge-inspector {
    padding: 14px;
    border-radius: 24px;
}

.knowledge-tools-row {
    grid-template-columns: minmax(220px, 290px) minmax(0, 1fr);
    gap: 12px;
}

.knowledge-control span {
    font-size: 10px;
    letter-spacing: 0.14em;
}

.knowledge-control select,
.knowledge-search-box {
    min-height: 44px;
    border-radius: 15px;
}

.knowledge-mode-switch {
    gap: 8px;
}

.knowledge-mode-btn {
    padding: 9px 12px;
    font-size: 11px;
    letter-spacing: 0.08em;
}

.knowledge-atlas-board {
    padding: 0;
    overflow: hidden;
    min-height: 720px;
    background:
        radial-gradient(circle at 50% 38%, rgba(255, 252, 243, 0.8200000000000001), rgba(255, 255, 255, 0.88)),
        linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.88));
}

.graph-shell {
    position: relative;
    min-height: 720px;
    overflow: hidden;
}

.graph-svg,
.graph-stage-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.graph-svg {
    pointer-events: none;
}

.graph-zone-aura {
    fill: rgba(30, 41, 59, 0.02);
    stroke-width: 1.5;
    filter: url(#graphGlow);
}

.graph-zone-aura.zone-core {
    fill: rgba(67, 56, 202, 0.06);
    stroke: rgba(67, 56, 202, 0.18);
}

.graph-zone-aura.zone-immunogenicity {
    fill: rgba(34, 211, 238, 0.06);
    stroke: rgba(34, 211, 238, 0.2);
}

.graph-zone-aura.zone-classification {
    fill: rgba(99, 102, 241, 0.06);
    stroke: rgba(99, 102, 241, 0.22);
}

.graph-edge {
    fill: none;
    stroke: rgba(148, 163, 184, 0.14);
    stroke-width: 1.6;
    stroke-linecap: round;
    transition: opacity 0.18s ease, stroke 0.18s ease, stroke-width 0.18s ease;
}

.graph-edge.is-related {
    stroke: rgba(96, 165, 250, 0.22);
}

.graph-edge.is-active {
    stroke: rgba(67, 56, 202, 0.52);
    stroke-width: 2.8;
}

.graph-stage-layer {
    z-index: 1;
}

.graph-core-badge,
.graph-zone-caption {
    position: absolute;
    transform: translate(-50%, -50%);
    border-radius: 999px;
    backdrop-filter: blur(14px);
    border: 1px solid rgba(30, 41, 59, 0.08);
    background: rgba(255, 252, 243, 0.72);
}

.graph-core-badge {
    left: 50%;
    top: 52px;
    transform: translateX(-50%);
    padding: 10px 14px 11px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.graph-core-badge span {
    color: rgba(148, 163, 184, 0.8);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.graph-core-badge strong {
    color: #1e293b;
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 800;
}

.graph-zone-caption {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
}

.graph-zone-caption span {
    font-size: 11px;
    font-weight: 800;
    color: #1e293b;
    letter-spacing: 0.08em;
}

.graph-zone-caption small {
    color: rgba(148, 163, 184, 0.82);
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.graph-zone-caption.zone-core {
    border-color: rgba(67, 56, 202, 0.22);
}

.graph-zone-caption.zone-immunogenicity {
    border-color: rgba(34, 211, 238, 0.22);
}

.graph-zone-caption.zone-classification {
    border-color: rgba(99, 102, 241, 0.22);
}

.graph-node {
    appearance: none;
    -webkit-appearance: none;
    position: absolute;
    transform: translate(-50%, -50%) scale(var(--node-scale, 1));
    min-width: 102px;
    max-width: 180px;
    padding: 12px 14px;
    border-radius: 18px;
    border: 1px solid rgba(30, 41, 59, 0.08);
    background: linear-gradient(180deg, rgba(255, 252, 243, 0.78), rgba(255, 255, 255, 0.86));
    color: #1e293b;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(255, 255, 255, 0.32);
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, opacity 0.18s ease, box-shadow 0.18s ease;
}

.graph-node:hover {
    transform: translate(-50%, -50%) scale(calc(var(--node-scale, 1) + 0.035));
    border-color: rgba(96, 165, 250, 0.3);
}

.graph-node.is-core {
    min-width: 190px;
    max-width: 240px;
    padding: 18px 20px;
    border-radius: 24px;
    background:
        linear-gradient(135deg, rgba(67, 56, 202, 0.18), rgba(255, 255, 255, 0.8200000000000001) 58%),
        linear-gradient(315deg, rgba(34, 211, 238, 0.12), rgba(255, 255, 255, 0.8200000000000001) 68%);
    border-color: rgba(67, 56, 202, 0.28);
    box-shadow: 0 14px 36px rgba(255, 255, 255, 0.42), 0 0 0 1px rgba(67, 56, 202, 0.08) inset;
}

.graph-node.is-active {
    background: linear-gradient(135deg, rgba(67, 56, 202, 0.18), rgba(59, 130, 246, 0.18));
    border-color: rgba(67, 56, 202, 0.42);
    box-shadow: 0 18px 42px rgba(255, 255, 255, 0.46), 0 0 0 1px rgba(67, 56, 202, 0.12) inset;
}

.graph-node.is-related:not(.is-active) {
    border-color: rgba(56, 189, 248, 0.28);
}

.graph-node.is-dimmed {
    opacity: 0.32;
}

.graph-node.importance-must_know {
    border-color: rgba(67, 56, 202, 0.18);
}

.graph-node.importance-high {
    border-color: rgba(34, 211, 238, 0.18);
}

.graph-node-order {
    position: absolute;
    top: -9px;
    left: -9px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(67, 56, 202, 0.95);
    color: #fffbf6;
    font-size: 11px;
    font-weight: 900;
    box-shadow: 0 6px 16px rgba(67, 56, 202, 0.28);
}

.graph-node-label {
    display: block;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.35;
    letter-spacing: 0.01em;
}

.graph-node.is-core .graph-node-label {
    font-family: var(--font-heading);
    font-size: 22px;
    line-height: 1.05;
}

.knowledge-inspector {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.88)),
        rgba(255, 252, 243, 0.75);
}

.inspector-compact-head {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.inspector-main-card {
    border-radius: 22px;
    padding: 16px 16px 18px;
    background: linear-gradient(180deg, rgba(255, 248, 239, 0.8200000000000001), rgba(255, 255, 255, 0.86));
    border: 1px solid rgba(30, 41, 59, 0.08);
}

.inspector-main-card.importance-must_know {
    border-color: rgba(67, 56, 202, 0.22);
}

.inspector-main-card.importance-high {
    border-color: rgba(34, 211, 238, 0.2);
}

.inspector-main-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.inspector-main-top h3 {
    font-family: var(--font-heading);
    font-size: clamp(26px, 2.4vw, 38px);
    line-height: 1;
}

.inspector-main-badge {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(67, 56, 202, 0.14);
    color: #4338ca;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.inspector-main-card p {
    margin-top: 12px;
    color: #1e293b;
    font-size: 14px;
    line-height: 1.75;
}

.inspector-chip-row {
    margin-top: 14px;
}

.inspector-flow-grid {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.flow-card,
.resource-strip-card {
    border-radius: 20px;
    padding: 14px;
    background: rgba(30, 41, 59, 0.03);
    border: 1px solid rgba(30, 41, 59, 0.06);
}

.flow-pill-group,
.resource-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.flow-pill,
.resource-mini-btn {
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid rgba(30, 41, 59, 0.08);
    background: rgba(30, 41, 59, 0.04);
    color: #1e293b;
    border-radius: 16px;
    padding: 11px 12px;
    cursor: pointer;
    text-align: left;
    transition: transform 0.18s ease, border-color 0.18s ease;
}

.flow-pill:hover,
.resource-mini-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(96, 165, 250, 0.24);
}

.flow-pill strong,
.resource-mini-btn span {
    display: block;
    font-size: 13px;
    font-weight: 800;
}

.flow-pill small {
    display: block;
    margin-top: 5px;
    color: rgba(148, 163, 184, 0.84);
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.flow-empty {
    color: rgba(148, 163, 184, 0.82);
    font-size: 12px;
    line-height: 1.7;
}

.knowledge-learning-panel {
    padding: 14px 18px 16px;
    gap: 10px;
}

.knowledge-section-head h3 {
    font-size: 18px;
}

.knowledge-section-head p {
    font-size: 12px;
}

.knowledge-learning-path {
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 4px;
}

.learning-rail {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 100%;
}

.learning-orb {
    appearance: none;
    -webkit-appearance: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px 10px 10px;
    min-width: 150px;
    border-radius: 999px;
    border: 1px solid rgba(30, 41, 59, 0.08);
    background: rgba(30, 41, 59, 0.04);
    color: #1e293b;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.learning-orb:hover {
    transform: translateY(-1px);
    border-color: rgba(96, 165, 250, 0.24);
}

.learning-orb.is-active {
    background: linear-gradient(135deg, rgba(67, 56, 202, 0.14), rgba(59, 130, 246, 0.14));
    border-color: rgba(67, 56, 202, 0.28);
}

.learning-orb-index {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(67, 56, 202, 0.18);
    color: #4338ca;
    font-size: 11px;
    font-weight: 900;
    flex-shrink: 0;
}

.learning-orb-label {
    font-size: 13px;
    font-weight: 800;
    line-height: 1.35;
}

@media (max-width: 1260px) {
    .knowledge-map-grid {
        grid-template-columns: 1fr;
    }

    .knowledge-map-hero {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 980px) {
    .knowledge-tools-row {
        grid-template-columns: 1fr;
    }

    .knowledge-summary-strip {
        grid-template-columns: 1fr 1fr 1fr;
    }

    .knowledge-atlas-board,
    .graph-shell {
        min-height: 640px;
    }

    .graph-zone-caption {
        transform: translate(-50%, -50%) scale(0.92);
    }
}

/* ============================================
   Knowledge Map v3 - Clean Mindmap Layout
   ============================================ */
.knowledge-map-view {
    gap: 12px;
}

.knowledge-map-view.is-expanded,
.knowledge-map-view:fullscreen {
    position: fixed;
    inset: 10px 12px;
    z-index: 220;
    padding: 10px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.885), rgba(255, 255, 255, 0.89));
    border-radius: 28px;
    box-shadow: 0 30px 70px rgba(255, 255, 255, 0.56);
}

.knowledge-map-view:fullscreen {
    position: relative;
    inset: auto;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    overflow: auto;
    padding: 18px;
    border-radius: 0;
    box-shadow: none;
}

.knowledge-map-view.is-expanded .knowledge-map-hero,
.knowledge-map-view:fullscreen .knowledge-map-hero {
    grid-template-columns: minmax(0, 1.6fr) 240px;
}

.knowledge-map-view.is-expanded .knowledge-map-grid,
.knowledge-map-view:fullscreen .knowledge-map-grid {
    grid-template-columns: minmax(0, 1.82fr) 330px;
}

.knowledge-map-hero {
    min-height: 104px;
    grid-template-columns: minmax(0, 1.75fr) 240px;
    gap: 14px;
    padding: 12px 16px 12px;
    align-items: center;
}

.knowledge-kicker {
    font-size: 11px;
    letter-spacing: 0.18em;
}

.knowledge-title-row {
    display: flex;
    align-items: baseline;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.knowledge-badge {
    margin-top: 0;
    padding: 6px 12px;
}

.knowledge-map-hero h2 {
    margin-top: 0;
    font-size: clamp(22px, 2.2vw, 32px);
}

.knowledge-subtitle-inline {
    font-size: 13px;
    color: rgba(30, 41, 59, 0.9);
    line-height: 1.3;
    flex: 1 1 320px;
    min-width: 0;
}

.knowledge-summary-inline {
    margin-top: 4px;
    color: rgba(30, 41, 59, 0.74);
    font-size: 12px;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.knowledge-hero-stats {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    align-items: center;
}

.knowledge-summary-strip {
    display: flex;
    gap: 10px;
}

.knowledge-mini-stat,
.km-mini-circle {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    padding: 10px 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 251, 0.86));
    border: 1px solid rgba(30, 41, 59, 0.08);
    gap: 4px;
}

.knowledge-mini-stat span,
.km-mini-circle span {
    color: rgba(148, 163, 184, 0.82);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.knowledge-mini-stat strong,
.km-mini-circle strong {
    font-family: var(--font-heading);
    font-size: 28px;
    line-height: 1;
}

.km-mini-circle .km-mini-text {
    font-size: 11px;
    line-height: 1.08;
    letter-spacing: 0.02em;
    max-width: 44px;
    text-wrap: balance;
}

.knowledge-map-grid {
    grid-template-columns: minmax(0, 1.9fr) 320px;
    gap: 12px;
}

.knowledge-stage-shell {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
    padding: 12px;
    border-radius: 24px;
}

.knowledge-stage-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.knowledge-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.km-tab-btn,
.knowledge-expand-btn,
.km-info-pill {
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid rgba(30, 41, 59, 0.08);
    background: rgba(30, 41, 59, 0.04);
    color: #1e293b;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.km-tab-btn {
    padding: 10px 14px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.km-tab-btn:hover,
.knowledge-expand-btn:hover,
.km-info-pill:hover {
    transform: translateY(-1px);
    border-color: rgba(96, 165, 250, 0.26);
}

.km-tab-btn.is-active {
    background: linear-gradient(135deg, rgba(67, 56, 202, 0.18), rgba(59, 130, 246, 0.16));
    border-color: rgba(67, 56, 202, 0.32);
    color: #1e293b;
}

.knowledge-expand-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.knowledge-stage-board {
    position: relative;
    flex: 1 1 auto;
    min-height: 690px;
    overflow: auto;
    border-radius: 22px;
    border: 1px solid rgba(30, 41, 59, 0.06);
    background:
        radial-gradient(circle at 50% 45%, rgba(255, 252, 243, 0.85), rgba(255, 255, 255, 0.89)),
        linear-gradient(rgba(148, 163, 184, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.04) 1px, transparent 1px);
    background-size: auto, 30px 30px, 30px 30px;
}

.km-board-frame {
    position: relative;
    width: 100%;
    min-height: 500px;
}

.knowledge-map-view.is-expanded .km-board-frame,
.knowledge-map-view:fullscreen .km-board-frame {
    min-height: 500px;
}

.knowledge-map-view:fullscreen .knowledge-stage-board {
    min-height: calc(100vh - 232px);
}

.km-graph-svg,
.km-graph-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.km-graph-svg {
    pointer-events: none;
}

.km-graph-edge {
    fill: none;
    stroke: rgba(148, 163, 184, 0.16);
    stroke-width: 2;
    stroke-linecap: round;
    transition: stroke 0.18s ease, stroke-width 0.18s ease, opacity 0.18s ease;
}

.km-graph-edge.is-active {
    stroke: rgba(67, 56, 202, 0.7);
    stroke-width: 3.4;
}

.km-node {
    appearance: none;
    -webkit-appearance: none;
    position: absolute;
    transform: translate(-50%, -50%);
    min-width: 96px;
    max-width: 230px;
    padding: 12px 14px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 253, 245, 0.8200000000000001), rgba(255, 255, 255, 0.88));
    border: 1px solid rgba(30, 41, 59, 0.08);
    color: #1e293b;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(255, 255, 255, 0.34);
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.km-node.is-expandable::after {
    content: '';
    position: absolute;
    right: 10px;
    bottom: 10px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(67, 56, 202, 0.3);
    box-shadow: 0 0 0 4px rgba(67, 56, 202, 0.08);
}

.km-node:hover {
    transform: translate(-50%, -50%) scale(1.03);
    border-color: rgba(96, 165, 250, 0.3);
}

.km-node.is-root {
    min-width: 170px;
    max-width: 250px;
    padding: 18px 20px;
    border-radius: 26px;
    background: linear-gradient(135deg, rgba(67, 56, 202, 0.2), rgba(251, 241, 228, 0.86));
    border-color: rgba(67, 56, 202, 0.34);
}

.km-node.is-active {
    border-color: rgba(67, 56, 202, 0.46);
    box-shadow: 0 16px 36px rgba(255, 255, 255, 0.46), 0 0 0 1px rgba(67, 56, 202, 0.14) inset;
}

.km-node.is-linked:not(.is-active) {
    border-color: rgba(34, 211, 238, 0.26);
}

.km-node.is-branch-open::after {
    background: rgba(67, 56, 202, 0.78);
    box-shadow: 0 0 0 4px rgba(67, 56, 202, 0.14);
}

.km-node span {
    display: block;
    font-size: calc(14px * var(--node-font-scale, 1));
    font-weight: 800;
    line-height: 1.22;
    text-align: center;
    text-wrap: balance;
    word-break: break-word;
}

.km-node.is-root span {
    font-family: var(--font-heading);
    font-size: calc(24px * var(--node-font-scale, 1));
    line-height: 1.02;
}

.km-measure-lab {
    position: absolute;
    left: -99999px;
    top: 0;
    opacity: 0;
    pointer-events: none;
    z-index: -1;
}

.km-node.is-measuring {
    position: static;
    transform: none;
    width: auto !important;
    min-width: 0;
    max-width: 230px;
    min-height: auto !important;
    margin-bottom: 10px;
}

.km-node.is-measuring:hover {
    transform: none;
}

.knowledge-inspector-shell {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
    padding: 12px;
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.88));
}

.km-inspector-head h3 {
    font-family: var(--font-heading);
    font-size: clamp(28px, 2.3vw, 40px);
    line-height: 1;
    margin-top: 6px;
}

.km-inspector-head p {
    margin-top: 10px;
    color: #1e293b;
    line-height: 1.8;
    font-size: 14px;
}

.km-inspector-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.km-inspector-meta span {
    display: inline-flex;
    align-items: center;
    padding: 8px 10px;
    border-radius: 999px;
    background: rgba(30, 41, 59, 0.05);
    color: #cbd5e1;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.km-inspector-block {
    margin-top: 18px;
    padding: 14px;
    border-radius: 20px;
    background: rgba(30, 41, 59, 0.03);
    border: 1px solid rgba(30, 41, 59, 0.06);
}

.km-pill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.km-info-pill {
    padding: 10px 12px;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 700;
}

.km-blank-copy {
    color: rgba(148, 163, 184, 0.84);
    font-size: 12px;
    line-height: 1.7;
}

@media (max-width: 1320px) {
    .knowledge-map-grid {
        grid-template-columns: 1fr;
    }

    .knowledge-map-view.is-expanded .knowledge-map-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 980px) {
    .knowledge-map-hero {
        grid-template-columns: 1fr;
    }

    .knowledge-hero-stats {
        justify-content: flex-start;
    }

    .knowledge-stage-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .knowledge-tabs {
        width: 100%;
    }

    .km-tab-btn {
        flex: 1 1 auto;
        text-align: center;
    }
}

/* ============================================
   Practice Arena - 实战演练
   ============================================ */
.practice-arena-view {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
    flex: 1 1 auto;
    overflow: hidden;
    padding-bottom: 4px;
}

.practice-arena-view::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 12% 18%, rgba(56, 189, 248, 0.16), transparent 28%),
        radial-gradient(circle at 84% 16%, rgba(236, 72, 153, 0.11), transparent 24%),
        radial-gradient(circle at 62% 96%, rgba(59, 130, 246, 0.12), transparent 28%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.87), rgba(255, 255, 255, 0.9));
    pointer-events: none;
    z-index: -2;
}

.practice-arena-view::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(148, 163, 184, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.04) 1px, transparent 1px);
    background-size: 30px 30px;
    mask-image: radial-gradient(circle at 50% 40%, rgba(30, 41, 59, 0.62), transparent 88%);
    pointer-events: none;
    z-index: -1;
}

.practice-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    padding: 12px 16px;
    align-items: center;
    overflow: hidden;
}

.practice-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(120deg, rgba(59, 130, 246, 0.1), transparent 36%),
        linear-gradient(300deg, rgba(34, 211, 238, 0.14), transparent 44%);
    pointer-events: none;
}

.practice-hero-main,
.practice-hero-stats {
    position: relative;
    z-index: 1;
}

.practice-hero-main {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.practice-kicker {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(67, 56, 202, 0.88);
    white-space: nowrap;
}

.practice-chapter-subtitle {
    color: rgba(30, 41, 59, 0.78);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
    min-width: 260px;
}

.practice-hero-stats {
    display: flex;
    gap: 10px;
}

.practice-stat-circle {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 3px;
    text-align: center;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.9));
    border: 1px solid rgba(30, 41, 59, 0.08);
}

.practice-stat-circle span {
    color: rgba(148, 163, 184, 0.9);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.06em;
}

.practice-stat-circle strong {
    font-family: var(--font-heading);
    font-size: 32px;
    line-height: 1;
    color: #1e293b;
}

.practice-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.75fr) minmax(300px, 0.85fr);
    gap: 12px;
    min-height: 0;
    flex: 1 1 auto;
}

.practice-stage-shell {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
    padding: 12px;
    border-radius: 24px;
}

.practice-stage-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.practice-stage-tag {
    display: inline-flex;
    align-items: center;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(30, 41, 59, 0.04);
    border: 1px solid rgba(30, 41, 59, 0.08);
    color: #1e293b;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.06em;
}

.practice-expand-btn {
    appearance: none;
    -webkit-appearance: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid rgba(30, 41, 59, 0.08);
    background: rgba(30, 41, 59, 0.04);
    color: #1e293b;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.06em;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease;
}

.practice-expand-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(96, 165, 250, 0.28);
}

.practice-stage-board {
    position: relative;
    flex: 1 1 auto;
    min-height: 600px;
    overflow: auto;
    border-radius: 22px;
    border: 1px solid rgba(30, 41, 59, 0.06);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.9));
    padding: 20px;
    padding-bottom: 92px;
}

.practice-board-backdrop {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 12% 18%, rgba(252, 165, 165, 0.36), transparent 30%),
        radial-gradient(circle at 72% 20%, rgba(196, 181, 253, 0.42), transparent 36%),
        radial-gradient(circle at 36% 76%, rgba(125, 211, 252, 0.34), transparent 34%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.16));
    pointer-events: none;
}

.practice-question-card {
    position: relative;
    z-index: 1;
    max-width: 580px;
    margin: 10px auto;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 24px;
    border: 1px solid rgba(30, 41, 59, 0.08);
    box-shadow: 0 18px 42px rgba(255, 255, 255, 0.42);
    padding: 24px;
}

.practice-question-head h3 {
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 400;
    line-height: 1.6;
    margin-top: 8px;
}

.practice-question-type {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(67, 56, 202, 0.12);
    border: 1px solid rgba(67, 56, 202, 0.2);
    color: #4338ca;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.practice-question-head p {
    margin-top: 12px;
    color: rgba(30, 41, 59, 0.8);
    line-height: 1.8;
    font-size: 14px;
}

.practice-option-list {
    margin-top: 18px;
    display: grid;
    gap: 10px;
}

.practice-option {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    text-align: left;
    border-radius: 14px;
    border: 1px solid rgba(30, 41, 59, 0.1);
    background: rgba(255, 255, 255, 0.8);
    padding: 12px 14px;
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    color: #1e293b;
    cursor: pointer;
    transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, opacity 0.16s ease;
}

.practice-option:hover {
    transform: translateY(-1px);
    border-color: rgba(96, 165, 250, 0.32);
}

.practice-option-key {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 12px;
    font-weight: 800;
    color: rgba(30, 41, 59, 0.74);
    background: rgba(148, 163, 184, 0.16);
}

.practice-option-copy {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
}

.practice-option.is-selected {
    border-color: rgba(59, 130, 246, 0.44);
    background: rgba(191, 219, 254, 0.36);
}

.practice-option.is-correct {
    border-color: rgba(16, 185, 129, 0.5);
    background: rgba(167, 243, 208, 0.34);
}

.practice-option.is-wrong {
    border-color: rgba(239, 68, 68, 0.46);
    background: rgba(254, 202, 202, 0.36);
}

.practice-option.is-muted {
    opacity: 0.7;
}

.practice-question-hint {
    margin-top: 14px;
    color: rgba(71, 85, 105, 0.9);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.practice-inspector-shell {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 0;
    padding: 14px;
    border-radius: 24px;
    overflow: auto;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.9)),
        rgba(255, 252, 243, 0.82);
}

.practice-inspector-kicker {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(67, 56, 202, 0.86);
}

.practice-inspector-shell h3 {
    font-family: var(--font-heading);
    font-size: clamp(28px, 2.2vw, 42px);
    line-height: 1.02;
}

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

.practice-type-pill {
    appearance: none;
    -webkit-appearance: none;
    border-radius: 999px;
    border: 1px solid rgba(30, 41, 59, 0.08);
    background: rgba(30, 41, 59, 0.04);
    color: #1e293b;
    padding: 8px 12px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
}

.practice-type-pill.is-active {
    border-color: rgba(67, 56, 202, 0.28);
    background: rgba(67, 56, 202, 0.12);
    color: #4338ca;
}

.practice-type-pill.is-disabled {
    opacity: 0.52;
}

.practice-explain-card {
    border-radius: 20px;
    border: 1px solid rgba(30, 41, 59, 0.08);
    background: rgba(30, 41, 59, 0.03);
    padding: 14px;
    color: #1e293b;
    line-height: 1.75;
    font-size: 14px;
}

.practice-explain-card.is-correct {
    border-color: rgba(16, 185, 129, 0.32);
    background: rgba(167, 243, 208, 0.24);
}

.practice-explain-card.is-wrong {
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(254, 202, 202, 0.24);
}

.practice-explain-result {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.practice-inspector-note {
    color: rgba(71, 85, 105, 0.86);
    font-size: 12px;
    line-height: 1.7;
}

.practice-arena-view.is-expanded,
.practice-arena-view:fullscreen {
    position: fixed;
    inset: 10px 12px;
    z-index: 220;
    padding: 10px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.9));
    border-radius: 28px;
    box-shadow: 0 30px 70px rgba(255, 255, 255, 0.56);
}

.practice-arena-view:fullscreen {
    position: relative;
    inset: auto;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    overflow: auto;
    padding: 18px;
    border-radius: 0;
    box-shadow: none;
}

.practice-arena-view:fullscreen .practice-stage-board {
    min-height: calc(100vh - 230px);
}

@media (max-width: 1300px) {
    .practice-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 980px) {
    .practice-hero {
        grid-template-columns: 1fr;
        align-items: flex-start;
    }

    .practice-hero-stats {
        width: 100%;
        justify-content: flex-start;
    }

    .practice-stage-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .practice-stage-board {
        min-height: 540px;
    }

    .practice-question-card {
        padding: 18px;
    }
}

/* Practice Arena Enhancements: mode + question type + navigation */
.practice-mode-tabs {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.practice-mode-tab {
    appearance: none;
    -webkit-appearance: none;
    border-radius: 999px;
    border: 1px solid rgba(30, 41, 59, 0.1);
    background: rgba(30, 41, 59, 0.04);
    color: #1e293b;
    padding: 9px 14px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.06em;
    cursor: pointer;
    transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.practice-mode-tab:hover {
    transform: translateY(-1px);
    border-color: rgba(96, 165, 250, 0.3);
}

.practice-mode-tab.is-active {
    border-color: rgba(67, 56, 202, 0.32);
    background: linear-gradient(135deg, rgba(67, 56, 202, 0.15), rgba(59, 130, 246, 0.15));
    color: #4338ca;
}

#practiceChapterSwitcher.is-hidden {
    display: none;
}

#practiceExamSwitcher.is-hidden {
    display: none;
}

.practice-board-nav {
    position: sticky;
    bottom: 12px;
    z-index: 3;
    max-width: 580px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 18px;
    border: 1px solid rgba(30, 41, 59, 0.08);
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(10px);
}

.practice-type-pill {
    cursor: pointer;
    transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.practice-type-pill:hover:not(.is-disabled) {
    transform: translateY(-1px);
    border-color: rgba(96, 165, 250, 0.3);
}

.practice-question-nav {
    margin-top: 16px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.practice-nav-btn,
.practice-reveal-btn {
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid rgba(30, 41, 59, 0.1);
    background: rgba(30, 41, 59, 0.04);
    color: #1e293b;
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, opacity 0.16s ease;
}

.practice-nav-btn:hover:not(:disabled),
.practice-reveal-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(96, 165, 250, 0.3);
}

.practice-nav-btn:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.practice-written-actions {
    margin-top: 16px;
}

.practice-reference-card {
    margin-top: 14px;
    border-radius: 16px;
    border: 1px solid rgba(30, 41, 59, 0.08);
    background: rgba(255, 255, 255, 0.82);
    padding: 14px;
}

.practice-reference-card h4 {
    font-size: 13px;
    margin-top: 0;
    margin-bottom: 6px;
    color: #1e293b;
}

.practice-reference-card h4 + h4 {
    margin-top: 12px;
}

.practice-reference-card p,
.practice-reference-card li {
    color: rgba(30, 41, 59, 0.86);
    line-height: 1.75;
    font-size: 13px;
}

.practice-reference-card ul {
    margin: 0;
    padding-left: 18px;
    display: grid;
    gap: 4px;
}

.practice-explain-card ul {
    margin: 8px 0 0;
    padding-left: 18px;
    display: grid;
    gap: 4px;
}

.practice-point-grid {
    margin-top: 16px;
    display: grid;
    gap: 10px;
}

.practice-point-card {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    text-align: left;
    border-radius: 14px;
    border: 1px solid rgba(30, 41, 59, 0.1);
    background: rgba(255, 255, 255, 0.8);
    padding: 11px 12px;
    cursor: pointer;
    transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, opacity 0.16s ease;
}

.practice-point-card:hover:not(:disabled) {
    transform: translateY(-1px);
    border-color: rgba(96, 165, 250, 0.32);
}

.practice-point-card:disabled {
    cursor: default;
}

.practice-point-card .practice-point-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
}

.practice-point-kind {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 3px 8px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(30, 41, 59, 0.72);
    background: rgba(148, 163, 184, 0.15);
}

.practice-point-score {
    font-size: 11px;
    font-weight: 800;
    color: rgba(30, 41, 59, 0.74);
}

.practice-point-text {
    font-size: 13px;
    line-height: 1.6;
    color: #1e293b;
}

.practice-point-card.rubric .practice-point-kind {
    color: #0f766e;
    background: rgba(16, 185, 129, 0.14);
}

.practice-point-card.distractor .practice-point-kind {
    color: #b45309;
    background: rgba(245, 158, 11, 0.16);
}

.practice-point-card.is-selected {
    border-color: rgba(59, 130, 246, 0.42);
    background: rgba(191, 219, 254, 0.34);
}

.practice-point-card.rubric.is-correct {
    border-color: rgba(16, 185, 129, 0.5);
    background: rgba(167, 243, 208, 0.32);
}

.practice-point-card.rubric.is-missed {
    border-color: rgba(239, 68, 68, 0.42);
    background: rgba(254, 226, 226, 0.34);
}

.practice-point-card.distractor.is-wrong {
    border-color: rgba(239, 68, 68, 0.46);
    background: rgba(254, 202, 202, 0.34);
}

.practice-point-card.distractor.is-safe {
    opacity: 0.72;
}

.practice-subjective-summary {
    margin-top: 12px;
    border-radius: 14px;
    padding: 10px 12px;
    border: 1px solid rgba(30, 41, 59, 0.08);
    background: rgba(30, 41, 59, 0.04);
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    font-size: 13px;
}

.practice-subjective-summary.mastered {
    border-color: rgba(16, 185, 129, 0.3);
    background: rgba(167, 243, 208, 0.28);
}

.practice-subjective-summary.basic {
    border-color: rgba(245, 158, 11, 0.34);
    background: rgba(254, 240, 138, 0.28);
}

.practice-subjective-summary.needs-work {
    border-color: rgba(239, 68, 68, 0.34);
    background: rgba(254, 202, 202, 0.26);
}

.practice-explain-card.is-mastered {
    border-color: rgba(16, 185, 129, 0.36);
    background: rgba(167, 243, 208, 0.24);
}

.practice-explain-card.is-basic {
    border-color: rgba(245, 158, 11, 0.34);
    background: rgba(254, 240, 138, 0.22);
}

.practice-explain-card.is-needs-work {
    border-color: rgba(239, 68, 68, 0.34);
    background: rgba(254, 202, 202, 0.24);
}

.practice-inspector-block {
    margin-top: 12px;
    border-radius: 14px;
    border: 1px solid rgba(30, 41, 59, 0.08);
    background: rgba(255, 255, 255, 0.75);
    padding: 11px 12px;
}

.practice-inspector-block h4 {
    margin: 0;
    font-size: 13px;
    color: #1e293b;
}

.practice-inspector-block p {
    margin-top: 8px;
    font-size: 12px;
    line-height: 1.7;
    color: rgba(30, 41, 59, 0.82);
}

.practice-inspector-block ul {
    margin: 8px 0 0;
    padding-left: 18px;
    display: grid;
    gap: 8px;
}

.practice-inspector-block li {
    font-size: 12px;
    color: rgba(30, 41, 59, 0.88);
    line-height: 1.7;
}

.practice-inspector-point-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.practice-inspector-point-head strong {
    font-size: 11px;
    color: #334155;
    white-space: nowrap;
}

.practice-inspector-block small {
    display: block;
    color: rgba(71, 85, 105, 0.86);
    font-size: 11px;
    margin-top: 3px;
}

.practice-empty-line {
    margin-top: 8px;
    font-size: 12px;
    color: rgba(71, 85, 105, 0.8);
}

/* ============================================
   Production layout repair - Vercel shell pass
   ============================================ */
.main-content {
    overflow: auto;
    min-height: 0;
}

.knowledge-map-view,
.practice-arena-view {
    overflow: auto;
    min-height: 0;
    scrollbar-gutter: stable;
}

/* Immersive whiteboard: assistant notes float above content instead of shrinking it. */
.visualization-stage {
    min-height: clamp(520px, calc(100vh - 220px), 760px);
    overflow-y: auto;
    overflow-x: hidden;
    align-content: stretch;
}

.assistant-popup {
    z-index: 160;
    pointer-events: auto;
}

.blackboard-section.has-assistant-note .caption-box,
.blackboard-section:has(#assistantPopup:not(.hidden)) .caption-box {
    inset: 28px 24px 210px;
}

.blackboard-section.has-assistant-note .caption-box.has-figure,
.blackboard-section.has-assistant-note .caption-box:has(.viz-figure),
.blackboard-section:has(#assistantPopup:not(.hidden)) .caption-box.has-figure,
.blackboard-section:has(#assistantPopup:not(.hidden)) .caption-box:has(.viz-figure) {
    inset: 28px 24px 190px;
    grid-template-columns: minmax(220px, 0.42fr) minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas:
        "title title"
        "body media";
    column-gap: 22px;
}

.blackboard-section.has-assistant-note .caption-box.figure-atlas-caption,
.blackboard-section:has(#assistantPopup:not(.hidden)) .caption-box.figure-atlas-caption {
    inset: 24px 24px 184px;
    grid-template-columns: minmax(220px, 0.36fr) minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas:
        "title title"
        "body media";
    column-gap: 22px;
}

.blackboard-section.has-assistant-note .caption-box.figure-atlas-caption p,
.blackboard-section:has(#assistantPopup:not(.hidden)) .caption-box.figure-atlas-caption p {
    max-height: none;
    overflow: auto;
}

.blackboard-section.has-assistant-note .caption-box .figure-atlas-image,
.blackboard-section:has(#assistantPopup:not(.hidden)) .caption-box .figure-atlas-image,
.caption-box.figure-atlas-caption .figure-atlas-image {
    width: 100%;
    height: 100%;
    max-height: 100%;
    object-fit: contain;
}

.blackboard-section.has-assistant-note .caption-box.has-figure h3,
.blackboard-section.has-assistant-note .caption-box:has(.viz-figure) h3,
.blackboard-section:has(#assistantPopup:not(.hidden)) .caption-box.has-figure h3,
.blackboard-section:has(#assistantPopup:not(.hidden)) .caption-box:has(.viz-figure) h3 {
    font-size: clamp(20px, 1.8vw, 30px);
}

.blackboard-section.has-assistant-note .caption-box.has-figure p,
.blackboard-section.has-assistant-note .caption-box:has(.viz-figure) p,
.blackboard-section:has(#assistantPopup:not(.hidden)) .caption-box.has-figure p,
.blackboard-section:has(#assistantPopup:not(.hidden)) .caption-box:has(.viz-figure) p {
    font-size: clamp(13px, 1vw, 17px);
}

.blackboard-section.has-assistant-note .caption-box.has-figure .viz-figure,
.blackboard-section.has-assistant-note .caption-box:has(.viz-figure) .viz-figure,
.blackboard-section:has(#assistantPopup:not(.hidden)) .caption-box.has-figure .viz-figure,
.blackboard-section:has(#assistantPopup:not(.hidden)) .caption-box:has(.viz-figure) .viz-figure {
    width: min(100%, 360px);
    max-height: 250px;
    justify-self: center;
}

@media (max-width: 1180px) {
    .blackboard-section.has-assistant-note .caption-box.has-figure,
    .blackboard-section.has-assistant-note .caption-box:has(.viz-figure),
    .blackboard-section:has(#assistantPopup:not(.hidden)) .caption-box.has-figure,
    .blackboard-section:has(#assistantPopup:not(.hidden)) .caption-box:has(.viz-figure),
    .blackboard-section.has-assistant-note .caption-box.figure-atlas-caption,
    .blackboard-section:has(#assistantPopup:not(.hidden)) .caption-box.figure-atlas-caption,
    .caption-box.figure-atlas-caption {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto minmax(0, 1fr);
        grid-template-areas:
            "title"
            "body"
            "media";
    }
}

/* Knowledge map: the mindmap owns the main canvas; explanation never covers it. */
.knowledge-map-view {
    display: flex;
    flex-direction: column;
}

.knowledge-map-grid,
.knowledge-map-view.is-expanded .knowledge-map-grid,
.knowledge-map-view:fullscreen .knowledge-map-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    min-height: 0;
    overflow: visible;
}

.knowledge-stage-board {
    min-height: max(920px, calc(100vh - 120px));
    max-height: none;
    overflow: auto;
}

.knowledge-stage-shell {
    min-height: 1000px;
    flex: 0 0 auto;
    overflow: visible;
}

.knowledge-map-view.is-expanded .knowledge-stage-board,
.knowledge-map-view:fullscreen .knowledge-stage-board {
    min-height: calc(100vh - 230px);
}

.knowledge-map-view.is-expanded .knowledge-stage-shell,
.knowledge-map-view:fullscreen .knowledge-stage-shell {
    min-height: 0;
    height: 100%;
}

.knowledge-inspector-shell {
    position: relative;
    z-index: 4;
    max-height: min(360px, 42vh);
    overflow: auto;
}

@media (min-width: 1500px) {
    .knowledge-map-view.is-expanded .knowledge-map-grid,
    .knowledge-map-view:fullscreen .knowledge-map-grid {
        grid-template-columns: minmax(0, 1fr) minmax(320px, 360px);
        align-items: stretch;
        height: calc(100vh - 150px);
    }

    .knowledge-map-view.is-expanded .knowledge-inspector-shell,
    .knowledge-map-view:fullscreen .knowledge-inspector-shell {
        max-height: none;
        height: 100%;
    }
}

/* Practice: question and explanation scroll independently; controls stay reachable. */
.practice-grid,
.practice-arena-view.is-expanded .practice-grid,
.practice-arena-view:fullscreen .practice-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    min-height: 0;
    overflow: visible;
}

.practice-grid {
    flex: 0 0 auto;
    align-items: start;
}

.practice-stage-shell {
    height: auto;
    overflow: visible;
}

.practice-stage-board {
    flex: 0 0 auto;
    min-height: max(500px, calc(100vh - 340px));
    max-height: none;
    overflow: auto;
    padding-bottom: 120px;
}

.practice-question-card,
.practice-board-nav {
    max-width: min(760px, 100%);
}

.practice-board-nav {
    bottom: 0;
    z-index: 20;
    background: rgba(255, 255, 255, 0.94);
}

.practice-inspector-shell {
    max-height: min(380px, 44vh);
    overflow: auto;
}

.practice-arena-view.is-expanded .practice-stage-board,
.practice-arena-view:fullscreen .practice-stage-board {
    flex: 1 1 auto;
    min-height: calc(100vh - 230px);
}

.practice-arena-view.is-expanded .practice-grid,
.practice-arena-view:fullscreen .practice-grid {
    flex: 1 1 auto;
    align-items: stretch;
}

.practice-arena-view.is-expanded .practice-stage-shell,
.practice-arena-view:fullscreen .practice-stage-shell {
    height: 100%;
    overflow: hidden;
}

@media (min-width: 1500px) {
    .practice-arena-view.is-expanded .practice-grid,
    .practice-arena-view:fullscreen .practice-grid {
        grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
        height: calc(100vh - 150px);
    }

    .practice-arena-view.is-expanded .practice-inspector-shell,
    .practice-arena-view:fullscreen .practice-inspector-shell {
        max-height: none;
        height: 100%;
    }
}

/* ============================================
   Learning reward status + practice/whiteboard repair
   ============================================ */
.stat-copy {
    display: flex;
    flex-direction: column;
    gap: 1px;
    line-height: 1.05;
}

.stat-copy strong {
    font-size: 14px;
    font-weight: 800;
    color: #111827;
    white-space: nowrap;
}

.stat-copy small {
    color: rgba(71, 85, 105, 0.76);
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}

.main-content:has(.practice-arena-view:not(.hidden)) {
    overflow: hidden;
}

.practice-arena-view:not(.hidden) {
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
    scrollbar-gutter: stable;
}

.practice-arena-view:not(.hidden) .practice-hero,
.practice-arena-view:fullscreen .practice-hero,
.practice-arena-view.is-expanded .practice-hero {
    position: sticky;
    top: 0;
    z-index: 30;
    min-height: 88px;
    border-radius: 18px;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 14px 34px rgba(148, 163, 184, 0.16);
}

.practice-arena-view:not(.hidden) .practice-grid {
    min-height: auto;
}

.practice-arena-view:not(.hidden) .practice-stat-circle {
    width: 58px;
    height: 58px;
}

.practice-arena-view:not(.hidden) .practice-stat-circle strong {
    font-size: 24px;
}

.holo-pulse-ring {
    z-index: 0;
    border-color: rgba(147, 197, 253, 0.2);
}

.holo-arrow-track {
    position: absolute;
    inset: 3%;
    z-index: 1;
    overflow: visible;
    filter: drop-shadow(0 0 8px rgba(96, 165, 250, 0.18));
}

.holo-arrow-track path {
    fill: none;
    stroke: rgba(96, 165, 250, 0.42);
    stroke-width: 3.2;
    stroke-linecap: round;
    stroke-dasharray: 120 20;
    marker-end: url(#holoArrowHead);
}

.holo-orbit-shell {
    position: absolute;
    inset: 8%;
    border-radius: 50%;
    z-index: 2;
    border: 1px solid rgba(147, 197, 253, 0.22);
    box-shadow:
        inset 0 0 34px rgba(96, 165, 250, 0.12),
        0 0 44px rgba(219, 234, 254, 0.35);
}

.holo-orbit {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    animation: orbitSpin 34s linear infinite;
}

.holo-orbit-element {
    position: absolute;
    left: 50%;
    top: 50%;
    width: clamp(78px, 18%, 120px);
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    transform-origin: center;
    filter: drop-shadow(0 16px 24px rgba(96, 165, 250, 0.16));
}

.holo-orbit-element img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    animation: counterOrbitSpin 34s linear infinite;
}

.element-dc {
    transform: translate(-50%, -50%) rotate(-90deg) translateY(calc(-1 * clamp(180px, 32vw, 225px))) rotate(90deg);
}

.element-lymphocyte {
    transform: translate(-50%, -50%) rotate(-18deg) translateY(calc(-1 * clamp(180px, 32vw, 225px))) rotate(18deg);
}

.element-effector {
    transform: translate(-50%, -50%) rotate(54deg) translateY(calc(-1 * clamp(180px, 32vw, 225px))) rotate(-54deg);
}

.element-antibody {
    transform: translate(-50%, -50%) rotate(126deg) translateY(calc(-1 * clamp(180px, 32vw, 225px))) rotate(-126deg);
}

.element-shield {
    transform: translate(-50%, -50%) rotate(198deg) translateY(calc(-1 * clamp(180px, 32vw, 225px))) rotate(-198deg);
}

.holo-core {
    z-index: 4;
    gap: 6px;
}

.holo-core img {
    width: clamp(118px, 26%, 168px);
    aspect-ratio: 1;
    object-fit: contain;
    filter: drop-shadow(0 22px 24px rgba(99, 102, 241, 0.22));
    animation: coreGlow 3.2s ease-in-out infinite alternate;
}

.core-label {
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(239, 246, 255, 0.74);
    border: 1px solid rgba(147, 197, 253, 0.26);
    color: #2563eb;
    font-family: var(--font-body);
    font-size: 15px;
    letter-spacing: 0.04em;
    text-shadow: 0 0 12px rgba(96, 165, 250, 0.24);
}

@keyframes counterOrbitSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(-360deg); }
}

@media (max-width: 980px) {
    .practice-arena-view:not(.hidden) .practice-hero {
        min-height: 0;
    }

    .practice-arena-view:not(.hidden) .practice-hero-stats {
        display: none;
    }

    .holo-orbit-element {
        width: clamp(58px, 17%, 88px);
    }
}

/* ============================================
   Mobile and tablet responsive shell
   ============================================ */
html,
body {
    min-height: 100%;
    -webkit-text-size-adjust: 100%;
}

:root {
    --mobile-tab-height: 64px;
    --beian-footer-height: 32px;
}

@supports (height: 100dvh) {
    body,
    .app-container {
        height: 100dvh;
    }
}

@media (min-width: 768px) and (max-width: 1024px) {
    :root {
        --mobile-tab-height: 72px;
    }
}

@media (max-width: 1024px) {
    .app-container {
        flex-direction: column;
        padding: 8px 8px 0;
        gap: 8px;
    }

    .main-content {
        width: 100%;
        min-width: 0;
        min-height: 0;
        overflow: auto;
        padding-bottom: calc(var(--mobile-tab-height) + var(--beian-footer-height) + env(safe-area-inset-bottom) + 12px);
    }

    .main-content:has(.practice-arena-view:not(.hidden)) {
        overflow: auto;
    }

    .sidebar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 200;
        width: 100%;
        height: calc(var(--mobile-tab-height) + env(safe-area-inset-bottom));
        padding: 0 8px env(safe-area-inset-bottom);
        border-radius: 20px 20px 0 0;
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-around;
        gap: 0;
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
    }

    body.is-fullscreen-active .sidebar,
    body.is-fullscreen-active .user-profile.ix-account,
    body.is-knowledge-expanded .sidebar,
    body.is-knowledge-expanded .user-profile.ix-account,
    body.is-practice-expanded .user-profile.ix-account,
    body.is-practice-expanded .sidebar {
        display: none;
    }

    .logo {
        display: none;
    }

    .nav-links {
        width: 100%;
        flex-direction: row;
        justify-content: space-around;
        gap: 0;
    }

    .nav-links li {
        flex: 1 1 0;
        min-width: 0;
        min-height: 44px;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        padding: 6px 0;
        border-left: 0 !important;
        border-radius: 12px;
        font-size: 10px;
        text-align: center;
    }

    .nav-links li:hover {
        transform: none;
    }

    .nav-links li.active {
        border-left: 0 !important;
        background: rgba(67, 56, 202, 0.12);
        color: var(--accent-indigo);
    }

    .nav-links li i {
        font-size: 20px;
        line-height: 1;
    }

    .nav-links li span {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 10px;
        line-height: 1.15;
    }

    .user-profile.ix-account {
        position: fixed;
        top: calc(10px + env(safe-area-inset-top));
        right: 10px;
        z-index: 260;
        display: block;
        width: 40px;
        height: 40px;
        margin: 0;
        pointer-events: none;
    }

    .ix-account-trigger {
        width: 40px;
        height: 40px;
        justify-content: center;
        padding: 0;
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.82);
        box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
        pointer-events: auto;
    }

    .ix-account-avatar img {
        width: 32px;
        height: 32px;
    }

    .ix-account-copy,
    .ix-account-caret {
        display: none;
    }

    .ix-account-menu {
        position: fixed;
        top: calc(58px + env(safe-area-inset-top));
        right: 10px;
        left: auto;
        bottom: auto;
        width: min(220px, calc(100vw - 20px));
        z-index: 270;
        pointer-events: auto;
    }

    .assistant-popup {
        position: fixed;
        top: calc(58px + env(safe-area-inset-top));
        right: 12px;
        width: min(360px, calc(100vw - 24px));
        height: min(260px, 36dvh);
        z-index: 280;
        pointer-events: auto;
    }

    .top-bar,
    .knowledge-map-hero,
    .practice-hero,
    .detective-header {
        padding-right: 58px;
    }

    .classroom-view,
    .case-detective-view,
    .knowledge-map-view,
    .practice-arena-view {
        min-width: 0;
        min-height: 0;
    }

    /* ---- hide sidebar guest buttons on mobile/tablet ---- */
    .ix-guest-actions {
        display: none !important;
    }

    /* show top-bar inline mobile guest buttons */
    .ix-guest-bar-mobile:not(.hidden) {
        display: flex;
        align-items: center;
        gap: 6px;
    }

    .ix-guest-bar-mobile .ix-mbtn {
        padding: 5px 8px;
        font-size: 11px;
    }

    .action-btn {
        min-height: 44px;
        padding: 16px 18px;
        font-size: 15px;
    }

    .tools button {
        width: 44px;
        height: 44px;
    }
}

@media (min-width: 768px) and (max-width: 1024px) {
    .nav-links li i {
        font-size: 22px;
    }

    .nav-links li span {
        font-size: 11px;
    }

    .top-bar {
        height: auto;
        flex-wrap: wrap;
        padding: 12px 58px 12px 16px;
    }

    .lesson-switcher {
        min-width: auto;
    }

    .blackboard-section {
        flex: 0 0 auto;
        min-height: clamp(520px, 58dvh, 680px);
    }

    .dialogue-section {
        flex: 0 0 auto;
        min-height: 360px;
    }

    .classroom-area {
        flex-direction: column;
        overflow: auto;
        gap: 12px;
    }

    .visualization-stage {
        min-height: clamp(460px, 54dvh, 640px);
        padding-bottom: 150px;
    }

    /* ── Tablet whiteboard caption-box: give figures more room ── */
    .caption-box,
    .caption-box.has-figure,
    .caption-box.figure-atlas-caption {
        inset: 22px 18px 136px;
        grid-template-columns: 1fr;
        grid-template-rows: auto auto minmax(0, 1fr);
        grid-template-areas:
            "title"
            "body"
            "media";
        row-gap: 12px;
    }

    .caption-box p {
        max-height: min(128px, 18dvh);
        overflow-y: auto;
    }

    .caption-box .viz-figure {
        width: min(100%, 400px);
        max-height: clamp(160px, 26dvh, 300px);
        justify-self: center;
        align-self: start;
    }

    .caption-box.figure-atlas-caption .figure-atlas-image,
    .caption-box .figure-atlas-image {
        width: min(100%, 420px);
        max-width: 100%;
        height: auto;
        max-height: clamp(190px, 30dvh, 340px);
        object-fit: contain;
        justify-self: center;
        align-self: center;
    }

    .interactive-cards {
        bottom: 12px;
    }

    .knowledge-stage-board {
        min-height: 600px;
    }

    .knowledge-stage-shell {
        min-height: auto;
    }
}

/* Mobile-only toggles for case detective - hidden on desktop */
.case-index-mobile-toggle,
.case-card-mobile-toggle {
    display: none;
}

@media (max-width: 767px) {
    .app-container {
        padding: 6px 6px 0;
    }

    .top-bar {
        height: auto;
        flex-wrap: wrap;
        gap: 8px;
        padding: 10px 58px 10px 12px;
        border-radius: 14px;
    }

    .course-info h2 {
        font-size: 16px;
        line-height: 1.2;
        max-width: calc(100vw - 92px);
    }

    .badge {
        font-size: 9px;
        padding: 2px 6px;
    }

    .top-bar-actions {
        width: 100%;
        flex-wrap: wrap;
        gap: 8px;
    }

    .lesson-switcher {
        min-width: 100%;
    }

    .stats {
        width: 100%;
        flex-wrap: wrap;
        gap: 8px;
    }

    .stat-item {
        padding: 6px 10px;
        flex: 1 1 calc(50% - 8px);
        min-width: 0;
    }

    .stat-copy strong {
        font-size: 12px;
    }

    .stat-copy small {
        font-size: 9px;
    }

    .mission-panel {
        left: 0;
        right: auto;
        width: 100%;
        max-height: min(72dvh, 560px);
        overflow: auto;
        border-radius: 14px;
    }

    .mission-item {
        grid-template-columns: 26px minmax(0, 1fr);
    }

    .mission-action {
        grid-column: 2;
        justify-self: start;
    }

    .classroom-area {
        flex-direction: column;
        overflow: auto;
        gap: 10px;
    }

    .blackboard-section {
        flex: 0 0 auto;
        min-height: clamp(360px, 56dvh, 520px);
        border-radius: 14px;
    }

    .dialogue-section {
        flex: 0 0 auto;
        min-height: 260px;
        border-radius: 14px;
    }

    .participants-panel {
        height: 48px;
        min-height: 48px;
        max-height: 48px;
    }

    .participants-strip {
        gap: 6px;
        padding: 6px 10px;
    }

    .participant-chip {
        min-width: 100px;
        max-width: 120px;
        padding: 6px 8px;
    }

    .participants-resizer {
        display: none;
    }

    .visualization-stage {
        min-height: clamp(380px, 54dvh, 520px);
        padding: 16px 12px 126px;
    }

    .caption-box,
    .caption-box.has-figure,
    .caption-box.figure-atlas-caption {
        inset: 14px 12px 116px;
        grid-template-columns: 1fr;
        grid-template-rows: auto auto minmax(0, 1fr);
        grid-template-areas:
            "title"
            "body"
            "media";
        row-gap: 8px;
        overflow: visible;
    }

    .caption-box h3 {
        font-size: 18px;
        line-height: 1.2;
    }

    .caption-box p {
        font-size: 13px;
        max-height: min(112px, 18dvh);
        overflow-y: auto;
    }

    /* ── Mobile whiteboard figures: vertically centered in the 1fr media area ── */
    .caption-box .viz-figure {
        width: min(100%, 320px);
        max-height: clamp(100px, 22dvh, 220px);
        justify-self: center;
        align-self: center;
    }

    .caption-box.figure-atlas-caption .figure-atlas-image,
    .caption-box .figure-atlas-image {
        width: min(100%, 340px);
        max-width: 100%;
        height: auto;
        max-height: clamp(132px, 26dvh, 240px);
        object-fit: contain;
        justify-self: center;
        align-self: center;
    }

    .interactive-cards {
        left: 12px;
        right: 12px;
        bottom: 10px;
        width: auto;
        transform: none;
        justify-content: flex-start;
        gap: 8px;
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .card {
        width: 120px;
        padding: 10px;
    }

    .chat-container {
        padding: 14px;
    }

    .action-area {
        padding: 10px 14px;
    }

    .assistant-popup {
        width: calc(100% - 24px);
        right: 12px;
        top: 50px;
        height: min(240px, 34dvh);
    }

    .assistant-popup-shell {
        grid-template-columns: minmax(0, 1fr) 52px;
    }

    .assistant-note-viewport {
        padding: 12px;
    }

    .assistant-note-history-range {
        height: 96px;
    }

    .knowledge-map-hero,
    .practice-hero {
        grid-template-columns: 1fr;
        min-height: auto;
        padding: 10px 58px 10px 12px;
    }

    .knowledge-kicker-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .knowledge-subtitle-inline {
        flex: 0 1 auto;
        width: 100%;
        height: auto;
        margin-left: 0 !important;
        font-size: 12px;
        line-height: 1.35;
    }

    .knowledge-summary-inline {
        white-space: normal;
    }

    .knowledge-hero-stats {
        flex-wrap: wrap;
        gap: 6px;
    }

    .knowledge-mini-stat,
    .km-mini-circle {
        width: 60px;
        height: 60px;
    }

    .knowledge-stage-board {
        min-height: 500px;
    }

    .knowledge-stage-shell {
        min-height: auto;
    }

    .knowledge-stage-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .km-tab-btn {
        flex: 1 1 auto;
        padding: 8px 10px;
        font-size: 11px;
        text-align: center;
    }

    .knowledge-inspector-shell {
        max-height: none;
        overflow: visible;
    }

    .km-node {
        min-width: 80px;
        max-width: 180px;
        padding: 10px 12px;
    }

    .km-node span {
        font-size: 12px;
    }

    .km-node.is-root span {
        font-size: 18px;
    }

    .practice-hero-main {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .practice-mode-tabs {
        width: 100%;
        flex-wrap: wrap;
    }

    .practice-mode-tab {
        flex: 1 1 auto;
        padding: 8px 10px;
        text-align: center;
    }

    .practice-chapter-subtitle {
        min-width: 0;
        font-size: 12px;
    }

    .practice-hero-stats {
        width: 100%;
        justify-content: flex-start;
    }

    .practice-stat-circle {
        width: 60px;
        height: 60px;
    }

    .practice-stat-circle strong {
        font-size: 24px;
    }

    .practice-stage-shell {
        padding: 8px;
    }

    .practice-stage-board {
        min-height: 400px;
        padding: 12px;
        padding-bottom: 100px;
    }

    .practice-question-card {
        max-width: 100%;
        padding: 16px;
    }

    .practice-board-nav {
        max-width: 100%;
        padding: 10px;
    }

    .practice-inspector-shell {
        max-height: none;
        overflow: visible;
    }

    .practice-option {
        padding: 10px 12px;
    }

    .detective-header {
        grid-template-columns: 1fr;
        padding-right: 58px;
    }

    .case-stage-grid {
        grid-template-columns: 1fr;
    }

    .stage-card,
    .case-board {
        min-height: auto;
    }

    /* ── Fix 1: Practice Arena ── keep mode tabs & switchers visible above bottom tab ── */
    .practice-arena-view:not(.hidden) .practice-hero,
    .practice-hero {
        position: relative !important; /* drop sticky so it scrolls naturally */
        z-index: auto;
        min-height: auto !important;
        padding: 10px 12px;
        overflow: visible !important;  /* override base overflow:hidden that clips tabs */
    }

    .practice-hero-main {
        gap: 6px;
    }

    .practice-mode-tabs {
        gap: 4px;
    }

    .practice-mode-tab {
        padding: 7px 8px;
        font-size: 11px;
    }

    .practice-chapter-subtitle {
        min-width: 0;
        width: 100%;
    }

    /* Ensure the practice stage board has enough bottom padding above the tab bar */
    .practice-stage-board {
        min-height: 300px;
        padding-bottom: 20px;
    }

    /* ── Fix 2: Knowledge Map ── enable touch scroll on mind map board ── */
    .knowledge-stage-board {
        overflow: auto;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-x pan-y;
        min-height: 400px;
    }

    .km-board-frame {
        touch-action: pan-x pan-y;
    }

    .knowledge-stage-shell {
        min-height: 460px;
    }

    /* ── Fix 2b: Knowledge Map expanded/maximized ── mobile-optimized layout ── */
    .knowledge-map-view.is-expanded .knowledge-map-hero,
    .knowledge-map-view:fullscreen .knowledge-map-hero {
        display: none;   /* hide hero to reclaim vertical space */
    }

    .knowledge-map-view.is-expanded .knowledge-map-grid,
    .knowledge-map-view:fullscreen .knowledge-map-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .knowledge-map-view.is-expanded .knowledge-stage-shell,
    .knowledge-map-view:fullscreen .knowledge-stage-shell {
        min-height: calc(100dvh - 80px);
    }

    .knowledge-map-view.is-expanded .knowledge-stage-board,
    .knowledge-map-view:fullscreen .knowledge-stage-board {
        height: calc(100dvh - 140px);
        max-height: calc(100dvh - 140px);
        min-height: 0;
        overflow: auto;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-x pan-y;
    }

    .knowledge-map-view.is-expanded .knowledge-inspector-shell,
    .knowledge-map-view:fullscreen .knowledge-inspector-shell {
        max-height: 200px;
        overflow: auto;
    }

    /* ── Fix 3: Case Detective ── auto-collapse header & case index on mobile ── */
    /* Compact the detective header */
    .detective-header {
        padding: 8px 58px 8px 10px;
        gap: 6px;
    }

    .detective-header h2 {
        font-size: 16px;
        line-height: 1.2;
    }

    /* current-case-card: collapsed by default on mobile, toggle to expand */
    .current-case-card {
        max-height: 0;
        overflow: hidden;
        padding: 0;
        margin: 0;
        border: none;
        opacity: 0;
        transition: max-height 0.3s ease, padding 0.3s ease, opacity 0.2s ease;
    }

    .case-detective-view.is-case-card-open .current-case-card {
        max-height: 200px;
        padding: 10px 14px;
        border: 1px solid rgba(67, 56, 202, 0.2);
        opacity: 1;
        overflow: visible;
    }

    /* Mobile toggle for current-case-card �?hidden on desktop */
    .case-card-mobile-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        width: 100%;
        padding: 7px;
        border: 1px solid rgba(67, 56, 202, 0.15);
        border-radius: 12px;
        background: linear-gradient(135deg, rgba(49, 46, 129, 0.06), rgba(255, 252, 243, 0.5));
        color: #4338ca;
        font-size: 12px;
        font-weight: 700;
        cursor: pointer;
        appearance: none;
        -webkit-appearance: none;
    }

    .case-card-mobile-toggle i {
        font-size: 16px;
        transition: transform 0.2s ease;
    }

    .case-detective-view.is-case-card-open .case-card-mobile-toggle i {
        transform: rotate(180deg);
    }

    /* Auto-collapse case index panel on mobile */
    .case-index-panel {
        max-height: 0;
        overflow: hidden;
        padding: 0;
        opacity: 0;
        transition: max-height 0.3s ease, padding 0.3s ease, opacity 0.2s ease;
    }

    .case-detective-view.is-index-open .case-index-panel {
        max-height: 240px;
        padding: 12px;
        opacity: 1;
        overflow: auto;
    }

    /* Detective grid stacks vertically, case-board gets priority */
    .detective-grid {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    /* case-board (推理�? takes all remaining space */
    .case-board {
        flex: 1 1 auto;
        overflow: auto;
        min-height: 0;
    }

    /* Add a mobile toggle for showing/hiding case-index */
    .case-index-mobile-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        width: 100%;
        padding: 8px;
        border: 1px solid rgba(30, 41, 59, 0.1);
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.72);
        color: var(--text-secondary);
        font-size: 12px;
        font-weight: 700;
        cursor: pointer;
        appearance: none;
        -webkit-appearance: none;
    }

    .case-index-mobile-toggle i {
        font-size: 16px;
        transition: transform 0.2s ease;
    }

    .case-detective-view.is-index-open .case-index-mobile-toggle i {
        transform: rotate(180deg);
    }
}

/* ── Desktop non-fullscreen: side-by-side map + inspector ── */
@media (min-width: 1025px) {
    /* Knowledge Map �?always two-column on desktop, matching fullscreen */
    .knowledge-map-grid,
    .knowledge-map-view.is-expanded .knowledge-map-grid,
    .knowledge-map-view:fullscreen .knowledge-map-grid {
        grid-template-columns: minmax(0, 1fr) minmax(320px, 360px);
        align-items: stretch;
    }

    .knowledge-inspector-shell {
        max-height: none;
        height: 100%;
        overflow: auto;
    }

    .knowledge-stage-shell {
        min-height: 0;
        flex: 1 1 auto;
        overflow: hidden;
    }

    .knowledge-stage-board {
        min-height: max(600px, calc(100vh - 300px));
    }

    /* Practice Arena �?always two-column on desktop, matching fullscreen */
    .practice-grid,
    .practice-arena-view.is-expanded .practice-grid,
    .practice-arena-view:fullscreen .practice-grid {
        grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
        align-items: stretch;
    }

    .practice-inspector-shell {
        max-height: none;
        height: 100%;
        overflow: auto;
    }

    .practice-stage-shell {
        height: 100%;
        overflow: hidden;
    }
}

/* ── Tablet breakpoint supplements (768�?024 px) ── */
@media (min-width: 768px) and (max-width: 1024px) {

    /* ─── Knowledge Map ─── */
    /* Touch scrolling */
    .knowledge-stage-board {
        overflow: auto;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-x pan-y;
        min-height: 500px;
    }

    .km-board-frame {
        touch-action: pan-x pan-y;
    }

    .knowledge-stage-shell {
        min-height: auto;
    }

    /* Inspector: give it proper readable height, not a compressed strip */
    .knowledge-inspector-shell {
        max-height: none;
        overflow: visible;
    }

    /* ─── Case Detective ─── collapse cards like mobile ─── */
    .detective-header {
        grid-template-columns: 1fr;
        padding: 8px 58px 8px 10px;
        gap: 6px;
    }

    .case-stage-grid {
        grid-template-columns: 1fr;
    }

    .stage-card,
    .case-board {
        min-height: auto;
    }

    /* current-case-card: collapsed by default */
    .current-case-card {
        max-height: 0;
        overflow: hidden;
        padding: 0;
        margin: 0;
        border: none;
        opacity: 0;
        transition: max-height 0.3s ease, padding 0.3s ease, opacity 0.2s ease;
    }

    .case-detective-view.is-case-card-open .current-case-card {
        max-height: 200px;
        padding: 10px 14px;
        border: 1px solid rgba(67, 56, 202, 0.2);
        opacity: 1;
        overflow: visible;
    }

    .case-card-mobile-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        width: 100%;
        padding: 7px;
        border: 1px solid rgba(67, 56, 202, 0.15);
        border-radius: 12px;
        background: linear-gradient(135deg, rgba(49, 46, 129, 0.06), rgba(255, 252, 243, 0.5));
        color: #4338ca;
        font-size: 12px;
        font-weight: 700;
        cursor: pointer;
        appearance: none;
        -webkit-appearance: none;
    }

    .case-card-mobile-toggle i {
        font-size: 16px;
        transition: transform 0.2s ease;
    }

    .case-detective-view.is-case-card-open .case-card-mobile-toggle i {
        transform: rotate(180deg);
    }

    /* Auto-collapse case index panel */
    .case-index-panel {
        max-height: 0;
        overflow: hidden;
        padding: 0;
        opacity: 0;
        transition: max-height 0.3s ease, padding 0.3s ease, opacity 0.2s ease;
    }

    .case-detective-view.is-index-open .case-index-panel {
        max-height: 240px;
        padding: 12px;
        opacity: 1;
        overflow: auto;
    }

    .detective-grid {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .case-board {
        flex: 1 1 auto;
        overflow: auto;
        min-height: 0;
    }

    .case-index-mobile-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        width: 100%;
        padding: 8px;
        border: 1px solid rgba(30, 41, 59, 0.1);
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.72);
        color: var(--text-secondary);
        font-size: 12px;
        font-weight: 700;
        cursor: pointer;
        appearance: none;
        -webkit-appearance: none;
    }

    .case-index-mobile-toggle i {
        font-size: 16px;
        transition: transform 0.2s ease;
    }

    .case-detective-view.is-index-open .case-index-mobile-toggle i {
        transform: rotate(180deg);
    }

    /* ─── Practice Arena ─── fix clipped hero ─── */
    .practice-arena-view:not(.hidden) .practice-hero,
    .practice-hero {
        position: relative !important;
        z-index: auto;
        min-height: auto !important;
        padding: 10px 12px;
        overflow: visible !important;
    }

    .practice-hero-main {
        gap: 6px;
    }

    .practice-mode-tabs {
        width: 100%;
        flex-wrap: wrap;
        gap: 4px;
    }

    .practice-mode-tab {
        flex: 1 1 auto;
        padding: 7px 8px;
        font-size: 11px;
        text-align: center;
    }

    .practice-chapter-subtitle {
        min-width: 0;
        width: 100%;
    }

    .practice-stage-board {
        min-height: 400px;
        padding-bottom: 20px;
    }

    .practice-inspector-shell {
        max-height: none;
        overflow: visible;
    }

    .practice-hero-stats {
        width: 100%;
        justify-content: flex-start;
    }

    .knowledge-map-hero,
    .practice-hero {
        grid-template-columns: 1fr;
        min-height: auto;
    }
}

@media (max-height: 560px) and (pointer: coarse) {
    .top-bar {
        padding-top: 8px;
        padding-bottom: 8px;
    }

    .blackboard-section {
        min-height: 280px;
    }

    .dialogue-section {
        min-height: 200px;
    }
}

/* ── Mobile / Tablet fullscreen whiteboard: use full viewport for figures ── */
@media (max-width: 1024px) {
    .blackboard-section:fullscreen .visualization-stage,
    .blackboard-section.is-fullscreen .visualization-stage {
        min-height: 100dvh;
        padding: 14px 12px 130px;
    }

    .blackboard-section:fullscreen .caption-box,
    .blackboard-section.is-fullscreen .caption-box,
    .blackboard-section:fullscreen .caption-box.has-figure,
    .blackboard-section.is-fullscreen .caption-box.has-figure,
    .blackboard-section:fullscreen .caption-box.figure-atlas-caption,
    .blackboard-section.is-fullscreen .caption-box.figure-atlas-caption {
        inset: 14px 12px 120px;
        grid-template-columns: 1fr;
        grid-template-rows: auto auto minmax(0, 1fr);
        grid-template-areas:
            "title"
            "body"
            "media";
        overflow: visible;
    }

    .blackboard-section:fullscreen .caption-box p,
    .blackboard-section.is-fullscreen .caption-box p {
        max-height: 80px;
        overflow-y: auto;
    }

    .blackboard-section:fullscreen .caption-box .viz-figure,
    .blackboard-section.is-fullscreen .caption-box .viz-figure {
        width: min(100%, 480px);
        max-height: calc(100dvh - 320px);
        justify-self: center;
        align-self: center;
    }

    .blackboard-section:fullscreen .caption-box .figure-atlas-image,
    .blackboard-section.is-fullscreen .caption-box .figure-atlas-image {
        width: 100%;
        height: auto;
        max-height: calc(100dvh - 300px);
        object-fit: contain;
        justify-self: center;
        align-self: center;
    }

    .blackboard-section:fullscreen .interactive-cards,
    .blackboard-section.is-fullscreen .interactive-cards {
        bottom: 10px;
    }

    .blackboard-section:not(.has-assistant-note) .caption-box.has-figure .viz-figure,
    .blackboard-section:not(:has(#assistantPopup:not(.hidden))) .caption-box:has(.viz-figure) .viz-figure {
        justify-self: center;
        align-self: center;
    }

    .blackboard-section:not(.has-assistant-note) .caption-box.figure-atlas-caption .figure-atlas-image,
    .blackboard-section:not(:has(#assistantPopup:not(.hidden))) .caption-box.figure-atlas-caption .figure-atlas-image {
        width: min(100%, 420px);
        max-width: 100%;
        height: auto;
        max-height: clamp(132px, 30dvh, 340px);
        justify-self: center;
        align-self: center;
        object-fit: contain;
    }
}

/* ── Landscape phone: tighter padding, smaller cards ── */
@media (max-height: 500px) and (orientation: landscape) and (pointer: coarse) {
    .visualization-stage {
        min-height: clamp(260px, 80dvh, 400px);
        padding-bottom: 110px;
    }

    .caption-box,
    .caption-box.has-figure,
    .caption-box.figure-atlas-caption {
        inset: 10px 12px 100px;
        row-gap: 6px;
    }

    .caption-box h3 {
        font-size: 16px;
    }

    .caption-box p {
        font-size: 12px;
        max-height: 40px;
    }

    .caption-box .viz-figure {
        max-height: clamp(80px, 40dvh, 180px);
        align-self: center;
    }

    .caption-box .figure-atlas-image {
        max-height: clamp(90px, 44dvh, 200px);
        align-self: center;
    }

    .interactive-cards {
        bottom: 6px;
    }

    .card {
        width: 100px;
        padding: 8px;
    }
}

/* ── 备案信息 Footer ────────────────── */
.site-beian-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px 16px;
    padding: 6px 20px;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(30, 41, 59, 0.06);
    font-size: 12px;
    color: #94a3b8;
    line-height: 1.6;
    letter-spacing: 0.01em;
}

@media (max-width: 1024px) {
    .site-beian-footer {
        bottom: calc(var(--mobile-tab-height) + env(safe-area-inset-bottom));
        z-index: 190;
    }
}

.beian-team {
    font-weight: 600;
    color: #64748b;
}

.beian-divider {
    display: inline-block;
    width: 1px;
    height: 12px;
    background: rgba(148, 163, 184, 0.4);
    vertical-align: middle;
}

.beian-items {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 14px;
}

.beian-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.18s ease;
}

.beian-link:hover {
    color: var(--accent-blue, #1d4ed8);
}

.beian-gongan-icon {
    width: 14px;
    height: 14px;
    vertical-align: middle;
    flex-shrink: 0;
}

/* Mobile: footer wraps neatly */
@media (max-width: 640px) {
    :root {
        --beian-footer-height: 52px;
    }

    .site-beian-footer {
        flex-direction: column;
        gap: 2px;
        padding: 6px 12px;
        font-size: 11px;
    }

    .beian-divider {
        display: none;
    }

    .beian-items {
        justify-content: center;
    }
}

@media (hover: none) {
    .card:hover,
    .km-node:hover,
    .practice-option:hover,
    .graph-node:hover,
    .nav-links li:hover {
        transform: none;
    }
}

/* Fix: touch devices (tablets) in desktop-mode - content clipped by overflow:hidden chain */
/* pointer:coarse detects touch devices, max-height:900px excludes large desktop touch monitors */
@media (pointer: coarse) and (max-height: 900px) {
    body {
        overflow: auto;
        height: auto;
        min-height: 100vh;
    }

    .app-container {
        height: auto;
        min-height: 100vh;
    }

    .main-content {
        overflow: visible;
        min-height: 0;
    }

    .classroom-area {
        overflow: visible;
        flex-wrap: wrap;
    }

    .blackboard-section {
        min-height: 400px;
    }

    .dialogue-section {
        min-height: 300px;
    }
}

/* Touch device whiteboard fallback background (avoid all-white when video poster fails) */
@media (pointer: coarse) {
    .hologram-effect {
        background: radial-gradient(
            circle at 50% 50%,
            rgba(147, 197, 253, 0.18),
            rgba(199, 210, 254, 0.12) 50%,
            transparent 70%
        );
    }
}
