/* ============================================================
   倪师堂 · UI v7 —— 中式雅致设计系统
   墨色侧栏 · 宣纸底 · 朱砂点金
   ============================================================ */
:root {
  --bg: #f3efe5;
  --paper: #faf7f0;
  --card: #fffdf8;
  --ink: #2c2822;
  --sub: #8a8172;
  --line: #e7dfcd;
  --line-strong: #d6cab0;
  --accent: #a63a2b;
  --accent-deep: #7f2b20;
  --accent-soft: #f8ece8;
  --gold: #a07c2f;
  --gold-soft: #f7f0dc;
  --green: #2f6e4f;
  --sidebar: #26221a;
  --sidebar-line: #3a342a;
  --sidebar-ink: #cfc6b2;
  --shadow-sm: 0 1px 2px rgba(72, 58, 32, .06);
  --shadow: 0 1px 2px rgba(72, 58, 32, .05), 0 10px 28px -14px rgba(72, 58, 32, .22);
  --radius: 14px;
  --serif: "Noto Serif SC", "Source Han Serif SC", "STZhongsong", "STSong", "SimSun", serif;
  --sans: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  font-size: 14.5px;
  line-height: 1.65;
  height: 100%;
}
/* 宣纸质感底纹 */
body::before {
  content: '';
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(ellipse 900px 500px at 85% -10%, rgba(160, 124, 47, .06), transparent 60%),
    radial-gradient(ellipse 700px 460px at -10% 100%, rgba(166, 58, 43, .05), transparent 60%);
}

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #c2b492; }
::-webkit-scrollbar-track { background: transparent; }

::selection { background: rgba(166, 58, 43, .18); }

button, input, select, textarea { font-family: inherit; }
:focus-visible { outline: 2px solid rgba(166, 58, 43, .45); outline-offset: 1px; border-radius: 6px; }

/* ============ 整体布局 ============ */
.app-shell { position: relative; z-index: 1; display: flex; min-height: 100vh; }

