/* ============================================
   遗传学·学习手册 —— 现代教科书风设计系统
   ============================================ */

:root {
    /* 色板 */
    --paper: #faf7f0;
    --paper-soft: #f3ede0;
    --paper-deep: #ebe3d2;
    --surface: #ffffff;
    --surface-elev: #fdfaf3;

    --ink: #14213d;
    --ink-2: #1f2c4a;
    --ink-3: #3a4a6b;
    --text: #1f2937;
    --text-muted: #6b7280;
    --text-soft: #9ca3af;

    --accent: #c2683a;
    --accent-soft: #e8a06b;
    --accent-bg: #fbe9d6;

    --gold: #b8860b;
    --rose: #b91c5c;
    --moss: #4a7c59;
    --teal: #2d6a7a;

    --success: #15803d;
    --success-bg: #dcfce7;
    --error: #b91c1c;
    --error-bg: #fee2e2;
    --warn: #a16207;
    --warn-bg: #fef3c7;
    --info: #1d4ed8;
    --info-bg: #dbeafe;

    --border: #e5dfd0;
    --border-strong: #c9c0a8;

    /* 阴影 */
    --shadow-sm: 0 1px 2px rgba(20, 33, 61, 0.04);
    --shadow: 0 2px 8px rgba(20, 33, 61, 0.06), 0 1px 2px rgba(20, 33, 61, 0.04);
    --shadow-md: 0 8px 24px rgba(20, 33, 61, 0.08), 0 2px 4px rgba(20, 33, 61, 0.04);
    --shadow-lg: 0 20px 50px rgba(20, 33, 61, 0.12), 0 4px 12px rgba(20, 33, 61, 0.06);

    /* 圆角 */
    --r-sm: 4px;
    --r: 6px;
    --r-md: 10px;
    --r-lg: 16px;

    /* 字体 */
    --font-serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", serif;
    --font-sans: "Inter", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
    --font-mono: "JetBrains Mono", "Cascadia Code", Consolas, monospace;
}

/* ============================================
   重置与基础
   ============================================ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.7;
    color: var(--text);
    background: var(--paper);
    background-image:
        radial-gradient(at 20% 10%, rgba(194, 104, 58, 0.04) 0%, transparent 50%),
        radial-gradient(at 80% 60%, rgba(20, 33, 61, 0.03) 0%, transparent 50%);
    background-attachment: fixed;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5 {
    font-family: var(--font-serif);
    color: var(--ink);
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

a {
    color: var(--ink-2);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--accent);
}

button {
    font-family: inherit;
    border: none;
    background: none;
    cursor: pointer;
    font-size: inherit;
}

img, svg {
    display: block;
    max-width: 100%;
}

/* ============================================
   通用组件
   ============================================ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 32px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--r);
    font-family: var(--font-sans);
    font-weight: 500;
    font-size: 14px;
    line-height: 1.4;
    transition: all 0.2s ease;
    cursor: pointer;
    border: 1px solid transparent;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--ink);
    color: var(--paper);
}
.btn-primary:hover:not(:disabled) {
    background: var(--ink-2);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
    color: var(--paper);
}

.btn-accent {
    background: var(--accent);
    color: white;
}
.btn-accent:hover:not(:disabled) {
    background: #a8552d;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(194, 104, 58, 0.3);
    color: white;
}

.btn-ghost {
    background: transparent;
    color: var(--ink);
    border-color: var(--border-strong);
}
.btn-ghost:hover:not(:disabled) {
    background: var(--paper-soft);
    border-color: var(--ink-3);
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 15px;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    background: var(--paper-soft);
    color: var(--ink-2);
    border-radius: 100px;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.02em;
    border: 1px solid var(--border);
}

.chip-accent {
    background: var(--accent-bg);
    color: var(--accent);
    border-color: rgba(194, 104, 58, 0.2);
}

.eyebrow {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.18em;
    color: var(--accent);
    text-transform: uppercase;
    margin-bottom: 12px;
}

/* ============================================
   顶部导航
   ============================================ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(250, 247, 240, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-serif);
    font-size: 20px;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: 0.02em;
}

.brand-mark {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ink);
    color: var(--paper);
    border-radius: var(--r);
}

.brand-mark svg {
    width: 22px;
    height: 22px;
}

.nav-list {
    display: flex;
    gap: 4px;
    list-style: none;
}

.nav-link {
    padding: 8px 16px;
    border-radius: var(--r);
    font-size: 14px;
    font-weight: 500;
    color: var(--ink-3);
    transition: all 0.2s;
    position: relative;
}

.nav-link:hover {
    color: var(--ink);
    background: var(--paper-soft);
}

.nav-link.active {
    color: var(--ink);
}

.nav-link.active::after {
    content: "";
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 2px;
    height: 2px;
    background: var(--accent);
    border-radius: 2px;
}

/* ============================================
   视图切换容器
   ============================================ */
