/* 莲助 v0 —— 移动优先响应式（质量闸门：手机可用优先，宽屏增强） */
:root {
  --c-primary: #0f766e;      /* 青：医疗安静感 */
  --c-primary-weak: #e6f4f2;
  --c-bg: #f7f8f7;
  --c-card: #ffffff;
  --c-text: #1f2937;
  --c-text-2: #6b7280;
  --c-line: #e5e7eb;
  --c-warn: #b45309;
  --c-part: #0e7490;
  --radius: 12px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { font-size: 16px; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--c-bg); color: var(--c-text); line-height: 1.65;
}

/* ===== 顶栏 ===== */
.topbar { position: sticky; top: 0; z-index: 30; background: var(--c-primary); }
.topbar-inner { max-width: 1080px; margin: 0 auto; padding: .55rem .9rem .6rem; display: flex; flex-direction: column; gap: .45rem; }
.brand { color: #fff; font-size: 1.25rem; font-weight: 700; letter-spacing: .05em; }
.brand-sub { color: #d3ece9; font-size: .72rem; margin-top: -2px; }
.searchbox input {
  width: 100%; padding: .52rem .85rem; border: none; border-radius: 999px;
  font-size: 1rem; background: #fff; color: var(--c-text); outline: none;
}
.searchbox input:focus { box-shadow: 0 0 0 3px rgba(255,255,255,.45); }

/* ===== 主视图 ===== */
.view { max-width: 1080px; margin: 0 auto; padding: .9rem .9rem calc(5.2rem + var(--safe-b)); min-height: 60vh; }

/* ===== 底部导航（手机核心交互） ===== */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; background: var(--c-card); border-top: 1px solid var(--c-line);
  padding-bottom: var(--safe-b);
}
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: .45rem 0 .3rem; text-decoration: none; color: var(--c-text-2); font-size: .68rem; }
.tab .tab-icon { font-size: 1.25rem; line-height: 1; }
.tab.active { color: var(--c-primary); font-weight: 600; }

