/* ==========================================================================
   调理日记 · 医师工作台样式
   ========================================================================== */

:root {
  --bg: #FBF4F6;
  --surface: #FFFFFF;
  --surface-2: #FDF8FA;
  --surface-3: #F9EFF3;
  --line: #F0E2E8;
  --line-2: #F7ECF0;
  --ink: #3A2A32;
  --ink-2: #6E5A64;
  --ink-3: #A08C96;
  --brand: #C96A87;
  --brand-dark: #B25572;
  --brand-tint: #FBE9EF;
  --green: #5E8A6E;
  --green-tint: #EAF3EC;
  --amber: #B07A3C;
  --amber-tint: #FAF1E1;
  --red: #C0506E;
  --red-tint: #FBE9EE;

  --r-sm: 10px;
  --r: 14px;
  --r-lg: 18px;
  --r-xl: 24px;

  --sh-1: 0 1px 2px rgba(140, 90, 110, .05);
  --sh-2: 0 1px 2px rgba(140, 90, 110, .04), 0 10px 28px -14px rgba(140, 90, 110, .18);
  --sh-3: 0 24px 60px -24px rgba(90, 50, 70, .3);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, p { margin: 0; }
button { font: inherit; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
.hidden { display: none !important; }

.ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }

.num { font-variant-numeric: tabular-nums; }

/* ============================ 登录 ============================ */

.login {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  min-height: 100vh;
}
.login-art {
  position: relative;
  background: linear-gradient(150deg, #FDF3F7 0%, #F9E3EA 42%, #F2D3DE 100%);
  overflow: hidden;
  display: flex;
  align-items: center;
  padding: 64px;
}
.login-art::before,
.login-art::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
}
.login-art::before {
  width: 460px; height: 460px;
  right: -140px; top: -120px;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.85), rgba(255,255,255,0) 65%);
}
.login-art::after {
  width: 340px; height: 340px;
  left: -120px; bottom: -140px;
  background: radial-gradient(circle at 50% 50%, rgba(201,106,135,.16), rgba(201,106,135,0) 70%);
}
.login-art-inner { position: relative; max-width: 460px; }
.login-art h1 {
  font-size: 40px;
  line-height: 1.28;
  font-weight: 700;
  letter-spacing: -.8px;
  margin: 34px 0 18px;
  color: #3A2A32;
}
.login-desc { color: #6E5A64; font-size: 15px; line-height: 1.85; }
.login-points { margin-top: 34px; display: grid; gap: 14px; }
.login-points li {
  display: flex; gap: 11px; align-items: flex-start;
  font-size: 14px; color: #6E5A64;
}
.login-points i {
  width: 18px; height: 18px; border-radius: 50%;
  background: rgba(201, 106, 135, .14);
  position: relative; flex: 0 0 auto; margin-top: 3px;
}
.login-points i::after {
  content: ""; position: absolute; inset: 5px;
  border-radius: 50%; background: var(--brand);
}
.login-foot { margin-top: 44px; font-size: 12.5px; color: #A08C96; }

.login-form-wrap {
  display: flex; align-items: center; justify-content: center;
  padding: 48px 32px;
  background: var(--surface);
}
.login-form { width: 100%; max-width: 340px; }
.login-form h2 { font-size: 24px; font-weight: 700; letter-spacing: -.3px; }
.login-form > .muted { color: var(--ink-3); font-size: 13.5px; margin-top: 6px; margin-bottom: 30px; }
.login-error {
  color: var(--red); font-size: 13px; min-height: 20px;
  margin: 2px 0 10px; opacity: 0; transition: .2s;
}
.login-error.show { opacity: 1; }
.login-hint {
  margin-top: 22px; padding: 12px 14px;
  background: var(--surface-2); border: 1px dashed var(--line);
  border-radius: var(--r-sm); font-size: 12.5px; color: var(--ink-3); line-height: 1.8;
}
.login-hint b { color: var(--ink-2); font-weight: 600; }

/* ============================ 品牌 ============================ */
.brand { display: flex; align-items: center; gap: 11px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 11px;
  background: linear-gradient(145deg, #D98BA3, #B25572);
  position: relative; flex: 0 0 auto;
  box-shadow: 0 5px 14px -4px rgba(185, 80, 62, .55);
}
.brand-mark::after {
  content: "";
  position: absolute; left: 50%; top: 50%;
  width: 13px; height: 13px;
  transform: translate(-50%, -50%) rotate(45deg);
  border-radius: 3px 9px 3px 9px;
  background: rgba(255, 255, 255, .95);
}
.brand.big .brand-mark { width: 42px; height: 42px; border-radius: 13px; }
.brand.big .brand-mark::after { width: 16px; height: 16px; }
.brand.big span:last-child { font-size: 17px; font-weight: 700; letter-spacing: .3px; }

/* ============================ 布局 ============================ */
.shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: #FFFDFC;
  border-right: 1px solid var(--line);
  padding: 22px 16px 18px;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.sidebar .brand { padding: 0 6px 22px; }
.brand-name { font-size: 15px; font-weight: 700; letter-spacing: .2px; }
.brand-sub { font-size: 11.5px; color: var(--ink-3); margin-top: 1px; }

.nav { display: grid; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  height: 42px; padding: 0 12px; border-radius: 11px;
  color: var(--ink-2); font-size: 14px; cursor: pointer;
  border: none; background: transparent; width: 100%; text-align: left;
  transition: background .14s, color .14s;
}
.nav-item:hover { background: var(--surface-3); color: var(--ink); }
.nav-item.active { background: var(--brand-tint); color: var(--brand-dark); font-weight: 600; }
.nav-item .badge-dot {
  margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--red); color: #fff;
  font-size: 11px; font-weight: 600; display: flex; align-items: center; justify-content: center;
}

.sidebar-foot { margin-top: auto; padding-top: 18px; }
.doctor-card {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--line-2);
}
.doctor-card .avatar { width: 34px; height: 34px; font-size: 13px; }
.doctor-card .dc-name { font-size: 13.5px; font-weight: 600; }
.doctor-card .dc-title { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.link-btn {
  margin-top: 10px; width: 100%; height: 34px;
  background: transparent; border: none; border-radius: 9px;
  color: var(--ink-3); font-size: 13px; cursor: pointer;
}
.link-btn:hover { background: var(--surface-3); color: var(--ink-2); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 66px; flex: 0 0 66px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; border-bottom: 1px solid var(--line);
  background: rgba(246, 242, 239, .82);
  backdrop-filter: saturate(1.4) blur(8px);
  position: sticky; top: 0; z-index: 20;
}
.topbar-left { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.topbar h1 { font-size: 18px; font-weight: 700; letter-spacing: -.2px; white-space: nowrap; }
.topbar-date { font-size: 12.5px; color: var(--ink-3); }
.topbar-right { display: flex; align-items: center; gap: 10px; }

.search-box {
  display: flex; align-items: center; gap: 7px;
  height: 36px; padding: 0 12px; width: 220px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; color: var(--ink-3);
  transition: border-color .15s, box-shadow .15s;
}
.search-box:focus-within { border-color: #E3C6D2; box-shadow: 0 0 0 3px rgba(201,106,135,.08); }
.search-box .ico { width: 15px; height: 15px; }
.search-box input { border: none; outline: none; background: transparent; width: 100%; font-size: 13.5px; color: var(--ink); }
.search-box input::placeholder { color: var(--ink-3); }
.menu-btn { display: none; margin-right: 4px; }

.icon-btn {
  width: 36px; height: 36px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface);
  color: var(--ink-2); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: .15s;
}
.icon-btn:hover { border-color: #E3C6D2; color: var(--brand); }

.view { padding: 24px 28px 72px; max-width: 1280px; width: 100%; }

/* ============================ 通用组件 ============================ */
.btn {
  height: 38px; padding: 0 16px; border-radius: 10px;
  border: 1px solid transparent; background: var(--surface-3);
  color: var(--ink-2); font-size: 13.5px; font-weight: 500;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  transition: .15s; white-space: nowrap;
}
.btn:hover { background: #F5E9EE; color: var(--ink); }
.btn:active { transform: translateY(.5px); }
.btn.primary { background: var(--brand); color: #fff; box-shadow: 0 6px 16px -8px rgba(201, 106, 135, .8); }
.btn.primary:hover { background: var(--brand-dark); color: #fff; }
.btn.ghost { background: var(--surface); border-color: var(--line); color: var(--ink-2); }
.btn.ghost:hover { border-color: #E3C6D2; color: var(--brand); background: var(--surface); }
.btn.danger { background: var(--surface); border-color: #F3DCE3; color: var(--red); }
.btn.danger:hover { background: var(--red-tint); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn.block { width: 100%; height: 44px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
}
.card-pad { padding: 20px 22px; }
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 14px;
}
.card-head h3 { font-size: 15px; font-weight: 600; letter-spacing: -.1px; }
.card-head .sub { font-size: 12.5px; color: var(--ink-3); }

.muted { color: var(--ink-3); font-size: 12.5px; }
.section-title {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 30px 0 12px; gap: 12px;
}
.section-title h2 { font-size: 15.5px; font-weight: 600; letter-spacing: -.1px; }
.section-title .sub { font-size: 12.5px; color: var(--ink-3); }

.grid { display: grid; gap: 14px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-2-1 { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }

/* 统计小卡 */
.stat {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 16px 18px;
  box-shadow: var(--sh-1);
}
.stat .s-label { font-size: 12.5px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; }
.stat .s-value { font-size: 28px; font-weight: 700; letter-spacing: -.6px; margin-top: 4px; line-height: 1.2; }
.stat .s-value small { font-size: 13px; font-weight: 500; color: var(--ink-3); margin-left: 3px; letter-spacing: 0; }
.stat .s-foot { font-size: 12px; color: var(--ink-3); margin-top: 6px; }
.stat.accent .s-value { color: var(--brand); }
.stat.warn .s-value { color: var(--amber); }
.stat.bad .s-value { color: var(--red); }
.stat.good .s-value { color: var(--green); }

/* 头像 */
.avatar {
  width: 36px; height: 36px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600; color: #fff;
  flex: 0 0 auto; letter-spacing: 0;
}
.avatar.lg { width: 52px; height: 52px; border-radius: 15px; font-size: 19px; }
.avatar.sm { width: 28px; height: 28px; border-radius: 9px; font-size: 12px; }
.a1 { background: linear-gradient(140deg, #E495AC, #C96A87); }
.a2 { background: linear-gradient(140deg, #7FAF94, #5E8A6E); }
.a3 { background: linear-gradient(140deg, #D3A165, #B07A3C); }
.a4 { background: linear-gradient(140deg, #A2AECC, #6E7FA3); }
.a5 { background: linear-gradient(140deg, #C9A0CB, #9A6898); }
.a6 { background: linear-gradient(140deg, #86B3C0, #52828F); }

/* 徽标 */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  height: 22px; padding: 0 8px; border-radius: 6px;
  font-size: 11.5px; font-weight: 500; white-space: nowrap;
}
.tag.green { background: var(--green-tint); color: var(--green); }
.tag.amber { background: var(--amber-tint); color: var(--amber); }
.tag.red { background: var(--red-tint); color: var(--red); }
.tag.grey { background: var(--surface-3); color: var(--ink-3); }
.tag.brand { background: var(--brand-tint); color: var(--brand-dark); }
.tag.outline { background: transparent; border: 1px solid var(--line); color: var(--ink-3); }

/* 表格 */
.table-wrap { overflow-x: auto; border-radius: var(--r); }
table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left; font-weight: 500; font-size: 12px; color: var(--ink-3);
  padding: 10px 14px; background: var(--surface-2);
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table th:first-child { border-top-left-radius: var(--r); }
.table th:last-child { border-top-right-radius: var(--r); }
.table td {
  padding: 12px 14px; border-bottom: 1px solid var(--line-2);
  white-space: nowrap;
}
.table tbody tr:hover { background: #FDF8FA; }
.table tbody tr:last-child td { border-bottom: none; }
.table .name-cell { display: flex; align-items: center; gap: 10px; }
.table .name-cell .nm { font-weight: 600; font-size: 13.5px; }
.table .name-cell .meta { font-size: 11.5px; color: var(--ink-3); }
.cell-strong { font-weight: 600; font-variant-numeric: tabular-nums; }
.down { color: var(--green); font-weight: 600; }
.up { color: var(--red); font-weight: 600; }
.flat { color: var(--ink-3); }

/* 空状态 */
.empty {
  text-align: center; padding: 48px 20px; color: var(--ink-3); font-size: 13.5px;
}
.empty .e-icon {
  width: 44px; height: 44px; border-radius: 14px; margin: 0 auto 12px;
  background: var(--surface-3); display: flex; align-items: center; justify-content: center;
  color: var(--ink-3);
}
.empty b { display: block; color: var(--ink-2); font-size: 14px; font-weight: 600; margin-bottom: 4px; }

/* 分段控件 */
.segmented {
  display: inline-flex; padding: 3px; gap: 2px;
  background: var(--surface-3); border-radius: 10px;
}
.segmented button {
  height: 30px; padding: 0 13px; border: none; background: transparent;
  border-radius: 8px; font-size: 13px; color: var(--ink-2); cursor: pointer;
  transition: .15s;
}
.segmented button:hover { color: var(--ink); }
.segmented button.on {
  background: var(--surface); color: var(--ink); font-weight: 600;
  box-shadow: 0 1px 2px rgba(140, 90, 110, .1);
}

/* 标签栏 */
.tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--line); margin: 22px 0 22px; }
.tabs button {
  position: relative; background: none; border: none; padding: 0 0 12px;
  font-size: 14px; color: var(--ink-3); cursor: pointer; transition: color .15s;
}
.tabs button:hover { color: var(--ink-2); }
.tabs button.on { color: var(--ink); font-weight: 600; }
.tabs button.on::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px;
  height: 2px; background: var(--brand); border-radius: 2px;
}

/* 输入 */
.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-size: 12.5px; color: var(--ink-2); margin-bottom: 7px; }
.input, .select, .textarea {
  width: 100%; height: 40px; padding: 0 12px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-sm); outline: none; font-size: 14px;
  transition: border-color .15s, box-shadow .15s;
}
.textarea { height: auto; min-height: 84px; padding: 10px 12px; line-height: 1.65; resize: vertical; }
.input:focus, .select:focus, .textarea:focus {
  border-color: #E3C6D2; box-shadow: 0 0 0 3px rgba(201, 106, 135, .08);
}
.input::placeholder, .textarea::placeholder { color: #CDB9C2; }

.inline-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translate(-50%, 14px);
  background: #3A2A32; color: #fff; padding: 11px 20px; border-radius: 11px;
  font-size: 13.5px; opacity: 0; pointer-events: none; transition: .22s;
  z-index: 300; box-shadow: var(--sh-3); max-width: 70vw;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Modal */
.modal-mask {
  position: fixed; inset: 0; background: rgba(60, 35, 50, .42);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px; z-index: 200;
  animation: fade .16s ease;
}
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
.modal {
  background: var(--surface); border-radius: 20px; width: 100%;
  max-width: 520px; max-height: 88vh; overflow: hidden;
  display: flex; flex-direction: column; box-shadow: var(--sh-3);
  animation: pop .18s cubic-bezier(.2,.9,.3,1.1);
}
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98) } to { opacity: 1; transform: none } }
.modal.wide { max-width: 720px; }
.modal-head {
  padding: 20px 22px 14px; display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--line-2);
}
.modal-head h3 { font-size: 16px; font-weight: 600; }
.modal-body { padding: 20px 22px; overflow-y: auto; }
.modal-foot {
  padding: 14px 22px 20px; display: flex; justify-content: flex-end; gap: 10px;
  border-top: 1px solid var(--line-2);
}
.modal-close {
  width: 30px; height: 30px; border-radius: 9px; border: none;
  background: var(--surface-3); color: var(--ink-2); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}

/* ============================ 概览页 ============================ */
.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 20px; flex-wrap: wrap;
}
.page-head h2 { font-size: 21px; font-weight: 700; letter-spacing: -.4px; }
.page-head .ph-sub { font-size: 13px; color: var(--ink-3); margin-top: 5px; }
.page-head-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.progress-line {
  height: 6px; border-radius: 99px; background: var(--surface-3);
  overflow: hidden; margin-top: 10px;
}
.progress-line > i {
  display: block; height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, #DE8AA2, #C96A87);
  transition: width .4s ease;
}

.report-row {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 0; border-bottom: 1px solid var(--line-2);
}
.report-row:last-child { border-bottom: none; }
.report-row .rr-name { font-size: 13.5px; font-weight: 500; }
.report-row .rr-time { font-size: 11.5px; color: var(--ink-3); }
.report-row .rr-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.alert-row {
  display: flex; gap: 11px; padding: 12px 0; border-bottom: 1px solid var(--line-2);
  cursor: pointer;
}
.alert-row:last-child { border-bottom: none; }
.alert-row:hover .ar-name { color: var(--brand); }
.ar-dot { width: 7px; height: 7px; border-radius: 50%; margin-top: 7px; flex: 0 0 auto; }
.ar-dot.bad { background: var(--red); box-shadow: 0 0 0 3px var(--red-tint); }
.ar-dot.warn { background: var(--amber); box-shadow: 0 0 0 3px var(--amber-tint); }
.ar-name { font-size: 13.5px; font-weight: 600; transition: color .15s; }
.ar-text { font-size: 12.5px; color: var(--ink-2); margin-top: 2px; line-height: 1.6; }

/* ============================ 病人详情 ============================ */
.detail-head {
  display: flex; align-items: center; gap: 16px;
  padding: 20px 22px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--sh-1); flex-wrap: wrap;
}
.detail-head .dh-main { min-width: 0; }
.detail-head h2 { font-size: 20px; font-weight: 700; letter-spacing: -.3px; display: flex; align-items: center; gap: 9px; }
.detail-meta { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 6px; font-size: 12.5px; color: var(--ink-3); }
.detail-meta b { color: var(--ink-2); font-weight: 600; }
.detail-head .dh-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

.mini-stats { display: flex; gap: 26px; flex-wrap: wrap; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line-2); }
.mini-stat .ms-v { font-size: 19px; font-weight: 700; letter-spacing: -.3px; font-variant-numeric: tabular-nums; }
.mini-stat .ms-v small { font-size: 11.5px; font-weight: 500; color: var(--ink-3); margin-left: 2px; letter-spacing: 0; }
.mini-stat .ms-k { font-size: 11.5px; color: var(--ink-3); margin-top: 1px; }

/* ---- 大盘卡片 ---- */
.kpi-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.kpi-card {
  border-radius: 18px; padding: 19px 20px 17px;
  min-height: 168px; display: flex; flex-direction: column;
  position: relative; overflow: hidden;
  border: 1px solid rgba(0, 0, 0, .035);
}
.kpi-card .k-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi-card .k-title { font-size: 12.5px; font-weight: 600; letter-spacing: .2px; opacity: .78; }
.kpi-card .k-badge {
  font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px;
  background: rgba(255, 255, 255, .62); opacity: .9;
}
.kpi-card .k-value {
  font-size: 42px; font-weight: 700; letter-spacing: -1.6px;
  line-height: 1.05; margin-top: 12px; display: flex; align-items: baseline; gap: 2px;
}
.kpi-card .k-value .k-unit { font-size: 17px; font-weight: 600; letter-spacing: 0; margin-left: 2px; opacity: .8; }
.kpi-card .k-value .k-prefix { font-size: 15px; font-weight: 600; letter-spacing: 0; margin-right: 4px; opacity: .78; }
.kpi-card .k-sub { font-size: 12.5px; margin-top: 8px; opacity: .82; line-height: 1.5; }
.kpi-card .k-foot { font-size: 11.5px; margin-top: auto; padding-top: 10px; opacity: .62; line-height: 1.5; }

.tone-lime { background: #E9EFC7; color: #4A5F1F; }
.tone-pink { background: #F7DBE6; color: #8C3F60; }
.tone-peach { background: #FBE4D3; color: #8F5C36; }
.tone-sand { background: #F1E7D2; color: #77633D; }
.tone-mint { background: #DBEBDE; color: #33654A; }
.tone-rose { background: #F7DCE1; color: #8B4855; }

/* ---- 结论 ---- */
.concl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.concl {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 18px 20px;
}
.concl h4 { font-size: 13.5px; font-weight: 600; display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.concl h4 i { width: 6px; height: 6px; border-radius: 50%; }
.concl.pos h4 i { background: var(--green); box-shadow: 0 0 0 3px var(--green-tint); }
.concl.neg h4 i { background: var(--amber); box-shadow: 0 0 0 3px var(--amber-tint); }
.concl ul { display: grid; gap: 9px; }
.concl li {
  font-size: 13px; color: var(--ink-2); line-height: 1.7;
  padding-left: 14px; position: relative;
}
.concl li::before {
  content: ""; position: absolute; left: 0; top: 9px;
  width: 5px; height: 5px; border-radius: 50%; background: #E2CFD7;
}
.concl.pos li::before { background: #B7D4C2; }
.concl.neg li::before { background: #E8CFA4; }
.concl li textarea {
  width: 100%; border: none; background: transparent; resize: none;
  font: inherit; color: inherit; padding: 0; outline: none;
  border-bottom: 1px dashed transparent;
}
.concl li textarea:focus { border-bottom-color: var(--line); }

.advice-card {
  background: #3B2A33; color: #FBF3F6; border-radius: var(--r-lg);
  padding: 22px 24px; margin-top: 14px;
}
.advice-card h4 { font-size: 13.5px; font-weight: 600; letter-spacing: .3px; margin-bottom: 16px; opacity: .72; }
.advice-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 28px; }
.advice-item { display: flex; gap: 12px; }
.advice-item .ai-num {
  width: 20px; height: 20px; border-radius: 6px; flex: 0 0 auto;
  background: rgba(255, 255, 255, .12); color: #FBF3F6;
  font-size: 11px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; margin-top: 1px;
}
.advice-item .ai-title { font-size: 13.5px; font-weight: 600; margin-bottom: 3px; }
.advice-item .ai-text { font-size: 12.5px; line-height: 1.7; opacity: .68; }

/* ---- 热力图 ---- */
.heatmap { display: flex; gap: 3px; overflow-x: auto; padding-bottom: 6px; }
.hm-col { display: grid; grid-template-rows: repeat(7, 12px); gap: 3px; }
.hm-cell { width: 12px; height: 12px; border-radius: 3px; background: #F7E9EE; }
.hm-cell.l1 { background: #FBE2EA; }
.hm-cell.l2 { background: #F3C2D1; }
.hm-cell.l3 { background: #E79CB1; }
.hm-cell.l4 { background: #C96A87; }
.hm-cell.l5 { background: #B35572; }
.hm-cell.today { box-shadow: 0 0 0 1.5px #3B2A33; }
.hm-months { display: flex; gap: 3px; margin-bottom: 6px; }
.hm-months span { font-size: 10.5px; color: var(--ink-3); }

/* ---- 图表 ---- */
.chart-box { width: 100%; }
.chart-box svg { display: block; width: 100%; height: auto; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--ink-2); margin-top: 10px; }
.legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }

/* ============================ 曲线页 ============================ */
.chart-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px 22px; }
.chart-panel + .chart-panel { margin-top: 14px; }
.chart-stats { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line-2); }
.chart-stats .cs { font-size: 12.5px; color: var(--ink-3); }
.chart-stats .cs b { font-size: 15px; color: var(--ink); font-weight: 700; margin-right: 3px; font-variant-numeric: tabular-nums; }

/* ============================ 病人列表 ============================ */
.filter-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 16px;
}
.filter-bar .grow { flex: 1; }
.patient-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.patient-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 18px 18px 16px;
  cursor: pointer; transition: .18s; position: relative; overflow: hidden;
}
.patient-card:hover {
  border-color: #E5CEDA; transform: translateY(-2px);
  box-shadow: 0 12px 28px -18px rgba(140, 90, 110, .5);
}
.patient-card .pc-head { display: flex; align-items: center; gap: 11px; }
.patient-card .pc-name { font-size: 14.5px; font-weight: 600; }
.patient-card .pc-sub { font-size: 11.5px; color: var(--ink-3); margin-top: 1px; }
.patient-card .pc-nums { display: flex; gap: 20px; margin-top: 16px; }
.patient-card .pc-nums .n { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.3px; }
.patient-card .pc-nums .n small { font-size: 11px; font-weight: 500; color: var(--ink-3); margin-left: 2px; letter-spacing: 0; }
.patient-card .pc-nums .k { font-size: 11px; color: var(--ink-3); }
.patient-card .pc-foot { margin-top: 14px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }

/* ============================ 日历 / 图表细节 ============================ */
.axis-text { font-size: 10.5px; fill: #AC98A2; }
.bar-week { display: flex; align-items: flex-end; gap: 8px; height: 96px; }
.bar-week .b-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.bar-week .b-track { width: 100%; height: 72px; background: var(--surface-3); border-radius: 6px; display: flex; align-items: flex-end; overflow: hidden; }
.bar-week .b-fill { width: 100%; background: linear-gradient(180deg, #E495AC, #C96A87); border-radius: 6px 6px 0 0; min-height: 3px; transition: height .4s; }
.bar-week .b-label { font-size: 10.5px; color: var(--ink-3); }

/* 打印 */
@media print {
  .sidebar, .topbar, .dh-actions, .page-head-actions { display: none !important; }
  .shell { grid-template-columns: 1fr; }
  .view { padding: 0; }
}

/* ============================ 响应式 ============================ */
@media (max-width: 1180px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .patient-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2-1 { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .login { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 60;
    width: 248px; transform: translateX(-100%); transition: transform .2s;
  }
  .sidebar.open { transform: none; box-shadow: var(--sh-3); }
  .view { padding: 18px 16px 60px; }
  .topbar { padding: 0 16px; }
  .search-box { width: 150px; }
  .menu-btn { display: flex; }
  .kpi-grid, .concl-grid, .grid-3, .grid-2, .advice-list { grid-template-columns: 1fr; }
  .patient-grid { grid-template-columns: 1fr; }
  .advice-list { gap: 14px; }
}

/* ============================ 代谢指标 ============================ */
.vital-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1.55fr;
  gap: 14px;
  margin-bottom: 22px;
}
@media (max-width: 960px) {
  .vital-row { grid-template-columns: 1fr 1fr; }
  .vital-box.wide { grid-column: 1 / -1; }
}
.vital-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--line);
  border-radius: var(--r);
  padding: 16px 18px 14px;
  box-shadow: var(--sh-1);
}
.vital-box.tone-good { border-left-color: var(--green); }
.vital-box.tone-warn { border-left-color: var(--amber); }
.vital-box.tone-bad { border-left-color: var(--red); }

.vb-top { display: flex; align-items: center; gap: 8px; }
.vb-k { font-size: 13px; color: var(--ink-2); font-weight: 500; }
.vb-badge { font-size: 11px; padding: 1px 7px; border-radius: 5px; background: var(--surface-3); color: var(--ink-2); }
.tone-good .vb-badge { background: var(--green-tint); color: var(--green); }
.tone-warn .vb-badge { background: var(--amber-tint); color: var(--amber); }
.tone-bad .vb-badge { background: var(--red-tint); color: var(--red); }
.vb-date { margin-left: auto; font-size: 11px; color: var(--ink-3); }

.vb-v { display: flex; align-items: baseline; gap: 3px; margin-top: 8px; }
.vb-num { font-size: 30px; font-weight: 700; letter-spacing: -.5px; color: var(--ink); line-height: 1.1; font-variant-numeric: tabular-nums; }
.vb-num.empty { color: var(--ink-3); }
.vb-sl { font-size: 18px; color: var(--ink-3); }
.vb-u { font-size: 11px; color: var(--ink-3); margin-left: 3px; }
.vb-sub { font-size: 12px; color: var(--ink-2); margin-top: 6px; }
.vb-foot { font-size: 11px; color: var(--ink-3); margin-top: 3px; line-height: 1.5; }

.lipid-bar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; }
.lb-cell { display: flex; flex-direction: column; gap: 1px; }
.lb-k { font-size: 10px; color: var(--ink-3); letter-spacing: .2px; }
.lb-v { font-size: 19px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.lb-v.lv-warn { color: var(--amber); }
.lb-v.lv-high { color: var(--red); }
.lb-v.lv-low { color: #6C7FA8; }
.lb-d { font-size: 10px; color: var(--ink-3); }
.lb-d.up { color: var(--red); }
.lb-d.down { color: var(--green); }

.vt-ok { color: var(--green); }
.vt-mild { color: var(--amber); }
.vt-warn { color: var(--red); }
.vt-bad { color: var(--red); font-weight: 600; }
.vt-none { color: var(--ink-3); }

/* ============================ 登录 / 注册 ============================ */
.login-switch {
  margin-top: 16px;
  font-size: 13px;
  color: var(--ink-3);
  text-align: center;
}
.link-inline {
  border: none; background: none; padding: 0; cursor: pointer;
  color: var(--brand); font-size: 13px; font-weight: 600;
}
.link-inline:hover { color: var(--brand-dark); }
#registerForm .inline-fields { margin-bottom: 2px; }
#registerForm .field > span, .login-form .field > span { font-size: 12.5px; }
.pending-icon {
  width: 54px; height: 54px; border-radius: 17px;
  background: var(--brand-tint); color: var(--brand);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 18px;
}
#pendingPanel .btn { margin-top: 22px; }

/* ============================ 成员管理 ============================ */
.member-list { display: grid; gap: 12px; }
.member-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 18px 20px;
  box-shadow: var(--sh-1);
}
.mc-head { display: flex; align-items: center; gap: 12px; }
.mc-main { min-width: 0; }
.mc-name {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 15px; font-weight: 600;
}
.mc-sub { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; }
.mc-meta {
  display: flex; gap: 20px; flex-wrap: wrap;
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line-2);
  font-size: 12.5px; color: var(--ink-3);
}
.mc-meta b { color: var(--ink-2); font-weight: 600; font-variant-numeric: tabular-nums; }
.mc-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }

.tip-block {
  margin-top: 22px; padding: 18px 20px;
  background: var(--surface-2); border: 1px dashed var(--line);
  border-radius: var(--r);
}
.tip-block b { font-size: 13.5px; }
.tip-block p { font-size: 12.5px; color: var(--ink-3); line-height: 1.9; margin-top: 6px; }

/* 账号信息 */
.acct-card { grid-column: 1 / -1; }
.acct-row { display: flex; align-items: flex-end; gap: 34px; flex-wrap: wrap; }
.acct-kv { display: flex; flex-direction: column; gap: 3px; }
.acct-kv span { font-size: 12px; color: var(--ink-3); }
.acct-kv b { font-size: 14px; font-weight: 600; }
.acct-actions { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }

.doctor-card .dc-role {
  display: inline-block; margin-left: 6px;
  font-size: 10px; font-weight: 600; letter-spacing: .2px;
  padding: 1px 6px; border-radius: 5px;
  background: var(--brand-tint); color: var(--brand-dark);
  vertical-align: 1px;
}

/* ============================ 移动端底部导航 ============================ */
.tabbar { display: none; }
.scrim {
  position: fixed; inset: 0; z-index: 55;
  background: rgba(60, 35, 50, .38);
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.scrim.show { opacity: 1; pointer-events: auto; }

.hide-mobile { }

@media (max-width: 900px) {
  .hide-mobile { display: none !important; }

  .tabbar {
    display: flex;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: rgba(255, 255, 255, .96);
    backdrop-filter: saturate(1.3) blur(10px);
    border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .tab-item {
    flex: 1; height: 58px; border: none; background: none; cursor: pointer;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    color: var(--ink-3); font-size: 10.5px; position: relative;
  }
  .tab-item .ico { width: 19px; height: 19px; }
  .tab-item.active { color: var(--brand); font-weight: 600; }
  .tab-item .badge-dot {
    position: absolute; top: 7px; right: 50%; margin-right: -18px;
    min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
    background: var(--red); color: #fff; font-size: 10px; font-weight: 600;
    display: flex; align-items: center; justify-content: center;
  }
  .view { padding-bottom: 96px; }
  .sidebar { width: 272px; padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
  .sidebar .sidebar-foot { display: flex; flex-direction: column; }

  /* 弹层在小屏更宽 */
  .modal { max-width: 100%; max-height: 86vh; }
  .modal-mask { padding: 14px; align-items: flex-end; }
  .modal { border-radius: 20px; }
}

@media (max-width: 720px) {
  .topbar { height: 58px; flex-basis: 58px; padding: 0 14px; }
  .topbar h1 { font-size: 16px; }
  .topbar-date { display: none; }
  .view { padding: 16px 14px 96px; }

  .page-head { gap: 10px; margin-bottom: 16px; }
  .page-head h2 { font-size: 19px; }
  .page-head .ph-sub { font-size: 12.5px; }
  .page-head-actions { width: 100%; }
  .page-head-actions .btn { flex: 1; height: 40px; }

  .grid-4, .grid-3, .grid-2, .grid-2-1 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { padding: 13px 14px; }
  .stat .s-value { font-size: 23px; }
  .kpi-grid { grid-template-columns: 1fr; }
  .kpi-card { min-height: 148px; }

  .detail-head { padding: 16px; gap: 12px; }
  .detail-head .dh-actions { margin-left: 0; width: 100%; }
  .detail-head .dh-actions .btn { flex: 1; }
  .mini-stats { gap: 18px 24px; }
  .mini-stat .ms-v { font-size: 17px; }

  .tabs { gap: 18px; overflow-x: auto; }
  .tabs button { font-size: 13.5px; white-space: nowrap; }

  .filter-bar { gap: 8px; }
  .filter-bar .search-box { width: 100% !important; }
  .filter-bar .select { width: 100% !important; }
  .segmented { overflow-x: auto; max-width: 100%; }

  .patient-grid { grid-template-columns: 1fr; }
  .concl-grid, .advice-list { grid-template-columns: 1fr; }
  .vital-row { grid-template-columns: 1fr; }
  .vital-box.wide { grid-column: auto; }

  .inline-fields { grid-template-columns: 1fr; gap: 0; }
  .modal-body { padding: 16px; }
  .modal-head { padding: 16px 16px 12px; }
  .modal-foot { padding: 12px 16px 16px; }
  .modal-foot .btn { flex: 1; }

  .acct-row { gap: 18px; }
  .acct-actions { margin-left: 0; width: 100%; }
  .acct-actions .btn { flex: 1; }

  .member-card { padding: 16px; }
  .mc-meta { gap: 12px; }
  .mc-actions .btn { flex: 1; }

  /* 表格：带 table-cards 的转成卡片列表 */
  .table-cards thead { display: none; }
  .table-cards, .table-cards tbody, .table-cards tr, .table-cards td { display: block; width: 100%; }
  .table-cards tr {
    border: 1px solid var(--line); border-radius: var(--r);
    padding: 12px 14px; margin-bottom: 10px; background: var(--surface);
  }
  .table-cards tr:hover { background: var(--surface); }
  .table-cards td {
    border: none; padding: 4px 0; white-space: normal;
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
  }
  .table-cards td::before {
    content: attr(data-label);
    font-size: 11.5px; color: var(--ink-3); flex: 0 0 auto;
  }
  .table-cards td:first-child { padding-bottom: 10px; border-bottom: 1px solid var(--line-2); margin-bottom: 6px; }
  .table-cards td:first-child::before { display: none; }
  .table-cards td .name-cell { width: 100%; }

  /* 明细表在手机上仍然横向滑动，但视觉上收一点 */
  .table-wrap { -webkit-overflow-scrolling: touch; }
  .table th, .table td { padding: 10px 12px; }
  .table { font-size: 13px; }

  .login-form-wrap { padding: 36px 20px; }
  .login-form h2 { font-size: 22px; }
  .login-hint { margin-top: 18px; }
}

@media (max-width: 420px) {
  .grid-4 { gap: 10px; }
  .segmented button { padding: 0 10px; }
}

/* 登录 / 注册表单的输入框（未使用 .input 类，单独补样式） */
.login-form .field { margin-bottom: 14px; }
.login-form .field input {
  width: 100%; height: 42px; padding: 0 12px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-sm); outline: none; font-size: 14px;
  transition: border-color .15s, box-shadow .15s;
}
.login-form .field input:focus {
  border-color: #E3C6D2;
  box-shadow: 0 0 0 3px rgba(201, 106, 135, .10);
}
.login-form .field input::placeholder { color: #CDB9C2; }

/* 三宫格统计（团队管理） */
.stat-trio .stat { padding: 14px 16px; }
@media (max-width: 720px) {
  .stat-trio { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 8px; }
  .stat-trio .stat { padding: 11px 10px; border-radius: 12px; }
  .stat-trio .s-label { font-size: 11px; }
  .stat-trio .s-value { font-size: 21px; margin-top: 2px; }
  .stat-trio .s-foot { font-size: 10px; margin-top: 4px; line-height: 1.35; }
  .stat-trio .s-value small { font-size: 11px; }
}

/* ============================ 病人编号 ============================ */
.pno {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: .2px;
  padding: 1px 7px;
  border-radius: 6px;
  background: var(--brand-tint);
  color: var(--brand-dark);
  vertical-align: 1px;
  white-space: nowrap;
}
h2 .pno, .dh-main h2 .pno { font-size: 12px; padding: 2px 8px; vertical-align: 2px; }
.pc-tags { margin-top: 6px; }

/* ============================ 疑似重复档案 ============================ */
.dup-card { margin-top: 14px; border-color: #EFDCE4; background: linear-gradient(180deg, #FDF7F9, var(--surface)); }
.dup-list { display: grid; gap: 8px; }
.dup-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 12px; border-radius: var(--r-sm);
  background: var(--surface); border: 1px solid var(--line-2);
}
.dup-name { font-size: 14px; font-weight: 600; }
.dup-nos { display: flex; gap: 5px; }
.dup-hint { font-size: 12.5px; color: var(--ink-3); flex: 1 1 200px; min-width: 0; }
.dup-row .btn { margin-left: auto; }

/* ============================ 合并弹窗 ============================ */
.mg-cur {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-radius: var(--r);
  background: var(--surface-2); border: 1px solid var(--line-2);
}
.mg-name { font-size: 14.5px; font-weight: 600; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.mg-sub { font-size: 12.5px; color: var(--ink-3); margin-top: 4px; line-height: 1.7; }

.mg-pick { margin-top: 16px; }
.mg-pick-head { font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.mg-row {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 14px; margin-bottom: 8px;
  border: 1px solid var(--line); border-radius: var(--r);
  cursor: pointer; transition: border-color .15s, background .15s;
}
.mg-row:hover { border-color: #E3C6D2; background: var(--surface-2); }
.mg-row input { margin-top: 3px; accent-color: var(--brand); }
.mg-main { min-width: 0; flex: 1; }

.mg-loading { margin-top: 16px; font-size: 13px; color: var(--ink-3); }
.mg-preview {
  margin-top: 16px; padding: 16px 18px;
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--surface);
}
.mg-result { font-size: 13.5px; line-height: 1.8; }
.mg-facts { margin: 12px 0 0; padding-left: 18px; }
.mg-facts li { font-size: 13px; color: var(--ink-2); line-height: 1.9; }
.mg-facts b { color: var(--ink); font-variant-numeric: tabular-nums; }
.mg-warn {
  margin-top: 12px; padding: 10px 12px;
  background: #FAF1E1; border: 1px solid #EBD9BE; border-radius: var(--r-sm);
  font-size: 12.5px; color: #8F5C36; line-height: 1.8;
}
.mg-base { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line); }
.mg-base-k { font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 8px; }
.mg-base-row {
  display: flex; align-items: baseline; gap: 8px;
  font-size: 13px; color: var(--ink-2); padding: 5px 0; cursor: pointer;
}
.mg-base-row input { accent-color: var(--brand); }
.mg-base-row b { font-variant-numeric: tabular-nums; color: var(--ink); }
.mg-base-row em { font-style: normal; font-size: 11.5px; color: var(--ink-3); }
.mg-confirm {
  display: flex; align-items: flex-start; gap: 10px;
  margin-top: 16px; padding: 12px 14px;
  background: var(--brand-tint); border-radius: var(--r-sm);
  font-size: 12.5px; color: var(--ink-2); line-height: 1.8; cursor: pointer;
}
.mg-confirm input { margin-top: 3px; accent-color: var(--brand); }
.mg-confirm strong { color: var(--brand-dark); }

/* ============================ 合并记录 ============================ */
.ml-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; }
.ml-grid > div { display: flex; flex-direction: column; gap: 2px; }
.ml-grid span { font-size: 11.5px; color: var(--ink-3); }
.ml-grid b { font-size: 13.5px; font-weight: 600; }
.ml-block { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line-2); }
.ml-k { font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 10px; }
.ml-note {
  margin-top: 10px; padding: 10px 12px; background: var(--surface-2);
  border-radius: var(--r-sm); font-size: 12.5px; color: var(--ink-2); line-height: 1.8;
}
.ml-snap {
  display: flex; gap: 12px; align-items: baseline;
  padding: 7px 0; border-bottom: 1px dashed var(--line-2);
  font-size: 12.5px; color: var(--ink-2);
}
.ml-snap:last-child { border-bottom: none; }
.ml-snap b { font-variant-numeric: tabular-nums; color: var(--ink); min-width: 88px; }

@media (max-width: 720px) {
  .dup-hint { flex-basis: 100%; }
  .dup-row .btn { margin-left: 0; flex: 1; }
  .ml-grid { grid-template-columns: 1fr; gap: 10px; }
  .mg-preview { padding: 14px; }
  .mg-base-row { align-items: flex-start; }
  .mg-base-row span { line-height: 1.7; }
}

.mg-group {
  font-size: 12px; font-weight: 600; color: var(--ink-3);
  margin: 4px 0 8px; letter-spacing: .2px;
}
.mg-none { font-size: 12.5px; color: var(--ink-3); padding: 4px 0 8px; }
.mg-more {
  width: 100%; min-height: 36px; height: auto; padding: 8px 12px; margin-top: 4px;
  line-height: 1.5;
  border: 1px dashed var(--line); border-radius: var(--r-sm);
  background: none; color: var(--ink-3); font-size: 12.5px; cursor: pointer;
}
.mg-more:hover { border-color: #E3C6D2; color: var(--brand-dark); background: var(--surface-2); }
.mg-others { margin-top: 8px; }

@media (max-width: 720px) {
  .dup-card .card-head { flex-direction: column; align-items: flex-start; gap: 4px; }
  .dup-card .card-head h3 { white-space: nowrap; }
  .dup-card .card-head .sub { font-size: 11.5px; line-height: 1.6; }
}

/* ---------- 明细页筛选栏：快捷范围 + 日期组 ---------- */
.quick-ranges {
  flex: 1 1 100%;
  display: flex; flex-wrap: wrap; gap: 8px;
}

.qr {
  height: 30px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--ink-2);
  font-size: 12.5px; font-family: inherit; font-weight: 500;
  cursor: pointer; white-space: nowrap;
  transition: border-color .15s, background .15s, color .15s;
}
.qr:hover { border-color: #E5CEDA; background: var(--brand-tint); color: var(--brand-dark); }
.qr.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.qr.on:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }

.date-range {
  display: flex; align-items: center; gap: 10px;
  flex: 0 0 auto; min-width: 0;
}

/* 原生日期框去掉系统外观，换自绘日历图标；整块都可点开日历 */
.dr-input {
  position: relative;
  width: 158px; height: 38px; flex: 0 0 auto;
  padding: 0 36px 0 12px;
  background-color: var(--surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23B49CA7' stroke-width='1.7' stroke-linecap='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='3'/%3E%3Cpath d='M8 3v4M16 3v4M3 10.5h18'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  cursor: pointer;
}
.dr-input:hover { border-color: #E5CEDA; }
.dr-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(201, 106, 135, .12); }
.dr-input::-webkit-calendar-picker-indicator {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  opacity: 0; cursor: pointer;
}

.patient-select { width: 160px; flex: 0 0 auto; }
.filter-btn { min-width: 104px; }

@media (max-width: 720px) {
  .dr-input { width: auto; flex: 1 1 0; min-width: 0; }
  .date-range { flex-basis: 100%; }
  .patient-select { width: auto; flex: 1 1 100%; }
  .filter-btn { flex: 1 1 0; min-width: 88px; height: 40px !important; }
  .qr { height: 32px; padding: 0 13px; }
  /* 窄屏放不下 5 个就横向滑动，别折成两行 */
  .quick-ranges { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .quick-ranges::-webkit-scrollbar { display: none; }
  .qr { flex: 0 0 auto; }
}