.view {
    display: none;
    animation: viewFade 0.4s ease;
}

.view.active {
    display: block;
}

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

/* ============================================
   首页 —— Hero
   ============================================ */
.hero {
    padding: 96px 0 80px;
    position: relative;
    overflow: hidden;
}

.hero-inner {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 64px;
    align-items: center;
}

.hero h1 {
    font-size: 64px;
    font-weight: 700;
    line-height: 1.1;
    margin: 16px 0 24px;
    color: var(--ink);
}

.hero h1 em {
    font-style: normal;
    color: var(--accent);
    position: relative;
}

.hero h1 em::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 6px;
    height: 10px;
    background: var(--accent-bg);
    z-index: -1;
    border-radius: 2px;
}

.hero-lead {
    font-size: 18px;
    color: var(--ink-3);
    margin-bottom: 36px;
    max-width: 480px;
    line-height: 1.7;
}

.hero-cta {
    display: flex;
    gap: 12px;
    margin-bottom: 48px;
}

.hero-meta {
    display: flex;
    gap: 40px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
}

.hero-meta-item .num {
    font-family: var(--font-serif);
    font-size: 32px;
    font-weight: 700;
    color: var(--ink);
    line-height: 1;
}

.hero-meta-item .label {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

.hero-visual {
    position: relative;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-visual svg {
    width: 100%;
    height: 100%;
    animation: floatY 6s ease-in-out infinite;
}

@keyframes floatY {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

/* ============================================
   首页 —— 章节目录
   ============================================ */
.section {
    padding: 80px 0;
}

.section-head {
    margin-bottom: 56px;
    max-width: 720px;
}

.section-head h2 {
    font-size: 40px;
    margin-bottom: 16px;
}

.section-head p {
    font-size: 17px;
    color: var(--ink-3);
}

.toc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
}

.toc-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 32px;
    transition: all 0.25s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.toc-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--accent);
    transform: scaleY(0);
    transform-origin: bottom;
    transition: transform 0.3s ease;
}

.toc-card:hover {
    border-color: var(--ink-3);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.toc-card:hover::before {
    transform: scaleY(1);
    transform-origin: top;
}

.toc-num {
    font-family: var(--font-serif);
    font-size: 14px;
    color: var(--accent);
    font-weight: 600;
    letter-spacing: 0.15em;
    margin-bottom: 12px;
}

.toc-card h3 {
    font-size: 24px;
    margin-bottom: 12px;
}

.toc-card p {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 24px;
    line-height: 1.6;
}

.toc-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ============================================
   首页 —— 实验入口
   ============================================ */
.exp-feature {
    background: var(--ink);
    color: var(--paper);
    border-radius: var(--r-lg);
    padding: 64px;
    margin: 80px auto;
    max-width: 1200px;
    position: relative;
    overflow: hidden;
}

.exp-feature::before {
    content: "";
    position: absolute;
    top: -50%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(194, 104, 58, 0.15) 0%, transparent 60%);
    pointer-events: none;
}

.exp-feature-inner {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: center;
}

.exp-feature h2 {
    color: var(--paper);
    font-size: 40px;
    margin-bottom: 20px;
}

