/* ===================== 中医入门小馆 · 主题样式 ===================== */
:root {
    --bg: #fdf8f3; --card: #fffefb; --primary: #8b4513; --primary-light: #a0522d;
    --accent: #c0392b; --accent-light: #e74c3c; --gold: #b8860b; --gold-light: #d4a745;
    --text: #3e2723; --text-light: #5d4037; --text-muted: #7b5b4e;
    --border: #e0d5c7; --shadow: 0 4px 20px rgba(139, 69, 19, 0.10);
    --shadow-lg: 0 12px 40px rgba(139, 69, 19, 0.15); --radius: 16px; --radius-sm: 10px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-heading: 'STSong', 'Songti SC', 'Noto Serif SC', 'KaiTi', 'STKaiti', '楷体', 'SimSun', serif;
    --font-body: 'PingFang SC', 'Microsoft YaHei', 'Hiragino Sans GB', 'Noto Sans SC', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: var(--font-body); background: var(--bg);
    background-image: radial-gradient(ellipse at 20% 20%, rgba(184,134,11,0.04) 0%, transparent 60%),
                      radial-gradient(ellipse at 80% 60%, rgba(139,69,19,0.04) 0%, transparent 60%);
    color: var(--text); min-height: 100vh; display: flex; flex-direction: column;
    align-items: center; padding: 20px; position: relative; line-height: 1.6;
}
.app-container { width: 100%; max-width: 720px; position: relative; z-index: 1; display: flex; flex-direction: column; gap: 0; }
.page { display: none; flex-direction: column; gap: 20px; animation: fadeSlideIn 0.45s ease; }
.page.active { display: flex; }
@keyframes fadeSlideIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
@keyframes popIn { 0% { opacity: 0; transform: scale(0.88); } 60% { transform: scale(1.03); } 100% { opacity: 1; transform: scale(1); } }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(192,57,43,0.30); } 50% { box-shadow: 0 0 0 16px rgba(192,57,43,0); } }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px 30px; border: 1px solid var(--border); transition: var(--transition); position: relative; }
.card:hover { box-shadow: var(--shadow-lg); }
.card--accent { border-left: 5px solid var(--accent); }
.card--gold { border-left: 5px solid var(--gold); }

