/* ============================================================
   岐黄智诊 · 中医诊所辅助辨证 SaaS
   设计系统：玉青主色 / 浅灰绿底 / 卡片式工作台
   ============================================================ */

:root {
  --jade-950: #062b29;
  --jade-900: #0a3d39;
  --jade-800: #0d554e;
  --jade-700: #0f766e;
  --jade-600: #12958a;
  --jade-500: #1aa79a;
  --jade-100: #d5efeb;
  --jade-50: #eefaf8;

  --ink: #12201f;
  --ink-2: #2b3d3b;
  --muted: #6b807d;
  --muted-2: #8fa19e;
  --line: #e3ebe9;
  --line-strong: #cfdad7;
  --bg: #f3f7f6;
  --card: #ffffff;

  --amber: #b45309;
  --amber-bg: #fef6e7;
  --amber-line: #f5d9a8;
  --red: #b91c1c;
  --red-bg: #fef2f2;
  --red-line: #f3c9c9;
  --blue: #1d4ed8;
  --blue-bg: #eff5ff;
  --green: #15803d;
  --green-bg: #eefaf1;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(16, 42, 39, .05);
  --shadow: 0 6px 22px rgba(16, 48, 44, .07);
  --shadow-lg: 0 24px 70px rgba(10, 40, 37, .22);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p { margin: 0; }
button { font-family: inherit; }
a { color: var(--jade-700); text-decoration: none; }
.hidden { display: none !important; }

/* ---------------- 通用控件 ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 500;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .18s, border-color .18s, color .18s, box-shadow .18s, transform .06s;
  white-space: nowrap;
}
.btn:hover { border-color: var(--jade-500); color: var(--jade-700); background: var(--jade-50); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn svg { width: 16px; height: 16px; }

.btn-primary {
  background: linear-gradient(180deg, var(--jade-600), var(--jade-700));
  border-color: var(--jade-700);
  color: #fff;
  box-shadow: 0 6px 16px rgba(15, 118, 110, .22);
}
.btn-primary:hover { background: linear-gradient(180deg, var(--jade-500), var(--jade-700)); color: #fff; border-color: var(--jade-700); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--jade-50); color: var(--jade-700); border-color: transparent; }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-danger { color: var(--red); border-color: var(--red-line); }
.btn-danger:hover { background: var(--red-bg); color: var(--red); border-color: var(--red); }

.icon-btn {
  width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; border-radius: 8px; background: transparent;
  color: inherit; cursor: pointer;
}
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn:hover { background: rgba(255, 255, 255, .12); }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > span { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.field input, .field select, .field textarea,
.input, select.input, textarea.input {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  font-family: inherit;
  padding: 10px 12px;
  outline: none;
  transition: border-color .16s, box-shadow .16s;
}
.field textarea, textarea.input { resize: vertical; min-height: 78px; line-height: 1.65; }
.field input:focus, .field select:focus, .field textarea:focus,
.input:focus, select.input:focus, textarea.input:focus {
  border-color: var(--jade-500);
  box-shadow: 0 0 0 3px rgba(26, 167, 154, .13);
}
.field input::placeholder, textarea::placeholder { color: var(--muted-2); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* 注册验证码行（输入框 + 图形/发送按钮） */
.captcha-row { display: flex; gap: 8px; align-items: center; }
.captcha-row input { flex: 1; width: auto; min-width: 0; }
.captcha-img {
  height: 42px; width: 116px; flex: none;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  cursor: pointer; background: #f5f7fb;
  object-fit: cover;
}
.captcha-row .btn { flex: none; white-space: nowrap; }

.form-error {
  min-height: 18px;
  color: var(--red);
  font-size: 12.5px;
  margin: -4px 0 8px;
}
.form-error:empty { min-height: 6px; }

/* ---------------- 登录 / 注册 ---------------- */

.auth-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(420px, 1.05fr) minmax(420px, .95fr);
}