.exp-feature p {
    color: rgba(250, 247, 240, 0.7);
    font-size: 16px;
    margin-bottom: 32px;
}

.exp-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.exp-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    background: rgba(250, 247, 240, 0.04);
    border: 1px solid rgba(250, 247, 240, 0.1);
    border-radius: var(--r-md);
    cursor: pointer;
    transition: all 0.2s;
}

.exp-list-item:hover {
    background: rgba(250, 247, 240, 0.08);
    border-color: var(--accent);
    transform: translateX(4px);
}

.exp-list-item .meta {
    display: flex;
    align-items: center;
    gap: 16px;
}

.exp-list-item .icon-box {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(194, 104, 58, 0.15);
    color: var(--accent-soft);
    border-radius: var(--r);
    font-size: 18px;
}

.exp-list-item h4 {
    color: var(--paper);
    font-family: var(--font-serif);
    font-size: 17px;
    margin-bottom: 4px;
}

.exp-list-item span.sub {
    font-size: 13px;
    color: rgba(250, 247, 240, 0.5);
}

.exp-list-item .arrow {
    color: var(--accent-soft);
    transition: transform 0.2s;
}

.exp-list-item:hover .arrow {
    transform: translateX(4px);
}

/* ============================================
   首页 —— 习题入口
   ============================================ */
.ex-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.ex-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 28px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.ex-card:hover {
    border-color: var(--accent);
    background: var(--surface-elev);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.ex-card .icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-bg);
    color: var(--accent);
    border-radius: var(--r);
    margin-bottom: 16px;
    font-size: 15px;
}

.ex-card h4 {
    font-size: 17px;
    margin-bottom: 6px;
}

.ex-card .count {
    color: var(--text-muted);
    font-size: 13px;
}

/* ============================================
   知识点视图
   ============================================ */
.kn-layout {
    display: grid;
    grid-template-columns: 240px 1fr 280px;
    gap: 48px;
    padding: 56px 0 96px;
}

.kn-sidebar {
    position: sticky;
    top: 96px;
    align-self: start;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.kn-sidebar-title {
    font-family: var(--font-serif);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 16px;
    padding-left: 12px;
}

.kn-nav {
    list-style: none;
    border-left: 1px solid var(--border);
}

.kn-nav-item {
    display: block;
    padding: 8px 16px;
    font-size: 14px;
    color: var(--ink-3);
    border-left: 2px solid transparent;
    margin-left: -1px;
    transition: all 0.15s;
    cursor: pointer;
}

.kn-nav-item:hover {
    color: var(--ink);
}

.kn-nav-item.active {
    color: var(--accent);
    border-left-color: var(--accent);
    font-weight: 600;
}

.kn-content {
    max-width: 720px;
}

.kn-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 24px;
}

.kn-back:hover {
    color: var(--accent);
}

.kn-content h2 {
    font-size: 44px;
    margin-bottom: 12px;
}

.kn-content .kn-eyebrow {
    font-size: 13px;
    letter-spacing: 0.18em;
    color: var(--accent);
    text-transform: uppercase;
    margin-bottom: 12px;
    font-weight: 600;
}

.kn-content .lede {
    font-family: var(--font-serif);
    font-size: 20px;
    line-height: 1.7;
    color: var(--ink-2);
    padding-bottom: 32px;
    margin-bottom: 40px;
    border-bottom: 1px solid var(--border);
}

/* 知识点正文格式 */
.kn-detail h3 {
    font-size: 26px;
    margin: 48px 0 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--ink);
    display: inline-block;
}

.kn-detail h4 {
    font-size: 18px;
    margin: 32px 0 12px;
    color: var(--ink);
    font-family: var(--font-serif);
}

.kn-detail h4::before {
    content: "❖";
    color: var(--accent);
    margin-right: 8px;
    font-size: 14px;
}

.kn-detail p {
    font-family: var(--font-serif);
    font-size: 16px;
    line-height: 1.9;
    color: var(--text);
    margin-bottom: 16px;
}

.kn-detail ul {
    list-style: none;
    margin: 16px 0 24px;
}