/* ============ 侧边栏 ============ */
.sidebar {
  width: 236px; flex-shrink: 0;
  background: linear-gradient(175deg, #2b261d 0%, #221e17 100%);
  color: var(--sidebar-ink);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  padding: 22px 14px 16px;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 2px 8px 20px; border-bottom: 1px solid var(--sidebar-line); }
.seal {
  width: 44px; height: 44px; flex-shrink: 0;
  background: linear-gradient(145deg, #b04434, #8c2f22);
  color: #f7ecd9; border-radius: 9px;
  font-family: var(--serif); font-size: 26px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 0 0 1.5px rgba(247, 236, 217, .35), 0 4px 10px -3px rgba(0, 0, 0, .5);
}
.brand-text b { display: block; font-family: var(--serif); font-size: 21px; letter-spacing: 3px; color: #f0e8d6; line-height: 1.3; }
.brand-text span { font-size: 11px; color: #948a74; letter-spacing: .5px; }

/* 导航 */
.tabs { display: flex; flex-direction: column; gap: 3px; padding: 14px 0; flex: 1; overflow-y: auto; }
.tabs button {
  display: flex; align-items: center; gap: 10px;
  border: none; background: transparent;
  color: var(--sidebar-ink);
  padding: 10px 14px; border-radius: 10px;
  font-size: 14px; cursor: pointer; text-align: left;
  position: relative; transition: background .18s, color .18s;
  white-space: nowrap;
}
.tabs button:hover { background: rgba(255, 248, 230, .07); color: #eee5d0; }
.tabs button.active {
  background: rgba(255, 248, 230, .1); color: #fff;
  font-weight: 600;
}
.tabs button.active::before {
  content: ''; position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px;
  background: linear-gradient(var(--gold), #c9a54e); border-radius: 3px;
}
.tabs button .ico { font-size: 16px; width: 22px; text-align: center; flex-shrink: 0; }

/* 侧栏底部 */
.sidebar-foot { border-top: 1px solid var(--sidebar-line); padding-top: 14px; }
.member-switch label { display: block; font-size: 11px; color: #948a74; margin: 0 8px 6px; letter-spacing: 1px; }
.ms-row { display: flex; gap: 6px; }
.member-switch select {
  flex: 1; min-width: 0;
  padding: 8px 10px; border: 1px solid var(--sidebar-line); border-radius: 9px;
  background: #322c22; color: #e8dfca; font-size: 13px;
}
.member-switch select:focus { border-color: var(--gold); outline: none; }
.side-note { font-size: 10.5px; color: #7d7460; line-height: 1.7; margin: 12px 8px 0; }

/* ============ 主区 ============ */
.main-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.disclaimer {
  background: linear-gradient(90deg, #f8efd8, #f5ecd0);
  color: #7d6320; font-size: 12.5px;
  padding: 7px 22px;
  border-bottom: 1px solid #ecdfb8;
  position: sticky; top: 0; z-index: 20;
}
main { flex: 1; width: 100%; max-width: 960px; margin: 0 auto; padding: 20px 22px 30px; }

/* ============ 标签页切换 ============ */
.tab { display: none; }
.tab.active { display: block; }

/* ============ 卡片 ============ */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 26px;
  margin-top: 18px;
  box-shadow: var(--shadow);
  animation: rise .3s ease both;
}
.card h3 {
  font-family: var(--serif); font-size: 17px; font-weight: 700;
  color: var(--ink); letter-spacing: 1px;
  display: flex; align-items: center; gap: 9px;
  margin-bottom: 14px;
}
.card h3::before {
  content: ''; width: 4px; height: 17px; border-radius: 2px; flex-shrink: 0;
  background: linear-gradient(180deg, var(--accent), var(--gold));
}

@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.tab.active > * { animation: rise .28s ease both; }

/* ============ 按钮 ============ */
.btn {
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--ink);
  padding: 8px 18px; border-radius: 10px;
  cursor: pointer; font-size: 13.5px;
  transition: all .16s ease;
  box-shadow: var(--shadow-sm);
}
.btn:hover { border-color: #c4b795; background: #fbf8f0; transform: translateY(-1px); }
.btn:active { transform: none; }
.btn.primary {
  background: linear-gradient(145deg, #b04434, #963526);
  color: #fdf6ea; border-color: #8c2f22;
  box-shadow: 0 2px 8px -2px rgba(140, 47, 34, .45), inset 0 1px 0 rgba(255, 255, 255, .15);
}
.btn.primary:hover { background: linear-gradient(145deg, #b8493a, #a03a2b); }
.btn.ghost { background: transparent; box-shadow: none; }
.sidebar .btn.ghost { color: #e8dfca; border-color: var(--sidebar-line); }
.sidebar .btn.ghost:hover { background: rgba(255, 248, 230, .1); border-color: var(--gold); color: #fff; }
.btn.sm { padding: 8px 12px; font-size: 15px; line-height: 1; }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
.muted { color: var(--sub); font-size: 13px; }

/* ============ 问诊对话（全屏应用式：占满整个视口高度） ============ */
/* 关键：main / main-wrap 必须允许收缩（min-height:0），否则消息一多
   就按内容高度撑开 100vh，把输入区顶出视口（flex 子项默认 min-height:auto） */
.app-shell:has(#tab-chat.active) { height: 100vh; }
.main-wrap:has(#tab-chat.active) { overflow: hidden; min-height: 0; }
.main-wrap:has(#tab-chat.active) .footer { display: none; }
#tab-chat.active { display: flex; flex-direction: column; flex: 1; min-height: 0; }
main:has(#tab-chat.active) {
  max-width: 1400px;
  display: flex; flex-direction: column;
  padding: 16px 24px 20px;
  min-height: 0;
  overflow: hidden;
}

.chat-window {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.chat-head {
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 18px;
  background: linear-gradient(180deg, #fbf9f2, #f8f4ea);
  border-bottom: 1px solid var(--line);
}
.ch-title {
  font-family: var(--serif); font-size: 16.5px; font-weight: 700;
  color: var(--ink); letter-spacing: 1px;
  display: flex; align-items: baseline; gap: 10px;
}
.ch-sub { font-family: var(--sans); font-size: 12px; font-weight: 400; color: var(--sub); letter-spacing: 0; }

.chat-box {
  flex: 1; min-height: 0;
  overflow-y: auto;
  padding: 20px 18px 12px;
  scroll-behavior: smooth;
}
.msg {
  position: relative;
  max-width: min(78%, 860px);
  padding: 11px 15px;
  border-radius: 14px;
  margin-bottom: 14px;
  white-space: pre-wrap;
  line-height: 1.75; font-size: 14.5px;
  box-shadow: var(--shadow-sm);
}
.msg.bot { background: #f5f1e6; border: 1px solid var(--line); border-top-left-radius: 4px; margin-left: 40px; }
.msg.bot::before {
  content: '倪';
  position: absolute; left: -40px; top: 0;
  width: 30px; height: 30px;
  background: linear-gradient(145deg, #b04434, #8c2f22);
  color: #f7ecd9; border-radius: 8px;
  font-family: var(--serif); font-size: 16px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 0 0 1px rgba(247, 236, 217, .3);
}
.msg.user {
  background: linear-gradient(145deg, #a8422f, #8c2f22);
  color: #fdf6ea; margin-left: auto; margin-right: 40px;
  border-top-right-radius: 4px;
}
.msg.user::after {
  content: '我';
  position: absolute; right: -40px; top: 0;
  width: 30px; height: 30px;
  background: #4a4336; color: #e8dfca; border-radius: 8px;
  font-size: 13px;
  display: flex; align-items: center; justify-content: center;
}
.msg .refchip {
  display: inline-block; font-size: 12px;
  background: #fff; border: 1px solid var(--line);
  border-radius: 8px; padding: 1.5px 9px; margin: 2px 3px;
  color: var(--sub); white-space: normal;
}
.msg .refchip a { color: var(--green); text-decoration: none; }
.msg .refchip a:hover { text-decoration: underline; }
.msg.prescription { border-left: 3px solid var(--gold); }

/* 溯源折叠 */
details.refs {
  margin-top: 10px;
  border: 1px solid var(--line); border-radius: 11px;
  background: #fbf8f0; font-size: 12.5px;
}
details.refs summary {
  cursor: pointer; padding: 8px 13px; color: var(--sub); font-weight: 600;
  list-style: none; display: flex; align-items: center; gap: 6px;
}
details.refs summary::-webkit-details-marker { display: none; }
details.refs summary::before {
  content: '▸'; color: var(--gold); transition: transform .2s; font-size: 12px;
}
details[open] > summary::before { transform: rotate(90deg); }
details.refs[open] summary { border-bottom: 1px dashed var(--line); }
details.refs .ref-sec { padding: 9px 13px 5px; }
details.refs .ref-sec b { display: block; color: var(--accent); font-size: 12px; margin-bottom: 5px; }

/* 相似医案折叠卡 */
details.cases-card {
  margin-top: 10px;
  border: 1px solid #ddcda6; border-radius: 11px;
  background: linear-gradient(180deg, #fbf6e9, #f9f3e2);
  font-size: 13px;
}
details.cases-card summary {
  cursor: pointer; padding: 9px 13px; color: #7c6120; font-weight: 700;
  list-style: none; display: flex; align-items: center; gap: 6px;
}
details.cases-card summary::-webkit-details-marker { display: none; }
details.cases-card summary::before { content: '▸'; transition: transform .2s; font-size: 12px; }
details.cases-card[open] summary { border-bottom: 1px dashed #ddcda6; }
details.cases-card .case-mini { padding: 11px 15px; border-bottom: 1px dashed var(--line); line-height: 1.7; }
details.cases-card .case-mini:last-child { border-bottom: none; }
details.cases-card .case-hit {
  float: right; font-size: 11.5px; color: #8a6c22;
  background: #f3ead2; border-radius: 8px; padding: 1px 8px;
}
details.cases-card a { color: var(--green); text-decoration: none; font-size: 12.5px; }
details.cases-card a:hover { text-decoration: underline; }

/* 欢迎语下的健康档案卡片 */
/* 状态摘要卡（健康档案页顶部） */
.status-card {
  background: linear-gradient(135deg, #fdf6ef, #faf0e4);
  border: 1px solid #e8cfae; border-left: 4px solid var(--accent);
  border-radius: 12px; padding: 14px 16px; margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.status-card.empty { border-left-color: #b9a98f; background: var(--card); }
.status-card .st-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.status-card .st-head b { color: var(--accent); font-size: 14.5px; }
.status-card .st-body { font-size: 14px; line-height: 1.8; color: var(--ink); }
.status-card .st-hist { margin-top: 10px; font-size: 13px; }
.status-card .st-hist summary { cursor: pointer; color: var(--accent); user-select: none; }
.status-card .st-hitem { padding: 6px 0 6px 12px; border-left: 2px solid #e8cfae; margin: 6px 0 6px 4px; line-height: 1.7; }
.status-card .st-hitem .muted { display: block; font-size: 12px; }
.welcome-card .st-inline b { color: var(--accent); }

.welcome-card {
  margin: 0 0 16px 40px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  background: linear-gradient(180deg, #fbf7ec, #f8f3e4);
  padding: 13px 16px;
  font-size: 13.5px;
  animation: rise .3s ease both;
}
.welcome-card.empty { background: linear-gradient(180deg, #fdf3e7, #faecd9); border-color: #e0c9a4; }
.welcome-card .wc-row { display: flex; gap: 12px; align-items: flex-start; }
.welcome-card .wc-ico { font-size: 22px; line-height: 1.2; flex-shrink: 0; }
.welcome-card .wc-body { flex: 1; line-height: 1.7; }
.welcome-card .wc-body b { color: var(--accent-deep); display: block; margin-bottom: 2px; font-size: 14px; }
.welcome-card .wc-body > span { display: block; color: #6c6353; }
.welcome-card .wc-acts { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; flex-shrink: 0; }
.welcome-card .wc-skip { font-size: 12px; color: var(--sub); cursor: pointer; }
.welcome-card .wc-skip:hover { color: var(--accent); }

/* 切换档案弹窗列表 */
.sw-list { display: flex; flex-direction: column; gap: 8px; max-height: 46vh; overflow-y: auto; }
.sw-item {
  border: 1px solid var(--line); border-radius: 11px;
  padding: 11px 14px; cursor: pointer; background: var(--paper);
  display: flex; flex-direction: column; gap: 2px;
  transition: border-color .15s, box-shadow .15s;
}
.sw-item:hover { border-color: #c98f7f; box-shadow: var(--shadow-sm); }
.sw-item.cur { border-color: var(--accent); background: var(--accent-soft); }
.sw-item.cur b::after { content: ' · 当前'; color: var(--accent); font-size: 12px; font-weight: 400; }
.sw-item b { color: var(--ink); font-size: 14.5px; }

/* 档案页成员切换条（顶部：所有档案 + 常驻新建按钮） */
.mem-bar {
  display: flex; gap: 12px; align-items: center; justify-content: space-between;
  flex-wrap: wrap; margin-bottom: 16px; padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.mem-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.mem-chip {
  border: 1px solid var(--line); border-radius: 10px;
  padding: 6px 13px; cursor: pointer; background: var(--paper);
  display: flex; align-items: baseline; gap: 7px;
  transition: border-color .15s, background .15s;
}
.mem-chip:hover { border-color: #c98f7f; box-shadow: var(--shadow-sm); }
.mem-chip.cur { border-color: var(--accent); background: var(--accent-soft); }
.mem-chip b { font-size: 14px; color: var(--ink); }
.mem-chip.cur b { color: var(--accent-deep); }
.mem-chip .muted { font-size: 11.5px; }

/* 医嘱来源标记 */
.src-tag {
  font-size: 10.5px; padding: 1px 7px; border-radius: 7px; flex-shrink: 0;
  font-weight: 600; white-space: nowrap;
}
.src-tag.consult { background: var(--accent-soft); color: var(--accent); border: 1px solid #e8c8be; }
.src-tag.tianji { background: var(--gold-soft); color: #7c6120; border: 1px solid #e3d5a8; }
.src-tag.solar { background: #e8f1e4; color: #4c6b3c; border: 1px solid #c4d8ba; }
.due-tag { font-size: 10.5px; padding: 1px 7px; border-radius: 7px; flex-shrink: 0; font-weight: 600; white-space: nowrap; background: #fdeeee; color: #b03a2e; border: 1px solid #efc4bd; }
.advice-list .dt { flex-shrink: 0; font-size: 11.5px; }

/* 今日参考卡（欢迎卡内） */
.brief-card { margin-top: 10px; background: #fdf9f0; border: 1px dashed var(--line); border-radius: 10px; padding: 9px 13px; font-size: 13px; line-height: 1.75; color: var(--ink); }
.brief-card b { color: var(--accent); }

/* 结诊归档 chip + 舌照邀请条（对话内） */
.conclude-chip { margin-top: 8px; background: #eef6ec; border: 1px solid #bfdcb8; color: #2f5d27; border-radius: 9px; padding: 7px 12px; font-size: 13px; }
.req-tongue { margin-top: 8px; background: #fdf6ef; border: 1px solid var(--line); border-radius: 9px; padding: 8px 12px; font-size: 13px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* 八字四柱 */
.bazi-grid { display: flex; gap: 10px; margin: 10px 0; flex-wrap: wrap; }
.bazi-grid .bz { flex: 1; min-width: 70px; text-align: center; background: linear-gradient(135deg, #fdf6ef, #f7ead6); border: 1px solid var(--line); border-radius: 10px; padding: 10px 6px; }
.bazi-grid .bz b { display: block; font-size: 20px; color: var(--accent); letter-spacing: 2px; margin-top: 2px; }
.bazi-grid .bz .muted { font-size: 11.5px; }
#baziResult { margin-top: 14px; background: #fffdf8; border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; }

/* 舌象对照图库 */
.tl-card { margin-top: 12px; }
.tl-card .tl-title { color: var(--accent); display: block; margin-bottom: 10px; }
.tl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.tl-item {
  border: 1px solid var(--line); border-radius: 10px; background: var(--paper);
  padding: 8px; display: flex; flex-direction: column; gap: 4px;
}
.tl-item img { width: 100%; border-radius: 7px; aspect-ratio: 1; object-fit: cover; }
.tl-item b { color: var(--ink); font-size: 14px; }
.tl-rare { background: var(--gold); color: #fff; border-radius: 4px; font-size: 10.5px; padding: 0 5px; margin-left: 4px; vertical-align: middle; }
.tl-item.empty { opacity: .62; }
.tl-syn { color: var(--accent); font-size: 12.5px; line-height: 1.6; }
.tl-sign { color: #7a6d5c; font-size: 12px; line-height: 1.6; }
.tl-noimg { width: 100%; aspect-ratio: 1; border-radius: 7px; background: var(--line); display: flex; align-items: center; justify-content: center; color: #8a7a68; font-size: 13px; }
.msg .tl-card { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin-top: 8px; }

/* 天纪：大限流年行 + 讲稿层 */
.hz-line { margin-top: 10px; padding: 8px 12px; background: #fdf6ef; border: 1px dashed #e0c9a8; border-radius: 8px; font-size: 13.5px; }
.hz-line b { color: var(--accent); }
.tj-layer .cite { padding: 8px 10px; border-left: 3px solid var(--gold); margin: 8px 0; background: #fdf9f0; border-radius: 0 8px 8px 0; line-height: 1.75; font-size: 13.5px; }

/* 舌照注入横幅（限高内部滚动，防止长 JSON 把输入栏顶出视口） */
.tongue-banner {
  background: #edf4ec; border: 1px solid #bfd6c1; color: #2d4a35;
  padding: 11px 15px; border-radius: 11px; margin-top: 12px;
  font-size: 13px; white-space: pre-wrap;
  max-height: 150px; overflow-y: auto;
  word-break: break-word; min-width: 0;
  animation: rise .3s ease both;
}
.tongue-banner a { color: var(--accent); margin-left: 6px; cursor: pointer; }
/* 天纪三层 */
details.tj-layer {
  margin-top: 14px;
  border: 1px solid var(--line); border-radius: 12px;
  background: #fcfaf4; overflow: hidden;
}
details.tj-layer summary {
  cursor: pointer; padding: 10px 15px;
  color: var(--accent); font-weight: 700; font-size: 13.5px;
  list-style: none; display: flex; align-items: center; gap: 6px;
}
details.tj-layer summary::-webkit-details-marker { display: none; }
details.tj-layer summary::before { content: '▸'; transition: transform .2s; font-size: 12px; color: var(--gold); }
details.tj-layer[open] summary { border-bottom: 1px dashed var(--line); }
details.tj-layer .palace-grid { padding: 12px; }
details.tj-layer #tjCites { padding: 8px 15px 14px; }

/* 天纪命盘追问框 */
.tj-ask { margin-top: 16px; padding: 14px; border: 1px dashed #e0c9a8; border-radius: 10px; background: #fdf9f0; }
.tj-ask-row { display: flex; gap: 8px; }
.tj-ask-row input { flex: 1; }
.tj-ask-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.tj-ask-chips a { font-size: 13px; color: var(--accent); background: #fff; border: 1px solid #e8cfae; border-radius: 999px; padding: 4px 12px; text-decoration: none; }
.tj-ask-chips a:hover { background: #fdf0e0; }
.tj-ask-out { display: none; margin-top: 12px; padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; line-height: 1.85; font-size: 14px; }

/* 历史诊断与开方（档案页） */
.rx-hist-wrap { margin-top: 16px; padding-top: 12px; border-top: 1px dashed var(--line); }
.rx-hist { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
/* v14 处方分类徽章 */
.rx-badge { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 8px; margin: 0 4px; vertical-align: middle; }
.rx-classic { background: #e3f4e3; color: #1d6b2e; border: 1px solid #b6dcb6; }
.rx-modified { background: #e3ecf9; color: #1c4f8f; border: 1px solid #b9cfe9; }
.rx-combination { background: #fdf0dd; color: #8a5a12; border: 1px solid #ecd3a8; }
.rx-custom { background: #fbe4e4; color: #9c2626; border: 1px solid #ecbcbc; }
.rx-unv { background: #efefef; color: #777; border: 1px dashed #ccc; }
.rx-added { font-size: 12.5px; color: #555; margin: 4px 0; padding: 6px 10px; background: #f7f7f2; border-radius: 8px; }

.rx-item { background: #fdf9f0; border: 1px solid #eadfcb; border-radius: 10px; padding: 10px 14px; }
.rx-item summary { cursor: pointer; font-size: 14px; line-height: 1.7; user-select: none; }
.rx-item summary::marker { color: var(--gold); }
.rx-concl { margin: 10px 0 8px; padding: 8px 12px; border-left: 3px solid var(--accent); background: var(--card); border-radius: 0 8px 8px 0; font-size: 13.5px; line-height: 1.75; }
.rx-card { background: var(--card); border: 1px solid #e8cfae; border-radius: 10px; overflow: hidden; }
.rx-card > b { display: block; padding: 8px 14px; background: linear-gradient(135deg, #fdf0e0, #fae8d0); color: var(--accent); font-size: 13.5px; }
.rx-card pre { margin: 0; padding: 12px 14px; white-space: pre-wrap; word-break: break-all; font-family: inherit; font-size: 13.5px; line-height: 1.9; color: var(--ink); }

/* 输入区（窗口底部固定） */
.chat-input {
  flex-shrink: 0;
  display: flex; gap: 12px; align-items: flex-end;
  padding: 13px 16px 14px;
  background: #fbf8f1;
  border-top: 1px solid var(--line);
}
.chat-window > #tongueCtxBanner,
.chat-window > #toxicWarning { flex-shrink: 0; padding: 0 16px; min-width: 0; max-height: 178px; overflow-y: auto; }
.chat-window > #tongueCtxBanner:empty,
.chat-window > #toxicWarning:empty { padding: 0; display: none; }
.chat-input textarea {
  flex: 1;
  padding: 12px 14px;
  border: 1px solid var(--line-strong); border-radius: 12px;
  background: var(--card);
  font-family: inherit; font-size: 14px; resize: none;
  max-height: 132px; overflow-y: auto;
  transition: border-color .16s, box-shadow .16s;
  box-shadow: var(--shadow-sm);
}
.chat-input textarea:focus { outline: none; border-color: #c98f7f; box-shadow: 0 0 0 3px rgba(166, 58, 43, .1); }
.chat-actions { display: flex; flex-direction: column; gap: 7px; align-items: flex-end; }
.chat-btns { display: flex; gap: 6px; }
.mode-toggle { font-size: 12px; color: var(--sub); display: flex; align-items: center; gap: 4px; cursor: pointer; }
.mode-toggle input { accent-color: var(--accent); }
.toxic {
  background: #fcefec; border: 1px solid #e5c0b8; color: #8c2f22;
  padding: 11px 15px; border-radius: 11px; margin-top: 12px; font-size: 13.5px;
  animation: rise .3s ease both;
}
.intercept {
  background: #fcefec; border: 1px solid #e5c0b8;
  padding: 12px 16px; border-radius: 12px; margin-bottom: 12px; font-size: 14px;
}

/* ============ 表单 ============ */
.frm { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.frm label { font-size: 12.5px; color: var(--sub); display: block; margin-bottom: 4px; font-weight: 600; }
.frm input, .frm textarea,
.advice-add input, .advice-add select,
.kb-search input,
.tianji-form input, .tianji-form select,
.tongue-upload input[type="file"] {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--paper);
  font-family: inherit; font-size: 13.5px;
  transition: border-color .16s, box-shadow .16s;
}
.frm input:focus, .frm textarea:focus, .advice-add input:focus,
.kb-search input:focus, .tianji-form input:focus, .tianji-form select:focus {
  outline: none; border-color: #c98f7f;
  box-shadow: 0 0 0 3px rgba(166, 58, 43, .08);
  background: #fff;
}
.frm .full { grid-column: 1 / -1; }

/* ============ 历史时间线 ============ */
.timeline { position: relative; padding-left: 22px; }
.timeline::before {
  content: ''; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 2px;
  background: linear-gradient(var(--gold), var(--line-strong));
  border-radius: 2px;
}
.tl-item { position: relative; margin-bottom: 16px; padding-bottom: 4px; }
.tl-item::before {
  content: ''; position: absolute; left: -22px; top: 6px;
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--card); border: 2.5px solid var(--accent);
  box-shadow: 0 0 0 3px rgba(166, 58, 43, .12);
}
.tl-item .t { font-size: 12px; color: var(--sub); letter-spacing: .3px; }
.tl-item .q { font-weight: 700; margin: 3px 0; cursor: pointer; transition: color .15s; }
.tl-item .q:hover { color: var(--accent); }
.tl-item .a { font-size: 13px; color: #6c6353; max-height: 64px; overflow: hidden; white-space: pre-wrap; }

/* ============ 医嘱 ============ */
.advice-add { display: flex; gap: 9px; margin-bottom: 14px; }
.advice-add select { width: 92px; flex-shrink: 0; }
.advice-add input { flex: 1; }
.advice-list { list-style: none; }
.advice-list li {
  display: flex; gap: 11px; align-items: center;
  padding: 10px 6px; border-bottom: 1px dashed var(--line);
  transition: background .15s;
}
.advice-list li:hover { background: #fbf8f0; }
.advice-list li:last-child { border-bottom: none; }
.advice-list li.done .content { text-decoration: line-through; color: var(--sub); }
.advice-list .cat {
  font-size: 11.5px; padding: 2px 10px; border-radius: 8px; flex-shrink: 0;
  background: var(--gold-soft); color: #7c6120; font-weight: 600;
}
.advice-list .content { flex: 1; }
.advice-list input[type="checkbox"] { accent-color: var(--green); width: 16px; height: 16px; cursor: pointer; }

/* 节气 */
.solar-term { font-size: 14px; line-height: 1.9; }
.solar-term b {
  font-family: var(--serif); font-size: 21px; color: var(--accent);
  letter-spacing: 2px;
}

/* ============ 舌诊 ============ */
.tongue-upload { display: flex; gap: 10px; margin-top: 12px; align-items: center; }
.tongue-upload input[type="file"] { flex: 1; padding: 8px; font-size: 12.5px; }
.tongue-result {
  margin-top: 14px; white-space: pre-wrap;
  background: #f7f4ea; border: 1px solid var(--line);
  padding: 16px 18px; border-radius: 11px; display: none;
  font-size: 13.5px; line-height: 1.8;
}
.tongue-records { display: flex; flex-wrap: wrap; gap: 12px; }
.tongue-records .rec { width: 128px; font-size: 12px; color: var(--sub); }
.tongue-records img {
  width: 128px; height: 128px; object-fit: cover;
  border-radius: 10px; border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

/* ============ 经方百科 ============ */
.kb-search { display: flex; gap: 10px; margin-bottom: 14px; }
.kb-search input { flex: 1; font-size: 14px; }
.kb-tabs { display: flex; gap: 7px; margin-bottom: 14px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line-strong); background: var(--card);
  border-radius: 999px; padding: 4.5px 16px; cursor: pointer; font-size: 13px;
  transition: all .15s;
}
.chip:hover { border-color: #c4b795; }
.chip.active {
  background: linear-gradient(145deg, #a8862f, #8a6c22); color: #fdf6e3;
  border-color: #8a6c22; font-weight: 600;
  box-shadow: 0 2px 6px -2px rgba(138, 108, 34, .5);
}
.kb-item {
  border: 1px solid var(--line); border-radius: 12px;
  padding: 13px 16px; margin-bottom: 11px; font-size: 13.5px;
  background: var(--paper); line-height: 1.75;
  transition: border-color .15s, box-shadow .15s;
}
.kb-item:hover { border-color: #c9ba97; box-shadow: var(--shadow-sm); }
.kb-item b { color: var(--accent); font-size: 14.5px; }
.kb-item .src { color: var(--sub); font-size: 12px; margin-left: 6px; }
.kb-item a { color: var(--green); text-decoration: none; font-size: 12.5px; }
.kb-item a:hover { text-decoration: underline; }

/* ============ 天纪 ============ */
.tianji-form {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 9px; margin-bottom: 16px;
}
.tianji-form button { grid-column: 1 / -1; padding: 10px; font-size: 14.5px; }
.palace-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 0; margin-top: 12px;
  border: 2px solid #8a6c4a; border-radius: 10px; overflow: hidden;
  background: #8a6c4a;
}
.palace {
  border: 1px solid #d8c9ac;
  padding: 9px 10px; font-size: 12px; min-height: 88px;
  background: #fdfaf2; line-height: 1.55;
  position: relative;
}
.palace b { color: var(--accent); display: block; font-size: 12.5px; margin-bottom: 2px; }
.palace.ming { background: linear-gradient(160deg, #f9ede6, #f5e3d8); }
.palace .mutagen { color: #8a6c22; font-size: 11.5px; font-weight: 700; }
.cite {
  border: 1px solid var(--line); border-radius: 11px;
  padding: 12px 15px; margin-top: 11px; font-size: 13.5px;
  background: var(--paper); line-height: 1.75;
}
.cite a { color: var(--green); text-decoration: none; font-size: 12.5px; display: inline-block; margin-top: 5px; }
.cite a:hover { text-decoration: underline; }

/* ============ 表格 ============ */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 8px; }
.tbl th {
  background: var(--gold-soft); color: #6d5518;
  padding: 8px 11px; border: 1px solid #e8dcb8;
  text-align: left; font-weight: 700; white-space: nowrap;
}
.tbl td { padding: 8px 11px; border: 1px solid var(--line); }
.tbl tr:nth-child(even) td { background: #fbf8f0; }
.tbl tr:hover td { background: #f5f0e2; }

/* ============ 弹窗 ============ */
.modal {
  position: fixed; inset: 0;
  background: rgba(38, 30, 18, .45);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  z-index: 50; animation: fadeIn .18s ease;
}
.modal[hidden] { display: none; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-card {
  background: var(--card);
  border-radius: 16px; padding: 26px 28px;
  width: min(560px, 92vw); max-height: 86vh; overflow-y: auto;
  box-shadow: 0 24px 60px -18px rgba(40, 30, 12, .5);
  border: 1px solid var(--line);
  animation: pop .22s cubic-bezier(.34, 1.4, .64, 1) both;
}
.modal-card.wide { width: min(760px, 94vw); }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }

/* ============ 页脚 ============ */
.footer { text-align: center; color: var(--sub); font-size: 11.5px; padding: 20px 16px 26px; line-height: 1.8; }

/* ============ 响应式 ============ */
@media (max-width: 920px) {
  .app-shell { flex-direction: column; }
  .sidebar {
    width: 100%; height: auto; position: static;
    padding: 12px 14px 10px;
    flex-direction: row; align-items: center; flex-wrap: wrap; gap: 4px;
  }
  .brand { border: none; padding: 0 10px 0 0; }
  .seal { width: 36px; height: 36px; font-size: 20px; border-radius: 8px; }
  .brand-text b { font-size: 16px; letter-spacing: 2px; }
  .brand-text span { display: none; }
  .tabs {
    flex-direction: row; flex: 1; overflow-x: auto; padding: 0;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs button { padding: 8px 11px; font-size: 13px; border-radius: 8px; }
  .tabs button.active::before { display: none; }
  .tabs button.active { background: rgba(255, 248, 230, .16); }
  .sidebar-foot {
    border: none; padding: 0; margin-left: auto;
    display: flex; align-items: center; gap: 8px;
  }
  .member-switch label, .side-note { display: none; }
  .member-switch select { padding: 6px 8px; font-size: 12.5px; }
  main { padding: 14px 14px 24px; }
  .disclaimer { padding: 6px 14px; }
  #tab-chat { min-height: 0; }
  main:has(#tab-chat.active) { padding: 10px 12px 14px; }
  .chat-head { padding: 10px 13px; }
  .ch-title { font-size: 15px; }
  .ch-sub { display: none; }
  .msg { max-width: 88%; }
  .msg.bot { margin-left: 34px; }
  .msg.bot::before { left: -34px; width: 26px; height: 26px; font-size: 13px; }
  .msg.user { margin-right: 34px; }
  .msg.user::after { right: -34px; width: 26px; height: 26px; font-size: 11px; }
  .chat-input { flex-direction: column; align-items: stretch; }
  .chat-actions { flex-direction: row; justify-content: space-between; align-items: center; }
  .palace-grid { grid-template-columns: repeat(2, 1fr); }
  .card { padding: 17px 18px; }
}

/* authGate: flex only when visible (hidden attr wins) */
#authGate:not([hidden]) { display: flex; align-items: center; justify-content: center; }


/* ---------- v39 检查单 ---------- */
.lab-card{border:1px solid var(--border,rgba(0,0,0,.12));border-radius:12px;padding:14px;margin-top:8px;background:var(--bg-soft,rgba(0,0,0,.02))}
.lab-hd{display:flex;gap:8px;align-items:baseline;flex-wrap:wrap;margin-bottom:8px}
.lab-hd .muted{font-size:12px}
.lab-meta{display:flex;gap:14px;flex-wrap:wrap;margin-bottom:10px}
.lab-meta label{font-size:12px;opacity:.8}
.lab-meta input{border:1px solid var(--border,rgba(0,0,0,.15));border-radius:6px;padding:3px 6px;font-size:13px;max-width:170px;background:transparent;color:inherit}
.lab-sec{margin:10px 0}
.lab-table{width:100%;border-collapse:collapse;font-size:13px}
.lab-table th{text-align:left;font-weight:500;opacity:.6;font-size:12px;padding:2px 4px}
.lab-table td{padding:2px 4px;border-top:1px solid var(--border,rgba(0,0,0,.08))}
.lab-table input{width:100%;border:1px solid transparent;border-radius:5px;padding:2px 4px;font-size:13px;background:transparent;color:inherit}
.lab-table input:focus{border-color:var(--accent,#378ADD);outline:none}
.lab-table .w-val{width:90px}.lab-table .w-unit{width:76px}
.lab-chips{display:flex;flex-wrap:wrap;gap:6px;margin:4px 0}
.lab-chip{background:var(--bg-soft,rgba(0,0,0,.05));border-radius:999px;padding:2px 10px;font-size:13px}
.lab-chip a{margin-left:6px;opacity:.5;text-decoration:none}
.lab-add{display:flex;gap:6px;margin-top:6px}
.lab-add input{flex:1;border:1px solid var(--border,rgba(0,0,0,.15));border-radius:6px;padding:4px 8px;font-size:13px;background:transparent;color:inherit}
.lab-line{font-size:13px;line-height:1.7}
.lab-warn{margin-top:8px;padding:8px 10px;border-radius:8px;font-size:13px;background:rgba(239,159,39,.12);border:1px solid rgba(239,159,39,.4)}
.lab-warn.urgent{background:rgba(226,75,74,.12);border-color:rgba(226,75,74,.45)}
.lab-acts{display:flex;gap:8px;margin-top:10px;flex-wrap:wrap}
.lab-done{margin-top:8px;padding:8px 10px;border-radius:8px;font-size:13px;background:rgba(99,153,34,.12);border:1px solid rgba(99,153,34,.35)}
.lab-rec{border-top:1px solid var(--border,rgba(0,0,0,.08));padding:10px 0}
.lab-rec-hd{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-bottom:4px}
.btn.sm{padding:2px 10px;font-size:12px}


/* ===== v43 管理后台 ===== */
.admin-shell{display:flex;max-width:1020px;margin:0 auto;background:#fff;border:1px solid #e5e5e5;border-radius:12px;overflow:hidden;min-height:520px;}
.admin-side{width:132px;flex-shrink:0;background:#f6f8f7;border-right:1px solid #eaecea;padding:14px 0;}
.admin-nav{padding:9px 16px;font-size:13.5px;color:#556;cursor:pointer;display:flex;justify-content:space-between;align-items:center;border-left:3px solid transparent;}
.admin-nav:hover{background:#eef2f0;}
.admin-nav.active{background:#fff;color:#2f6f4f;font-weight:bold;border-left-color:#2f6f4f;}
.admin-badge{background:#c0392b;color:#fff;border-radius:9px;padding:0 7px;font-size:11px;}
.admin-main{flex:1;min-width:0;padding:16px 18px;}
.admin-stat{flex:1;background:#f6f8f7;border-radius:8px;padding:10px 8px;text-align:center;min-width:96px;}
.admin-stat b{font-size:20px;font-weight:bold;display:block;}
.admin-stat span{font-size:11.5px;color:#889;}
.admin-card{border:1px solid #eee;border-radius:8px;padding:10px 12px;margin-bottom:8px;}
.admin-tabs{display:flex;border-bottom:1px solid #e5e5e5;margin:14px 0 10px;}
.admin-tab{border:none;background:none;padding:9px 14px;font-size:13px;color:#667;cursor:pointer;border-bottom:2px solid transparent;}
.admin-tab.active{color:#1f5c8b;font-weight:bold;border-bottom-color:#1f5c8b;}
@media (max-width:760px){.admin-side{width:46px;}.admin-nav{font-size:0;justify-content:center;padding:11px 0;}.admin-nav.active{border-left-width:2px;}.admin-badge{font-size:10px;padding:0 5px;}}

/* ===== v45 处方卡 chip + 弹窗 ===== */
.rx-chip{display:flex;align-items:center;gap:10px;margin:10px 0;padding:10px 14px;border:0.5px solid var(--border,#d8d5cc);border-radius:10px;background:var(--surface,#faf9f6);cursor:pointer;max-width:520px}
.rx-chip:hover{border-color:var(--accent,#8b6f47)}
.rx-chip-ico{font-size:20px}
.rx-chip-main{flex:1;min-width:0}
.rx-chip-main b{font-size:14px;color:var(--text,#2c2a24)}
.rx-chip-sub{display:block;font-size:12px;color:#8a867c;margin-top:2px}
.rx-chip-go{font-size:12px;color:var(--accent,#8b6f47);white-space:nowrap}
.rx-modal{position:fixed;inset:0;z-index:1000}
.rx-modal[hidden]{display:none}
.rx-mask{position:absolute;inset:0;background:rgba(20,18,12,.5)}
.rx-panel{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:min(640px,92vw);max-height:88vh;overflow:auto;background:#fff;border-radius:14px;padding:20px 22px;box-shadow:0 10px 40px rgba(0,0,0,.25)}
.rx-head{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:14px}
.rx-name{font-size:18px;font-weight:600;color:var(--text,#2c2a24)}
.rx-src{font-size:12px;color:#8a867c;margin-top:3px}
.rx-close{flex-shrink:0}
.rx-gate .rx-warn{background:#fdecec;border:0.5px solid #f0b4b4;border-radius:10px;padding:12px 14px;margin-bottom:12px}
.rx-gate .rx-warn b{color:#a32d2d;font-size:13px}
.rx-gate .rx-warn ul{margin:6px 0 0;padding-left:18px;font-size:12.5px;line-height:1.8;color:#5a544a}
.rx-ack{display:flex;align-items:flex-start;gap:8px;font-size:13px;margin-bottom:12px;cursor:pointer}
.rx-open{width:100%;background:var(--accent,#8b6f47);color:#fff;border:none;border-radius:8px;padding:10px 0;font-size:14px;cursor:pointer}
.btn[disabled],.rx-open[disabled]{opacity:.45;cursor:not-allowed}
.rx-warnline{background:#fdecec;border-radius:8px;padding:7px 10px;font-size:12px;color:#a32d2d;margin-bottom:10px;line-height:1.7}
.rx-tabs{display:flex;gap:6px;margin-bottom:12px}
.rx-tabs button{flex:1;padding:7px 4px;font-size:12.5px;border:0.5px solid var(--border,#d8d5cc);background:transparent;border-radius:8px;cursor:pointer;color:#5a544a}
.rx-tabs button.active{background:#efe7d8;border-color:var(--accent,#8b6f47);color:#6b5432;font-weight:600}
.rx-sec-note{font-size:11.5px;color:#8a867c;margin-bottom:6px}
.rx-row{padding:7px 10px;border-bottom:0.5px dashed #e8e4da;font-size:13px;line-height:1.6;color:var(--text,#2c2a24)}
.rx-row:last-child{border-bottom:none}
.rx-row.keep{color:#8a867c}
.rx-row.dec-sec{background:#faf9f6;border-radius:8px;border:none;margin-bottom:2px}
.rx-dec-title{font-size:12.5px;font-weight:600;color:var(--accent,#6b5432);margin:10px 0 4px}
.rx-foot{margin-top:12px;font-size:11.5px;color:#8a867c;line-height:1.6;border-top:0.5px solid #eee9df;padding-top:10px}
.rx-next{display:flex;gap:8px;margin-top:10px;flex-wrap:wrap}
body.rx-lock{overflow:hidden}

/* v46 记忆接续：续诊回访徽标 */
.greet-tag{display:inline-block;background:var(--accent,#185FA5);color:#fff;font-size:11.5px;padding:1px 8px;border-radius:10px;margin-right:6px;vertical-align:1px}

/* ===== v48 病历本：病史目录 + 问诊回放 ===== */
.wc-toc { margin-top: 8px; border-top: 1px dashed rgba(128,120,100,.35); padding-top: 8px; }
.wc-toc > b { font-size: 12px; color: var(--accent, #2a7a5c); display: block; margin-bottom: 4px; }
.wc-toc-row { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.wc-toc-row:hover { background: rgba(128,120,100,.08); }
.wc-toc-row.cur { background: rgba(42,122,92,.09); }
.wc-toc-day { color: var(--muted, #8a8578); font-size: 12px; white-space: nowrap; }
.wc-toc-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wc-toc-meta { color: var(--muted, #8a8578); font-size: 12px; white-space: nowrap; }
.wc-toc-cur { background: var(--accent, #2a7a5c); color: #fff; font-size: 11px; padding: 1px 7px; border-radius: 8px; white-space: nowrap; }
.seg-head { text-align: center; font-size: 12px; color: var(--muted, #8a8578); margin: 8px 0; }
#newConsultBtn { white-space: nowrap; }
/* ===== v49 病史目录卡片化（行动导向：按钮引导回看/续聊） ===== */
.wc-toc-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.wc-toc-head > b { font-size: 13px; color: var(--accent, #2a7a5c); }
.wc-toc-hint { font-size: 12px; color: var(--muted, #8a8578); }
.wc-toc-card { border: 1px solid rgba(128,120,100,.32); border-radius: 10px; padding: 8px 10px; margin-bottom: 6px; background: rgba(255,255,255,.65); }
.wc-toc-card.cur { border-color: rgba(42,122,92,.55); background: rgba(42,122,92,.07); }
.wc-toc-card-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.wc-toc-title { font-weight: 600; font-size: 13px; }
.wc-toc-rx { margin-left: 6px; font-size: 12px; color: var(--accent, #2a7a5c); font-weight: 600; }
.wc-toc-card .wc-toc-meta { margin-top: 2px; white-space: normal; }
.wc-toc-btns { display: flex; gap: 6px; margin-top: 7px; flex-wrap: wrap; }
.wc-toc-btn { font-size: 12px; padding: 4px 12px; border-radius: 8px; border: 1px solid rgba(128,120,100,.4); background: #fff; color: inherit; cursor: pointer; }
.wc-toc-btn:hover { border-color: var(--accent, #2a7a5c); color: var(--accent, #2a7a5c); }
.wc-toc-btn.primary { background: var(--accent, #2a7a5c); border-color: var(--accent, #2a7a5c); color: #fff; }
.wc-toc-btn.primary:hover { opacity: .88; color: #fff; }