.auth-brand {
  position: relative;
  overflow: hidden;
  padding: 64px 70px;
  color: #eaf7f4;
  background:
    radial-gradient(900px 500px at 10% 0%, rgba(26, 167, 154, .34), transparent 62%),
    linear-gradient(150deg, var(--jade-950) 0%, var(--jade-900) 45%, #0b4a44 100%);
  display: flex;
  align-items: center;
}
.auth-brand-inner { position: relative; z-index: 2; max-width: 520px; }
.brand-lg { display: flex; align-items: center; gap: 16px; margin-bottom: 60px; }
.brand-mark-lg {
  width: 54px; height: 54px; border-radius: 15px;
  display: flex; align-items: center; justify-content: center;
  font-size: 27px; font-weight: 700; color: var(--jade-950);
  background: linear-gradient(160deg, #d9f5ef, #8fd8cd);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .22);
}
.brand-lg h1 { font-size: 25px; font-weight: 700; letter-spacing: 2px; }
.brand-lg p { font-size: 12.5px; color: #9dc9c2; letter-spacing: 3px; margin-top: 2px; }

.auth-slogan {
  font-size: 42px;
  line-height: 1.32;
  font-weight: 700;
  letter-spacing: 2px;
  margin-bottom: 24px;
  background: linear-gradient(120deg, #ffffff 30%, #a9e3d9);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.auth-desc { color: #b7d6d1; font-size: 14px; line-height: 1.9; max-width: 440px; }
.auth-points { list-style: none; padding: 0; margin: 30px 0 0; display: flex; flex-direction: column; gap: 12px; }
.auth-points li { display: flex; align-items: flex-start; gap: 10px; color: #d3e8e4; font-size: 13.5px; }
.auth-points .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #62d0c1; margin-top: 8px; flex: none;
  box-shadow: 0 0 0 4px rgba(98, 208, 193, .14);
}
.auth-disclaimer {
  margin-top: 46px; font-size: 11.5px; color: #7fb0a9;
  border-top: 1px solid rgba(255, 255, 255, .09);
  padding-top: 16px; max-width: 440px;
}
.auth-orbit { position: absolute; border-radius: 50%; pointer-events: none; }
.orbit-a {
  width: 560px; height: 560px; right: -220px; bottom: -220px;
  border: 1px solid rgba(120, 214, 199, .16);
  box-shadow: inset 0 0 120px rgba(26, 167, 154, .09);
}
.orbit-b {
  width: 340px; height: 340px; right: -110px; bottom: -110px;
  border: 1px solid rgba(120, 214, 199, .12);
}

.auth-panel {
  display: flex; align-items: center; justify-content: center;
  padding: 40px;
  background:
    radial-gradient(600px 300px at 90% 0%, #e5f5f1, transparent 70%),
    #f7faf9;
}
.auth-card {
  width: 100%; max-width: 430px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(15, 60, 55, .10);
  padding: 30px 34px 26px;
}
.auth-tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
  background: #f1f6f5; border-radius: 11px; padding: 5px; margin-bottom: 26px;
}
.auth-tab {
  border: none; background: transparent; color: var(--muted);
  font-size: 14px; font-weight: 500; padding: 9px 0; border-radius: 8px; cursor: pointer;
  transition: all .18s;
}
.auth-tab.active { background: #fff; color: var(--jade-700); box-shadow: var(--shadow-sm); font-weight: 600; }
.auth-form h3 { font-size: 22px; font-weight: 700; letter-spacing: .5px; }
.auth-hint { color: var(--muted); font-size: 12.5px; margin: 4px 0 22px; }
.auth-foot { margin-top: 16px; text-align: center; font-size: 12px; color: var(--muted-2); line-height: 1.7; }

/* ---------------- 应用骨架 ---------------- */

.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 236px; flex: none;
  display: flex; flex-direction: column;
  background:
    radial-gradient(500px 260px at 0% 0%, rgba(26, 167, 154, .2), transparent 70%),
    linear-gradient(180deg, #0a3d39, #073330 70%, #062b29);
  color: #cfe6e2;
  position: sticky; top: 0; height: 100vh;
  z-index: 30;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 22px 20px 24px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700; color: var(--jade-950);
  background: linear-gradient(160deg, #d9f5ef, #8fd8cd);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.35; }
.brand-text strong { font-size: 16px; color: #fff; letter-spacing: 1.5px; }
.brand-text span { font-size: 10.5px; color: #7fb0a9; letter-spacing: 1.5px; }

.nav { display: flex; flex-direction: column; gap: 3px; padding: 6px 12px; flex: 1; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: 9px;
  color: #a9c9c4; font-size: 13.5px; cursor: pointer;
  border: none; background: transparent; text-align: left; width: 100%;
  transition: background .16s, color .16s;
}
.nav-item svg { width: 18px; height: 18px; flex: none; }
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #e6f5f2; }
.nav-item.active {
  background: linear-gradient(90deg, rgba(38, 176, 160, .26), rgba(38, 176, 160, .08));
  color: #fff; font-weight: 500;
  box-shadow: inset 2px 0 0 #4fd0bf;
}
.nav-item .nav-badge {
  margin-left: auto; font-size: 10.5px; padding: 1px 7px; border-radius: 20px;
  background: rgba(79, 208, 191, .18); color: #7fe0d2;
}

.sidebar-foot { padding: 14px 16px 18px; border-top: 1px solid rgba(255, 255, 255, .07); }
.engine-pill {
  display: flex; align-items: center; gap: 7px;
  font-size: 11.5px; color: #8fb9b3;
  padding: 7px 10px; margin-bottom: 12px;
  background: rgba(255, 255, 255, .05);
  border-radius: 7px;
}
.engine-dot { width: 7px; height: 7px; border-radius: 50%; background: #94a3a1; flex: none; }
.engine-pill.ok .engine-dot { background: #4ade80; box-shadow: 0 0 0 3px rgba(74, 222, 128, .16); }
.engine-pill.bad .engine-dot { background: #f87171; box-shadow: 0 0 0 3px rgba(248, 113, 113, .16); }
.engine-pill.ok .engine-text { color: #a7e8c4; }
.engine-pill.bad .engine-text { color: #f0a9a9; }

.user-card { display: flex; align-items: center; gap: 9px; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: rgba(79, 208, 191, .2); color: #9be6da;
  font-size: 13px; font-weight: 600;
}
.user-meta { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.user-meta strong { font-size: 12.5px; color: #e8f4f1; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-meta span { font-size: 10.5px; color: #7fa8a2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-card .icon-btn { margin-left: auto; color: #8fb9b3; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 20px 30px 16px;
  background: rgba(243, 247, 246, .86);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 20;
  border-bottom: 1px solid rgba(227, 235, 233, .7);
}
.topbar-title h1 { font-size: 20px; font-weight: 700; letter-spacing: .4px; }
.topbar-title p { font-size: 12px; color: var(--muted); margin-top: 2px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.quota-chip {
  display: flex; flex-direction: column; gap: 3px;
  font-size: 11px; color: var(--muted);
  padding: 6px 12px; background: #fff; border: 1px solid var(--line);
  border-radius: 9px; min-width: 138px;
}
.quota-chip strong { font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.quota-bar { height: 4px; background: #edf2f1; border-radius: 4px; overflow: hidden; }
.quota-bar i { display: block; height: 100%; background: var(--jade-600); border-radius: 4px; transition: width .4s; }
.quota-chip.warn .quota-bar i { background: var(--amber); }

.view-root { padding: 22px 30px 46px; flex: 1; }

/* ---------------- 卡片 / 网格 ---------------- */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.card-head h2, .card-head h3 { font-size: 14.5px; font-weight: 600; letter-spacing: .3px; }
.card-head .sub { font-size: 12px; color: var(--muted); }
.head-actions { display: flex; gap: 8px; align-items: center; }
.card-body { padding: 18px 20px; }

.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-dash { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr); gap: 16px; }

.metric {
  position: relative; overflow: hidden;
  padding: 18px 20px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.metric::after {
  content: ""; position: absolute; right: -26px; top: -26px;
  width: 90px; height: 90px; border-radius: 50%;
  background: radial-gradient(circle, rgba(26, 167, 154, .1), transparent 70%);
}
.metric-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.metric-label { font-size: 12.5px; color: var(--muted); }
.metric-icon {
  width: 32px; height: 32px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  background: var(--jade-50); color: var(--jade-700);
}
.metric-icon svg { width: 17px; height: 17px; }
.metric-value { font-size: 27px; font-weight: 700; letter-spacing: -.5px; line-height: 1.15; }
.metric-value small { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 3px; }
.metric-foot { font-size: 11.5px; color: var(--muted-2); margin-top: 6px; }
.metric-foot b { color: var(--jade-700); font-weight: 600; }

.section-title { font-size: 14px; font-weight: 600; margin: 22px 0 12px; }
.muted { color: var(--muted); }
.tiny { font-size: 11.5px; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; }
.flex { display: flex; } .between { justify-content: space-between; } .center { align-items: center; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; }

/* ---------------- 趋势图 ---------------- */

.trend { display: flex; align-items: flex-end; gap: 10px; height: 168px; padding: 8px 4px 0; }
.trend-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.trend-bars { display: flex; align-items: flex-end; gap: 4px; height: 100%; width: 100%; justify-content: center; }
.trend-bar {
  width: 42%; max-width: 22px; border-radius: 4px 4px 2px 2px;
  background: linear-gradient(180deg, var(--jade-500), var(--jade-700));
  min-height: 3px; position: relative;
  transition: height .5s cubic-bezier(.2,.8,.2,1);
}
.trend-bar.boundary { background: linear-gradient(180deg, #f3c68b, #d97706); }
.trend-label { font-size: 10.5px; color: var(--muted-2); white-space: nowrap; }
.trend-legend { display: flex; gap: 16px; font-size: 11.5px; color: var(--muted); }
.legend-item { display: flex; align-items: center; gap: 6px; }
.legend-swatch { width: 9px; height: 9px; border-radius: 3px; background: var(--jade-600); }
.legend-swatch.amber { background: #d97706; }

.pattern-rank { display: flex; flex-direction: column; gap: 14px; }
.rank-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; }
.rank-name { font-size: 13px; color: var(--ink-2); }
.rank-count { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.rank-track { grid-column: 1 / -1; height: 6px; background: #eef3f2; border-radius: 6px; overflow: hidden; }
.rank-track i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--jade-600), #63c9bb); }

/* ---------------- 表格 ---------------- */

.table-wrap { overflow-x: auto; }
/* 记录较多时固定高度内部滚动，避免撑开页面布局 */
.table-scroll { max-height: 296px; overflow: auto; }
.table-scroll table.data th { position: sticky; top: 0; z-index: 1; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th {
  text-align: left; font-weight: 500; color: var(--muted);
  padding: 11px 14px; border-bottom: 1px solid var(--line);
  background: #fafcfc; white-space: nowrap; font-size: 12px;
}
table.data td { padding: 12px 14px; border-bottom: 1px solid #eef3f2; vertical-align: middle; }
table.data tbody tr { cursor: pointer; transition: background .14s; }
table.data tbody tr:hover { background: var(--jade-50); }
table.data tbody tr:last-child td { border-bottom: none; }
table.data td.nowrap, table.data th.nowrap { white-space: nowrap; }
.cell-main { font-weight: 500; color: var(--ink); }
.cell-sub { font-size: 11.5px; color: var(--muted-2); margin-top: 1px; }
.empty-cell { text-align: center; color: var(--muted-2); padding: 38px 0 !important; cursor: default; }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; padding: 2px 8px; border-radius: 20px;
  background: #f1f5f4; color: var(--muted); white-space: nowrap;
}
.badge.jade { background: var(--jade-50); color: var(--jade-700); }
.badge.green { background: var(--green-bg); color: var(--green); }
.badge.amber { background: var(--amber-bg); color: var(--amber); }
.badge.red { background: var(--red-bg); color: var(--red); }
.badge.blue { background: var(--blue-bg); color: var(--blue); }

/* ---------------- 工具栏 ---------------- */

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .spacer { flex: 1; }
.search-box { position: relative; }
.search-box svg {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  width: 15px; height: 15px; color: var(--muted-2); pointer-events: none;
}
.search-box input { padding-left: 34px; min-width: 230px; }
select.input { width: auto; min-width: 130px; padding-right: 30px; }

/* ---------------- 智能接诊 ---------------- */

.wb-grid { display: grid; grid-template-columns: minmax(360px, 430px) minmax(0, 1fr); gap: 16px; align-items: start; }
.wb-left { position: sticky; top: 92px; max-height: calc(100vh - 112px); display: flex; flex-direction: column; }
.wb-left-scroll { overflow-y: auto; padding: 18px 20px 20px; }
.wb-right { min-width: 0; }

.wb-block { margin-bottom: 20px; }
.wb-block:last-child { margin-bottom: 0; }
.wb-label {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 9px;
}
.wb-label .tiny { font-weight: 400; color: var(--muted-2); }

.segmented { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; background: #f1f6f5; padding: 4px; border-radius: 9px; }
.segmented label {
  text-align: center; font-size: 12.5px; padding: 7px 4px; border-radius: 6px;
  color: var(--muted); cursor: pointer; transition: all .16s;
}
.segmented input { display: none; }
.segmented input:checked + span { display: block; }
.segmented label:has(input:checked) { background: #fff; color: var(--jade-700); font-weight: 600; box-shadow: var(--shadow-sm); }

.symptom-toolbar { display: flex; gap: 8px; margin-bottom: 9px; }
.symptom-toolbar .search-box { flex: 1; }
.symptom-toolbar input { min-width: 0; padding: 7px 10px 7px 30px; font-size: 13px; }
.symptom-toolbar .disease-select { flex: 0 0 auto; width: 200px; padding: 7px 8px; font-size: 13px; }

.symptom-picker {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  max-height: 236px; overflow-y: auto;
  padding: 8px 10px;
  background: #fbfdfd;
}
.sym-cat { margin-bottom: 8px; }
.sym-cat-title { font-size: 11px; color: var(--muted-2); padding: 4px 2px; letter-spacing: .5px; }
.sym-list { display: flex; flex-wrap: wrap; gap: 5px; }
.sym-chip {
  border: 1px solid var(--line);
  background: #fff; color: var(--ink-2);
  font-size: 12px; padding: 3px 9px; border-radius: 20px;
  cursor: pointer; transition: all .14s;
}
.sym-chip:hover { border-color: var(--jade-500); color: var(--jade-700); }
.sym-chip.active {
  background: var(--jade-700); border-color: var(--jade-700); color: #fff;
  box-shadow: 0 3px 8px rgba(15, 118, 110, .2);
}
.sym-empty { font-size: 12px; color: var(--muted-2); text-align: center; padding: 16px 0; }

.selected-box {
  display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px;
  max-height: 94px; overflow-y: auto;
}
.selected-box:empty::before {
  content: "尚未选择症状"; font-size: 11.5px; color: var(--muted-2);
}
.sel-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px; padding: 2px 6px 2px 9px;
  border-radius: 20px; background: var(--jade-50); color: var(--jade-700);
  border: 1px solid var(--jade-100);
}
.sel-chip button { border: none; background: transparent; color: inherit; cursor: pointer; line-height: 1; padding: 0 2px; font-size: 13px; }

/* 脉象代偿问答：默认折叠入口 + 紧凑脉象标签 + 单题问答面板 */
.pulse-toggle {
  width: 100%; display: flex; align-items: center; gap: 8px;
  padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: #fbfdfd; cursor: pointer; text-align: left; color: var(--ink-2);
  transition: all .14s;
}
.pulse-toggle:hover { border-color: var(--jade-100); background: var(--jade-50); }
.pulse-toggle .pulse-title { font-size: 12.5px; font-weight: 600; color: var(--jade-700); flex: none; }
.pulse-toggle .pulse-sum { flex: 1; font-size: 11.5px; color: var(--muted-2); }
.pulse-toggle .chevron { width: 14px; height: 14px; color: var(--muted-2); transition: transform .2s; }
.pulse-toggle.open .chevron { transform: rotate(90deg); }

.pulse-body {
  margin-top: 8px; padding: 10px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fbfdfd;
}
.pulse-tip { font-size: 11.5px; color: var(--muted); line-height: 1.6; margin-bottom: 8px; }
.pulse-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.pulse-chip {
  display: inline-flex; align-items: center; gap: 4px;
  border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  font-size: 12px; padding: 3px 8px; border-radius: 20px; cursor: pointer;
  transition: all .14s;
}
.pulse-chip:hover { border-color: var(--jade-500); color: var(--jade-700); }
.pulse-chip.active { border-color: var(--jade-600); background: var(--jade-50); color: var(--jade-700); }
.pulse-chip.answered { background: var(--jade-700); border-color: var(--jade-700); color: #fff; }
.pulse-chip.answered.active { box-shadow: 0 0 0 2px var(--jade-100); }
.pulse-flag {
  font-style: normal; font-size: 9.5px; font-weight: 700; line-height: 1;
  width: 13px; height: 13px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--amber-bg); color: var(--amber);
}
.pulse-chip.answered .pulse-flag { background: rgba(255, 255, 255, .22); color: #fff; }
.pulse-ans {
  font-size: 10.5px; opacity: .85;
  max-width: 78px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* 六部脉位采集 */
.pp-wrap { margin-top: 8px; }
.pp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 9px; }
.pp-item { border: 1px solid var(--line); border-radius: 8px; padding: 8px; background: #fff; min-width: 0; }
.pp-label {
  display: flex; align-items: baseline; justify-content: space-between;
  font-size: 12px; font-weight: 600; color: var(--jade-700); margin-bottom: 5px;
}
.pp-organ { font-size: 10.5px; font-weight: 400; color: var(--muted); }
/* 覆盖 select.input 的 width:auto / min-width:130px，否则窄格内会把网格撑破 */
select.input.pp-select {
  width: 100%; min-width: 0;
  font-size: 12px; padding: 5px 22px 5px 8px; height: auto;
}
.pp-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.pp-tag {
  display: inline-flex; align-items: center; gap: 3px;
  border: 1px solid var(--jade-100); background: var(--jade-50); color: var(--jade-700);
  font-size: 11px; line-height: 1.5; padding: 1px 6px; border-radius: 999px; cursor: pointer;
}
.pp-tag i { font-style: normal; opacity: .55; font-size: 10px; }
.pp-tag:hover { border-color: var(--jade-600); }
.pp-tag:hover i { opacity: 1; }
.pp-tip { margin-top: 7px; font-size: 10.5px; color: var(--muted); line-height: 1.5; }
.fu-pulse-pos { margin-top: 10px; }

.pulse-qa { margin-top: 9px; padding-top: 9px; border-top: 1px dashed var(--line); }
.pulse-qa-head { display: flex; align-items: baseline; gap: 6px; margin-bottom: 7px; font-size: 12px; }
.pulse-qa-head b { flex: none; color: var(--jade-700); }
.pulse-qa-head span { color: var(--muted); line-height: 1.6; }
.pulse-qa-opts { display: flex; flex-direction: column; gap: 5px; }
.pulse-qa-opt {
  text-align: left; border: 1px solid var(--line); background: #fff;
  padding: 7px 10px; border-radius: 7px; font-size: 12px; cursor: pointer; color: var(--ink-2);
  transition: all .14s;
}
.pulse-qa-opt:hover { border-color: var(--jade-500); }
.pulse-qa-opt.active { background: var(--jade-50); border-color: var(--jade-600); color: var(--jade-700); font-weight: 500; }
.pulse-qa-critical {
  margin-top: 7px; padding: 6px 8px; border-radius: 7px;
  background: var(--amber-bg); border: 1px solid var(--amber-line);
  color: var(--amber); font-size: 11.5px; line-height: 1.6;
}
.pulse-qa-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }

/* 结果区：脉象补充提示 */
.pulse-hint {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 13px 15px; border-radius: var(--radius);
  background: var(--blue-bg); border: 1px solid #cbdcfb;
}
.pulse-hint-main { flex: 1; min-width: 0; }
.pulse-hint-main strong { display: block; font-size: 13px; color: #1e3a8a; margin-bottom: 3px; }
.pulse-hint-main p { font-size: 12.5px; color: #33518f; line-height: 1.7; }
.pulse-hint .chip-row { margin-bottom: 0; }
.pulse-hint-chip { font-family: inherit; cursor: pointer; }
.pulse-hint > .btn { flex: none; margin-top: 2px; }

/* 结果区：追问补充问诊 */
.followup-card { border-color: #cbdcfb; box-shadow: 0 0 0 3px rgba(59, 130, 246, .06); }
.followup-card .section-card-head h3 { display: flex; align-items: center; gap: 8px; }
.fu-round {
  font-size: 11px; font-weight: 500; color: var(--blue);
  background: var(--blue-bg); border-radius: 20px; padding: 2px 8px;
}
.fu-tip { font-size: 12px; color: var(--muted); line-height: 1.7; margin: 6px 0 10px; }
.fu-grid { display: flex; flex-wrap: wrap; gap: 7px; }
.fu-chip {
  display: inline-flex; flex-direction: column; align-items: flex-start; gap: 2px;
  border: 1px solid var(--line); background: #fff; border-radius: 8px;
  padding: 7px 11px; cursor: pointer; font-family: inherit; text-align: left;
  transition: all .14s;
}
.fu-chip:hover { border-color: var(--jade-500); background: var(--jade-50); }
.fu-chip.active { border-color: var(--jade-600); background: var(--jade-50); }
.fu-name { font-size: 12.5px; color: var(--ink-2); }
.fu-chip.active .fu-name { color: var(--jade-700); font-weight: 600; }
.fu-src { font-size: 10.5px; color: var(--muted-2); }
.fu-pulse-link { font-size: 10.5px; color: var(--blue); margin-top: 1px; }
.fu-pulse-link:hover { text-decoration: underline; }
.fu-group-head { display: flex; align-items: baseline; gap: 6px; margin-bottom: 7px; font-size: 12px; }
.fu-group-head b { color: var(--ink-2); font-weight: 600; }
.fu-group-hint { font-size: 10.5px; color: var(--muted-2); }
.fu-pulse-group {
  margin-top: 12px; padding: 10px 11px; border: 1px dashed #cbdcfb;
  border-radius: 9px; background: var(--blue-bg);
}
.fu-pulse-group .fu-tip { margin: 0 0 8px; font-size: 11.5px; }
.fu-pulse-jump {
  margin-top: 8px; padding: 0; border: none; background: none; cursor: pointer;
  font-family: inherit; font-size: 11px; color: var(--blue);
}
.fu-pulse-jump:hover { text-decoration: underline; }
.fu-actions { display: flex; gap: 9px; margin-top: 12px; }

.advanced { border-top: 1px dashed var(--line); padding-top: 12px; }
.advanced summary { cursor: pointer; font-size: 12.5px; color: var(--muted); list-style: none; display: flex; align-items: center; gap: 6px; }
.advanced summary::-webkit-details-marker { display: none; }
.advanced summary::before { content: "+"; font-weight: 600; color: var(--jade-600); }
.advanced[open] summary::before { content: "−"; }
.adv-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-top: 10px; }
.adv-grid .field { margin-bottom: 0; }
.adv-grid .field input { padding: 7px 9px; font-size: 12.5px; }
.adv-grid .field > span { font-size: 11px; }

.wb-actions { display: flex; gap: 9px; margin-top: 18px; }
.wb-actions .btn-primary { flex: 1; }

/* ---------------- 结果区 ---------------- */

.result-panel { display: flex; flex-direction: column; gap: 16px; }
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 72px 30px;
  color: var(--muted-2);
}
.empty-icon {
  width: 64px; height: 64px; border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  background: var(--jade-50); color: var(--jade-600); margin-bottom: 18px;
}
.empty-icon svg { width: 30px; height: 30px; }
.empty-state h3 { font-size: 15px; color: var(--ink-2); margin-bottom: 6px; font-weight: 600; }
.empty-state p { font-size: 12.5px; max-width: 340px; line-height: 1.8; }

.loading-card { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 64px 20px; }
.spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid var(--jade-100); border-top-color: var(--jade-600);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-card p { font-size: 13px; color: var(--muted); }
.loading-steps { font-size: 11.5px; color: var(--muted-2); display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 4px 6px; }
.loading-steps .lstep { transition: color .3s, font-weight .3s; }
.loading-steps .lstep.active { color: var(--jade-700); font-weight: 600; }
.loading-steps .lstep.done { color: var(--jade-500); }
.loading-steps .lstep-sep { color: var(--line-strong); }

/* 治法详解（证型卡片内，治则下方） */
.tp-explain {
  margin: 6px 0 2px;
  padding: 8px 12px;
  background: var(--jade-50);
  border-left: 3px solid var(--jade-500);
  border-radius: 0 6px 6px 0;
  font-size: 12px;
  line-height: 1.8;
  color: var(--ink-2);
  white-space: pre-line;
}

/* 证素推理依据（折叠区内容） */
.elem-reasoning .er-h { font-size: 13px; font-weight: 600; color: var(--ink); margin: 10px 0 4px; }
.elem-reasoning .er-h:first-child { margin-top: 0; }
.elem-reasoning .er-p { font-size: 12.5px; color: var(--ink-2); line-height: 1.8; margin: 2px 0; }
.elem-reasoning .er-ul { margin: 2px 0 8px; padding-left: 20px; font-size: 12.5px; color: var(--ink-2); line-height: 1.8; }
.elem-reasoning .er-ul li { margin: 1px 0; }

.result-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  flex-wrap: wrap;
}
.result-title h2 { font-size: 17px; font-weight: 700; }
.result-title p { font-size: 12px; color: var(--muted); margin-top: 3px; }
.result-meta { display: flex; gap: 6px; flex-wrap: wrap; }

.alert {
  display: flex; gap: 12px;
  padding: 14px 16px; border-radius: var(--radius);
  border: 1px solid var(--line); background: #fff; font-size: 13px;
}
.alert-icon { flex: none; width: 20px; height: 20px; }
.alert-icon svg { width: 20px; height: 20px; }
.alert-body { min-width: 0; }
.alert-body strong { display: block; font-size: 13.5px; margin-bottom: 4px; }
.alert-body p { font-size: 12.5px; line-height: 1.75; white-space: pre-wrap; }
.alert.amber { background: var(--amber-bg); border-color: var(--amber-line); color: #7c3a06; }
.alert.amber .alert-icon { color: var(--amber); }
.alert.green { background: var(--green-bg); border-color: #bfe6cb; color: #14532d; }
.alert.green .alert-icon { color: var(--green); }
.alert.blue { background: var(--blue-bg); border-color: #cbdcfb; color: #1e3a8a; }
.alert.blue .alert-icon { color: var(--blue); }

.pattern-card {
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.pattern-card.top { border-color: var(--jade-100); box-shadow: 0 8px 28px rgba(15, 118, 110, .08); }
.pattern-head { display: flex; align-items: flex-start; gap: 12px; padding: 16px 18px 12px; }
.rank-badge {
  width: 26px; height: 26px; flex: none; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  background: #f1f5f4; color: var(--muted);
}
.pattern-card.top .rank-badge { background: var(--jade-700); color: #fff; }
.pattern-title { flex: 1; min-width: 0; }
.pattern-title h3 { font-size: 16px; font-weight: 700; letter-spacing: .3px; }
.pattern-title .p-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 5px; font-size: 11.5px; color: var(--muted-2); }
.conf-box { text-align: right; flex: none; }
.conf-box strong { font-size: 22px; font-weight: 700; color: var(--jade-700); font-variant-numeric: tabular-nums; line-height: 1.1; }
.conf-box span { display: block; font-size: 10.5px; color: var(--muted-2); }
.conf-track { height: 5px; background: #edf3f2; margin: 0 18px 14px; border-radius: 5px; overflow: hidden; }
.conf-track i { display: block; height: 100%; border-radius: 5px; background: linear-gradient(90deg, var(--jade-600), #63c9bb); }
.conf-track.low i { background: linear-gradient(90deg, #d97706, #f0b35e); }
.conf-box.doctor strong { font-size: 15px; color: var(--blue); }
.conf-box.doctor span { color: var(--blue); }

/* 医生自主调整证型面板 */
.adjust-toggle { flex: none; align-self: center; }
.adjust-panel {
  margin: 0 18px 14px; padding: 12px 14px;
  border: 1px dashed var(--jade-500); border-radius: var(--radius-sm);
  background: var(--jade-50);
}
.adjust-row { margin-bottom: 10px; }
.adjust-q {
  width: 100%; padding: 7px 10px; font-size: 12.5px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
  outline: none; box-sizing: border-box;
}
.adjust-q:focus { border-color: var(--jade-500); }
.adjust-results { margin-top: 8px; }
.adjust-chip { cursor: pointer; }
.adjust-chip:hover { border-color: var(--jade-500); color: var(--jade-700); }
.adjust-chip.active { background: var(--jade-700); border-color: var(--jade-700); color: #fff; }
.adjust-chip.orig { border-style: dashed; border-color: var(--blue); color: var(--blue); }
.adjust-chip.orig:hover { border-color: var(--blue); color: var(--blue); }
.adjust-chip.orig.active { background: var(--blue); border-color: var(--blue); color: #fff; }
.adjust-actions { display: flex; align-items: center; gap: 8px; }
.adjust-actions .spacer { flex: 1; }

.pattern-body { padding: 0 18px 16px; }
.p-def { font-size: 12.5px; color: var(--ink-2); line-height: 1.75; margin-bottom: 12px; }
.kv-line { display: flex; gap: 10px; font-size: 13px; margin-bottom: 10px; }
.kv-line .k { color: var(--muted); flex: none; width: 46px; font-size: 12.5px; }
.kv-line .v { color: var(--ink); font-weight: 500; }

.chip-row { display: flex; flex-wrap: wrap; gap: 5px; margin: 6px 0 10px; }
.chip-label { font-size: 11.5px; color: var(--muted-2); margin-bottom: 3px; }
.chip {
  font-size: 11.5px; padding: 2px 8px; border-radius: 20px;
  background: #f3f7f6; color: var(--ink-2); border: 1px solid transparent;
}
.chip.hit { background: var(--jade-50); color: var(--jade-700); border-color: var(--jade-100); }
.chip.miss { background: #fdf6ec; color: #a16207; border-color: #f5e3c3; }
.chip.plain { background: #f6f8f8; color: var(--muted); }

.treatment-box {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px 14px; background: #fbfdfd; margin-top: 12px;
}
.treatment-title { font-size: 12px; color: var(--muted); margin-bottom: 7px; font-weight: 600; letter-spacing: .4px; }
.formula-line { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.formula-line b { font-size: 15px; color: var(--jade-800); }
.formula-src { font-size: 11px; color: var(--muted-2); }

/* 中成药紧凑标签流：不逐行展示，悬停可见组成，点击进中成药库 */
.patent-list { display: flex; flex-wrap: wrap; gap: 6px; }
.patent-chip {
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink-2);
  font-family: inherit;
  font-size: 12.5px;
  padding: 3px 11px;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.patent-chip:hover { border-color: var(--jade-500); color: var(--jade-700); background: var(--jade-50); }
.herb-list { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
/* 兼证加减：药名 + 兼证标签 + 药性说明 */
.mod-list { display: flex; flex-direction: column; gap: 7px; margin-top: 6px; }
.mod-item { display: flex; flex-direction: column; gap: 3px; }
.mod-head { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.mod-tag { font-size: 10px; padding: 1px 7px; }
.mod-info { line-height: 1.55; }
.herb {
  font-size: 11.5px; padding: 2px 8px; border-radius: 6px;
  background: #fff; border: 1px solid var(--line); color: var(--ink-2);
}
.herb.jun { border-color: #e8b4b4; color: #a12b2b; background: #fdf5f5; }
.herb.chen { border-color: #ecc9a2; color: #a1580b; background: #fdf9f3; }
.herb.zuo { border-color: #b9dcc4; color: #1f6b3a; background: #f5fbf7; }
.herb.shi { border-color: #cdbfe8; color: #5b3f96; background: #f9f6fd; }
/* 配伍安全预警 */
.herb.herb-warn { border-color: var(--amber-line); background: var(--amber-bg); }
.herb-warn-tag { display: block; font-size: 10px; color: var(--amber); margin-top: 2px; font-weight: 600; }
.formula-warns { display: flex; flex-direction: column; gap: 5px; margin-bottom: 8px; }
.formula-warn { font-size: 12px; padding: 6px 10px; border-radius: 7px; line-height: 1.5; }
.formula-warn.danger { background: var(--red-bg); color: var(--red); border: 1px solid var(--red-line); }
.formula-warn.caution { background: var(--amber-bg); color: var(--amber); border: 1px solid var(--amber-line); }
/* 换处方切换 */
.formula-switch { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 9px; }
.formula-switch-btn {
  font-family: inherit; font-size: 12px; padding: 4px 11px; border-radius: 7px;
  border: 1px solid var(--line-strong); background: #fff; color: var(--ink-2); cursor: pointer;
}
.formula-switch-btn:hover { border-color: var(--jade-500); color: var(--jade-700); }
.formula-switch-btn.on { background: var(--jade-50); border-color: var(--jade-500); color: var(--jade-800); font-weight: 600; }
/* 智能拟方（规则配伍）标签：区别于经方，用琥珀色标识 */
.formula-switch-btn.smart { border-color: var(--amber-line); color: var(--amber); }
.formula-switch-btn.smart.on { background: var(--amber-bg); border-color: var(--amber); color: var(--amber); font-weight: 600; }
/* 参考医案 */
.case-ref { padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; margin-bottom: 6px; background: #fff; }
.case-ref:last-child { margin-bottom: 0; }
.case-ref-head { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 3px; flex-wrap: wrap; }
.case-ref-head b { font-size: 13px; color: var(--jade-800); }
.case-ref-src { font-size: 11px; color: var(--muted-2); }
.case-ref-body { display: flex; flex-direction: column; gap: 2px; }

/* ---------------- 智能拟方：配伍加减 ---------------- */

.rx-box { background: #fbfdfd; }
.rx-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 10px; flex-wrap: wrap; margin-bottom: 8px;
}
.rx-head .treatment-title { margin-bottom: 0; }
.rx-count { margin-left: 8px; font-size: 11.5px; font-weight: 400; color: var(--muted-2); }
.rx-tools { display: flex; gap: 6px; }
.rx-tool {
  font-family: inherit; font-size: 12px; padding: 5px 11px; border-radius: 7px;
  border: 1px solid var(--line-strong); background: #fff; color: var(--ink-2);
  cursor: pointer; white-space: nowrap;
  transition: background .18s, border-color .18s, color .18s;
}
.rx-tool:hover { border-color: var(--jade-500); color: var(--jade-700); background: var(--jade-50); }
.rx-tool.primary { background: var(--jade-700); border-color: var(--jade-700); color: #fff; }
.rx-tool.primary:hover { background: var(--jade-600); border-color: var(--jade-600); color: #fff; }
.rx-note { margin: 0 0 10px; font-size: 12px; color: var(--muted); line-height: 1.7; }
.rx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.rx-herb {
  position: relative; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; padding: 8px 9px 9px; transition: opacity .18s, border-color .18s, background .18s;
}
.rx-herb.jun { border-color: #e8b4b4; background: #fdf5f5; }
.rx-herb.chen { border-color: #ecc9a2; background: #fdf9f3; }
.rx-herb.zuo { border-color: #b9dcc4; background: #f5fbf7; }
.rx-herb.shi { border-color: #cdbfe8; background: #f9f6fd; }
.rx-herb.removed { opacity: .42; }
.rx-herb.removed .rx-role,
.rx-herb.removed .rx-name { text-decoration: line-through; }
.rx-herb.added { border-style: dashed; border-color: #2e7d32; background: #f5fbf7; }
.rx-herb.dose-danger { border-color: #d32f2f; border-width: 1.5px; background: #fff5f5; box-shadow: 0 0 0 2px rgba(211,47,47,.12); }
.rx-herb.dose-danger .rx-dosage { color: #d32f2f; font-weight: 600; }
.rx-herb.dose-caution { border-color: #ed8936; background: #fffaf0; }
.rx-herb.dose-caution .rx-dosage { color: #c05621; font-weight: 600; }
.rx-ops {
  position: absolute; top: 4px; right: 4px; display: flex; gap: 2px;
  opacity: .5; transition: opacity .15s;
}
.rx-herb:hover .rx-ops, .rx-herb.removed .rx-ops { opacity: 1; }
.rx-op {
  width: 21px; height: 21px; padding: 0; display: inline-flex;
  align-items: center; justify-content: center;
  font-family: inherit; font-size: 11px; line-height: 1;
  border: 1px solid var(--line); border-radius: 5px;
  background: #fff; color: var(--muted); cursor: pointer;
}
.rx-op:hover { color: var(--jade-700); border-color: var(--jade-500); }
.rx-op.del:hover { color: var(--red); border-color: var(--red-line); background: var(--red-bg); }
.rx-role { padding-right: 48px; font-size: 10.5px; color: var(--muted-2); letter-spacing: .3px; }
.rx-name {
  display: flex; align-items: baseline; gap: 5px; flex-wrap: wrap;
  margin-top: 2px; font-size: 13px; font-weight: 600; color: var(--ink);
}
.rx-dosage {
  font-size: 12px; font-weight: 500; color: var(--jade-700);
  border-bottom: 1px dashed var(--jade-100); cursor: text;
}
.rx-dosage:hover { border-bottom-color: var(--jade-500); background: var(--jade-50); }
.rx-dosage-input {
  width: 58px; padding: 1px 4px; font-family: inherit; font-size: 12px;
  border: 1px solid var(--jade-500); border-radius: 4px; outline: none; color: var(--ink);
}
.rx-special { margin-top: 4px; font-size: 10.5px; color: var(--amber); }
.rx-special.danger { color: #d32f2f; font-weight: 600; }
.rx-special.caution { color: #c05621; }
.rx-reason { margin-top: 4px; font-size: 11px; color: var(--muted); line-height: 1.55; }
.rx-tag {
  display: inline-block; margin-top: 5px; padding: 1px 6px;
  font-size: 10px; border-radius: 10px;
  color: var(--green); background: var(--green-bg); border: 1px solid #b9dcc4;
}
.rx-tag.off { color: var(--muted-2); background: #f6f8f8; border-color: var(--line); }
.rx-add {
  display: grid; grid-template-columns: 1.3fr .9fr .8fr 1fr auto;
  gap: 6px; align-items: end;
  margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line);
}
.rx-field { display: flex; flex-direction: column; gap: 3px; font-size: 10.5px; color: var(--muted-2); }
.rx-field input, .rx-field select {
  font-family: inherit; font-size: 12px; padding: 6px 8px;
  border: 1px solid var(--line-strong); border-radius: 7px;
  background: #fff; color: var(--ink); outline: none;
}
.rx-field input:focus, .rx-field select:focus {
  border-color: var(--jade-500); box-shadow: 0 0 0 3px rgba(26, 167, 154, .1);
}
.rx-add-btn {
  font-family: inherit; font-size: 12px; padding: 7px 12px; border-radius: 7px;
  border: 1px dashed var(--jade-500); background: var(--jade-50); color: var(--jade-700);
  cursor: pointer; white-space: nowrap;
}
.rx-add-btn:hover { background: var(--jade-100); }

/* 中药功效展示 + 药名自动补全 */
.rx-func { margin-top: 4px; font-size: 11px; color: var(--jade-700); line-height: 1.5; }
.rx-auto { position: relative; }
.rx-auto > input { width: 100%; }
.rx-suggest {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 30;
  max-height: 220px; overflow-y: auto;
  background: #fff; border: 1px solid var(--line-strong); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .12); margin-top: 3px;
}
.rx-suggest-item {
  display: flex; flex-direction: column; gap: 2px; align-items: flex-start;
  width: 100%; padding: 7px 10px; text-align: left;
  border: none; border-bottom: 1px solid var(--line);
  background: #fff; cursor: pointer; font-family: inherit;
}
.rx-suggest-item:last-child { border-bottom: none; }
.rx-suggest-item:hover { background: var(--jade-50); }
.rs-name { font-size: 13px; font-weight: 600; color: var(--ink); }
.rs-func { font-size: 11px; color: var(--muted); line-height: 1.4; }
.rs-dose { font-size: 11px; color: var(--jade-700); }
.rs-empty { padding: 8px 10px; font-size: 12px; color: var(--muted-2); }
.herb.clickable { cursor: pointer; transition: border-color .15s, background .15s, color .15s; }
.herb.clickable:hover { border-color: var(--jade-500); background: var(--jade-50); color: var(--jade-700); }
.rx-diff {
  display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px;
  padding-top: 8px; border-top: 1px dashed var(--line);
}
.rx-diff::before { content: "调整："; align-self: center; font-size: 10.5px; color: var(--muted-2); }
.rx-diff-item { padding: 1px 7px; font-size: 10.5px; border-radius: 10px; border: 1px solid transparent; }
.rx-diff-item.del { color: var(--red); background: var(--red-bg); border-color: var(--red-line); }
.rx-diff-item.add { color: var(--green); background: var(--green-bg); border-color: #b9dcc4; }
.rx-diff-item.mod { color: var(--amber); background: var(--amber-bg); border-color: var(--amber-line); }

/* 煎服法与医嘱 */
.rx-decoction {
  margin-top: 10px; padding: 10px 12px;
  background: #f7fbf9; border: 1px solid var(--jade-100);
  border-radius: var(--radius-sm);
}
.rx-dec-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 600; color: var(--jade-700); margin-bottom: 6px;
}
.rx-dec-cat {
  font-size: 10px; font-weight: 500; padding: 0 7px; line-height: 16px;
  border-radius: 10px; background: var(--jade-50); color: var(--jade-700);
  border: 1px solid var(--jade-100);
}
.rx-dec-row { display: flex; gap: 8px; font-size: 12px; line-height: 1.6; padding: 1px 0; }
.rx-dec-row .k { flex: 0 0 96px; color: var(--muted); }
.rx-dec-row .v { flex: 1; color: var(--ink-2); }

/* 适宜技术（非药物疗法） */
.technique-box { background: #fcfdfd; }
.tech-hint { font-size: 10.5px; font-weight: 400; color: var(--muted-2); margin-left: 8px; }
.tech-grid { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.tech-chip {
  display: inline-flex; align-items: center; gap: 6px;
  flex: none; white-space: nowrap;
  font-family: inherit; font-size: 12.5px; padding: 4px 11px;
  border-radius: 999px; border: 1px solid var(--line-strong);
  background: #fff; color: var(--ink-2); cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}
.tech-chip:hover { border-color: var(--jade-500); color: var(--jade-700); background: var(--jade-50); }
.tech-chip.hot { border-color: var(--jade-100); background: var(--jade-50); color: var(--jade-700); }
.tech-chip.on {
  border-color: var(--jade-600); background: var(--jade-50); color: var(--jade-800);
  font-weight: 600; box-shadow: inset 0 0 0 1px var(--jade-500);
}
.tech-chip.on .tech-cat { color: var(--jade-700); border-color: var(--jade-100); background: #fff; }
.tech-chip.on .tech-check { color: var(--jade-600); }
.tech-chip.off {
  cursor: not-allowed; opacity: .55; color: var(--muted-2);
  background: #f6f7f7; border-style: dashed;
}
.tech-check { font-weight: 700; }
.tech-cat {
  font-size: 10px; padding: 0 6px; line-height: 15px; border-radius: 8px;
  color: var(--muted); background: rgba(0,0,0,.03); border: 1px solid var(--line);
}
.tech-picked { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.tech-detail {
  padding: 8px 10px; border-radius: var(--radius-sm);
  background: #fff; border: 1px solid var(--line);
}
.tech-detail-head { display: flex; align-items: center; gap: 7px; font-size: 12.5px; margin-bottom: 3px; }
.tech-detail-head b { color: var(--jade-800); }
.tech-target {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px;
  margin: 5px 0; padding: 5px 8px; border-radius: var(--radius-sm);
  background: var(--jade-50); border: 1px solid var(--jade-100);
}
.tech-target .tt-label {
  flex: none; font-size: 10.5px; padding: 0 6px; line-height: 16px;
  border-radius: 8px; background: #fff; border: 1px solid var(--jade-100);
  color: var(--jade-700);
}
.tech-target .tt-val { font-size: 12px; color: var(--jade-800); line-height: 1.6; }
.tech-target .tt-list { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.tech-target .tt-point { font-size: 12px; color: var(--jade-800); }
.tech-target .tt-point em {
  font-style: normal; font-size: 10.5px; color: var(--muted);
  margin-left: 4px;
}
.tech-disclaimer { margin-top: 6px; }
.confirm-tech {
  padding: 7px 10px; border-radius: var(--radius-sm);
  background: var(--jade-50); border: 1px solid var(--jade-100);
  font-size: 12.5px; color: var(--jade-800); line-height: 1.6;
  white-space: pre-wrap;
}

@media (max-width: 560px) {
  .rx-grid { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); }
  .rx-add { grid-template-columns: 1fr 1fr; }
  .rx-add-btn { grid-column: 1 / -1; }
}

details.more { margin-top: 12px; border-top: 1px dashed var(--line); padding-top: 10px; }
details.more summary {
  cursor: pointer; font-size: 12px; color: var(--muted); list-style: none;
  display: flex; align-items: center; gap: 6px;
}
details.more summary::-webkit-details-marker { display: none; }
details.more summary::before { content: "+"; font-weight: 600; color: var(--jade-600); }
details.more[open] summary::before { content: "−"; }
.more-body { padding-top: 10px; font-size: 12.5px; color: var(--ink-2); line-height: 1.8; }
.source-item {
  display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px dashed #eef3f2;
  font-size: 12px;
}
.source-item:last-child { border-bottom: none; }
.source-type {
  flex: none; font-size: 10.5px; padding: 1px 7px; border-radius: 4px;
  background: var(--jade-50); color: var(--jade-700); height: fit-content;
}
.source-text { color: var(--muted); line-height: 1.65; }
.source-text b { color: var(--ink-2); font-weight: 500; }

.section-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.section-card-head { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.section-card-head h3 { font-size: 13.5px; font-weight: 600; }
.section-card-body { padding: 16px 18px; }

.confirm-card { border: 1px solid var(--jade-100); background: linear-gradient(180deg, #f7fdfc, #fff); }
.confirm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.confirm-grid .full { grid-column: 1 / -1; }
.confirm-card .field { margin-bottom: 0; }
.confirm-card textarea { min-height: 66px; }

.standard-symptoms { display: flex; flex-wrap: wrap; gap: 5px; }
.advice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.advice-item { background: #fbfdfd; border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; font-size: 12px; }
.advice-item strong { display: block; font-size: 12.5px; margin-bottom: 3px; }
.advice-item span { color: var(--muted); }

/* ---------------- 弹层 ---------------- */

.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(8, 30, 28, .46);
  backdrop-filter: blur(2px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 6vh 20px 40px;
  overflow-y: auto;
  animation: fadeIn .16s ease;
}
@keyframes fadeIn { from { opacity: 0; } }
.modal {
  background: #fff; border-radius: 18px;
  width: 100%; max-width: 620px;
  box-shadow: var(--shadow-lg);
  animation: rise .2s ease;
  overflow: hidden;
}
.modal.wide { max-width: 920px; }
@keyframes rise { from { transform: translateY(10px); opacity: .6; } }
.modal-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
  padding: 20px 24px 14px; border-bottom: 1px solid var(--line);
}
.modal-head h2 { font-size: 17px; font-weight: 700; }
.modal-head p { font-size: 12px; color: var(--muted); margin-top: 3px; }
.modal-body { padding: 20px 24px; max-height: 68vh; overflow-y: auto; }
.modal-foot {
  padding: 14px 24px; border-top: 1px solid var(--line);
  display: flex; justify-content: flex-end; gap: 9px; background: #fbfdfd;
}
.modal-close {
  border: none; background: #f1f5f4; color: var(--muted); cursor: pointer;
  width: 30px; height: 30px; border-radius: 8px; flex: none;
  display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: #e6eeec; color: var(--ink); }
.modal-close svg { width: 16px; height: 16px; }

.detail-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
.detail-meta.four { grid-template-columns: repeat(4, 1fr); }
.meta-item { background: #fbfdfd; border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px; }
.meta-item span { display: block; font-size: 10.5px; color: var(--muted-2); }
.meta-item strong { font-size: 13px; font-weight: 500; }

/* ---- 病历详情：推理留痕 ---- */
.detail-stack { display: flex; flex-direction: column; gap: 12px; }
.detail-h3 {
  font-size: 13px; font-weight: 600; color: var(--ink);
  padding-left: 9px; border-left: 3px solid var(--jade-600);
  margin: 6px 0 0;
}

.qa-line { display: flex; gap: 10px; font-size: 12.5px; padding: 6px 0; border-bottom: 1px dashed #eef3f2; line-height: 1.6; }
.qa-line:last-child { border-bottom: none; }
.qa-line .k { flex: none; width: 64px; color: var(--muted); }
.qa-line .v { color: var(--ink-2); }

.round-timeline { position: relative; padding-left: 18px; }
.round-timeline::before {
  content: ""; position: absolute; left: 5px; top: 6px; bottom: 6px;
  width: 2px; background: linear-gradient(180deg, var(--jade-100), #eef3f2);
}
.round-item { position: relative; padding: 2px 0 16px; }
.round-item:last-child { padding-bottom: 0; }
.round-item::before {
  content: ""; position: absolute; left: -18px; top: 6px;
  width: 9px; height: 9px; border-radius: 50%;
  background: #fff; border: 2px solid var(--jade-600);
}
.round-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.round-head b { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.round-time { font-size: 11px; color: var(--muted-2); margin-left: auto; }
.round-delta {
  font-size: 11px; padding: 1px 6px; border-radius: 4px;
  background: var(--jade-50); color: var(--jade-700);
}
.round-delta.down { background: #fdf6ec; color: #a16207; }
.round-sub { font-size: 11.5px; color: var(--muted-2); margin-top: 3px; }
.round-diff { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.round-top { font-size: 12.5px; color: var(--ink-2); margin-top: 6px; line-height: 1.7; }

.element-row { padding: 7px 0; border-bottom: 1px dashed #eef3f2; }
.element-row:last-child { border-bottom: none; }
.element-head { display: flex; align-items: center; gap: 10px; }
.element-name { flex: none; min-width: 108px; font-size: 12.5px; color: var(--ink-2); }
.element-name b { font-weight: 500; }
.element-name em { font-style: normal; font-size: 10px; color: var(--muted-2); margin-left: 5px; }
.element-bar { flex: 1; height: 6px; background: #edf3f2; border-radius: 6px; overflow: hidden; }
.element-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--jade-600), #63c9bb); border-radius: 6px; }
.element-val { flex: none; width: 38px; text-align: right; font-size: 11.5px; color: var(--muted); }
.element-hit { font-size: 11.5px; color: var(--muted-2); margin-top: 3px; line-height: 1.6; }

.patient-history { display: flex; flex-direction: column; gap: 8px; }
.history-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px;
  cursor: pointer; transition: background .14s;
}
.history-row:hover { background: var(--jade-50); }
.history-row .h-date { font-size: 11.5px; color: var(--muted-2); flex: none; width: 92px; }
.history-row .h-main { flex: 1; min-width: 0; }
.history-row .h-main strong { display: block; font-size: 12.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-row .h-main span { font-size: 11px; color: var(--muted-2); }

/* ---------------- Toast ---------------- */

.toast-root {
  position: fixed; right: 22px; bottom: 22px; z-index: 200;
  display: flex; flex-direction: column; gap: 10px; align-items: flex-end;
}
.toast {
  background: #fff; border: 1px solid var(--line);
  border-left: 3px solid var(--jade-600);
  border-radius: 10px; box-shadow: var(--shadow);
  padding: 11px 16px; font-size: 13px; color: var(--ink-2);
  max-width: 360px; animation: toastIn .22s ease;
}
.toast.error { border-left-color: var(--red); }
.toast.warn { border-left-color: #ed8936; }
.toast.success { border-left-color: var(--green); }
@keyframes toastIn { from { transform: translateX(14px); opacity: 0; } }

/* ---------------- 患者 / 设置页 ---------------- */

.patient-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 16px; align-items: start; }
.info-list { display: flex; flex-direction: column; gap: 10px; }
.info-row { display: flex; gap: 10px; font-size: 12.5px; }
.info-row .k { color: var(--muted-2); width: 72px; flex: none; }
.info-row .v { color: var(--ink-2); flex: 1; word-break: break-word; }

.settings-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.settings-grid .span-2 { grid-column: 1 / -1; }

.audit-detail {
  font-size: 11px; color: var(--muted-2);
  max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.quota-panel { display: flex; flex-direction: column; gap: 12px; }
.quota-big { display: flex; align-items: baseline; gap: 8px; }
.quota-big strong { font-size: 32px; font-weight: 700; letter-spacing: -1px; }
.quota-big span { color: var(--muted); font-size: 12.5px; }
.progress { height: 8px; background: #edf3f2; border-radius: 8px; overflow: hidden; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--jade-600), #63c9bb); border-radius: 8px; transition: width .4s; }
.progress.warn i { background: linear-gradient(90deg, #d97706, #f2b45f); }

.engine-status { display: flex; align-items: center; gap: 12px; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: #94a3b8; flex: none; }
.status-dot.ok { background: #22c55e; box-shadow: 0 0 0 4px rgba(34, 197, 94, .14); }
.status-dot.bad { background: #ef4444; box-shadow: 0 0 0 4px rgba(239, 68, 68, .14); }

/* ---------------- 打印 ---------------- */

.print-root { display: none; }

@media print {
  body { background: #fff; }
  body > *:not(.print-root) { display: none !important; }
  .print-root { display: block !important; padding: 0; font-size: 12pt; color: #000; }
  .print-doc { max-width: 100%; }
  .print-head { text-align: center; border-bottom: 2px solid #0f766e; padding-bottom: 12px; margin-bottom: 16px; }
  .print-head h1 { font-size: 20pt; letter-spacing: 4px; margin: 0 0 4px; }
  .print-head p { font-size: 9pt; color: #555; margin: 0; }
  .print-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 24px; font-size: 10.5pt; margin-bottom: 14px; }
  .print-section { margin-bottom: 14px; }
  .print-section h2 { font-size: 12pt; border-left: 4px solid #0f766e; padding-left: 8px; margin: 0 0 8px; }
  .print-section p { margin: 4px 0; line-height: 1.8; }
  .print-pattern { border: 1px solid #999; border-radius: 4px; padding: 10px 12px; margin-bottom: 10px; page-break-inside: avoid; }
  .print-round { margin-bottom: 10px; page-break-inside: avoid; }
  .print-round .pm { font-size: 10pt; color: #333; margin: 2px 0; }
  .print-pattern h3 { font-size: 12pt; margin: 0 0 4px; }
  .print-pattern .pm { font-size: 10pt; color: #333; margin: 2px 0; }
  .print-foot { border-top: 1px solid #999; margin-top: 24px; padding-top: 8px; font-size: 9pt; color: #555; display: flex; justify-content: space-between; }
}

/* ---------------- 响应式 ---------------- */

@media (max-width: 1180px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-dash { grid-template-columns: 1fr; }
  .wb-grid { grid-template-columns: minmax(330px, 390px) minmax(0, 1fr); }
  .settings-grid { grid-template-columns: 1fr; }
  .patient-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .auth-screen { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .auth-panel { min-height: 100vh; }

  .app-shell { flex-direction: column; }
  .sidebar {
    width: 100%; height: auto; position: static;
    flex-direction: row; align-items: center; gap: 8px;
    padding: 8px 12px;
  }
  .brand { padding: 6px 8px; }
  .brand-text span { display: none; }
  .brand-mark { width: 32px; height: 32px; font-size: 17px; border-radius: 9px; }
  .nav { flex-direction: row; padding: 0; overflow-x: auto; gap: 2px; }
  .nav-item { width: auto; white-space: nowrap; padding: 8px 12px; }
  .nav-item svg { width: 16px; height: 16px; }
  .nav-item .nav-label { display: none; }
  .nav-item.active .nav-label { display: inline; }
  .sidebar-foot { display: none; }
  .topbar { padding: 14px 16px; }
  .topbar-title p { display: none; }
  .quota-chip { display: none; }
  .view-root { padding: 16px 14px 40px; }
  .wb-grid { grid-template-columns: 1fr; }
  .wb-left { position: static; max-height: none; }
  .wb-left-scroll { overflow: visible; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .detail-meta { grid-template-columns: 1fr 1fr; }
  .confirm-grid { grid-template-columns: 1fr; }
  .adv-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
  .grid-4 { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .topbar-right .btn span { display: none; }
  .auth-card { padding: 24px 20px; }
  .modal-body { padding: 16px; }
  .modal-head, .modal-foot { padding-left: 16px; padding-right: 16px; }
  .toolbar .search-box input { min-width: 0; width: 100%; }
  .toolbar .search-box { flex: 1; }
}

/* ---------------- 知识库 ---------------- */

.kb-wrap { display: flex; flex-direction: column; gap: 16px; }

.kb-tabs {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.kb-tab {
  border: 1px solid var(--line);
  background: #fff; color: var(--ink-2);
  font-size: 13.5px; font-weight: 500;
  padding: 9px 16px; border-radius: 20px; cursor: pointer;
  transition: background .18s, border-color .18s, color .18s;
}
.kb-tab:hover { border-color: var(--jade-500); color: var(--jade-700); }
.kb-tab.active {
  background: linear-gradient(180deg, var(--jade-600), var(--jade-700));
  border-color: var(--jade-700); color: #fff;
  box-shadow: 0 4px 12px rgba(15, 118, 110, .2);
}

.kb-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.kb-search {
  display: flex; align-items: center; gap: 8px;
  flex: 1; min-width: 260px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: #fff; padding: 10px 14px;
}
.kb-search svg { width: 17px; height: 17px; color: var(--muted-2); flex: none; }
.kb-search input {
  flex: 1; border: none; outline: none; background: transparent;
  font-size: 14px; color: var(--ink); font-family: inherit;
}
.kb-search input::placeholder { color: var(--muted-2); }

.kb-subs { display: flex; gap: 6px; }
.kb-sub {
  border: 1px solid var(--line-strong); background: #fff; color: var(--muted);
  font-size: 12.5px; padding: 7px 14px; border-radius: var(--radius-sm); cursor: pointer;
  transition: background .18s, color .18s, border-color .18s;
}
.kb-sub:hover { border-color: var(--jade-500); color: var(--jade-700); }
.kb-sub.active { background: var(--jade-50); border-color: var(--jade-500); color: var(--jade-700); font-weight: 600; }

.kb-meta { font-size: 12px; color: var(--muted); }

.kb-results { display: flex; flex-direction: column; gap: 10px; }

.kb-card {
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.kb-card-head {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 14px 18px; border: none; background: none;
  cursor: pointer; text-align: left; font-family: inherit;
  transition: background .15s;
}
.kb-card-head:hover { background: var(--jade-50); }
.kb-card-title { font-size: 15px; font-weight: 600; color: var(--ink); flex: none; }
.kb-card-badge {
  flex: none; font-size: 11px; line-height: 1; padding: 3px 7px; border-radius: 10px;
  color: var(--muted); background: var(--jade-50); border: 1px solid var(--line);
}
.kb-card-sum {
  flex: 1; min-width: 0; font-size: 12.5px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.kb-card-arrow { flex: none; color: var(--muted-2); font-size: 12px; transition: transform .18s; }

.kb-card-body { padding: 4px 18px 16px; border-top: 1px dashed var(--line); margin-top: 4px; }
.kb-img-box {
  margin: 12px 0 6px; text-align: center;
}
.kb-img-box .kb-img {
  max-width: 100%; max-height: 360px;
  border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,.08);
  background: var(--jade-50);
}
.kb-img-box .kb-img-missing { display: none; }
.kb-card-body .kb-kv {
  display: flex; gap: 12px; padding: 9px 0;
  border-bottom: 1px solid var(--line); font-size: 13px;
}
.kb-card-body .kb-kv:last-child { border-bottom: none; }
.kb-k { flex: none; width: 70px; color: var(--muted); font-size: 12.5px; }
.kb-v { flex: 1; color: var(--ink-2); line-height: 1.7; white-space: pre-wrap; word-break: break-word; }

/* 证型卡片：关联经方/中成药内链 chips */
.kb-links { display: flex; flex-wrap: wrap; gap: 6px; white-space: normal; }
.kb-link {
  border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px;
  background: #fff; color: var(--jade-700); font-size: 12.5px;
  cursor: pointer; transition: all .15s ease;
}
.kb-link:hover { border-color: var(--jade-600); background: var(--jade-50); }
.kb-link-src { font-style: normal; color: var(--muted); font-size: 11px; margin-left: 3px; }

/* 知识库内链返回条 */
.kb-backbar { margin: 10px 0 -2px; }
.kb-back {
  border: 1px dashed var(--line-strong); border-radius: 999px; padding: 4px 14px;
  background: #fff; color: var(--jade-700); font-size: 12.5px;
  cursor: pointer; transition: all .15s ease;
}
.kb-back:hover { border-color: var(--jade-600); border-style: solid; background: var(--jade-50); }

.kb-pager {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  padding: 14px 0 2px;
}
.kb-page { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ================= 操作说明 ================= */

.guide-wrap { display: flex; flex-direction: column; gap: 16px; max-width: 920px; }

.guide-hero {
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 60%, #faf5ff 100%);
  border: 1px solid #d1fae5;
  padding: 24px 28px;
}
.guide-hero-inner { display: flex; align-items: center; gap: 20px; }
.guide-hero-icon {
  width: 56px; height: 56px; border-radius: 14px;
  background: #fff; border: 1px solid #a7f3d0;
  display: flex; align-items: center; justify-content: center;
  color: #059669; flex: none;
}
.guide-hero-icon svg { width: 28px; height: 28px; }
.guide-hero-text h2 { font-size: 17px; font-weight: 600; color: #064e3b; margin: 0 0 4px; }
.guide-hero-text p { font-size: 13px; color: #047857; margin: 0; }

.guide-section { padding: 0; }
.guide-section-head {
  font-size: 14.5px; font-weight: 600; color: var(--ink);
  padding: 14px 20px; border-bottom: 1px solid var(--line);
}
.guide-body {
  font-size: 13.5px; color: var(--ink-2); line-height: 1.8;
  white-space: pre-wrap;
}
.guide-body b { color: var(--ink); }

.guide-steps {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 10px;
}
.guide-steps li {
  padding: 10px 14px;
  background: var(--bg-soft);
  border-radius: 8px;
  font-size: 13.5px; color: var(--ink-2); line-height: 1.7;
}
.guide-steps li b { color: var(--ink); }

.guide-faqs { display: flex; flex-direction: column; gap: 12px; }
.guide-faq {
  border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
}
.guide-faq-q {
  padding: 10px 14px; font-size: 13px; font-weight: 600; color: var(--ink);
  background: var(--bg-soft); border-bottom: 1px solid var(--line);
}
.guide-faq-a {
  padding: 10px 14px; font-size: 13px; color: var(--ink-2); line-height: 1.7;
}

@media (max-width: 560px) {
  .pp-grid { grid-template-columns: repeat(2, 1fr); }
  .kb-search { min-width: 0; }
  .kb-subs { width: 100%; }
}