.kn-detail li {
    position: relative;
    padding-left: 24px;
    margin-bottom: 10px;
    font-family: var(--font-serif);
    font-size: 15px;
    line-height: 1.8;
    color: var(--text);
}

.kn-detail li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 12px;
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
}

.kn-detail .highlight {
    background: linear-gradient(180deg, transparent 65%, var(--accent-bg) 65%);
    padding: 0 2px;
    color: var(--ink);
    font-weight: 600;
    font-family: var(--font-sans);
}

.kn-aside {
    position: sticky;
    top: 96px;
    align-self: start;
}

.kn-aside-card {
    background: var(--paper-soft);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 24px;
    margin-bottom: 16px;
}

.kn-aside-card h5 {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.kn-aside-card p {
    font-size: 13px;
    color: var(--ink-3);
    line-height: 1.6;
    margin-bottom: 12px;
}

.kn-aside-card .quick-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--surface);
    border-radius: var(--r-sm);
    font-size: 13px;
    color: var(--ink);
    margin-top: 8px;
    transition: all 0.15s;
    cursor: pointer;
    border: 1px solid transparent;
}

.kn-aside-card .quick-link:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ============================================
   实验视图
   ============================================ */
.exp-page {
    padding: 32px 0 80px;
}

.exp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.exp-header-info h1 {
    font-size: 34px;
    margin-bottom: 6px;
}

.exp-header-info .sub {
    font-size: 14px;
    color: var(--text-muted);
}

.exp-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
    font-size: 13px;
}

.exp-progress-bar {
    width: 200px;
    height: 4px;
    background: var(--paper-deep);
    border-radius: 100px;
    overflow: hidden;
}

.exp-progress-fill {
    height: 100%;
    background: var(--accent);
    transition: width 0.4s ease;
    border-radius: 100px;
}

.exp-layout {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 32px;
    min-height: 600px;
}

.exp-stage {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 32px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.exp-stage-title {
    font-family: var(--font-serif);
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 4px;
    letter-spacing: 0.1em;
}

.exp-stage-step {
    font-size: 24px;
    color: var(--ink);
    margin-bottom: 24px;
}

.exp-canvas {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    min-height: 400px;
}

.exp-controls {
    margin-top: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.exp-controls-left, .exp-controls-right {
    display: flex;
    gap: 8px;
}

.exp-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.exp-panel-block {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 24px;
}

.exp-panel-block h4 {
    font-family: var(--font-sans);
    font-size: 11px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 12px;
}

.exp-panel-block h3 {
    font-size: 20px;
    margin-bottom: 12px;
}

.exp-panel-block p {
    font-family: var(--font-serif);
    font-size: 14px;
    line-height: 1.8;
    color: var(--ink-3);
}

.exp-task {
    background: var(--accent-bg);
    border: 1px solid rgba(194, 104, 58, 0.2);
    border-radius: var(--r-md);
    padding: 20px;
}

.exp-task .label {
    font-size: 11px;
    color: var(--accent);
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.exp-task .desc {
    font-family: var(--font-serif);
    font-size: 15px;
    color: var(--ink);
    line-height: 1.7;
}

.exp-feedback {
    padding: 16px 20px;
    border-radius: var(--r);
    font-size: 14px;
    line-height: 1.6;
    display: none;
    animation: fbIn 0.3s ease;
}

.exp-feedback.show { display: block; }
.exp-feedback.success { background: var(--success-bg); color: var(--success); border: 1px solid rgba(21, 128, 61, 0.2); }
.exp-feedback.error { background: var(--error-bg); color: var(--error); border: 1px solid rgba(185, 28, 28, 0.2); }
.exp-feedback.info { background: var(--info-bg); color: var(--info); border: 1px solid rgba(29, 78, 216, 0.2); }

@keyframes fbIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   实验通用互动元素
   ============================================ */
.choice-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 12px;
}

.choice-card {
    padding: 14px 16px;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--r);
    cursor: pointer;
    font-size: 14px;
    text-align: left;
    transition: all 0.15s;
    color: var(--ink);
}

.choice-card:hover:not(.disabled) {
    border-color: var(--ink-3);
    background: var(--surface-elev);
}

.choice-card.correct {
    background: var(--success-bg);
    border-color: var(--success);
    color: var(--success);
}

.choice-card.wrong {
    background: var(--error-bg);
    border-color: var(--error);
    color: var(--error);
}

.choice-card.disabled {
    cursor: default;
}

/* 拖拽元素 */
.draggable {
    cursor: grab;
    transition: transform 0.15s;
    user-select: none;
    touch-action: none;
}
.draggable:active { cursor: grabbing; }
.draggable.dragging {
    z-index: 100;
    opacity: 0.85;
    transform: scale(1.05);
}

.drop-zone {
    border: 2px dashed var(--border-strong);
    border-radius: var(--r-md);
    background: var(--paper-soft);
    transition: all 0.2s;
}
.drop-zone.hover {
    border-color: var(--accent);
    background: var(--accent-bg);
}
.drop-zone.filled {
    border-style: solid;
    border-color: var(--success);
    background: var(--success-bg);
}

/* 配子小球 */
.gamete {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: 22px;
    color: white;
    box-shadow: var(--shadow);
    position: relative;
}

.gamete::after {
    content: "";
    position: absolute;
    inset: 6px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.4) 0%, transparent 50%);
    pointer-events: none;
}