/* 头部与导航 */
.site-header { width: 100%; max-width: 720px; position: relative; z-index: 1; }
.site-footer { position: fixed; bottom: 14px; right: 20px; z-index: 999; }
.copyright { font-size: 0.8em; color: #b5a595; letter-spacing: 0.06em; font-family: var(--font-heading); background: rgba(253,248,243,0.7); padding: 4px 10px; border-radius: 12px; }
.top-nav { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-bottom: 14px; }
.top-nav .nav-link { font-size: 0.85em; color: var(--text-muted); cursor: pointer; padding: 6px 14px; border-radius: 16px; font-family: var(--font-heading); border: 1px solid transparent; background: transparent; }
.top-nav .nav-link:hover { color: var(--primary); background: rgba(139,69,19,0.05); }
.top-nav .nav-link.nav-active { color: var(--accent); font-weight: 700; background: rgba(192,57,43,0.06); border-color: rgba(192,57,43,0.2); }

/* 按钮 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 14px 28px; border-radius: 28px; border: none; cursor: pointer; font-size: 1.05em; font-weight: 600; letter-spacing: 0.03em; transition: var(--transition); font-family: var(--font-body); white-space: nowrap; position: relative; text-decoration: none; user-select: none; }
.btn:active { transform: scale(0.96); }
.btn--primary { background: var(--accent); color: #fff; font-size: 1.25em; padding: 16px 40px; border-radius: 36px; box-shadow: 0 6px 22px rgba(192,57,43,0.30); animation: pulse 2.5s infinite; }
.btn--primary:hover { background: #a93226; animation: none; }
.btn--outline { background: transparent; border: 2px solid var(--primary); color: var(--primary); padding: 12px 20px; border-radius: 24px; }
.btn--outline:hover { background: rgba(139,69,19,0.06); }
.btn--ghost { background: rgba(139,69,19,0.04); color: var(--text-light); padding: 12px 20px; border-radius: 24px; border: 1px solid transparent; }
.btn--ghost:hover { background: rgba(139,69,19,0.1); }
.btn--equal { flex: 1 1 0; min-width: 0; }

/* 首页 */
.hero-title { font-family: var(--font-heading); font-size: 2.4em; font-weight: 700; color: var(--primary); text-align: center; letter-spacing: 0.04em; margin-bottom: 4px; }
.hero-subtitle { text-align: center; color: var(--text-muted); font-size: 1.05em; margin-bottom: 8px; font-family: var(--font-heading); }
.hero-desc { text-align: center; color: var(--text-light); font-size: 0.95em; background: rgba(184,134,11,0.05); border-radius: 20px; padding: 14px 20px; line-height: 1.7; }
.home-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.home-bar-tip { font-size: 0.82em; color: var(--text-muted); }
.home-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; border-radius: var(--radius-sm); transition: background 0.15s, box-shadow 0.15s; }
.home-grid.drag-over { background: rgba(184,134,11,0.06); box-shadow: inset 0 0 0 2px var(--gold-light); }
.home-grid-empty { grid-column: 1 / -1; border: 1px dashed var(--border); border-radius: var(--radius-sm); padding: 20px; text-align: center; font-size: 0.85em; color: var(--text-muted); background: rgba(139,69,19,0.02); }
.module-card { position: relative; display: flex; gap: 12px; align-items: center; padding: 16px 16px 16px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); border-left: 5px solid var(--mc, var(--primary)); background: var(--card); cursor: pointer; transition: var(--transition); overflow: hidden; }
.module-card:hover { border-color: var(--primary-light); box-shadow: var(--shadow); transform: translateY(-2px); }
.module-card.dragging { opacity: 0.55; box-shadow: var(--shadow-lg); transform: scale(1.02); }
.module-card .mod-handle { position: absolute; left: 2px; top: 50%; transform: translateY(-50%); color: var(--mc, var(--primary)); opacity: 0.35; font-size: 1.1em; cursor: grab; user-select: none; }
.module-card .mod-icon { font-size: 1.9em; flex: none; margin-left: 14px; }
.module-card .mod-body h3 { font-family: var(--font-heading); color: var(--primary); font-size: 1.08em; }
.module-card .mod-body p { color: var(--text-muted); font-size: 0.82em; line-height: 1.5; margin-top: 2px; }
.module-card .mod-go { margin-left: auto; color: var(--mc, var(--primary)); font-weight: 700; opacity: 0.5; flex: none; }
.module-card:hover .mod-go { opacity: 1; }

