/* 麻醉学院 AnesAcademy — 全部样式（医学专业浅色） */
:root {
  --primary: #0e7490;
  --primary-2: #0891b2;
  --primary-dark: #155e75;
  --primary-soft: #ecfeff;
  --bg: #f6f8fa;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --red: #dc2626;
  --red-bg: #fef2f2;
  --amber: #d97706;
  --amber-bg: #fffbeb;
  --green: #059669;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0, 0, 0, .08);
  --shadow-hover: 0 4px 14px rgba(14, 116, 144, .14);
  --serif: "Noto Serif SC", "Songti SC", "SimSun", serif;
  --sans: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --mono: ui-monospace, "SF Mono", Consolas, "Courier New", monospace;
  --topbar-h: 56px;
}

* { box-sizing: border-box; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  padding-top: var(--topbar-h);
}
h1, h2, h3, h4, .brand, .sec-title, .card-title { font-family: var(--serif); }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-2); }
code, .mono {
  font-family: var(--mono);
  font-size: .92em;
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0 .3em;
}
.container { max-width: 1100px; margin: 0 auto; padding: 0 1.25rem; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--topbar-h);
  background: var(--card);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.topbar-inner {
  max-width: 1100px; margin: 0 auto; height: 100%;
  display: flex; align-items: center; gap: 1.25rem; padding: 0 1.25rem;
}
.brand { font-size: 1.2rem; font-weight: 700; color: var(--primary); white-space: nowrap; }
.brand-en { font-size: .72rem; color: var(--muted); margin-left: .45em; font-family: var(--sans); font-weight: 400; letter-spacing: .04em; }
.main-nav { display: flex; gap: .25rem; flex: 0 0 auto; }
.main-nav a {
  padding: .35rem .7rem; border-radius: 8px; color: var(--text);
  font-size: .95rem; white-space: nowrap;
}
.main-nav a:hover { background: var(--primary-soft); color: var(--primary); }
.main-nav a.active { background: var(--primary); color: #fff; }
.top-search { position: relative; flex: 1; max-width: 320px; margin-left: auto; }
.top-search input, .hero-search input, .filter-bar input {
  width: 100%; padding: .5rem .8rem; border: 1px solid var(--border);
  border-radius: 8px; font-size: .95rem; font-family: var(--sans);
  background: #fff; color: var(--text); outline: none;
}
.top-search input:focus, .hero-search input:focus, .filter-bar input:focus {
  border-color: var(--primary-2); box-shadow: 0 0 0 3px rgba(8, 145, 178, .15);
}
.hamburger {
  display: none; background: none; border: 1px solid var(--border);
  border-radius: 8px; font-size: 1.15rem; padding: .25rem .6rem;
  cursor: pointer; color: var(--primary);
}

/* 搜索下拉 */
.search-dropdown {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 120;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .12); display: none; overflow: hidden;
}
.search-dropdown.show { display: block; }
.search-item {
  display: block; padding: .55rem .8rem; border-bottom: 1px solid #f1f5f9;
  color: var(--text); font-size: .92rem; line-height: 1.45;
}
.search-item:last-child { border-bottom: none; }
.search-item:hover { background: var(--primary-soft); color: var(--text); }
.si-label { display: block; font-weight: 600; }
.si-sub { display: block; color: var(--muted); font-size: .8rem; }
.search-empty { padding: .8rem; color: var(--muted); font-size: .9rem; text-align: center; }