.gamete-D { background: linear-gradient(135deg, #1e3a5f, #2d4d7a); }
.gamete-d { background: linear-gradient(135deg, #c2683a, #d97706); }

/* 数字输入 */
.ratio-input {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-serif);
    font-size: 20px;
}

.ratio-input input {
    width: 60px;
    padding: 8px 10px;
    border: 1.5px solid var(--border-strong);
    border-radius: var(--r);
    font-family: var(--font-serif);
    font-size: 20px;
    text-align: center;
    color: var(--ink);
    background: var(--surface);
}

.ratio-input input:focus {
    outline: none;
    border-color: var(--accent);
}

.ratio-input .sep {
    color: var(--text-muted);
    margin: 0 4px;
}

/* 滑动条 */
.slider-wrap {
    width: 100%;
    margin: 20px 0;
}
.slider-wrap input[type=range] {
    width: 100%;
    -webkit-appearance: none;
    height: 4px;
    background: var(--border);
    border-radius: 100px;
    outline: none;
}
.slider-wrap input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(194, 104, 58, 0.4);
    transition: transform 0.15s;
}
.slider-wrap input[type=range]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}
.slider-wrap input[type=range]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

/* 碱基块 */
.base {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: 17px;
    border-radius: 4px;
    color: white;
    transition: transform 0.15s, box-shadow 0.15s;
}

.base-A { background: #c2683a; }
.base-T { background: #2d6a7a; }
.base-G { background: #b8860b; }
.base-C { background: #b91c5c; }
.base-U { background: #4a7c59; }

.base.pickable {
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}
.base.pickable:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-md);
}

.base.empty {
    background: var(--paper-deep);
    color: var(--text-muted);
    border: 2px dashed var(--border-strong);
}

.base.error {
    animation: shake 0.4s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(21, 128, 61, 0.4); }
    100% { box-shadow: 0 0 0 12px rgba(21, 128, 61, 0); }
}

.pulse-success { animation: pulse 0.8s; }

/* ============================================
   习题视图
   ============================================ */
.qz-page {
    max-width: 820px;
    margin: 0 auto;
    padding: 48px 32px 96px;
}

.qz-header {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.qz-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.qz-header h1 {
    font-size: 32px;
}

.qz-stats {
    display: flex;
    gap: 24px;
    font-size: 13px;
    color: var(--text-muted);
}

.qz-stats strong {
    color: var(--ink);
    font-weight: 600;
    font-size: 15px;
}

.qz-progress {
    height: 4px;
    background: var(--paper-deep);
    border-radius: 100px;
    overflow: hidden;
}

.qz-progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 100px;
    transition: width 0.4s ease;
}

.qz-question {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 32px;
    margin-bottom: 16px;
    transition: all 0.2s;
}

.qz-question.answered {
    background: var(--surface-elev);
}

.qz-qnum {
    display: inline-block;
    font-family: var(--font-serif);
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 0.15em;
    margin-bottom: 12px;
    text-transform: uppercase;
}

.qz-qtext {
    font-family: var(--font-serif);
    font-size: 18px;
    color: var(--ink);
    line-height: 1.6;
    margin-bottom: 20px;
}

.qz-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.qz-option {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: var(--paper-soft);
    border: 1.5px solid transparent;
    border-radius: var(--r);
    cursor: pointer;
    transition: all 0.15s;
    font-size: 14.5px;
    color: var(--ink);
    text-align: left;
}

.qz-option:hover:not(:disabled) {
    background: var(--surface);
    border-color: var(--border-strong);
}

.qz-option .badge {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--surface);
    color: var(--ink-3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: 13px;
    border: 1px solid var(--border);
    flex-shrink: 0;
    transition: all 0.15s;
}

.qz-option:hover:not(:disabled) .badge {
    background: var(--paper-soft);
    border-color: var(--ink-3);
}

.qz-option.correct {
    background: var(--success-bg);
    border-color: var(--success);
    color: var(--success);
    animation: pulse 0.8s;
}
.qz-option.correct .badge {
    background: var(--success);
    color: white;
    border-color: var(--success);
}

.qz-option.wrong {
    background: var(--error-bg);
    border-color: var(--error);
    color: var(--error);
    animation: shake 0.4s;
}
.qz-option.wrong .badge {
    background: var(--error);
    color: white;
    border-color: var(--error);
}

.qz-option:disabled {
    cursor: default;
}

.qz-explain {
    margin-top: 20px;
    padding: 20px;
    background: var(--paper-soft);
    border-left: 3px solid var(--accent);
    border-radius: var(--r-sm);
    display: none;
}

.qz-explain.show {
    display: block;
    animation: fbIn 0.3s ease;
}

.qz-explain .label {
    font-size: 11px;
    color: var(--accent);
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.qz-explain .answer {
    font-size: 14px;
    color: var(--ink);
    margin-bottom: 12px;
    font-family: var(--font-serif);
}

.qz-explain .answer strong {
    color: var(--accent);
}

.qz-explain .text {
    font-family: var(--font-serif);
    font-size: 14.5px;
    color: var(--ink-3);
    line-height: 1.8;
}

.qz-finish {
    background: var(--ink);
    color: var(--paper);
    border-radius: var(--r-md);
    padding: 40px;
    text-align: center;
    margin-top: 32px;
    display: none;
}

.qz-finish.show { display: block; animation: fbIn 0.4s ease; }

.qz-finish h3 {
    color: var(--paper);
    font-size: 28px;
    margin-bottom: 12px;
}

.qz-finish .score {
    font-family: var(--font-serif);
    font-size: 56px;
    color: var(--accent-soft);
    font-weight: 700;
    line-height: 1;
    margin: 16px 0;
}

.qz-finish p {
    color: rgba(250, 247, 240, 0.7);
    margin-bottom: 24px;
}

/* ============================================
   响应式
   ============================================ */
@media (max-width: 1024px) {
    .hero-inner {
        grid-template-columns: 1fr;
        gap: 48px;
    }
    .hero h1 { font-size: 48px; }
    .kn-layout {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    .kn-sidebar, .kn-aside {
        position: static;
        max-height: none;
    }
    .exp-layout {
        grid-template-columns: 1fr;
    }
    .exp-feature-inner {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .container { padding: 0 20px; }
    .hero { padding: 56px 0; }
    .hero h1 { font-size: 36px; }
    .section { padding: 56px 0; }
    .section-head h2 { font-size: 28px; }
    .nav-list { gap: 0; }
    .nav-link { padding: 8px 10px; font-size: 13px; }
    .exp-feature { padding: 40px 24px; margin: 40px 0; }
    .exp-page { padding: 24px 0; }
    .qz-page { padding: 32px 20px; }
    .qz-question { padding: 24px; }
}