/* 首页分组 + 折叠 */
.home-group { margin-bottom: 12px; }
.home-group:last-child { margin-bottom: 0; }
.home-group-head { display: flex; align-items: center; gap: 8px; padding: 8px 12px; cursor: pointer; border-radius: var(--radius-sm); background: rgba(139,69,19,0.045); border: 1px solid var(--border); user-select: none; transition: var(--transition); }
.home-group-head:hover { background: rgba(139,69,19,0.09); }
.hg-icon { font-size: 1.15em; flex: none; }
.hg-title { font-family: var(--font-heading); color: var(--primary); font-weight: 700; font-size: 1.02em; }
.hg-count { font-size: 0.74em; color: var(--text-muted); background: #fffefb; border: 1px solid var(--border); border-radius: 12px; padding: 1px 9px; flex: none; }
.hg-toggle { margin-left: auto; color: var(--text-muted); font-size: 0.92em; }
.home-grid.collapsed { display: none; }

/* 学习路径闯关 */
.path-overall { margin-top: 14px; }
.path-overall-top { display: flex; justify-content: space-between; font-size: 0.9em; color: var(--text-light); margin-bottom: 6px; }
.path-overall-pct { font-weight: 700; color: var(--primary); }
.path-stage { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px 18px; margin-bottom: 14px; background: var(--card); position: relative; transition: var(--transition); }
.path-stage.cleared { border-color: #6aaf8a; background: linear-gradient(135deg, #fffefb 0%, #f3faf6 100%); }
.path-stage.locked { opacity: 0.7; background: #f7f3ee; }
.path-stage-head { display: flex; align-items: center; gap: 12px; }
.path-stage-icon { font-size: 1.8em; flex: none; }
.path-stage-titles { flex: 1; min-width: 0; }
.path-stage-name { font-family: var(--font-heading); color: var(--primary); font-size: 1.15em; font-weight: 700; }
.path-stage-desc { font-size: 0.82em; color: var(--text-muted); margin-top: 2px; }
.path-stage-badge { flex: none; font-size: 0.85em; font-weight: 700; color: var(--gold); background: rgba(184,134,11,0.1); border-radius: 12px; padding: 4px 12px; }
.path-stage.cleared .path-stage-badge { color: #2d6a4f; background: rgba(45,106,79,0.12); }
.path-task { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px dashed var(--border); }
.path-task:first-of-type { border-top: none; }
.path-task.done .path-task-label { color: #2d6a4f; font-weight: 600; }
.path-task-go { flex: none; font-size: 0.78em; color: var(--primary); background: rgba(139,69,19,0.07); border: 1px solid transparent; border-radius: 14px; padding: 4px 12px; cursor: pointer; transition: var(--transition); font-family: var(--font-body); }
.path-task-go:hover { background: rgba(139,69,19,0.14); }
.path-task-main { flex: 1; min-width: 0; }
.path-task-label { font-size: 0.9em; color: var(--text-light); }
.path-task-num { flex: none; font-size: 0.82em; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.path-lock { text-align: center; font-size: 0.82em; color: var(--text-muted); margin-top: 8px; }
.path-task-cards { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; }
.path-chip { font-size: 0.72em; color: var(--text-light); background: #fdfaf5; border: 1px solid var(--border); border-radius: 10px; padding: 2px 8px; }

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

/* 小课堂 */
.lesson-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.lesson-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px; cursor: pointer; transition: var(--transition); }
.lesson-head:hover { background: rgba(139,69,19,0.04); }
.lesson-head .lh-title { font-family: var(--font-heading); color: var(--primary); font-size: 1.1em; font-weight: 700; }
.lesson-head .lh-tag { font-size: 0.75em; color: var(--gold); border: 1px solid var(--gold-light); border-radius: 12px; padding: 2px 10px; }
.lesson-head .lh-done { font-size: 0.75em; color: #2d6a4f; }
.lesson-body { padding: 0 18px 18px; display: none; }
.lesson-card.open .lesson-body { display: block; animation: fadeSlideIn 0.3s ease; }
.lesson-summary { color: var(--text-light); font-size: 0.92em; margin-bottom: 12px; }
.point-item { display: flex; gap: 10px; padding: 10px 12px; margin: 8px 0; background: #fdfaf5; border-radius: 8px; border-left: 3px solid var(--gold); }
.point-item .pt-term { font-weight: 700; color: var(--primary); flex: none; }
.point-item .pt-explain { color: var(--text-light); font-size: 0.9em; }
.tip-box { background: rgba(184,134,11,0.07); border-radius: 10px; padding: 12px 14px; font-size: 0.88em; color: var(--text-light); margin-top: 10px; }
.tip-box strong { color: var(--gold); }

/* 闪卡 */
.flashcard-wrap { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.flashcard { width: 100%; max-width: 480px; min-height: 220px; perspective: 1000px; cursor: pointer; }
.flashcard-inner { position: relative; width: 100%; min-height: 220px; transition: transform 0.5s; transform-style: preserve-3d; }
.flashcard.flipped .flashcard-inner { transform: rotateY(180deg); }
.flashcard-face { position: absolute; inset: 0; backface-visibility: hidden; border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; border: 1px solid var(--border); }
.flashcard-front { background: linear-gradient(135deg, #fffefb 0%, #fef9f2 100%); border: 2px solid var(--gold-light); }
.flashcard-back { background: #fdfaf5; transform: rotateY(180deg); border: 2px solid var(--primary-light); }
.flashcard-face .fc-cat { font-size: 0.75em; color: var(--gold); letter-spacing: 0.1em; margin-bottom: 10px; }
.flashcard-face .fc-main { font-family: var(--font-heading); font-size: 1.8em; color: var(--primary); }
.flashcard-face .fc-sub { font-size: 0.95em; color: var(--text-light); margin-top: 12px; line-height: 1.7; }
.flashcard-face .fc-hint { font-size: 0.8em; color: var(--text-muted); margin-top: 16px; }
.fc-controls { display: flex; gap: 10px; width: 100%; max-width: 480px; }
.fc-controls .btn { flex: 1 1 0; min-width: 0; font-size: 0.95em; padding: 12px 8px; border-radius: 20px; animation: none; }
.fc-controls .btn--small { flex: 0 0 auto; }
.fc-progress { font-size: 0.85em; color: var(--text-muted); text-align: center; }
.fc-known { color: #2d6a4f; font-weight: 700; }

/* 闪卡：按课筛选 */
.fc-filter-card { padding: 14px 16px; }
.fc-filter-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fc-filter-label { font-family: var(--font-heading); color: var(--primary); font-size: 0.95em; white-space: nowrap; }
.fc-select { flex: 1 1 220px; min-width: 0; padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--card); color: var(--text); font-size: 0.92em; font-family: inherit; cursor: pointer; }
.fc-select:focus { outline: none; border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(184,134,11,0.12); }
.fc-deck-info { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; font-size: 0.86em; color: var(--text-muted); }
.fc-deck-title { font-weight: 700; color: var(--text-light); }
.fc-deck-done { color: #2d6a4f; font-weight: 700; }
.fc-lesson-badge { display: inline-block; text-align: center; font-size: 0.85em; color: var(--primary); background: rgba(184,134,11,0.09); border: 1px solid var(--gold-light); border-radius: 20px; padding: 6px 16px; }
@media (max-width: 480px) {
    .fc-controls { flex-wrap: wrap; }
    .fc-controls .btn { flex: 1 1 100%; }
}

/* 辨证推演 */
.difficulty-row { display: flex; gap: 10px; flex-wrap: wrap; }
.case-pick { display: flex; gap: 10px; flex-wrap: wrap; }
.case-pick .case-chip { border: 2px solid var(--border); background: #fffefb; color: var(--text-light); border-radius: 20px; padding: 8px 14px; font-size: 0.88em; cursor: pointer; transition: var(--transition); }
.case-pick .case-chip:hover { border-color: var(--primary-light); color: var(--primary); }
.case-pick .case-chip.active { background: rgba(139,69,19,0.12); border-color: var(--primary); color: var(--primary); font-weight: 700; }
.chief-complaint { background: linear-gradient(135deg, #fffefb 0%, #fef9f2 100%); border: 2px solid var(--gold-light); border-radius: var(--radius-sm); padding: 16px 18px; font-size: 1.05em; color: var(--primary); text-align: center; }
.four-diag { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.four-diag .btn--diag { padding: 16px 10px; border-radius: var(--radius-sm); font-weight: 700; border: 2px solid var(--border); background: var(--card); color: var(--primary); cursor: pointer; transition: var(--transition); display: flex; flex-direction: column; align-items: center; gap: 6px; font-family: var(--font-heading); }
.four-diag .btn--diag:hover { border-color: var(--primary-light); transform: translateY(-2px); }
.four-diag .btn--diag.explored { background: #f9f5ef; border-color: #c9b896; color: #6b4d34; opacity: 0.7; cursor: default; }
.four-diag .btn--diag.explored::after { content: '✓'; position: absolute; }
.clue-area { background: #fdfaf5; border-radius: var(--radius-sm); padding: 16px 18px; border: 1px dashed var(--border); min-height: 60px; max-height: 280px; overflow-y: auto; }
.clue-area:empty::before { content: '🔍 线索收集区：点击上方四诊按钮探查线索...'; color: #c5b5a0; font-style: italic; font-size: 0.9em; display: block; text-align: center; padding: 20px 0; }
.clue-item { display: flex; gap: 10px; padding: 10px 14px; margin: 6px 0; background: #fffefb; border-radius: 8px; border-left: 3px solid var(--gold); font-size: 0.93em; animation: popIn 0.35s ease; }
.clue-item .clue-tag { font-weight: 700; font-size: 0.8em; padding: 3px 10px; border-radius: 12px; color: #fff; flex: none; }
.tag-wang { background: #5b8c5a; } .tag-wen { background: #b8860b; } .tag-ask { background: #7b5ea7; } .tag-pulse { background: #c0392b; }
.inquiry-q { display: block; width: 100%; text-align: left; margin: 6px 0; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--border); background: #fffefb; cursor: pointer; font-family: var(--font-body); color: var(--text-light); transition: var(--transition); }
.inquiry-q:hover { border-color: var(--primary-light); background: rgba(139,69,19,0.04); }
.answer-form { display: flex; flex-direction: column; gap: 10px; }
.answer-form input, .answer-form textarea { width: 100%; padding: 10px 14px; border-radius: 10px; border: 2px solid var(--border); font-size: 0.95em; background: #fffefb; outline: none; font-family: var(--font-body); }
.answer-form input:focus, .answer-form textarea:focus { border-color: var(--primary-light); }
.result-box { padding: 18px; border-radius: var(--radius-sm); margin: 12px 0; animation: popIn 0.4s; line-height: 1.7; }
.result-box.success { background: #f0faf4; border: 2px solid #6aaf8a; color: #1e4d34; }
.result-box.fail { background: #fef9f4; border: 2px solid #e0b060; color: #6b4d20; }
.full-analysis { font-size: 0.92em; line-height: 1.7; color: var(--text-light); }
.full-analysis strong { color: var(--primary); }

/* 模态框 */
.modal-overlay { position: fixed; inset: 0; background: rgba(30,15,5,0.55); z-index: 1000; display: flex; align-items: center; justify-content: center; animation: fadeIn 0.25s; padding: 20px; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal { background: var(--card); border-radius: var(--radius); padding: 28px 26px; max-width: 560px; width: 100%; max-height: 85vh; overflow-y: auto; box-shadow: var(--shadow-lg); animation: popIn 0.4s; position: relative; border: 1px solid var(--border); }
.modal-close { position: absolute; top: 12px; right: 16px; width: 36px; height: 36px; border-radius: 50%; border: none; background: rgba(0,0,0,0.05); cursor: pointer; font-size: 1.2em; color: var(--text-muted); }
.modal h3 { font-family: var(--font-heading); color: var(--primary); margin-bottom: 14px; }

/* 互动图谱 */
.organ-node circle { transition: var(--transition); }
.organ-detail { margin-top: 14px; background: #fdfaf5; border-radius: 10px; padding: 14px 16px; font-size: 0.92em; color: var(--text-light); line-height: 1.7; min-height: 40px; border: 1px dashed var(--border); }
.organ-detail .od-head { font-family: var(--font-heading); font-size: 1.15em; color: var(--primary); margin-bottom: 8px; }
.organ-detail .od-badge { display: inline-block; width: 30px; height: 30px; line-height: 30px; text-align: center; border-radius: 50%; color: #fff; font-family: var(--font-heading); margin-right: 8px; }
.organ-detail p { margin: 4px 0; }
.organ-detail strong { color: var(--primary); }
.meridian-list { display: flex; flex-wrap: wrap; gap: 8px; }
.meridian-item { border: 1px solid var(--border); background: #fffefb; color: var(--text-light); border-radius: 14px; padding: 7px 12px; font-size: 0.82em; cursor: pointer; transition: var(--transition); font-family: var(--font-body); }
.meridian-item:hover { border-color: var(--primary-light); color: var(--primary); }
.meridian-item.active { background: rgba(139,69,19,0.12); border-color: var(--primary); color: var(--primary); font-weight: 700; }
.meridian-detail { margin-top: 12px; background: #fdfaf5; border-radius: 10px; padding: 12px 14px; font-size: 0.9em; color: var(--text-light); line-height: 1.6; min-height: 36px; border: 1px dashed var(--border); }
.meridian-detail strong { color: var(--primary); }

/* 关于 / 免责 */
.disclaimer { font-size: 0.82em; color: var(--text-muted); line-height: 1.7; background: rgba(192,57,43,0.05); border: 1px solid rgba(192,57,43,0.15); border-radius: 12px; padding: 14px 16px; }
.data-stats { font-size: 0.9em; color: var(--text-light); margin: 8px 0 14px; }
.data-actions button { padding: 8px 14px; border-radius: 12px; border: 2px solid var(--border); background: #fffefb; color: var(--text-light); font-size: 0.85em; cursor: pointer; }
.data-actions button:hover { border-color: var(--primary-light); color: var(--primary); }

@media (max-width: 500px) {
    .hero-title { font-size: 1.8em; }
    .four-diag { grid-template-columns: repeat(2, 1fr); }
    .card { padding: 18px 16px; }
    .home-secondary { flex-direction: column; }
    .btn--equal { width: 100%; }
}

/* 舌诊模块 */
.tongue-sec-title { font-family: var(--font-heading); font-size: 1.15em; color: var(--primary); margin-bottom: 12px; border-left: 4px solid var(--accent); padding-left: 10px; }
.tongue-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.tongue-card { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 12px; background: var(--card); transition: var(--transition); text-align: center; }
.tongue-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); border-color: var(--primary-light); }
.tongue-card-svg { display: flex; justify-content: center; align-items: center; padding: 8px; background: radial-gradient(ellipse at center, rgba(192,57,43,0.05) 0%, transparent 70%); border-radius: 12px; margin-bottom: 8px; }
.tongue-svg { display: block; }
.tongue-card-name { font-family: var(--font-heading); color: var(--primary); font-weight: 700; font-size: 1.02em; margin-bottom: 4px; }
.tongue-card-mean { font-size: 0.82em; color: var(--text-light); line-height: 1.6; }

/* 辨证推演里的舌象线索 */
.tongue-clue .tongue-clue-body { display: flex; gap: 12px; align-items: center; }
.tongue-clue .tongue-thumb { flex: none; }
.tongue-clue .tongue-thumb .tongue-svg { width: 60px; height: 82px; }

/* 看舌识证小练习 */
.tq-card { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.tq-svg { flex: none; background: radial-gradient(ellipse at center, rgba(192,57,43,0.05) 0%, transparent 70%); border-radius: 12px; padding: 6px; }
.tq-body { flex: 1 1 240px; min-width: 0; }
.tq-prompt { font-size: 0.96em; color: var(--text-light); font-weight: 600; line-height: 1.7; margin-bottom: 10px; }
.tq-options { display: flex; flex-direction: column; gap: 8px; }
.tq-opt { text-align: left; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--border); background: #fffefb; cursor: pointer; font-family: var(--font-body); color: var(--text-light); transition: var(--transition); font-size: 0.92em; }
.tq-opt:hover:not(:disabled) { border-color: var(--primary-light); background: rgba(139,69,19,0.04); }
.tq-opt:disabled { cursor: default; opacity: 0.7; }

@media (max-width: 500px) {
    .tongue-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
    .tq-card { flex-direction: column; align-items: center; }
    .tq-body { flex: 1 1 auto; }
}

/* ===== 通用：搜索框 / 筛选 chips ===== */
.search-bar { margin: 4px 0 14px; }
.search-bar input { width: 100%; padding: 12px 16px; border-radius: 24px; border: 2px solid var(--border); font-size: 0.95em; background: #fffefb; outline: none; font-family: var(--font-body); box-sizing: border-box; }
.search-bar input:focus { border-color: var(--primary-light); }
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.filter-chip { font-size: 0.82em; color: var(--text-muted); cursor: pointer; padding: 6px 14px; border-radius: 16px; border: 1px solid var(--border); background: #fffefb; transition: var(--transition); font-family: var(--font-heading); }
.filter-chip:hover { color: var(--primary); border-color: var(--primary-light); }
.filter-chip.active { color: #fff; background: var(--primary); border-color: var(--primary); font-weight: 700; }
.src-note { font-size: 0.78em; color: var(--text-muted); margin-top: 8px; line-height: 1.6; }
.empty { text-align: center; color: var(--text-muted); font-size: 0.9em; padding: 30px 0; }

/* 四诊速查 */
.sym-list { display: flex; flex-direction: column; gap: 10px; }
.sym-item { background: #fdfaf5; border-radius: 10px; padding: 14px 16px; border-left: 4px solid var(--gold); }
.sym-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.sym-cat { font-size: 0.72em; color: #fff; background: var(--gold); border-radius: 10px; padding: 2px 10px; }
.sym-head b { font-family: var(--font-heading); color: var(--primary); font-size: 1.05em; }
.sym-manifest { font-size: 0.9em; color: var(--text-light); }
.sym-implies { font-size: 0.88em; color: var(--text-muted); margin-top: 6px; }

/* 中药房 */
.herb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.herb-cat-desc { grid-column: 1 / -1; font-size: 0.85em; color: var(--text-muted); background: rgba(184,134,11,0.05); border-radius: 10px; padding: 8px 14px; }
.herb-card { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px; background: var(--card); }
.herb-name { font-family: var(--font-heading); color: var(--primary); font-size: 1.1em; font-weight: 700; margin-bottom: 8px; }
.herb-py { font-size: 0.7em; color: var(--text-muted); font-family: var(--font-body); }
.herb-meta { font-size: 0.85em; color: var(--text-light); margin: 4px 0; line-height: 1.6; }
.herb-meta span { display: inline-block; min-width: 34px; color: var(--gold); font-weight: 700; }
.herb-note { font-size: 0.78em; color: #a0522d; margin-top: 6px; background: rgba(160,82,45,0.06); border-radius: 8px; padding: 6px 10px; }

/* 穴位 */
.point-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.point-card { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px; background: var(--card); }
.point-name { font-family: var(--font-heading); color: var(--primary); font-size: 1.1em; font-weight: 700; }
.point-code { font-size: 0.72em; color: var(--text-muted); font-family: var(--font-body); margin-left: 6px; }
.point-meridian { font-size: 0.78em; color: var(--gold); margin: 4px 0 8px; }
.point-loc { font-size: 0.85em; color: var(--text-light); margin-bottom: 6px; }
.point-ind { font-size: 0.85em; color: var(--text-light); line-height: 1.6; }
.point-warn { font-size: 0.78em; color: #a0522d; margin-top: 6px; }

/* 体质自测 */
.const-group { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px; margin-bottom: 14px; }
.const-group-title { font-family: var(--font-heading); font-size: 1.15em; font-weight: 700; margin-bottom: 10px; }
.const-q { padding: 8px 0; border-top: 1px dashed var(--border); }
.const-q-text { font-size: 0.92em; color: var(--text); margin-bottom: 6px; }
.const-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.const-opt { font-size: 0.8em; color: var(--text-light); cursor: pointer; padding: 4px 10px; border-radius: 12px; border: 1px solid var(--border); background: #fffefb; transition: var(--transition); }
.const-opt:hover { border-color: var(--primary-light); color: var(--primary); }
.const-opt input { margin-right: 4px; }
.const-result-card { border: 1px solid var(--border); }
.const-result-title { font-family: var(--font-heading); font-size: 1.25em; margin-bottom: 8px; }
.const-care { font-size: 0.9em; color: var(--text-light); margin-top: 8px; background: rgba(184,134,11,0.06); border-radius: 10px; padding: 10px 12px; }
.const-bar-row { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.const-bar-name { width: 64px; flex: none; font-size: 0.82em; color: var(--text-light); }
.const-bar { flex: 1; height: 14px; background: #f0e9dd; border-radius: 8px; overflow: hidden; }
.const-bar-fill { height: 100%; border-radius: 8px; transition: width 0.5s; }
.const-bar-val { width: 28px; text-align: right; font-size: 0.82em; color: var(--text-muted); }

/* 经典条文 */
.classic-list { display: flex; flex-direction: column; gap: 12px; }
.classic-card { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px 18px; background: var(--card); border-left: 4px solid var(--primary); }
.classic-source { font-size: 0.78em; color: var(--gold); margin-bottom: 6px; font-family: var(--font-heading); }
.classic-text { font-family: var(--font-heading); font-size: 1.15em; color: var(--primary); line-height: 1.7; margin-bottom: 8px; }
.classic-vern { font-size: 0.9em; color: var(--text-light); line-height: 1.7; }

/* 章节测验 */
.quiz-chapters { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.quiz-chapter { border: 2px solid var(--border); border-radius: var(--radius-sm); padding: 16px; text-align: center; cursor: pointer; transition: var(--transition); background: var(--card); }
.quiz-chapter:hover { border-color: var(--primary-light); transform: translateY(-2px); box-shadow: var(--shadow); }
.quiz-chapter b { display: block; font-family: var(--font-heading); color: var(--primary); font-size: 1.02em; margin-bottom: 4px; }
.quiz-count { font-size: 0.78em; color: var(--text-muted); }
.quiz-qlist { display: flex; flex-direction: column; gap: 14px; }
.quiz-q { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px; }
.quiz-q.right { border-color: #6aaf8a; background: #f0faf4; }
.quiz-q.wrong { border-color: #e0b060; background: #fef9f4; }
.quiz-q-text { font-size: 0.95em; color: var(--text); font-weight: 600; margin-bottom: 10px; line-height: 1.6; }
.quiz-opts { display: flex; flex-direction: column; gap: 8px; }
.quiz-opt { font-size: 0.88em; color: var(--text-light); cursor: pointer; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--border); background: #fffefb; transition: var(--transition); }
.quiz-opt:hover { border-color: var(--primary-light); background: rgba(139,69,19,0.04); }
.quiz-explain { font-size: 0.85em; color: var(--text-light); margin-top: 10px; line-height: 1.6; border-top: 1px dashed var(--border); padding-top: 8px; }
.quiz-score { text-align: center; font-size: 1.1em; color: var(--primary); }

/* 四季养生 */
.season-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; }
.season-title { font-family: var(--font-heading); font-size: 1.3em; font-weight: 700; margin-bottom: 12px; }
.season-points { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.season-point { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; background: #fdfaf5; border-radius: 10px; border-left: 3px solid var(--gold); }
.season-point b { font-family: var(--font-heading); color: var(--primary); font-size: 0.98em; }
.season-point span { font-size: 0.88em; color: var(--text-light); line-height: 1.6; }
.season-yiji { display: flex; gap: 12px; flex-wrap: wrap; }
.yiji-col { flex: 1 1 200px; border-radius: 10px; padding: 12px 14px; }
.yiji-do { background: rgba(45,106,79,0.08); }
.yiji-avoid { background: rgba(192,57,43,0.06); }
.yiji-h { font-weight: 700; margin-bottom: 8px; color: var(--primary); font-family: var(--font-heading); }
.yiji-tag { display: inline-block; margin: 3px 4px 0 0; padding: 3px 10px; border-radius: 12px; font-size: 0.82em; background: #fffefb; border: 1px solid var(--border); color: var(--text-light); }

/* 学习进度 */
.prog-row { margin-bottom: 16px; }
.prog-row-head { display: flex; justify-content: space-between; font-size: 0.95em; color: var(--text-light); margin-bottom: 6px; }
.prog-row-num { color: var(--primary); font-weight: 700; }
.prog-bar { height: 14px; background: #f0e9dd; border-radius: 8px; overflow: hidden; margin-bottom: 8px; }
.prog-bar-fill { height: 100%; background: linear-gradient(90deg, var(--gold), var(--primary)); border-radius: 8px; transition: width 0.5s; }
.prog-wrong { font-size: 0.85em; color: #a0522d; margin-top: 4px; }
.prog-lib { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.prog-lib-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--card); cursor: pointer; transition: var(--transition); }
.prog-lib-item:hover { border-color: var(--primary-light); transform: translateY(-2px); box-shadow: var(--shadow); }
.prog-lib-label { font-family: var(--font-heading); color: var(--primary); font-size: 0.95em; }
.prog-lib-count { font-size: 0.8em; color: var(--text-muted); }
.btn--small { padding: 6px 14px; font-size: 0.82em; border-radius: 16px; }

/* 站内搜索 */
.search-group { margin-bottom: 16px; }
.search-group-title { font-family: var(--font-heading); font-size: 1.05em; color: var(--primary); margin-bottom: 8px; border-left: 4px solid var(--accent); padding-left: 10px; }
.search-item { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--border); background: #fffefb; cursor: pointer; transition: var(--transition); margin-bottom: 6px; }
.search-item:hover { border-color: var(--primary-light); background: rgba(139,69,19,0.04); }
.search-item-t { font-family: var(--font-heading); color: var(--primary); font-size: 0.98em; }
.search-item-s { font-size: 0.82em; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 500px) {
    .herb-grid, .point-grid, .prog-lib { grid-template-columns: 1fr; }
    .quiz-chapters { grid-template-columns: 1fr 1fr; }
}