/* ---------- 主区通用 ---------- */
.app-main { min-height: calc(100vh - var(--topbar-h) - 60px); }
.page { padding-top: 1.5rem; padding-bottom: 3rem; animation: fadein .25s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1.25rem 1.5rem; margin-bottom: 1.5rem; border: 1px solid #eef1f4;
}
.card-title {
  margin: 0 0 .8rem; font-size: 1.08rem; color: var(--primary-dark);
  border-left: 3px solid var(--primary); padding-left: .6rem; line-height: 1.4;
}
.sec-title { font-size: 1.5rem; margin: .25rem 0 .25rem; color: var(--primary-dark); }
.sec-sub { color: var(--muted); margin: 0 0 1.25rem; font-size: .95rem; }
.cat-title { font-size: 1.15rem; color: var(--primary); margin: 1.75rem 0 .8rem; }
.crumb { color: var(--muted); font-size: .88rem; margin-bottom: 1rem; }
.empty-note {
  background: var(--amber-bg); border: 1px dashed var(--amber); color: #92600a;
  border-radius: var(--radius); padding: 1rem 1.25rem; margin: 1rem 0; font-size: .95rem;
}
ul.tight, ol.tight { margin: 0; padding-left: 1.3rem; }
ul.tight li, ol.tight li { margin-bottom: .45rem; }

/* ---------- 首页 ---------- */
.hero {
  background: linear-gradient(135deg, #0e7490 0%, #0891b2 60%, #06b6d4 100%);
  border-radius: 14px; color: #fff; padding: 2.6rem 2rem 2.4rem; margin-bottom: 1.5rem;
  box-shadow: 0 6px 20px rgba(14, 116, 144, .25);
}
.hero h1 { margin: 0; font-size: 2rem; letter-spacing: .02em; }
.hero-en { font-size: 1rem; opacity: .85; margin-left: .5em; font-family: var(--sans); font-weight: 400; }
.hero-sub { opacity: .92; margin: .6rem 0 1.4rem; font-size: 1rem; }
.hero-search { position: relative; max-width: 560px; }
.hero-search input { padding: .75rem 1rem; font-size: 1rem; border: none; border-radius: 10px; }

.stat-bar {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.5rem;
}
.stat {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1rem; text-align: center; border: 1px solid #eef1f4;
}
.stat-val { font-size: 1.45rem; font-weight: 700; color: var(--primary); font-family: var(--mono); }
.stat-label { color: var(--muted); font-size: .85rem; margin-top: .15rem; }

.continue-card {
  display: block; background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.1rem 1.5rem; border-left: 4px solid var(--amber);
  color: var(--text); transition: transform .15s, box-shadow .15s;
}
.continue-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); color: var(--text); }
.cc-tag { color: var(--amber); font-size: .82rem; font-weight: 700; letter-spacing: .05em; }
.cc-title { font-size: 1.12rem; font-weight: 700; margin-top: .2rem; }
.cc-sub { color: var(--muted); font-size: .88rem; }

.entry-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 2rem; }
.entry-card {
  display: block; background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.4rem 1.2rem; text-align: center;
  color: var(--text); border: 1px solid #eef1f4;
  transition: transform .15s, box-shadow .15s;
}
.entry-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); color: var(--text); }
.entry-icon { font-size: 1.7rem; }
.entry-title { font-weight: 700; margin: .5rem 0 .25rem; color: var(--primary-dark); }
.entry-sub { color: var(--muted); font-size: .85rem; line-height: 1.5; }