/* ===== 通用卡片与部件 ===== */
.page-title { font-size: 1.15rem; font-weight: 700; margin-bottom: .2rem; }
.page-desc { color: var(--c-text-2); font-size: .85rem; margin-bottom: .9rem; }
.card { background: var(--c-card); border: 1px solid var(--c-line); border-radius: var(--radius); padding: .95rem 1rem; margin-bottom: .75rem; }
.card h3 { font-size: 1rem; margin-bottom: .35rem; }
.part-tag { display: inline-block; font-size: .7rem; color: var(--c-part); background: #ecfeff; border: 1px solid #a5f3fc; border-radius: 6px; padding: 0 .45rem; margin-right: .35rem; vertical-align: 1px; }
.type-tag { display: inline-block; font-size: .7rem; color: var(--c-primary); background: var(--c-primary-weak); border-radius: 6px; padding: 0 .45rem; vertical-align: 1px; }

/* 出处标注（质量闸门1：每条可见） */
.source-line { margin-top: .55rem; padding-top: .45rem; border-top: 1px dashed var(--c-line); font-size: .74rem; color: var(--c-text-2); }
.source-line .src-name { color: var(--c-primary); }

/* 部位筛选条 */
.filter-bar { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .85rem; }
.chip { border: 1px solid var(--c-line); background: var(--c-card); color: var(--c-text-2); border-radius: 999px; padding: .28rem .8rem; font-size: .82rem; cursor: pointer; }
.chip.active { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }

/* 模板正文 */
.tpl-section { margin: .5rem 0; }
.tpl-section .sec-name { font-weight: 600; color: var(--c-primary); font-size: .88rem; }
.tpl-section .sec-body { white-space: pre-wrap; font-size: .9rem; background: #fafbfa; border-radius: 8px; padding: .55rem .7rem; margin-top: .2rem; }

/* 正常值表 */
.vtable { width: 100%; border-collapse: collapse; font-size: .88rem; margin-top: .3rem; }
.vtable th, .vtable td { border: 1px solid var(--c-line); padding: .4rem .5rem; text-align: left; }
.vtable th { background: var(--c-primary-weak); color: var(--c-primary); font-weight: 600; white-space: nowrap; }
.vtable td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* 术语 */
.term-def { font-size: .9rem; }
.term-usage { margin-top: .3rem; font-size: .84rem; color: var(--c-text-2); }
.term-usage b { color: var(--c-text); }

/* 搜索结果 */
.hit-type { font-size: .72rem; color: var(--c-warn); }
.search-hint { color: var(--c-text-2); font-size: .85rem; padding: 1rem 0; text-align: center; }
mark { background: #fef08a; border-radius: 3px; padding: 0 1px; }

/* 占位页 */
.placeholder-box { text-align: center; padding: 2.2rem 1rem; color: var(--c-text-2); }
.placeholder-box .big { font-size: 2.2rem; margin-bottom: .5rem; }
.placeholder-box h3 { color: var(--c-text); margin-bottom: .35rem; }

/* 按钮与行内操作 */
.btn-primary { background: var(--c-primary); color: #fff; border: none; border-radius: 10px; padding: .6rem 1.4rem; font-size: 1rem; cursor: pointer; width: 100%; }
.btn-line { background: var(--c-card); color: var(--c-primary); border: 1px solid var(--c-primary); border-radius: 10px; padding: .5rem 1rem; font-size: .9rem; cursor: pointer; margin-top: .5rem; }
.row-actions { margin-top: .5rem; display: flex; gap: .5rem; flex-wrap: wrap; }

/* 覆盖层（免责声明） */
.overlay { position: fixed; inset: 0; z-index: 100; background: rgba(17,24,39,.55); display: flex; align-items: center; justify-content: center; padding: 1.2rem; }
.overlay.hidden { display: none; }
.overlay-card { background: #fff; border-radius: 16px; padding: 1.5rem 1.3rem; max-width: 430px; width: 100%; }
.overlay-card h2 { font-size: 1.15rem; margin-bottom: .6rem; }
.overlay-main { font-size: .95rem; margin-bottom: .5rem; }
.overlay-sub { font-size: .8rem; color: var(--c-text-2); margin-bottom: 1rem; }

/* 计数徽标 */
.count-note { font-size: .78rem; color: var(--c-text-2); margin: .2rem 0 .8rem; }

/* ===== 宽屏增强（≥760px：底部导航转侧栏） ===== */
@media (min-width: 760px) {
  .topbar-inner { flex-direction: row; align-items: center; gap: 1rem; }
  .brand { font-size: 1.45rem; }
  .brand-sub { margin: 0 .8rem 0 0; }
  .searchbox { flex: 1; max-width: 520px; }
  .view { padding-left: 7.5rem; } /* 让出侧栏 */
  .tabbar {
    left: 0; right: auto; top: 0; bottom: 0; width: 6.6rem; flex-direction: column;
    border-top: none; border-right: 1px solid var(--c-line); padding: 4.2rem 0 1rem; gap: .3rem;
    background: var(--c-card);
  }
  .tab { padding: .7rem 0; font-size: .78rem; }
}

/* ===== B4：我的空间三区 / 收藏笔记 / 引导 ===== */
.sec-h { font-size: .95rem; margin: 1rem 0 .5rem; color: var(--c-primary); }
.fav-star { color: #f59e0b; margin-left: .2rem; }
.entry-actions { margin-top: .5rem; }
.entry-actions .chip { font-size: .76rem; padding: .18rem .65rem; }
.note-box { margin-top: .5rem; width: 100%; }
.note-box.hidden { display: none; }
.note-box textarea {
  width: 100%; min-height: 4.2rem; border: 1px solid var(--c-line); border-radius: 8px;
  padding: .5rem .6rem; font-size: .86rem; font-family: inherit; resize: vertical;
}
.note-box .note-save { margin-top: .35rem; background: var(--c-primary); color: #fff; border: none; }