/* 学习路径时间线 */
.timeline { position: relative; padding-left: 1.2rem; }
.timeline::before {
  content: ""; position: absolute; left: 1.2rem; top: 12px; bottom: 12px;
  width: 2px; background: #cde7ee;
}
.tl-item {
  position: relative; display: flex; align-items: flex-start; gap: .9rem;
  padding: .55rem 0 .55rem 1.6rem; color: var(--text);
}
.tl-dot {
  position: absolute; left: 0; top: .7rem; width: 2.1rem; height: 2.1rem;
  margin-left: calc(-1.05rem + 1px); border-radius: 50%;
  background: #fff; border: 2px solid var(--primary-2); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem; font-weight: 700; font-family: var(--mono); flex: 0 0 auto;
}
.tl-item.done .tl-dot { background: var(--primary); border-color: var(--primary); color: #fff; }
.tl-item:hover .tl-title { color: var(--primary); }
.tl-title { display: block; font-weight: 600; }
.tl-sub { display: block; color: var(--muted); font-size: .83rem; }

/* ---------- 列表卡片 ---------- */
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1rem; }
.ch-card, .drug-card {
  display: block; background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.1rem 1.2rem; color: var(--text);
  border: 1px solid #eef1f4; transition: transform .15s, box-shadow .15s;
}
.ch-card:hover, .drug-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); color: var(--text); }
.ch-head { display: flex; align-items: center; gap: .5rem; margin-bottom: .4rem; }
.ch-num { font-family: var(--mono); font-size: .78rem; color: var(--primary-2); font-weight: 700; }
.ch-title { font-weight: 700; font-size: 1.05rem; color: var(--text); }
.ch-en, .drug-en { color: var(--muted); font-size: .85rem; font-weight: 400; }
.ch-sum { color: var(--muted); font-size: .88rem; margin-top: .4rem; line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.done-mark { margin-left: auto; color: var(--green); font-size: .8rem; font-weight: 700; white-space: nowrap; }
.stars { color: var(--amber); font-size: .85rem; letter-spacing: .1em; }
.badges { margin-top: .45rem; display: flex; flex-wrap: wrap; gap: .35rem; }

/* 徽标 / 胶囊 */
.chip {
  display: inline-block; background: var(--primary-soft); color: var(--primary-dark);
  border-radius: 999px; padding: .12rem .7rem; font-size: .8rem; font-weight: 600;
}
.badge { display: inline-block; border-radius: 999px; padding: .1rem .65rem; font-size: .78rem; font-weight: 700; }
.badge-critical { background: var(--red); color: #fff; }
.badge-red { background: #fff; color: var(--red); border: 1.5px solid var(--red); }
.badge-amber { background: var(--amber-bg); color: var(--amber); border: 1px solid var(--amber); }
.badge-gray { background: #f3f4f6; color: var(--muted); border: 1px solid var(--border); }
.term-chip {
  display: inline-block; background: #f1f5f9; border: 1px solid var(--border);
  color: #475569; border-radius: 999px; padding: .15rem .75rem;
  font-size: .82rem; margin: 0 .4rem .4rem 0;
}
.term-chip.link { color: var(--primary); border-color: var(--primary-2); background: var(--primary-soft); }
.term-chip.link:hover { background: var(--primary); color: #fff; }
.term-chip.dim { opacity: .65; }

/* 筛选条 */
.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem; margin-bottom: 1rem; }
.filter-bar input[type="search"] { max-width: 300px; }
.chip-bar { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: 1rem; }
.filter-bar .chip-bar { margin-bottom: 0; }
.chip-btn {
  border: 1px solid var(--border); background: #fff; color: var(--text);
  border-radius: 999px; padding: .28rem .85rem; font-size: .85rem; cursor: pointer;
  font-family: var(--sans);
}
.chip-btn:hover { border-color: var(--primary-2); color: var(--primary); }
.chip-btn.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.switch { display: inline-flex; align-items: center; gap: .4rem; font-size: .9rem; color: var(--muted); cursor: pointer; }
.switch input { accent-color: var(--primary); width: 1rem; height: 1rem; }

/* ---------- 详情页 ---------- */
.detail-head {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1.5rem 1.75rem; margin-bottom: 1.5rem; border: 1px solid #eef1f4;
  border-top: 4px solid var(--primary);
}
.detail-head h1 { margin: .2rem 0; font-size: 1.7rem; color: var(--primary-dark); }
.ch-num-big { font-family: var(--mono); color: var(--primary-2); font-weight: 700; font-size: .9rem; letter-spacing: .08em; }
.detail-en { color: var(--muted); font-size: 1rem; margin-bottom: .4rem; }
.detail-meta { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-top: .4rem; }
.detail-actions { display: flex; gap: .7rem; margin-top: .9rem; flex-wrap: wrap; }
.drug-title-row { display: flex; align-items: baseline; gap: .8rem; flex-wrap: wrap; }

.obj-card ol { margin: 0; padding-left: 1.3rem; }
.obj-card li { margin-bottom: .4rem; }
.sec-card .sec-title-bar {
  font-size: 1.1rem; color: var(--primary-dark); margin: 0 0 .8rem;
  border-left: 3px solid var(--primary); padding-left: .6rem; font-family: var(--serif);
}
.terms { margin-top: .9rem; }

/* markdown 正文 */
.md p { margin: .6rem 0; }
.md h3 { font-size: 1.12rem; color: var(--primary-dark); margin: 1.2rem 0 .5rem; border-left: 3px solid var(--primary); padding-left: .6rem; }
.md h4 { font-size: 1.02rem; color: var(--primary); margin: 1.1rem 0 .45rem; }
.md ul { margin: .5rem 0; padding-left: 1.35rem; }
.md li { margin-bottom: .35rem; }
.md blockquote {
  margin: .8rem 0; padding: .6rem 1rem; background: var(--primary-soft);
  border-left: 3px solid var(--primary-2); border-radius: 0 8px 8px 0; color: #155e75;
}
.md strong { color: #0f172a; }

/* 表格 */
.table-wrap { overflow-x: auto; margin: .8rem 0; border-radius: 8px; border: 1px solid var(--border); }
table { border-collapse: collapse; width: 100%; font-size: .9rem; background: #fff; }
th, td { padding: .5rem .75rem; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
thead th { background: var(--primary); color: #fff; font-weight: 600; white-space: nowrap; }
tbody tr:nth-child(even) { background: #f8fafc; }
tbody tr:hover { background: var(--primary-soft); }
.dose-table td.mono { font-family: var(--mono); font-size: .85rem; background: none; border: none; padding: .5rem .75rem; color: var(--primary-dark); font-weight: 600; }

/* 药物详情特色卡 */
.oneliner {
  background: var(--primary-soft); border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius) var(--radius) 0; padding: .9rem 1.25rem;
  font-size: 1.05rem; font-weight: 600; color: var(--primary-dark); margin-bottom: 1.5rem;
}
.alert-card { background: var(--red-bg); border: 1px solid #fecaca; }
.alert-card .card-title { color: var(--red); border-left-color: var(--red); }
.alert-line {
  background: #fff; border: 1px solid #fecaca; border-radius: 8px;
  padding: .6rem .9rem; margin-bottom: .55rem; font-size: .95rem; line-height: 1.6;
}
.memory-card { background: #f0fdf4; border: 1px solid #bbf7d0; }
.memory-card .card-title { color: #047857; border-left-color: #059669; }
.exam-line { display: flex; gap: .55rem; align-items: flex-start; padding: .4rem 0; border-bottom: 1px dashed #eef1f4; }
.exam-line:last-child { border-bottom: none; }
.exam-line span { flex: 1; }
.fav-btn {
  background: none; border: none; cursor: pointer; font-size: 1.05rem;
  color: #cbd5e1; padding: 0 .1rem; line-height: 1.6; flex: 0 0 auto;
}
.fav-btn:hover { color: var(--amber); transform: scale(1.15); }
.fav-btn.on { color: var(--amber); }

/* 手风琴 */
.acc { border: 1px solid var(--border); border-radius: 8px; margin-bottom: .55rem; overflow: hidden; }
.acc summary {
  cursor: pointer; padding: .7rem 1rem; font-weight: 600; color: var(--primary-dark);
  background: #f8fafc; list-style: none;
}
.acc summary::before { content: "▸ "; color: var(--primary-2); }
.acc[open] summary::before { content: "▾ "; }
.acc summary:hover { background: var(--primary-soft); }
.acc-body { padding: .8rem 1.1rem; font-size: .95rem; border-top: 1px solid var(--border); }

/* 深度阅读 */
.deep-card summary {
  cursor: pointer; font-weight: 700; color: var(--primary-dark); font-size: 1.05rem;
  list-style: none; padding: .2rem 0;
}
.deep-card summary::before { content: "▸ "; color: var(--primary-2); }
.deep-card details[open] summary::before { content: "▾ "; }
.deep-tag {
  font-size: .75rem; font-weight: 600; color: var(--amber);
  background: var(--amber-bg); border: 1px solid var(--amber);
  border-radius: 999px; padding: .1rem .6rem; margin-left: .5rem; vertical-align: middle;
}
.deep-body { margin-top: 1rem; border-top: 1px dashed var(--border); padding-top: 1rem; }

/* 考点速记 */
.exam-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.exam-mini {
  position: relative; background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1rem 1.2rem 2.2rem; border: 1px solid #eef1f4;
}
.exam-mini .fav-btn { position: absolute; top: .7rem; right: .8rem; }
.exam-text { font-size: .93rem; line-height: 1.6; padding-right: 1.6rem; }
.exam-src {
  position: absolute; bottom: .6rem; left: 1.2rem; font-size: .8rem; color: var(--muted);
}
.exam-src:hover { color: var(--primary); }

/* 按钮 / 导航 */
.btn {
  border: 1px solid var(--border); background: #fff; color: var(--text);
  border-radius: 8px; padding: .5rem 1.2rem; font-size: .95rem; cursor: pointer;
  font-family: var(--sans); transition: all .15s;
}
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-ghost { color: var(--primary); border-color: var(--primary-2); }
.btn-ghost:hover { background: var(--primary-soft); }
.prev-next {
  display: flex; justify-content: space-between; gap: 1rem;
  margin: .5rem 0 1rem; font-size: .95rem;
}
.prev-next a { max-width: 48%; }

/* 页脚 */
.app-footer {
  text-align: center; color: var(--muted); font-size: .82rem;
  padding: 1.4rem 1rem 1.8rem; border-top: 1px solid var(--border); background: #fff;
}

/* ---------- 移动端 ---------- */
@media (max-width: 900px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .entry-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-bar { grid-template-columns: repeat(2, 1fr); }
  .exam-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  body { font-size: 15px; }
  .topbar-inner { gap: .6rem; padding: 0 .8rem; }
  .top-search { display: none; }
  .hamburger { display: block; margin-left: auto; }
  .main-nav {
    display: none; position: fixed; top: var(--topbar-h); right: 0; left: 0;
    background: #fff; flex-direction: column; gap: 0;
    border-bottom: 1px solid var(--border); box-shadow: 0 8px 20px rgba(0,0,0,.1);
    padding: .4rem;
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: .8rem 1rem; border-radius: 8px; }
  .hero { padding: 1.8rem 1.3rem; }
  .hero h1 { font-size: 1.5rem; }
  .card-grid { grid-template-columns: 1fr; }
  .container { padding: 0 .9rem; }
  .detail-head, .card { padding: 1.1rem 1.1rem; }
  .prev-next { flex-direction: column; }
  .prev-next a { max-width: 100%; }
  input, button { font-size: 15px; }
}

/* ============ 神经阻滞图谱画廊 ============ */
.fig-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; align-items: start; }
.blk-fig { margin: 0; position: relative; background: #0b1220; border-radius: 10px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.blk-fig img { width: 100%; display: block; cursor: zoom-in; }
.blk-fig .fig-kind { position: absolute; top: .5rem; left: .5rem; background: rgba(14,116,144,.92); color: #fff; font-size: .72rem; padding: .15rem .55rem; border-radius: 999px; }
.blk-fig figcaption { font-size: .78rem; color: #475569; background: #fff; padding: .45rem .6rem; line-height: 1.5; }
.lightbox { position: fixed; inset: 0; background: rgba(246,248,250,.96); backdrop-filter: blur(6px); display: none; z-index: 999; align-items: center; justify-content: center; flex-direction: column; padding: 2vh 2vw; }
.lightbox.on { display: flex; }
.lightbox img { max-width: 94vw; max-height: 82vh; border-radius: 8px; background: #fff; box-shadow: 0 10px 40px rgba(2,6,23,.22); }
.lightbox .lb-cap { color: #334155; margin-top: .8rem; font-size: .85rem; max-width: 82vw; text-align: center; line-height: 1.5; }
.blk-video { margin-bottom: 1rem; }
.blk-video video { width: 100%; border-radius: 8px; background: #0b1220; }
.blk-video .video-title { font-size: .8rem; color: #475569; margin-top: .4rem; }
