:root {
  --eir-aura: linear-gradient(135deg, #0f9b8e 0%, #34b3a5 30%, #7cc7c0 70%, #a8c5d4 100%);
  --eir-aura-soft: radial-gradient(circle at top left, rgba(15, 155, 142, 0.16), transparent 42%),
    radial-gradient(circle at bottom right, rgba(30, 148, 168, 0.18), transparent 46%);
  --eir-50: #f0fafb;
  --eir-100: #d5eff4;
  --eir-300: #74cbd8;
  --eir-500: #1e94a8;
  --eir-600: #197a8e;
  --eir-700: #1a6474;
  --gold-200: #fddcb0;
  --gold-500: #d4a76a;
  --gold-700: #96703e;
  --sand-50: #fafaf7;
  --sand-100: #f5f4f0;
  --sand-200: #e8e6e1;
  --sand-300: #d4d1cb;
  --sand-400: #a8a49e;
  --sand-500: #7a766f;
  --sand-600: #5a5650;
  --sand-700: #3d3a36;
  --sand-900: #1a1917;
  --health-600: #16a34a;
  /* v2.234：红旗/风险/危急值强调色统一 token（行动清单 #21——原 11 处裸 #9f1239） */
  --danger-ink: #9f1239;
  --shadow-soft: 0 18px 60px rgba(26, 100, 116, 0.08);
  --shadow-card: 0 14px 36px rgba(17, 17, 16, 0.08);
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 28px;
  --radius-xl: 40px;
  --max: 1180px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: auto;
}

/* [hidden] 语义必须赢过任何 class 的 display 规则：此前 .app-recover-bar（display:flex）、
   .button（display:inline-flex）等把带 hidden 属性的元素重新显示出来，导致「暂停录音 /
   结束并生成」未录音时就可见、「上次录音处理失败」横幅对所有新访客常驻等 9 处状态错乱。
   全局一条 !important 兜底，任何 display:none 意图不再被覆盖。 */
[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Geist Sans", Inter, "SF Pro Text", system-ui, sans-serif;
  color: var(--sand-700);
  background:
    linear-gradient(180deg, rgba(245, 244, 240, 0.98), rgba(250, 250, 247, 0.98)),
    var(--eir-aura-soft);
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

p,
li {
  color: var(--sand-600);
  line-height: 1.65;
}

.site-shell {
  width: min(calc(100% - 32px), var(--max));
  margin: 0 auto;
  padding-bottom: 56px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 0;
  backdrop-filter: blur(18px);
  background: linear-gradient(180deg, rgba(250, 250, 247, 0.94), rgba(250, 250, 247, 0.82));
  border-bottom: 1px solid rgba(232, 230, 225, 0.8);
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.brand-lockup img {
  width: 40px;
  height: 40px;
}

.brand-eyebrow,
.brand-subline {
  display: block;
}

.brand-eyebrow {
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--sand-700);
}

.brand-subline {
  font-size: 0.8rem;
  color: var(--sand-500);
}

.topnav {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  font-size: 0.96rem;
  color: var(--sand-600);
}

.topnav a {
  padding: 8px 2px;
}

.topnav a:hover {
  color: var(--eir-700);
}

.topnav-link-cta {
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(30, 148, 168, 0.1);
  border: 1px solid rgba(30, 148, 168, 0.16);
  color: var(--eir-700);
  font-weight: 700;
}

.topnav-link-cta:hover {
  background: rgba(30, 148, 168, 0.14);
  color: var(--eir-700);
}

.app-nav-button {
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.app-nav-button:hover {
  color: var(--eir-700);
}

.hero {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 48px;
  align-items: center;
  padding: 64px 0 28px;
}

.kicker,
.section-kicker {
  margin: 0 0 12px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--eir-700);
}

.hero h1,
.content-section h2,
.cta-copy h2 {
  margin: 0;
  letter-spacing: -0.045em;
  color: var(--sand-900);
}

.hero h1 {
  max-width: 22ch;
  font-size: clamp(2rem, 3.6vw, 3.1rem);
  line-height: 1.15;
  text-wrap: balance;
}

.hero-lead {
  max-width: 58ch;
  margin: 24px 0 0;
  font-size: 1.12rem;
}

.hero-actions,
.cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 22px;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: -0.01em;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--eir-600), var(--eir-700));
  box-shadow: 0 14px 28px rgba(26, 100, 116, 0.18);
}

.button-secondary {
  color: var(--sand-700);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(212, 209, 203, 0.88);
}

.trust-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 36px 0 0;
}

.trust-strip div {
  padding: 16px 18px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(232, 230, 225, 0.92);
  box-shadow: 0 8px 24px rgba(17, 17, 16, 0.04);
}

.trust-strip dt {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sand-500);
}

.trust-strip dd {
  margin: 8px 0 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--sand-700);
  text-wrap: balance;
}

.hero-stage {
  position: relative;
}

.aura {
  position: absolute;
  inset: 24px 8px auto auto;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: var(--eir-aura);
  filter: blur(34px);
  opacity: 0.36;
}

.mock-note-card {
  position: relative;
  margin-top: 12px;
  padding: 22px;
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(232, 230, 225, 0.94);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.mock-note-card::after {
  content: "";
  position: absolute;
  inset: auto -18% -32% auto;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212, 167, 106, 0.18), transparent 62%);
}

.mock-note-topline,
.note-preview-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.mock-note-topline {
  margin-bottom: 18px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(30, 148, 168, 0.12);
  color: var(--eir-700);
  font-size: 0.82rem;
  font-weight: 700;
}

.status-pill.muted {
  background: rgba(212, 167, 106, 0.14);
  color: var(--gold-700);
}

.mock-grid {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  gap: 16px;
}

.capture-card,
.note-preview,
.feature-card,
.architecture-card,
.output-card {
  position: relative;
  border-radius: var(--radius-md);
  background: #fff;
  border: 1px solid rgba(232, 230, 225, 0.96);
  box-shadow: var(--shadow-card);
}

.capture-card {
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100%;
}

.capture-mark {
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: rgba(30, 148, 168, 0.08);
}

.capture-label {
  margin: 20px 0 6px;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--sand-700);
}

.capture-meta {
  margin: 0;
  font-size: 0.84rem;
}

.note-preview {
  padding: 16px 16px 8px;
}

.note-preview-head {
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(232, 230, 225, 0.96);
  font-size: 0.84rem;
  color: var(--sand-500);
}

.note-preview p {
  margin: 0 0 10px;
  font-size: 0.92rem;
  line-height: 1.6;
}

.note-preview strong {
  color: var(--sand-700);
}

.narrative-band {
  margin: 18px 0 0;
  padding: 24px 28px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(30, 148, 168, 0.1), rgba(212, 167, 106, 0.12));
  border: 1px solid rgba(232, 230, 225, 0.9);
}

.narrative-band p {
  margin: 0;
  max-width: 68ch;
  font-size: 1.1rem;
  color: var(--sand-700);
}

.content-section {
  padding: 88px 0 0;
}

.section-heading {
  max-width: 780px;
}

.section-heading.compact {
  max-width: 620px;
}

.content-section h2,
.cta-copy h2 {
  font-size: clamp(2.1rem, 4vw, 3.4rem);
  line-height: 1.18;
  text-wrap: balance;
}

.section-heading p,
.cta-copy p {
  margin: 18px 0 0;
  font-size: 1.05rem;
}

.feature-grid,
.output-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 30px;
}

.output-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.feature-card,
.output-card {
  padding: 22px 22px 20px;
}

.feature-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(212, 167, 106, 0.18);
  color: #6b4e23; /* 加深以过 Lighthouse 对比度（原 gold-700 不足 4.5:1） */
  font-size: 0.85rem;
  font-weight: 800;
}

.feature-card h3,
.architecture-card h3,
.output-card h3 {
  margin: 18px 0 10px;
  font-size: 1.18rem;
  letter-spacing: -0.03em;
  color: var(--sand-900);
}

.split-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 30px;
}

.architecture-card {
  padding: 26px 24px 22px;
}

.architecture-card.emphasis {
  background: linear-gradient(180deg, rgba(240, 250, 251, 0.96), rgba(255, 255, 255, 0.98));
}

.architecture-card ul {
  margin: 18px 0 0;
  padding-left: 18px;
}

.architecture-card li + li {
  margin-top: 10px;
}

.cta-section {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: end;
  margin-top: 88px;
  padding: 34px;
  border-radius: var(--radius-xl);
  background:
    linear-gradient(135deg, rgba(26, 100, 116, 0.96), rgba(13, 45, 55, 0.96)),
    var(--eir-aura);
  box-shadow: 0 22px 44px rgba(13, 45, 55, 0.18);
}

.cta-section .section-kicker,
.cta-section h2,
.cta-section p,
.cta-section .button-secondary {
  color: #fff;
}

.cta-section p {
  max-width: 58ch;
  color: rgba(255, 255, 255, 0.8);
}

.cta-section .button-primary {
  background: #fff;
  color: var(--eir-700);
}

.cta-section .button-secondary {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
}

/* 定价区：不能用 .cta-section 的两列 grid（子块多会被逐个塞进网格列导致破版），改为块级流式 */
.pricing-section {
  margin-top: 88px;
  padding: 34px;
  border-radius: var(--radius-xl);
  background:
    linear-gradient(135deg, rgba(26, 100, 116, 0.96), rgba(13, 45, 55, 0.96)),
    var(--eir-aura);
  box-shadow: 0 22px 44px rgba(13, 45, 55, 0.18);
}

.pricing-section .section-kicker,
.pricing-section h2,
.pricing-section p,
.pricing-section .button-secondary {
  color: #fff;
}

.pricing-section p {
  max-width: 58ch;
  color: rgba(255, 255, 255, 0.8);
}

/* 深色定价区里的白卡：卡内文字恢复深色，避免白底白字 */
.pricing-section .output-card p,
.pricing-section .architecture-card p,
.pricing-section .output-card h3,
.pricing-section .architecture-card h3 {
  color: var(--sand-600);
}

.pricing-section .output-card h3,
.pricing-section .architecture-card h3 {
  color: var(--sand-900);
}

.pricing-section .button-primary {
  background: #fff;
  color: var(--eir-700);
}

.pricing-section .button-secondary {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
}

/* 能力对比表：白卡容器限宽 + 内部横向滚动，绝不允许把外层布局撑爆 */
.pricing-table-card {
  margin-top: 24px;
  max-width: 100%;
  overflow-x: auto;
  background: #fff;
  border-radius: 16px;
  padding: 10px 14px;
  box-shadow: 0 6px 18px rgba(15, 118, 110, 0.12);
}

.pricing-table-card table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 560px;
}

/* 套餐卡：固定 3 列，窄屏降 1 列 */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 24px;
}

.pricing-grid .output-card p {
  max-width: none;
  margin: 0;
}

/* 付款三步卡：两列自适应，窄屏 1 列 */
.pay-steps-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 24px;
}

@media (max-width: 1100px) {
  .pricing-grid,
  .pay-steps-grid {
    grid-template-columns: 1fr;
  }
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 28px;
  align-items: flex-end;
  padding: 80px 0 0;
}

.footer-brand {
  max-width: 40rem;
}

.footer-brand p {
  margin: 18px 0 0;
  max-width: 56ch;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  color: var(--sand-500);
}

.footer-links a:hover {
  color: var(--eir-700);
}

.js [data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 480ms ease, transform 480ms ease;
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1100px) {
  .hero,
  .cta-section,
  .site-footer,
  .split-grid,
  .feature-grid,
  .output-grid {
    grid-template-columns: 1fr;
  }

  .hero-stage {
    min-height: 0;
  }

  .site-footer {
    align-items: flex-start;
  }
}

/* 宽屏下的手动断行（中文标题断在语义处），窄屏隐藏恢复自然流 */
.br-lg { display: inline; }
@media (max-width: 700px) {
  .br-lg { display: none; }
}

@media (max-width: 820px) {
  .site-shell {
    width: min(calc(100% - 24px), var(--max));
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topnav {
    gap: 14px;
    font-size: 0.92rem;
  }

  .hero {
    padding-top: 36px;
    gap: 32px;
  }

  .hero h1 {
    max-width: none;
  }

  .trust-strip,
  .mock-grid {
    grid-template-columns: 1fr;
  }

  .content-section {
    padding-top: 72px;
  }

  .cta-section {
    padding: 28px 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
  }
}

.app-page {
  min-height: 100vh;
}

.app-shell {
  padding-bottom: 72px;
}

.app-topnav {
  align-items: center;
}

.app-main {
  display: grid;
  gap: 28px;
  padding: 48px 0 16px;
}

.app-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 420px);
  gap: 28px;
  align-items: stretch;
}

.app-recorder-card,
.app-panel {
  padding: 28px;
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(232, 230, 225, 0.94);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(14px);
}

.app-recorder-card {
  display: grid;
  justify-items: center;
  gap: 14px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.app-recorder-card::before {
  content: "";
  position: absolute;
  inset: auto -40px -60px auto;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(212, 167, 106, 0.12);
}

.app-record-button {
  position: relative;
  width: 230px;
  height: 230px;
  margin-top: 10px;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
}

.app-record-ring,
.app-record-core {
  position: absolute;
  inset: 0;
  border-radius: 50%;
}

.app-record-ring {
  background: radial-gradient(circle, rgba(15, 155, 142, 0.22), rgba(15, 118, 110, 0.06));
  box-shadow: inset 0 0 0 18px rgba(212, 167, 106, 0.12);
}

.app-record-core {
  inset: 26px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #0f9b8e, #0f766e);
  box-shadow: 0 20px 36px rgba(61, 58, 54, 0.18);
}

.app-record-icon {
  width: 18px;
  height: 46px;
  border-radius: 999px;
  background: #fff9f0;
  position: relative;
  transition: width 180ms ease, height 180ms ease, border-radius 180ms ease;
}

.app-record-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -13px;
  width: 34px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 249, 240, 0.35);
  transform: translateX(-50%);
}

.app-record-button.is-recording .app-record-core {
  background: linear-gradient(135deg, #c2410c, #9a3412);
}

.app-record-button.is-recording .app-record-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
}

.app-mode-card {
  margin-top: 20px;
  padding: 16px 18px;
  border-radius: 22px;
  border: 1px solid rgba(232, 230, 225, 0.94);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-soft);
}

.app-mode-toggle {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(245, 244, 240, 0.92);
}

.app-mode-button {
  min-height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--sand-600);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.app-mode-button.is-active {
  background: linear-gradient(135deg, rgba(30, 148, 168, 0.12), rgba(212, 167, 106, 0.22));
  color: var(--sand-900);
  box-shadow: inset 0 0 0 1px rgba(30, 148, 168, 0.1);
}

.app-mode-detail {
  margin: 12px 0 0;
  color: var(--sand-600);
  line-height: 1.6;
}

.app-recorder-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.app-runtime-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.app-model-summary {
  width: 100%;
  margin: -2px 0 0;
  text-align: center;
  color: var(--sand-500);
  font-size: 0.92rem;
}

.app-local-activity {
  width: 100%;
  margin-top: 6px;
  text-align: left;
}

.app-local-activity summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--sand-500);
  list-style: none;
}

.app-local-activity summary::-webkit-details-marker {
  display: none;
}

.app-local-progress {
  width: 100%;
  margin-top: 12px;
  padding: 16px 18px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(250, 250, 247, 0.96), rgba(245, 244, 240, 0.94));
  border: 1px solid rgba(232, 230, 225, 0.94);
  text-align: left;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.app-local-progress[hidden] {
  display: none;
}

.app-local-progress-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.app-local-progress-head h2 {
  margin: 4px 0 0;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  color: var(--sand-900);
}

.app-local-progress-detail {
  margin: 10px 0 0;
  color: var(--sand-600);
  line-height: 1.55;
}

.app-advanced {
  width: 100%;
  margin-top: 6px;
  text-align: left;
}

.app-advanced summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--sand-600);
  list-style: none;
}

.app-advanced summary::-webkit-details-marker {
  display: none;
}

.app-advanced-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.app-advanced label {
  display: grid;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--sand-600);
}

.app-advanced input,
.app-advanced select {
  width: 100%;
  min-height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(212, 209, 203, 0.92);
  background: rgba(255, 255, 255, 0.9);
  padding: 0 12px;
  color: var(--sand-700);
  font: inherit;
}

.app-results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.app-panel {
  min-height: 360px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 18px;
}

.app-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.app-panel-head h2 {
  margin: 0;
  font-size: 1.4rem;
  letter-spacing: -0.03em;
  color: var(--sand-900);
}

.app-panel-body {
  min-height: 220px;
  border-radius: 22px;
  border: 1px solid rgba(232, 230, 225, 0.92);
  background: rgba(250, 250, 247, 0.92);
  padding: 22px;
  color: var(--sand-700);
  line-height: 1.72;
  white-space: pre-wrap;
}

.app-note-output {
  font-family: "Geist Mono", "SF Mono", ui-monospace, monospace;
  font-size: 0.95rem;
}

.app-note-editor {
  width: 100%;
  resize: vertical;
  font: inherit;
  outline: none;
  appearance: none;
}

/* 病历草稿高亮层：textarea 里没法单独给几个字上背景色，
   只能叠一层"同字体、同内边距、透明文字"的覆盖层，用半透明底色把那句话涂出来。
   必须 pointer-events:none —— 否则它盖在文本框上，连光标都点不进去。 */
.note-editor-wrap {
  position: relative;
}

.note-highlight-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
  border: 1px solid transparent;
  padding: 22px;
  box-sizing: border-box;
  color: transparent;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  word-break: break-word;
  line-height: 1.72;
  font-family: "Geist Mono", "SF Mono", ui-monospace, monospace;
  font-size: 0.95rem;
}

/* 半透明黄：像荧光笔划过，字仍然看得清（涂太实就把正文盖住了） */
.note-highlight-layer mark {
  background: rgba(255, 196, 62, 0.45);
  color: transparent;
  border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(214, 150, 20, 0.4);
}

.note-highlight-inner-fade {
  transition: opacity 0.5s ease;
  opacity: 0;
}

.app-note-editor:focus {
  border-color: rgba(30, 148, 168, 0.42);
  box-shadow: 0 0 0 4px rgba(30, 148, 168, 0.08);
}

.app-note-edited {
  display: inline-flex;
  margin-left: 10px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(212, 167, 106, 0.16);
  color: var(--gold-700);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
}
/* display 设置会覆盖 hidden 属性的默认隐藏，必须显式声明 */
.app-note-edited[hidden] { display: none; }

.app-copy-button[disabled] {
  opacity: 0.5;
  cursor: default;
}

.app-warning {
  margin: 0;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(212, 167, 106, 0.14);
  color: var(--gold-700);
  border: 1px solid rgba(212, 167, 106, 0.28);
}

.app-quota {
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(30, 148, 168, 0.08);
  border: 1px solid rgba(30, 148, 168, 0.18);
}

.app-quota p:last-child {
  margin-top: 6px;
}

.app-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(26, 25, 23, 0.28);
  backdrop-filter: blur(12px);
}

.app-settings-sheet {
  position: fixed;
  inset: auto 24px 24px auto;
  z-index: 41;
  width: min(540px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 24px;
  border-radius: 30px;
  background: linear-gradient(180deg, rgba(250, 250, 247, 0.98), rgba(245, 244, 240, 0.97));
  border: 1px solid rgba(232, 230, 225, 0.94);
  box-shadow: 0 30px 80px rgba(17, 17, 16, 0.18);
}

.app-settings-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.app-settings-head h2 {
  margin: 4px 0 0;
  color: var(--sand-900);
  letter-spacing: -0.03em;
}

.app-sheet-close {
  min-height: 42px;
}

.app-settings-copy {
  margin: 16px 0 0;
}

.app-settings-grid {
  display: grid;
  gap: 14px;
  margin-top: 20px;
}

.app-settings-field {
  display: grid;
  gap: 8px;
  color: var(--sand-600);
  font-size: 0.92rem;
  font-weight: 600;
}

.app-settings-field input,
.app-settings-field select {
  width: 100%;
  min-height: 48px;
  border-radius: 16px;
  border: 1px solid rgba(212, 209, 203, 0.92);
  background: rgba(255, 255, 255, 0.92);
  padding: 0 14px;
  color: var(--sand-700);
  font: inherit;
}

.app-settings-custom {
  margin-top: -2px;
}

.app-settings-status {
  margin-top: 18px;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(30, 148, 168, 0.07);
  border: 1px solid rgba(30, 148, 168, 0.14);
}

.app-settings-status p:last-child {
  margin: 8px 0 0;
}

.app-settings-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
}

@media (max-width: 980px) {
  .app-hero,
  .app-results {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .app-main {
    padding-top: 24px;
  }

  .app-recorder-card,
  .app-panel {
    padding: 22px;
  }

  .app-record-button {
    width: 190px;
    height: 190px;
  }

  .app-advanced-grid {
    grid-template-columns: 1fr;
  }

  .app-settings-sheet {
    inset: auto 12px 12px 12px;
    width: auto;
    max-height: calc(100vh - 24px);
    padding: 20px;
    border-radius: 24px;
  }

  .app-settings-head,
  .app-settings-actions {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ===== 文字模式面板（中文增强） ===== */
.text-mode-panel {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed #d8e0dd;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.text-mode-tip {
  margin: 0;
  font-size: 13px;
  line-height: 1.7;
  color: #5f7480;
}
.text-mode-input {
  width: 100%;
  min-height: 140px;
  resize: vertical;
  border: 1px solid #d8e0dd;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.7;
  font-family: inherit;
  color: #1c2b33;
  background: #fff;
}
.text-mode-input:focus {
  outline: 2px solid rgba(15, 118, 110, 0.25);
  border-color: #0f766e;
}
.text-mode-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ===== 会员与历史记录 ===== */
.history-panel { margin-top: 14px; }
.history-panel summary { cursor: pointer; font-size: 13px; color: #5f7480; }
.history-list { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.history-item {
  border: 1px solid #d8e0dd; border-radius: 10px; padding: 10px 12px;
  cursor: pointer; background: #fff; transition: border-color .15s;
}
.history-item:hover { border-color: #0f766e; }
.history-item .hi-meta { font-size: 12px; color: #5f7480; margin-bottom: 4px; }
.history-item .hi-note { font-size: 13px; color: #1c2b33; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===== 导出/打印/反馈操作区 ===== */
.app-note-actions {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 10px; padding-top: 12px; border-top: 1px dashed #e3e8e6;
}
.app-note-actions .button { font-size: 13px; padding: 7px 14px; }
.app-note-actions-spacer { flex: 1; }
.app-feedback-label { font-size: 12px; color: #8a9aa3; }
.app-feedback-btn { font-size: 12px !important; padding: 5px 10px !important; }
.app-feedback-btn:disabled { opacity: .5; cursor: not-allowed; }
.app-feedback-btn.is-done { border-color: #0f766e; color: #0f766e; }

/* 历史记录单项操作 */
.history-item .hi-actions { display: flex; gap: 6px; margin-top: 6px; }
.history-item .hi-actions button {
  font-size: 12px; padding: 3px 10px; border-radius: 8px;
  border: 1px solid #d8e0dd; background: #fff; color: #5f7480; cursor: pointer;
}
.history-item .hi-actions button:hover { border-color: #0f766e; color: #0f766e; }

/* ===== 第四轮：上传音频 / 患者须知 / 质控提醒 / 草稿恢复 / 字数 ===== */
.app-upload-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 14px;
}
.app-upload-btn { font-size: 13px; padding: 8px 14px; }
.app-upload-filename { font-size: 12px; color: #8a9aa3; }
.app-char-count { font-size: 12px; font-weight: 400; color: #8a9aa3; margin-left: 6px; }
.app-qc-hints {
  margin-top: 10px; padding: 12px 16px; border-radius: 14px;
  background: rgba(212, 167, 106, 0.12); border: 1px solid rgba(212, 167, 106, 0.3);
  color: #8a5a1e; font-size: 13px; line-height: 1.7;
}
.command-feedback {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 118, 110, 0.9);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transition: opacity 0.3s ease;
}
.command-feedback.show {
  opacity: 1;
}
.feedback-tag {
  margin: 0 4px;
  font-weight: 600;
}

.app-qc-hints strong { color: #8a5a1e; }
/* ===== v2.17 医保 DIP 3.0 核验结果样式 =====
   这几个类名此前被多个面板（ICD 建议、DIP 核验）当 className 用在 DOM 上，
   但样式表里从未定义过——结果就是所有这类结果行都退回浏览器默认样式，
   在 13px 正文里挤成一坨、严重项与建议项完全无法区分。
   本次补齐定义：统一行距、缩进与严重度配色，并适配夜间模式。 */
.dip-result, #dip-result { line-height: 1.75; }
.calc-detail {
  margin: 6px 0 0; font-size: 13px; line-height: 1.7;
  color: #5f7480;
  /* v2.30 修复：防止超长溯源 anchor 或连续英文编码撑破窄屏/移动端布局 */
  overflow-wrap: break-word;
  word-break: break-word;
}
.icd-item {
  margin: 4px 0; padding: 8px 12px; border-radius: 10px;
  font-size: 13px; line-height: 1.7;
  background: rgba(15, 118, 110, 0.06);
  border: 1px solid rgba(15, 118, 110, 0.18);
  color: #1c2b33;
  word-break: break-word;
}
.qc-group { margin: 8px 0; display: flex; flex-direction: column; gap: 6px; }
.qc-group-title {
  margin: 12px 0 4px; font-size: 13px; font-weight: 600;
  color: #1c2b33;
}
.qc-item {
  margin: 0; padding: 9px 13px; border-radius: 12px;
  font-size: 13px; line-height: 1.7; word-break: break-word;
}
.qc-sev-high {
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.32);
  color: var(--danger-ink, #9f1239);
}
.qc-sev-mid {
  background: rgba(212, 167, 106, 0.12);
  border: 1px solid rgba(212, 167, 106, 0.34);
  color: #8a5a1e;
}
.qc-sev-low {
  background: rgba(15, 118, 110, 0.07);
  border: 1px solid rgba(15, 118, 110, 0.24);
  color: #0f766e;
}
.lex-bulk { display: flex; flex-direction: column; gap: 2px; }
:root[data-theme="dark"] .calc-detail { color: #93a7b1; }
:root[data-theme="dark"] .icd-item {
  background: rgba(45, 212, 191, 0.08);
  border-color: rgba(45, 212, 191, 0.22);
  color: #d6e5ea;
}
:root[data-theme="dark"] .qc-group-title { color: #d6e5ea; }
:root[data-theme="dark"] .qc-sev-high {
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.34);
  color: #fca5a5;
}
:root[data-theme="dark"] .qc-sev-mid {
  background: rgba(212, 167, 106, 0.14);
  border-color: rgba(212, 167, 106, 0.34);
  color: #e8c39a;
}
:root[data-theme="dark"] .qc-sev-low {
  background: rgba(45, 212, 191, 0.08);
  border-color: rgba(45, 212, 191, 0.24);
  color: #5eead4;
}
/* ===== v2.24 风险复核卡片：严重程度视觉分级 =====
   之前 risk-card / batch-line 完全没有样式，critical（救命级）与 info（普通提示）
   在界面上无从区分——等于把最该拦的项藏进了"提示"里。这里把三档做成可一眼分辨的配色：
   致命=深红+描边+外发光（最强警示）｜高危=红｜提示=青。并补齐暗色主题。 */
.risk-card {
  margin: 8px 0; padding: 10px 14px; border-radius: 12px;
  font-size: 13px; line-height: 1.75; word-break: break-word;
  border: 1px solid rgba(15, 118, 110, 0.18);
  background: rgba(15, 118, 110, 0.05);
  color: #1c2b33;
}
.risk-card > b { font-weight: 700; display: block; margin-bottom: 3px; }
.risk-card > span { display: block; }
.risk-card > em { display: block; margin-top: 4px; color: #51606a; font-style: normal; }
.risk-card-high {
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.34);
  color: var(--danger-ink, #9f1239);
}
.risk-card-critical {
  background: rgba(185, 28, 28, 0.12);
  border: 1px solid rgba(185, 28, 28, 0.55);
  box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.12);
  color: #7f1d1d;
}
.risk-card-critical > b { color: #7f1d1d; }
/* v2.234（B2-P1）：危急值一键登记——critical 卡片内的行动按钮与已登记态 */
.risk-cv-register {
  margin-top: 8px; padding: 5px 14px; font-size: 12.5px; border-radius: 8px;
}
.risk-cv-register:disabled { opacity: 0.85; cursor: default; }
.risk-cv-registered {
  display: inline-block; margin-top: 8px; padding: 3px 10px; border-radius: 6px;
  font-size: 12px; color: var(--health-600, #16a34a);
  background: rgba(22, 163, 74, 0.08); border: 1px solid rgba(22, 163, 74, 0.3);
}
/* v2.235：危急值记录面板的操作行 */
.cv-action-row {
  margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap;
}
.cv-action-row .button { padding: 5px 14px; font-size: 12.5px; border-radius: 8px; }
.risk-card-info {
  background: rgba(15, 118, 110, 0.05);
  border: 1px solid rgba(15, 118, 110, 0.20);
  color: #1c2b33;
}
.batch-line {
  margin: 6px 0; padding: 6px 12px; border-radius: 10px;
  font-size: 13px; line-height: 1.7; color: #1c2b33;
  background: rgba(15, 118, 110, 0.05);
  border: 1px solid rgba(15, 118, 110, 0.16);
  word-break: break-word;
}
.batch-line-warn {
  background: rgba(220, 38, 38, 0.10);
  border: 1px solid rgba(220, 38, 38, 0.34);
  color: var(--danger-ink, #9f1239);
  font-weight: 600;
}
:root[data-theme="dark"] .risk-card {
  background: rgba(45, 212, 191, 0.06);
  border-color: rgba(45, 212, 191, 0.22);
  color: #d6e5ea;
}
:root[data-theme="dark"] .risk-card > em { color: #93a7b1; }
:root[data-theme="dark"] .risk-card-high {
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.38);
  color: #fca5a5;
}
:root[data-theme="dark"] .risk-card-critical {
  background: rgba(248, 113, 113, 0.18);
  border-color: rgba(248, 113, 113, 0.6);
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.15);
  color: #fecaca;
}
:root[data-theme="dark"] .risk-card-critical > b { color: #fecaca; }
:root[data-theme="dark"] .risk-card-info {
  background: rgba(45, 212, 191, 0.06);
  border-color: rgba(45, 212, 191, 0.24);
  color: #d6e5ea;
}
:root[data-theme="dark"] .batch-line {
  background: rgba(45, 212, 191, 0.06);
  border-color: rgba(45, 212, 191, 0.22);
  color: #d6e5ea;
}
:root[data-theme="dark"] .batch-line-warn {
  background: rgba(248, 113, 113, 0.14);
  border-color: rgba(248, 113, 113, 0.4);
  color: #fca5a5;
}
/* ===== v2.18 溯源链样式 =====
   交互形态对标 Abridge Linked Evidence：有依据的句子折叠成一行、出处随点随看，
   只默认展开需要核对的句子——30 句全展开医生根本读不完，反而会退化成「红一片就忽略」。 */
.evidence-item {
  margin: 4px 0; border: 1px solid rgba(15, 118, 110, 0.16);
  border-radius: 12px; background: rgba(15, 118, 110, 0.04); overflow: hidden;
}
.evidence-item > summary {
  cursor: pointer; padding: 9px 13px; font-size: 13px; line-height: 1.7;
  display: flex; gap: 9px; align-items: flex-start; flex-wrap: wrap;
}
.evidence-item > summary:hover { background: rgba(15, 118, 110, 0.08); }
.evidence-badge {
  flex: 0 0 auto; padding: 1px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 600; white-space: nowrap; line-height: 1.8;
}
.evidence-text { flex: 1 1 auto; min-width: 0; color: #1c2b33; word-break: break-word; }
.evidence-detail {
  padding: 2px 13px 11px; border-top: 1px dashed rgba(15, 118, 110, 0.22);
  margin-top: 2px;
}
.evidence-detail .calc-detail { margin-top: 6px; }
/* 音频时间轴（v2.19）：显示「这句出自录音第几秒」，医生可回听原话核对 */
.evidence-audio {
  margin: 6px 0 0; padding: 5px 11px; border-radius: 9px;
  font-size: 12.5px; line-height: 1.7;
  background: rgba(15, 118, 110, 0.10); color: #0f766e;
  display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap;
}
.evidence-audio b { font-weight: 600; font-variant-numeric: tabular-nums; }
/* 回听按钮（v2.21）：点秒数直接跳到录音对应位置 */
.evidence-play {
  margin-left: auto; padding: 3px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 600; line-height: 1.7; cursor: pointer;
  background: rgba(15, 118, 110, 0.14); color: #0f766e;
  border: 1px solid rgba(15, 118, 110, 0.32);
}
.evidence-play:hover { background: rgba(15, 118, 110, 0.24); }
.evidence-play:focus-visible { outline: 2px solid #0f766e; outline-offset: 2px; }
:root[data-theme="dark"] .evidence-play {
  background: rgba(45, 212, 191, 0.16); color: #5eead4;
  border-color: rgba(45, 212, 191, 0.34);
}
:root[data-theme="dark"] .evidence-play:hover { background: rgba(45, 212, 191, 0.26); }
:root[data-theme="dark"] .evidence-audio {
  background: rgba(45, 212, 191, 0.12); color: #5eead4;
}
:root[data-theme="dark"] .evidence-item {
  background: rgba(45, 212, 191, 0.05);
  border-color: rgba(45, 212, 191, 0.18);
}
:root[data-theme="dark"] .evidence-item > summary:hover { background: rgba(45, 212, 191, 0.09); }
:root[data-theme="dark"] .evidence-text { color: #d6e5ea; }
:root[data-theme="dark"] .evidence-detail { border-top-color: rgba(45, 212, 191, 0.2); }
.app-recover-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 10px; padding: 12px 16px; border-radius: 14px;
  background: rgba(15, 118, 110, 0.08); border: 1px dashed rgba(15, 118, 110, 0.4);
  color: #0f766e; font-size: 13px;
}
.app-recover-bar .button { font-size: 12px; padding: 6px 12px; }
#draft-recover-bar[hidden] { display: none; }
.app-panel-head-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.app-copy-transcript-btn { font-size: 12px !important; padding: 6px 12px !important; }
/* 转写原文编辑态 */
#transcript-output.is-editing {
  outline: 2px dashed rgba(15, 118, 110, 0.5);
  outline-offset: 2px;
  background: rgba(15, 118, 110, 0.04);
  cursor: text;
}
/* 文字模式追加选项 */
.text-mode-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.text-mode-actions-spacer { flex: 1; }
.append-mode-label {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; color: #5f7480; cursor: pointer; user-select: none;
}
.append-mode-label input { accent-color: #0f766e; }
/* 自定义模板偏好（会员功能） */
.style-hint-label textarea {
  width: 100%; resize: vertical; min-height: 60px;
  font: inherit; padding: 8px 10px; border-radius: 10px;
  border: 1px solid #d8e0dd; background: #fff; color: inherit;
}
.member-tag {
  font-style: normal; font-size: 11px; padding: 1px 7px; border-radius: 99px;
  background: rgba(212, 167, 106, 0.18); color: var(--gold-700, #96703e);
  border: 1px solid rgba(212, 167, 106, 0.4); margin-left: 4px;
}
/* 会员即将到期（≤7天）温和提醒 */
.status-pill.is-expiring {
  background: linear-gradient(135deg, #fde8c0, #e9bc7a);
  color: #6b4a1a;
  font-weight: 700;
  border-color: rgba(212, 167, 106, 0.55);
}

/* 快捷医嘱短语库 */
.phrases-panel {
  margin-top: 10px; border: 1px dashed #d8e0dd; border-radius: 14px;
  padding: 10px 14px; background: rgba(15, 118, 110, 0.03);
}
.phrases-panel summary { font-size: 13px; color: #5f7480; cursor: pointer; }
.phrases-list { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.phrases-empty { margin: 0; font-size: 12px; color: #8a9aa3; }
.phrase-row { display: flex; align-items: center; gap: 8px; }
.phrase-text { flex: 1; font-size: 13px; color: #33454f; word-break: break-all; }
.phrase-btn { font-size: 12px !important; padding: 4px 10px !important; flex: none; }
.phrase-del { color: #a05a5a; border-color: #e0d0d0; }
.phrase-add-row { display: flex; gap: 8px; margin-top: 10px; }
.phrase-add-row input {
  flex: 1; font: inherit; font-size: 13px; padding: 7px 10px;
  border-radius: 10px; border: 1px solid #d8e0dd; background: #fff; color: inherit;
}

/* ===== 账号注册/登录（算力体系） ===== */
.account-tabs {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(245, 244, 240, 0.92);
  margin-top: 16px;
}
.account-tab-btn {
  min-height: 42px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--sand-600);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.account-tab-btn.is-active {
  background: linear-gradient(135deg, rgba(30, 148, 168, 0.12), rgba(212, 167, 106, 0.22));
  color: var(--sand-900);
  box-shadow: inset 0 0 0 1px rgba(30, 148, 168, 0.1);
}
.account-form {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}
/* display 设置会覆盖 hidden 属性的默认隐藏，必须显式声明 */
.account-form[hidden] { display: none; }
.account-form label {
  display: grid;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--sand-600);
}
.account-form input {
  width: 100%;
  min-height: 46px;
  border-radius: 14px;
  border: 1px solid rgba(212, 209, 203, 0.92);
  background: rgba(255, 255, 255, 0.92);
  padding: 0 14px;
  color: var(--sand-700);
  font: inherit;
}
.account-status {
  margin: 12px 0 0;
  min-height: 20px;
  font-size: 0.9rem;
  color: #b91c1c;
}
.account-status.is-ok { color: #15803d; }
.account-brief {
  margin: 14px 0 0;
  font-size: 0.88rem;
  color: var(--sand-500);
  line-height: 1.7;
}
.account-logged-in { margin-top: 14px; }
.account-balance-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 16px 18px;
  border-radius: 16px;
  background: rgba(30, 148, 168, 0.08);
  border: 1px solid rgba(30, 148, 168, 0.18);
  margin-top: 14px;
}
.account-balance-card b { font-size: 1.4rem; color: var(--eir-700); }
.account-grant-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(22, 163, 74, 0.12);
  color: #15803d;
  font-size: 0.82rem;
  font-weight: 700;
}
/* 顶栏账号按钮 */
#account-btn { color: var(--eir-700); font-weight: 700; }

/* ===== 检验/检查结果输入 ===== */
.labs-label textarea {
  width: 100%; resize: vertical; min-height: 52px;
  font: inherit; padding: 8px 10px; border-radius: 10px;
  border: 1px solid #d8e0dd; background: #fff; color: inherit;
}

/* ===== 建议追问 / 待补充提示（利用服务端 followUpQuestions） ===== */
.app-followup-hints {
  margin-top: 10px; padding: 12px 16px; border-radius: 14px;
  background: rgba(30, 148, 168, 0.08); border: 1px solid rgba(30, 148, 168, 0.25);
  color: #1a6474; font-size: 13px; line-height: 1.8;
}
.app-followup-hints strong { color: #1a6474; }
.app-followup-hints ol { margin: 6px 0 0; padding-left: 20px; }
.app-followup-hints[hidden] { display: none; }

@page {
  margin: 14mm;
}
@media print {
  /* v2.01 修复：此前只 visibility:hidden（保留布局占位），print-sheet 之前有 5000px+
     的隐藏元素——打印第一页是整页空白，病历从第 5 页才开始。改为 display:none 把
     非打印内容真正移出文档流，print-sheet 直接顶到第一页。 */
  body.app-page > *:not(#print-sheet) {
    display: none !important;
  }
  body.app-page .print-sheet,
  body.app-page .print-sheet * {
    visibility: visible;
  }
  /* 打印页走静态文档流（不依赖滚动位置），显式白底黑字，清除一切界面残留 */
  body.app-page .print-sheet {
    display: block;
    position: static;
    width: 100%;
    margin: 0;
    padding: 0;
    background: #fff;
    color: #111;
    box-shadow: none;
    border: none;
    border-radius: 0;
    font-family: "Geist Sans", Inter, "SF Pro Text", system-ui, "Microsoft YaHei", sans-serif;
    font-size: 12pt;
    line-height: 1.9;
  }
  .print-sheet .ps-head {
    border-bottom: 2px solid #111;
    padding-bottom: 10px;
    margin-bottom: 14px;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
  }
  .print-sheet .ps-title {
    font-size: 17pt;
    font-weight: 700;
    letter-spacing: 0.04em;
    margin: 0;
  }
  .print-sheet .ps-org {
    font-size: 11pt;
    color: #333;
  }
  .print-sheet .ps-meta {
    font-size: 11pt;
    color: #333;
    margin: 0 0 12px;
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
  }
  .print-sheet .ps-note {
    white-space: pre-wrap;
    margin: 0 0 14px;
    font-size: 12pt;
  }
  .print-sheet .ps-foot {
    border-top: 1px solid #999;
    padding-top: 8px;
    margin-top: 18px;
    font-size: 9.5pt;
    color: #555;
    line-height: 1.6;
  }
  /* v2.226：公卫/宣教/用药清单打印正文。此前该类 4 处使用但零 CSS 定义——
     pre 元素裸奔浏览器默认等宽字体，与病历打印的衬线排版割裂。 */
  .print-sheet .selfmed-print-text {
    font-family: "Geist Sans", Inter, "SF Pro Text", system-ui, "Microsoft YaHei", sans-serif;
    white-space: pre-wrap;
    margin: 0 0 14px;
    font-size: 11.5pt;
    line-height: 1.9;
  }
  /* 随访趋势 SVG 折线图打印时限制在纸宽内（生成尺寸 640px，A4 纸宽约 794px@96dpi） */
  .print-sheet .selfmed-print-text + svg {
    max-width: 100%;
  }
}

/* ===== v1.90 编辑区快捷操作与面板控件（此前为浏览器原生样式，与整体设计割裂） ===== */
.refine-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.refine-chip {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(30, 148, 168, 0.28);
  background: rgba(30, 148, 168, 0.06);
  color: var(--eir-700);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}

.refine-chip:hover {
  background: rgba(30, 148, 168, 0.12);
  border-color: rgba(30, 148, 168, 0.5);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(26, 100, 116, 0.12);
}

.refine-chip:active { transform: translateY(0); }

.refine-chip:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* 本机功能（精简去重/溯源核对）与 AI 功能视觉区分：沙金色系 = 免费、本机 */
.refine-chip-local {
  border-color: rgba(212, 167, 106, 0.42);
  background: rgba(212, 167, 106, 0.1);
  color: var(--gold-700);
}

.refine-chip-local:hover {
  background: rgba(212, 167, 106, 0.18);
  border-color: rgba(212, 167, 106, 0.66);
}

.refine-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.refine-row #refine-input {
  flex: 1 1 240px;
  min-width: 0;
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 12px;
  border: 1px solid rgba(212, 209, 203, 0.9);
  background: rgba(255, 255, 255, 0.85);
  color: var(--sand-700);
  font-size: 13.5px;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.refine-row #refine-input:focus {
  outline: none;
  border-color: var(--eir-500);
  box-shadow: 0 0 0 3px rgba(30, 148, 168, 0.14);
}

.refine-row .button {
  min-height: 40px;
  font-size: 13px;
}

.panel-search-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 10px;
}

.panel-search-row input[type="search"] {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 14px;
  border: 1px solid rgba(212, 209, 203, 0.9);
  background: rgba(255, 255, 255, 0.85);
  color: var(--sand-700);
  font-size: 14px;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.panel-search-row input[type="search"]:focus {
  outline: none;
  border-color: var(--eir-500);
  box-shadow: 0 0 0 3px rgba(30, 148, 168, 0.14);
}

.panel-search-count {
  flex: 0 0 auto;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--sand-500);
  white-space: nowrap;
}

/* 临床计算器：项目切换 chip 与字段输入 */
.calc-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 12px;
}

.calc-tab {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid rgba(212, 209, 203, 0.9);
  background: rgba(255, 255, 255, 0.72);
  color: var(--sand-600);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}

.calc-tab:hover {
  border-color: rgba(30, 148, 168, 0.5);
  color: var(--eir-700);
}

.calc-tab.is-active {
  border-color: transparent;
  background: linear-gradient(135deg, var(--eir-500), var(--eir-600));
  color: #fff;
  box-shadow: 0 4px 12px rgba(30, 148, 168, 0.28);
}

.calc-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
}

.calc-field {
  display: flex;
  align-items: center;
  gap: 8px;
}

.calc-field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--sand-600);
  white-space: nowrap;
}

.calc-field input {
  width: 96px;
  min-height: 36px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid rgba(212, 209, 203, 0.9);
  background: rgba(255, 255, 255, 0.85);
  color: var(--sand-700);
  font-size: 13.5px;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.calc-field input:focus {
  outline: none;
  border-color: var(--eir-500);
  box-shadow: 0 0 0 3px rgba(30, 148, 168, 0.14);
}

/* HIS/EMR 预设等长下拉：窄屏不得撑破容器（实测 390px 视口被 476px select 撑出横向滚动） */
.handout-lang {
  max-width: 100%;
}

/* ===== v1.71 深色模式（工作台，夜间门诊 / 值班护眼） =====
   入口：顶栏「🌙 夜间模式」按钮；data-theme 挂在 <html> 上，选择记忆在本地。
   覆盖策略：重定义调色板变量 + 集中覆盖表单控件与卡片表面；
   打印、落地区营销页不受影响（它们不设置 data-theme）。 */
:root[data-theme="dark"] {
  color-scheme: dark;
  --sand-50: #16191b;
  --sand-100: #1b1f21;
  --sand-200: #24292c;
  --sand-300: #33393c;
  --sand-400: #8f979b;
  --sand-500: #aeb5b8;
  --sand-600: #ccd2d4;
  --sand-700: #e4e8e9;
  --sand-900: #f4f6f6;
  --eir-50: #0e1f21;
  --eir-100: #123030;
  --eir-300: #2c6a6e;
  --eir-500: #35aebc;
  --eir-600: #5cc3cf;
  --eir-700: #8ad9e1;
  --shadow-soft: 0 18px 60px rgba(0, 0, 0, 0.5);
  --shadow-card: 0 14px 36px rgba(0, 0, 0, 0.42);
}
:root[data-theme="dark"] body.app-page {
  background:
    linear-gradient(180deg, rgba(18, 21, 23, 0.98), rgba(14, 17, 18, 0.98)),
    radial-gradient(circle at top left, rgba(15, 155, 142, 0.1), transparent 42%),
    radial-gradient(circle at bottom right, rgba(30, 148, 168, 0.1), transparent 46%);
  /* v1.90 修复：暗色令牌是反转的，--sand-300 在暗色下是深灰(#33393c)，曾把正文/标题
     直接写成深灰字配深底（hero 大标题、hero-lead 等未自带颜色规则的区域整片不可读）。
     正文取 --sand-600（#ccd2d4），标题单独提亮到 --sand-900。 */
  color: var(--sand-600);
}

:root[data-theme="dark"] body.app-page h1,
:root[data-theme="dark"] .app-hero-copy h1 {
  color: var(--sand-900);
}
:root[data-theme="dark"] .topbar {
  background: linear-gradient(180deg, rgba(20, 24, 26, 0.94), rgba(16, 20, 22, 0.86));
  border-bottom: 1px solid rgba(60, 68, 72, 0.8);
}
:root[data-theme="dark"] .brand-subline,
:root[data-theme="dark"] .topnav a,
:root[data-theme="dark"] .app-nav-button {
  color: var(--sand-400);
}
:root[data-theme="dark"] .app-panel-head h2,
:root[data-theme="dark"] .section-kicker {
  color: var(--sand-100);
}
:root[data-theme="dark"] .app-panel-body {
  background: rgba(27, 31, 33, 0.92);
  border-color: rgba(58, 66, 70, 0.9);
  color: var(--sand-300);
}
:root[data-theme="dark"] body.app-page textarea,
:root[data-theme="dark"] body.app-page input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]),
:root[data-theme="dark"] body.app-page select {
  background: #1b1f21;
  color: var(--sand-200);
  border-color: #33393c;
}
:root[data-theme="dark"] body.app-page textarea::placeholder,
:root[data-theme="dark"] body.app-page input::placeholder {
  color: #6f787c;
}
:root[data-theme="dark"] body.app-page textarea:focus,
:root[data-theme="dark"] body.app-page input:focus,
:root[data-theme="dark"] body.app-page select:focus {
  border-color: var(--eir-500);
  outline: 2px solid rgba(53, 174, 188, 0.25);
}
:root[data-theme="dark"] body.app-page .button-secondary,
:root[data-theme="dark"] body.app-page .app-nav-button {
  background: #24292c;
  color: var(--sand-400);
  border-color: #33393c;
}
:root[data-theme="dark"] body.app-page .button-secondary:hover,
:root[data-theme="dark"] body.app-page .app-nav-button:hover {
  border-color: var(--eir-500);
  color: var(--sand-100);
}
:root[data-theme="dark"] .history-item,
:root[data-theme="dark"] .selfcheck-card,
:root[data-theme="dark"] .onboarding-card,
:root[data-theme="dark"] .app-mode-card,
:root[data-theme="dark"] .account-balance-card,
:root[data-theme="dark"] .med-ask-panel {
  background: #1b1f21;
  border-color: #33393c;
  /* v1.90 修复：同 --sand-300 反转问题——卡片文字曾为深灰配深底（新手三步引导不可读） */
  color: var(--sand-600);
}

/* v1.90：服务属性四卡（部署位置/大模型引擎/隐私保护/使用方式）暗色覆盖——
   此前沿用 rgba(255,255,255,.68) 亮底，配反转后的亮色文字几乎不可读 */
:root[data-theme="dark"] .trust-strip div {
  background: rgba(27, 31, 33, 0.86);
  border-color: #33393c;
  box-shadow: none;
}

:root[data-theme="dark"] .trust-strip dt {
  color: var(--sand-500);
}

:root[data-theme="dark"] .trust-strip dd {
  color: var(--sand-700);
}
:root[data-theme="dark"] .med-ask-panel summary {
  color: var(--sand-200);
}
:root[data-theme="dark"] .med-ask-disclaimer,
:root[data-theme="dark"] .hint,
:root[data-theme="dark"] .text-mode-tip {
  color: #7f8a8e;
}
:root[data-theme="dark"] .banner.ok {
  background: #0e2a1c;
  color: #7fd6a4;
  border-color: #1d5c3a;
}
:root[data-theme="dark"] .banner.err {
  background: #301214;
  color: #f1a0a5;
  border-color: #6b2530;
}
:root[data-theme="dark"] body.app-page code,
:root[data-theme="dark"] body.app-page kbd {
  background: #24292c;
  color: var(--sand-300);
  border-color: #33393c;
}
:root[data-theme="dark"] body.app-page table {
  color: var(--sand-300);
}
:root[data-theme="dark"] body.app-page th {
  background: #24292c;
  color: var(--sand-200);
}
:root[data-theme="dark"] body.app-page td {
  border-color: #33393c;
}
:root[data-theme="dark"] .panel-search-row input[type="search"] {
  background: #1b1f21;
  color: var(--sand-200);
  border-color: #33393c;
}
:root[data-theme="dark"] .panel-search-count {
  background: #0e1f21;
  color: var(--eir-600);
  border-color: #123030;
}
:root[data-theme="dark"] .trace-item.is-fact {
  background: #261213;
}
:root[data-theme="dark"] .trace-item.is-diagnosis {
  background: #261d0f;
}

/* v1.71 深色模式补充：主卡片与模式切换条的半透明白底收编 */
:root[data-theme="dark"] .app-panel {
  background: rgba(23, 27, 29, 0.88);
  border-color: rgba(58, 66, 70, 0.92);
  backdrop-filter: none;
}
:root[data-theme="dark"] .app-hero .app-recorder-card,
:root[data-theme="dark"] div.app-recorder-card {
  background: rgba(23, 27, 29, 0.88);
  border-color: rgba(58, 66, 70, 0.92);
}
:root[data-theme="dark"] .app-mode-toggle {
  background: #1b1f21;
  border-color: #33393c;
  color: var(--sand-400);
}
:root[data-theme="dark"] .app-mode-card {
  background: rgba(23, 27, 29, 0.88);
}
:root[data-theme="dark"] .app-settings-field input,
:root[data-theme="dark"] .app-settings-field select {
  background: #1b1f21;
  color: var(--sand-200);
}

/* v1.90 深色模式补充：编辑区快捷操作与面板控件（refine-chip / calc-tab / 搜索框） */
:root[data-theme="dark"] .refine-chip {
  border-color: rgba(92, 195, 207, 0.32);
  background: rgba(53, 174, 188, 0.1);
  color: var(--eir-700);
}

:root[data-theme="dark"] .refine-chip:hover {
  background: rgba(53, 174, 188, 0.18);
  border-color: rgba(92, 195, 207, 0.55);
}

:root[data-theme="dark"] .refine-chip-local {
  border-color: rgba(212, 167, 106, 0.4);
  background: rgba(212, 167, 106, 0.12);
  color: var(--gold-200);
}

:root[data-theme="dark"] .refine-chip-local:hover {
  background: rgba(212, 167, 106, 0.2);
}

:root[data-theme="dark"] .refine-row #refine-input,
:root[data-theme="dark"] .panel-search-row input[type="search"],
:root[data-theme="dark"] .calc-field input {
  background: #1b1f21;
  border-color: #33393c;
  color: var(--sand-200);
}

:root[data-theme="dark"] .refine-row #refine-input:focus,
:root[data-theme="dark"] .panel-search-row input[type="search"]:focus,
:root[data-theme="dark"] .calc-field input:focus {
  border-color: var(--eir-500);
}

:root[data-theme="dark"] .calc-tab {
  background: #1b1f21;
  border-color: #33393c;
  color: var(--sand-400);
}

:root[data-theme="dark"] .calc-tab:hover {
  border-color: rgba(92, 195, 207, 0.5);
  color: var(--eir-700);
}

:root[data-theme="dark"] .calc-tab.is-active {
  background: linear-gradient(135deg, var(--eir-500), var(--eir-600));
  border-color: transparent;
  color: #fff;
}

:root[data-theme="dark"] .panel-search-count {
  color: var(--sand-500);
}

/* ===== v1.91 统一确认弹窗（替代原生 confirm） ===== */
.ui-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(26, 25, 23, 0.45);
  backdrop-filter: blur(3px);
}

.ui-confirm-card {
  width: min(430px, 100%);
  max-height: 80vh;
  overflow: auto;
  padding: 24px 26px;
  border-radius: var(--radius-md);
  background: #fff;
  border: 1px solid rgba(232, 230, 225, 0.9);
  box-shadow: 0 24px 70px rgba(17, 17, 16, 0.28);
}

.ui-confirm-title {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 800;
  color: var(--sand-900);
}

.ui-confirm-message {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--sand-600);
  white-space: pre-wrap;
  word-break: break-word;
}

.ui-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.ui-confirm-actions .button {
  min-height: 40px;
  font-size: 13.5px;
}

:root[data-theme="dark"] .ui-confirm-card {
  background: #1b1f21;
  border-color: #33393c;
}

:root[data-theme="dark"] .ui-confirm-title {
  color: var(--sand-900);
}

:root[data-theme="dark"] .ui-confirm-message {
  color: var(--sand-600);
}

/* ===== v1.91 功能面板分组导航 ===== */
.panel-group-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}

.panel-group-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(212, 209, 203, 0.9);
  background: rgba(255, 255, 255, 0.7);
  color: var(--sand-600);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 140ms ease, color 140ms ease, background 140ms ease;
}

.panel-group-chip:hover {
  border-color: rgba(30, 148, 168, 0.55);
  color: var(--eir-700);
  background: rgba(30, 148, 168, 0.06);
}

.panel-group { margin: 0 0 18px; }

.panel-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 10px 4px;
  border: 0;
  border-bottom: 1px solid rgba(232, 230, 225, 0.9);
  background: transparent;
  cursor: pointer;
  font-size: 14.5px;
  font-weight: 800;
  color: var(--sand-900);
  text-align: left;
}

.panel-group-head:hover { color: var(--eir-700); }

.panel-group-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--sand-500);
}

.panel-group.is-folded .panel-group-body { display: none; }
.panel-group.is-empty { display: none; }

:root[data-theme="dark"] .panel-group-head {
  border-bottom-color: #33393c;
  color: var(--sand-100);
}

:root[data-theme="dark"] .panel-group-count { color: var(--sand-500); }

:root[data-theme="dark"] .panel-group-chip {
  background: #1b1f21;
  border-color: #33393c;
  color: var(--sand-400);
}

:root[data-theme="dark"] .panel-group-chip:hover {
  border-color: rgba(92, 195, 207, 0.5);
  color: var(--eir-700);
}

/* ===== v1.92 内置宣教库 ===== */
.edu-lib-row {
  margin: 12px 0 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(212, 167, 106, 0.08);
  border: 1px dashed rgba(212, 167, 106, 0.4);
}

.edu-lib-label {
  display: block;
  font-size: 13px;
  font-weight: 800;
  color: var(--gold-700);
}

.edu-lib-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.edu-lib-controls select {
  flex: 1 1 200px;
  min-width: 0;
  min-height: 38px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid rgba(212, 209, 203, 0.9);
  background: rgba(255, 255, 255, 0.85);
  color: var(--sand-700);
  font-size: 13.5px;
}

.edu-lib-controls .button { min-height: 38px; font-size: 13px; }

.edu-lib-hint {
  margin: 8px 0 0;
  font-size: 12.5px;
  color: var(--sand-500);
  line-height: 1.6;
}

:root[data-theme="dark"] .edu-lib-row {
  background: rgba(212, 167, 106, 0.1);
  border-color: rgba(212, 167, 106, 0.35);
}

:root[data-theme="dark"] .edu-lib-label { color: var(--gold-200); }

:root[data-theme="dark"] .edu-lib-controls select {
  background: #1b1f21;
  border-color: #33393c;
  color: var(--sand-200);
}

:root[data-theme="dark"] .edu-lib-hint { color: var(--sand-500); }

/* ===== v1.92 落地页价格锚点（定价区为深色底，锚点用亮色卡片保证对比度） ===== */
.price-anchor {
  margin: 18px 0 0;
  padding: 14px 18px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 10px 30px rgba(10, 60, 70, 0.18);
  font-size: 14px;
  line-height: 1.85;
  color: #2b4449;
  text-align: left;
}

.price-anchor b { color: #0f766e; }

/* v2.09：会员系统关闭（测试期）时隐藏购买入口与定价区（开关由 /v1/public-config 下发） */
html.membership-off .membership-only,
body.membership-off .membership-only {
  display: none !important;
}

/* ===== v2.226 审计补齐：工作台面板 CSS 缺口（约 140 类，此前零定义裸奔） ===== */
/* 原则：只用既有 token（sand/eir/gold/health/radius），暗色靠 token 自动翻转；
   透明度色沿用本文件既有 rgba 值（青 rgba(15,118,110) / 青500 rgba(30,148,168) /
   金 rgba(212,167,106) / 红 rgba(220,38,38) / 绿 rgba(22,163,74)）；
   布局克制（8px 间距节奏、13-15px 字号、行高≥1.6），与 refine-chips/面板既有风格一致。
   注：med-ask-panel / selfcheck-card / onboarding-card / trace-item 此前只有暗色覆盖、
   无浅色基底，本章一并补上，使既有暗色规则真正生效。 */

/* ---------- 录音条：电平表与暂停小按钮（mic-level 此前完全不可见） ---------- */
.mic-level {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 16px;
  margin-left: 6px;
  flex: none;
}
.mic-level i {
  width: 3px;
  border-radius: 2px;
  background: var(--sand-300);
  transition: background 90ms ease;
}
.mic-level i:nth-child(1), .mic-level i:nth-child(8) { height: 6px; }
.mic-level i:nth-child(2), .mic-level i:nth-child(7) { height: 9px; }
.mic-level i:nth-child(3), .mic-level i:nth-child(6) { height: 13px; }
.mic-level i:nth-child(4), .mic-level i:nth-child(5) { height: 16px; }
.mic-level i.on { background: var(--eir-500); }

/* ---------- 工作台小按钮（统一比 .button 小一号的内联操作钮） ---------- */
.pause-btn,
.preset-btn,
.qc-act-btn,
.qc-dup-del,
.selfcheck-toggle,
.onboarding-close,
.todo-copy,
.ledger-learn-btn,
.tpl-library-chip,
.risk-inline-btn {
  min-height: 30px;
  padding: 0 12px;
  font-size: 12.5px;
  flex: none;
}

/* ---------- 版本历史 / 档案条目行（版本对比、患者档案、失访追回名单） ---------- */
.version-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}
.version-row {
  padding: 10px 12px;
  border: 1px solid var(--sand-200);
  border-radius: 12px;
  background: var(--sand-50);
  transition: border-color 140ms ease, background 140ms ease;
}
.version-row:hover {
  border-color: rgba(30, 148, 168, 0.4);
  background: var(--eir-50);
}
.version-row-active {
  border-color: rgba(30, 148, 168, 0.55);
  box-shadow: 0 0 0 3px rgba(30, 148, 168, 0.12);
}
.note-version-row { border-left: 3px solid rgba(30, 148, 168, 0.35); }
.version-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  font-size: 13px;
}
.version-index {
  padding: 1px 9px;
  border-radius: 999px;
  background: var(--eir-100);
  color: var(--eir-700);
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}
.version-time {
  color: var(--sand-500);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.version-label {
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--sand-100);
  color: var(--sand-500);
  font-size: 11.5px;
  white-space: nowrap;
}
.version-preview {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.65;
  color: var(--sand-600);
  word-break: break-word;
}
.version-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.version-actions .button { min-height: 32px; padding: 0 12px; font-size: 12.5px; }

/* 档案面板（患者档案汇总 / 本机账号对比 / 待复查勾选） */
.arch-row { border-left: 3px solid rgba(30, 148, 168, 0.35); }
.arch-recheck-row { border-left: 3px solid rgba(212, 167, 106, 0.55); }
.arch-compare-detail {
  margin: 8px 0;
  padding: 8px 12px;
  border: 1px dashed var(--sand-300);
  border-radius: 12px;
}
.arch-compare-warn {
  cursor: pointer;
  font-size: 13px;
  color: var(--gold-700);
}
.arch-recheck-pick {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
}
.arch-recheck-pick:hover { background: var(--sand-100); }
.archive-text {
  margin: 8px 0;
  padding: 10px 12px;
  border: 1px solid var(--sand-200);
  border-radius: 12px;
  background: var(--sand-50);
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--sand-600);
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* ---------- 病历质控面板（评分头、条目徽标、条目内小按钮与已办态） ---------- */
.qc-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  margin: 4px 0 8px;
}
.qc-score {
  font-size: 22px;
  font-weight: 800;
  color: var(--eir-700);
  font-variant-numeric: tabular-nums;
}
.qc-grade {
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.qc-grade-a {
  background: rgba(22, 163, 74, 0.12);
  border: 1px solid rgba(22, 163, 74, 0.35);
  color: #15803d;
}
.qc-grade-b {
  background: rgba(212, 167, 106, 0.15);
  border: 1px solid rgba(212, 167, 106, 0.4);
  color: var(--gold-700);
}
.qc-grade-c {
  background: rgba(220, 38, 38, 0.1);
  border: 1px solid rgba(220, 38, 38, 0.32);
  color: var(--danger-ink, #9f1239);
}
.qc-summary { margin: 0 0 8px; font-size: 13px; line-height: 1.65; color: var(--sand-600); }
.qc-item-label { font-weight: 700; margin-right: 6px; }
.qc-item-detail { color: var(--sand-600); }
.qc-item-advice { display: block; margin-top: 2px; color: var(--eir-700); }
.qc-item .qc-act-btn { margin: 4px 6px 0 0; }
.qc-item-high {
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.32);
  color: var(--danger-ink, #9f1239);
}
.qc-item-mid {
  background: rgba(212, 167, 106, 0.12);
  border: 1px solid rgba(212, 167, 106, 0.34);
  color: #8a5a1e;
}
/* v2.229：环节/时效提示级（info）——比 mid 更轻，强调「不计分、可忽略」的口吻 */
.qc-item-low {
  background: rgba(87, 118, 104, 0.08);
  border: 1px solid rgba(87, 118, 104, 0.28);
  color: var(--eir-700);
}
.qc-item-done {
  background: var(--sand-100);
  border: 1px solid var(--sand-200);
  color: var(--sand-500);
}
.qc-clean { margin: 6px 0; font-size: 13px; color: var(--eir-700); }
.qc-act-on {
  border-color: var(--eir-500) !important;
  color: var(--eir-700);
  background: rgba(30, 148, 168, 0.12);
}
.qc-report-row { margin-top: 8px; }

/* ---------- 鉴别诊断（ddx 分层清单） ---------- */
.ddx-tier-title { margin: 12px 0 4px; font-size: 13px; font-weight: 700; color: var(--sand-700); }
.ddx-item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
  margin: 4px 0;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(15, 118, 110, 0.06);
  border: 1px solid rgba(15, 118, 110, 0.18);
  font-size: 13px;
  line-height: 1.7;
  word-break: break-word;
}
.ddx-item-cannotmiss {
  background: rgba(220, 38, 38, 0.07);
  border-color: rgba(220, 38, 38, 0.3);
}
.ddx-name { font-weight: 700; color: var(--sand-700); }
.ddx-line { font-size: 12.5px; color: var(--sand-500); }

/* ---------- 术语词库（错写→正确、行输入、词条 chip） ---------- */
.lex-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.lex-input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 36px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid var(--sand-300);
  background: var(--sand-50);
  color: inherit;
  font-size: 13px;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.lex-input:focus {
  outline: none;
  border-color: var(--eir-500);
  box-shadow: 0 0 0 3px rgba(30, 148, 168, 0.14);
}
.lex-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.lex-auto-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 13px;
  color: var(--sand-600);
  cursor: pointer;
}
.lex-auto-row input { accent-color: var(--eir-500); }
.lex-arrow { padding: 0 2px; color: var(--eir-700); font-weight: 700; }
.lex-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.lex-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 6px 3px 10px;
  border-radius: 999px;
  background: var(--eir-50);
  border: 1px solid rgba(30, 148, 168, 0.25);
  font-size: 12.5px;
  color: var(--sand-700);
}
.lex-del {
  width: 18px;
  height: 18px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--sand-300);
  background: var(--sand-100);
  color: var(--sand-500);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}
.lex-del:hover {
  border-color: rgba(220, 38, 38, 0.45);
  color: var(--danger-ink, #9f1239);
}
.lex-change { font-size: 13px; line-height: 1.7; color: var(--sand-600); word-break: break-word; }
.lex-change b { color: var(--eir-700); }

/* ---------- 医学查询 / 用药解读面板（结果容器、追问 chip、输入行） ---------- */
.med-ask-panel {
  margin: 0 0 14px;
  padding: 10px 14px;
  border: 1px solid var(--sand-200);
  border-radius: 14px;
  background: var(--sand-50);
}
.med-ask-panel > summary { cursor: pointer; font-weight: 600; color: var(--sand-700); }
.med-ask-result { margin-top: 8px; font-size: 13.5px; line-height: 1.7; color: var(--sand-600); }
.med-ask-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}
.med-ask-chip {
  min-height: 32px;
  padding: 4px 13px;
  border-radius: 999px;
  border: 1px solid var(--sand-300);
  background: var(--sand-50);
  color: var(--sand-700);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 140ms ease, color 140ms ease;
}
.med-ask-chip:hover { border-color: rgba(30, 148, 168, 0.45); color: var(--eir-700); }
.med-ask-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; align-items: center; }
.med-ask-row input {
  flex: 1 1 220px;
  min-width: 0;
  min-height: 38px;
  padding: 6px 12px;
  border-radius: 11px;
  border: 1px solid var(--sand-300);
  background: var(--sand-50);
  color: inherit;
  font-size: 13.5px;
}
.med-guide-input {
  width: 100%;
  min-height: 120px;
  resize: vertical;
  margin-top: 8px;
  padding: 8px 11px;
  border-radius: 12px;
  border: 1px solid var(--sand-300);
  background: var(--sand-50);
  color: inherit;
  font: inherit;
  font-size: 13.5px;
  line-height: 1.65;
}
.med-guide-count { flex: none; align-self: center; font-size: 12px; color: var(--sand-500); }
.med-guide-input:focus, .med-ask-row input:focus {
  outline: none;
  border-color: var(--eir-500);
  box-shadow: 0 0 0 3px rgba(30, 148, 168, 0.14);
}

/* 面板内裸下拉（.handout-lang 此前只有 max-width，浏览器原生样式与整体割裂） */
select.handout-lang {
  min-height: 34px;
  padding: 4px 8px;
  border-radius: 10px;
  border: 1px solid var(--sand-300);
  background: var(--sand-50);
  color: inherit;
  font-size: 13px;
  max-width: 100%;
}

/* ---------- 导出 / 打印区（提示行与预览 textarea） ---------- */
.export-hint { margin: 8px 0 0; font-size: 12.5px; line-height: 1.65; color: var(--sand-500); }
.export-preview {
  width: 100%;
  min-height: 90px;
  resize: vertical;
  margin-top: 8px;
  padding: 8px 11px;
  border-radius: 12px;
  border: 1px dashed var(--sand-300);
  background: var(--sand-50);
  color: var(--sand-700);
  font: inherit;
  font-size: 12.5px;
  line-height: 1.65;
}
.export-preview:focus {
  outline: none;
  border-style: solid;
  border-color: var(--eir-500);
  box-shadow: 0 0 0 3px rgba(30, 148, 168, 0.12);
}

/* ---------- 模板（自定义模板清单 / 模板广场 / 官方库） ---------- */
.tpl-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.tpl-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--sand-200);
  border-radius: 10px;
  background: var(--sand-50);
  transition: border-color 140ms ease;
}
.tpl-item:hover { border-color: rgba(30, 148, 168, 0.4); }
.tpl-item-name {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--sand-700);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tpl-item-time { flex: none; font-size: 12px; color: var(--sand-500); font-variant-numeric: tabular-nums; }
.tpl-hint { font-size: 12.5px; line-height: 1.65; color: var(--sand-500); }
.tpl-empty { margin: 6px 0; font-size: 12.5px; line-height: 1.65; color: var(--sand-500); }
.tpl-actions-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.tpl-actions-row .tpl-hint { flex: 1 1 200px; }
.tpl-section-spacer { flex: 1 1 8px; }
.tpl-market { margin-top: 14px; }
.tpl-library-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }

/* ---------- HIS 字段对照（字段名映射行 / 上下移 / 不导出勾选） ---------- */
.his-map-rows { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.his-map-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid var(--sand-200);
  border-radius: 10px;
  background: var(--sand-50);
}
.his-map-name { flex: 0 0 5.5em; font-size: 13px; font-weight: 600; color: var(--sand-700); }
.his-map-input { flex: 1 1 120px; }
.his-map-move { display: inline-flex; gap: 4px; flex: none; }
.his-map-arrow {
  width: 26px;
  height: 26px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid var(--sand-300);
  background: var(--sand-50);
  color: var(--sand-600);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}
.his-map-arrow:hover:not(:disabled) { border-color: var(--eir-500); color: var(--eir-700); }
.his-map-arrow:disabled { opacity: 0.4; cursor: default; }
.his-map-hide {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: none;
  font-size: 12px;
  color: var(--sand-500);
  cursor: pointer;
}

/* ---------- 患者宣教 handout（多语言标签与分块卡片） ---------- */
.handout-lang-label { flex: none; font-size: 12.5px; font-weight: 600; color: var(--sand-600); }
.handout-block {
  margin: 6px 0;
  padding: 10px 12px;
  border: 1px solid var(--sand-200);
  border-left: 3px solid rgba(30, 148, 168, 0.5);
  border-radius: 10px;
  background: var(--sand-50);
}
.handout-block-title { margin: 0; font-size: 12px; font-weight: 700; color: var(--eir-700); }
.handout-block-body { margin: 4px 0 0; font-size: 13.5px; line-height: 1.7; color: var(--sand-700); }

/* ---------- 工作量统计 / 质控趋势（统计卡与纵向柱状图 + 目标线） ---------- */
.batch-card {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  vertical-align: top;
  min-width: 110px;
  margin: 4px 6px 4px 0;
  padding: 10px 14px;
  border: 1px solid var(--sand-200);
  border-radius: 12px;
  background: var(--sand-50);
}
.batch-card b { font-size: 18px; font-weight: 800; color: var(--eir-700); font-variant-numeric: tabular-nums; }
.batch-card span { font-size: 12px; color: var(--sand-500); }
.batch-trend { margin: 10px 0; }
.trend-bars {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 130px;
  margin-top: 10px;
  padding: 0 4px;
  border-bottom: 1px solid var(--sand-300);
}
.trend-col {
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
  padding-top: 22px; /* 给柱顶数值留位：100% 柱（甲级率常满格）不把数字顶出图区 */
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
}
.trend-bar {
  position: relative;
  width: 100%;
  max-width: 34px;
  border-radius: 6px 6px 2px 2px;
  background: var(--sand-300);
}
.trend-bar-ok { background: var(--eir-500); }
.trend-bar-miss { background: var(--gold-500); }
.trend-bar b {
  position: absolute;
  top: -19px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  font-weight: 700;
  color: var(--sand-600);
  white-space: nowrap;
}
.trend-label { flex: none; font-size: 11px; color: var(--sand-500); font-variant-numeric: tabular-nums; }
.trend-target-line {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 2px dashed rgba(220, 38, 38, 0.55);
  pointer-events: none;
}
.trend-target-tag {
  position: absolute;
  right: 0;
  top: -19px;
  font-size: 11px;
  font-weight: 700;
  color: var(--danger-ink, #9f1239);
  background: var(--sand-50);
  padding: 0 4px;
}
.trend-dim {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  color: var(--sand-600);
  cursor: pointer;
}
.trend-dim input { accent-color: var(--eir-500); }
.batch-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px 10px;
  margin-top: 8px;
}
.batch-filter-grid .handout-lang-label {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 12px;
  color: var(--sand-500);
  font-weight: 600;
}
.batch-filter-grid .handout-lang-label > .lex-input { width: 100%; }
.batch-target-input { flex: 0 1 90px; }
.batch-target-note { flex: none; font-size: 12px; color: var(--sand-500); }

/* ---------- 溯源核对（trace-item 此前只有暗色覆盖；句子 + 标签 + 核对点） ---------- */
.trace-item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
  margin: 4px 0;
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.65;
}
.trace-item.is-fact {
  background: rgba(220, 38, 38, 0.06);
  border: 1px solid rgba(220, 38, 38, 0.24);
}
.trace-item.is-diagnosis {
  background: rgba(212, 167, 106, 0.08);
  border: 1px solid rgba(212, 167, 106, 0.28);
}
.trace-tag {
  flex: none;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.trace-tag.is-fact { background: rgba(220, 38, 38, 0.1); color: var(--danger-ink, #9f1239); }
.trace-tag.is-diagnosis { background: rgba(212, 167, 106, 0.16); color: var(--gold-700); }
.trace-sentence { flex: 1 1 240px; min-width: 0; color: var(--sand-700); word-break: break-word; }
.trace-entities { flex: 1 1 100%; font-size: 12px; color: var(--sand-500); }
.is-clickable { cursor: pointer; }
.evidence-jump {
  flex: none;
  margin-left: auto;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.7;
  cursor: pointer;
  background: rgba(30, 148, 168, 0.1);
  color: var(--eir-700);
  border: 1px solid rgba(30, 148, 168, 0.32);
}
.evidence-jump:hover { background: rgba(30, 148, 168, 0.2); }

/* ---------- 版本对比 diff（行级红删绿增 + 词级高亮） ---------- */
.diff-block, .diff-change, .diff-remove, .diff-add {
  margin: 4px 0;
  border: 1px solid var(--sand-200);
  border-radius: 10px;
  overflow: hidden;
}
.diff-line {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 5px 10px;
  font-size: 13px;
  line-height: 1.65;
  word-break: break-word;
  color: var(--sand-700);
}
.diff-del-line {
  background: rgba(220, 38, 38, 0.06);
  border-left: 3px solid rgba(220, 38, 38, 0.4);
}
.diff-add-line {
  background: rgba(22, 163, 74, 0.07);
  border-left: 3px solid rgba(22, 163, 74, 0.45);
}
.diff-mark { flex: none; width: 1.2em; text-align: center; font-weight: 800; color: var(--sand-500); }
.diff-word-del { background: rgba(220, 38, 38, 0.18); border-radius: 3px; padding: 0 1px; }
.diff-word-add { background: rgba(22, 163, 74, 0.2); border-radius: 3px; padding: 0 1px; }
.ai-diff-line {
  display: block;
  margin: 2px 0;
  font-size: 13px;
  line-height: 1.65;
  color: var(--sand-600);
  word-break: break-word;
}

/* ---------- 随访待办清单（todo 行 / 勾选行 / 履约批量勾选） ---------- */
.todo-list { display: flex; flex-direction: column; gap: 4px; margin: 10px 0; }
.todo-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--sand-200);
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.6;
  background: var(--sand-50);
  transition: background 140ms ease, border-color 140ms ease;
}
.todo-line:hover { background: var(--eir-50); border-color: rgba(30, 148, 168, 0.35); }
.todo-line b { flex: none; }
.todo-line-done, .fall-todo-item-done {
  color: var(--sand-500);
  background: var(--sand-100);
  border-color: var(--sand-200);
  text-decoration: line-through;
  text-decoration-color: var(--sand-400);
}
.todo-check-line, .perform-batch-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--sand-600);
  cursor: pointer;
  margin: 2px 0;
}
.todo-cfg-box, .todo-done-box, .screen-cfg-box { accent-color: var(--eir-500); flex: none; }
.todo-kind-assign { margin-top: 6px; }
.todo-owner-input { flex: 0 1 140px; }
.todo-copy { margin-left: auto; }
.perform-batch-items {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 6px 0;
  padding-left: 12px;
  border-left: 2px solid var(--sand-200);
}

/* ---------- 公卫随访杂项行（片区联系 / 今日名单 / 老年人查体 / 失访通话计划） ---------- */
.area-contact-line { display: block; margin: 4px 0; font-size: 12.5px; color: var(--sand-500); }
.area-today-sub {
  margin: 6px 0 6px 12px;
  padding: 6px 10px;
  border-left: 2px solid rgba(30, 148, 168, 0.35);
  font-size: 13px;
  line-height: 1.65;
}
.elder-check-line { margin: 4px 0 0; font-size: 13px; color: var(--sand-600); }
.lost-call-plan-line { color: var(--gold-700); }
.review-check-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 13px;
  color: var(--sand-600);
  cursor: pointer;
}
.review-check-row input { accent-color: var(--eir-500); }
.review-trend-line {
  margin: 4px 0;
  font-size: 13px;
  line-height: 1.7;
  font-variant-numeric: tabular-nums;
}
.risk-list { display: flex; flex-direction: column; gap: 4px; margin: 8px 0; }
.risk-card-evidence { cursor: pointer; }

/* ---------- 额外用药（长期用药清单行 + 停药线 + 化验监测行） ---------- */
.extra-med-form { border-left: 3px solid rgba(30, 148, 168, 0.35); }
.extra-med-row { margin-top: 4px; }
.extra-med-list { margin-top: 6px; }
.extra-med-name { flex: 2 1 150px; }
.extra-med-dose { flex: 1 1 90px; }
.extra-med-src { flex: 1 1 110px; }
.extra-med-day, .extra-med-by { flex: 1 1 80px; }
.extra-med-left { flex: 1 1 90px; }
.extra-med-lab-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0; }
.extra-med-stopped { color: var(--sand-500); text-decoration: line-through; text-decoration-color: var(--sand-400); }

/* ---------- 儿科剂量表（表头 + 改动徽标 + 说明书批量解析行） ---------- */
.ped-dose-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 2px;
}
.ped-dose-head span { flex: 1 1 70px; font-size: 11.5px; color: var(--sand-500); }
.ped-dose-head span:first-child { flex: 2 1 180px; }
.ped-dose-select { min-height: 32px; padding: 2px 6px; font-size: 12.5px; }
.ped-dose-badge {
  flex: none;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--sand-100);
  border: 1px solid var(--sand-200);
  color: var(--sand-500);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.ped-bulk-line {
  margin: 4px 0;
  padding: 4px 8px;
  border: 1px dashed var(--sand-300);
  border-radius: 10px;
}
.ped-bulk-text { flex: 1 1 auto; min-width: 0; word-break: break-word; font-size: 13px; }
.ped-bulk-note { flex: none; font-style: normal; font-size: 12px; color: var(--gold-700); }
.ped-bulk-skipped-head { margin: 8px 0 2px; font-size: 12.5px; font-weight: 600; color: var(--gold-700); }
.ped-bulk-skipped { margin: 2px 0; font-size: 12.5px; color: var(--gold-700); }

/* ---------- 团队名单（公卫责任人编辑行 + 名下人数） ---------- */
.owner-row { margin-top: 6px; }
.owner-name-input { flex: 1 1 90px; }
.owner-contact-input { flex: 1.2 1 130px; }
.owner-duty-input { flex: 1.5 1 150px; }
.owner-area-input { flex: 1 1 120px; }
.owner-people-count { flex: none; font-size: 12px; color: var(--sand-500); }
.group-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--sand-200);
  font-size: 13px;
  transition: background 140ms ease;
}
.group-row:hover { background: var(--eir-50); }
.group-name { flex: 0 1 auto; font-size: 13px; color: var(--sand-700); }
.group-meta { flex: 1 1 auto; font-size: 12px; color: var(--sand-500); }

/* ---------- 筛查配置 / 自用药化验曲线（勾选项与图表容器） ---------- */
.screen-cfg-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 2px 6px 2px 0;
  font-size: 13px;
  cursor: pointer;
}
.selfmed-chart-wrap {
  margin: 8px 0;
  padding: 8px;
  border: 1px solid var(--sand-200);
  border-radius: 12px;
  background: var(--sand-50);
}
.selfmed-range-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 6px 0; }

/* ---------- 临床计算器与表单标签（calc 面板字段行） ---------- */
.calc-label { flex: none; font-size: 13px; font-weight: 600; color: var(--sand-600); }
.calc-input {
  flex: 1 1 100px;
  min-width: 0;
  min-height: 34px;
  padding: 5px 9px;
  border-radius: 10px;
  border: 1px solid var(--sand-300);
  background: var(--sand-50);
  color: inherit;
  font-size: 13px;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.calc-input:focus {
  outline: none;
  border-color: var(--eir-500);
  box-shadow: 0 0 0 3px rgba(30, 148, 168, 0.14);
}
.calc-main { margin: 6px 0 2px; font-size: 15px; font-weight: 700; color: var(--eir-700); }

/* ---------- 生成后自检卡（体检头 / 摘要 / 详情 / 脚注） ---------- */
.selfcheck-card {
  margin-top: 10px;
  padding: 10px 14px;
  border: 1px solid rgba(30, 148, 168, 0.22);
  border-radius: 14px;
  background: rgba(30, 148, 168, 0.05);
}
.selfcheck-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.selfcheck-head b { flex: none; font-size: 13px; color: var(--sand-700); }
.selfcheck-summary { flex: 1 1 200px; font-size: 12.5px; color: var(--sand-600); }
.selfcheck-body {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--sand-300);
  font-size: 13px;
  line-height: 1.65;
}
.selfcheck-foot { margin: 8px 0 0; font-size: 12px; color: var(--sand-500); }
.selfcheck-good { color: var(--health-600); font-weight: 600; }
.selfcheck-bad { color: var(--danger-ink, #9f1239); font-weight: 600; }

/* ---------- 新手引导 / 微信提示条（onboarding-card 此前只有暗色覆盖） ---------- */
.onboarding-card {
  margin-bottom: 12px;
  padding: 12px 16px;
  border: 1px solid rgba(30, 148, 168, 0.25);
  border-radius: 14px;
  background: var(--sand-50);
}
.onboarding-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.onboarding-head b { font-size: 14px; color: var(--sand-700); }
.onboarding-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 6px 14px;
  margin-top: 8px;
}
.onboarding-steps div { font-size: 13px; line-height: 1.7; color: var(--sand-600); }
.onboarding-steps b { color: var(--sand-700); }
.onboarding-tip { margin: 8px 0 0; font-size: 12.5px; color: var(--sand-500); }
.wechat-banner {
  border-color: rgba(212, 167, 106, 0.5);
  background: rgba(212, 167, 106, 0.08);
}

/* ---------- 提醒条（档案备份催办 / 待补充待办 / 余额告警 / 风险复核横幅） ---------- */
.archive-nudge-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 9px 12px;
  border: 1px solid rgba(212, 167, 106, 0.35);
  border-left: 3px solid var(--gold-500);
  border-radius: 12px;
  background: rgba(212, 167, 106, 0.1);
}
.archive-nudge-text { flex: 1 1 200px; font-size: 13px; line-height: 1.6; color: var(--gold-700); }
.note-todo-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 9px 12px;
  border: 1px solid rgba(30, 148, 168, 0.3);
  border-left: 3px solid var(--eir-500);
  border-radius: 12px;
  background: var(--eir-50);
}
.note-todo-text { flex: 1 1 200px; font-size: 13px; line-height: 1.6; color: var(--sand-700); }
.app-warn-text { color: var(--gold-700); }
.app-quota.is-warning, .is-warning {
  border-color: rgba(212, 167, 106, 0.5);
  background: rgba(212, 167, 106, 0.12);
}
.risk-inline-alert {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 9px 12px;
  border: 1px solid rgba(220, 38, 38, 0.3);
  border-left: 3px solid rgba(220, 38, 38, 0.65);
  border-radius: 12px;
  background: rgba(220, 38, 38, 0.07);
}
.risk-inline-text { flex: 1 1 240px; font-size: 13px; line-height: 1.6; color: var(--danger-ink, #9f1239); }
.risk-inline-close {
  flex: none;
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(220, 38, 38, 0.35);
  background: transparent;
  color: var(--danger-ink, #9f1239);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}
.risk-inline-close:hover { background: rgba(220, 38, 38, 0.1); }
.note-flash { animation: note-flash-kf 1.1s ease-out; }
@keyframes note-flash-kf {
  from { background: rgba(30, 148, 168, 0.25); }
  to { background: transparent; }
}
.is-hidden-row { opacity: 0.55; }

/* ---------- 患者信息 / 就诊预设 / 化验拍照 / 方言提示（病历选项区） ---------- */
.patient-info-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px 12px;
}
.patient-info-row label > span {
  display: block;
  margin-bottom: 3px;
  font-size: 12.5px;
  color: var(--sand-500);
}
.preset-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; margin-top: 8px; }
.preset-row label { flex: 1 1 220px; }
.preset-row label > span {
  display: block;
  margin-bottom: 3px;
  font-size: 12.5px;
  color: var(--sand-500);
}
.preset-name-row {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--sand-100);
}
.labs-photo-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; }
.dialect-hint { margin: 6px 0 0; font-size: 12.5px; line-height: 1.65; color: var(--sand-500); }
.patient-chart-hint {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 8px 12px;
  border: 1px dashed rgba(30, 148, 168, 0.35);
  border-radius: 12px;
  background: var(--eir-50);
  font-size: 13px;
  color: var(--sand-600);
}
.patient-chart-hint > span { flex: 1 1 200px; }

/* ---------- 面板搜索空态 / 面板锚点 / 记录工具条 / 邀请卡 ---------- */
.panel-search-empty {
  margin: 8px 0;
  padding: 14px;
  border: 1px dashed var(--sand-300);
  border-radius: 12px;
  text-align: center;
  font-size: 13px;
  color: var(--sand-500);
}
.app-panel-note, .app-panel-transcript { scroll-margin-top: 84px; }
.history-tools { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; align-items: center; }
.history-tools input {
  flex: 1 1 200px;
  min-width: 0;
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 10px;
  border: 1px solid var(--sand-300);
  background: var(--sand-50);
  color: inherit;
  font-size: 13px;
}
.history-tools input:focus {
  outline: none;
  border-color: var(--eir-500);
  box-shadow: 0 0 0 3px rgba(30, 148, 168, 0.14);
}
.invite-card {
  border-color: rgba(212, 167, 106, 0.4);
  background: rgba(212, 167, 106, 0.06);
}

/* ---------- 页脚与信任条（app 页脚此前裸奔，与官网页脚层级不一致） ---------- */
.app-footer {
  margin-top: 26px;
  padding: 26px 0 34px;
  border-top: 1px solid var(--sand-200);
  text-align: center;
  font-size: 12px;
  color: var(--sand-500);
}
.app-trust-strip { margin-top: 22px; }
.app-trust-strip div { padding: 12px 14px; }
.app-trust-strip dt { font-size: 0.7rem; }
.app-trust-strip dd { margin-top: 6px; font-size: 0.88rem; }
.changelog-new-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--gold-500);
  color: #fff;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  vertical-align: middle;
}
.site-icp {
  margin: 14px 0 0;
  text-align: center;
  font-size: 12px;
  color: var(--sand-500);
}
.split-section { padding-top: 8px; }

/* ---------- 暗色补充（仅金/红等不随 token 翻转的文字色，沿用本文件既有暗色值） ---------- */
:root[data-theme="dark"] .arch-compare-warn,
:root[data-theme="dark"] .archive-nudge-text,
:root[data-theme="dark"] .app-warn-text,
:root[data-theme="dark"] .lost-call-plan-line,
:root[data-theme="dark"] .ped-bulk-note,
:root[data-theme="dark"] .ped-bulk-skipped,
:root[data-theme="dark"] .ped-bulk-skipped-head { color: var(--gold-200); }
:root[data-theme="dark"] .risk-inline-text,
:root[data-theme="dark"] .risk-inline-close,
:root[data-theme="dark"] .selfcheck-bad,
:root[data-theme="dark"] .trend-target-tag { color: #fca5a5; }
:root[data-theme="dark"] .trace-tag.is-fact { background: rgba(248, 113, 113, 0.14); color: #fca5a5; }
:root[data-theme="dark"] .trace-tag.is-diagnosis { background: rgba(212, 167, 106, 0.2); color: var(--gold-200); }
:root[data-theme="dark"] .qc-grade-a { background: rgba(45, 212, 191, 0.12); border-color: rgba(45, 212, 191, 0.36); color: #5eead4; }
:root[data-theme="dark"] .qc-grade-b { background: rgba(212, 167, 106, 0.18); border-color: rgba(212, 167, 106, 0.42); color: var(--gold-200); }
:root[data-theme="dark"] .qc-grade-c { background: rgba(248, 113, 113, 0.12); border-color: rgba(248, 113, 113, 0.36); color: #fca5a5; }
:root[data-theme="dark"] .selfcheck-good { color: #5eead4; }
:root[data-theme="dark"] .qc-clean { color: #5eead4; }
:root[data-theme="dark"] .qc-item-high { background: rgba(248, 113, 113, 0.12); border-color: rgba(248, 113, 113, 0.38); color: #fca5a5; }
:root[data-theme="dark"] .qc-item-mid { background: rgba(212, 167, 106, 0.14); border-color: rgba(212, 167, 106, 0.38); color: var(--gold-200); }
:root[data-theme="dark"] .qc-item-low { background: rgba(94, 234, 212, 0.06); border-color: rgba(94, 234, 212, 0.24); color: #99f6e4; }
:root[data-theme="dark"] .ddx-item { background: rgba(45, 212, 191, 0.06); border-color: rgba(45, 212, 191, 0.22); }
:root[data-theme="dark"] .ddx-item-cannotmiss { background: rgba(248, 113, 113, 0.1); border-color: rgba(248, 113, 113, 0.34); }
:root[data-theme="dark"] .lex-del:hover { border-color: rgba(248, 113, 113, 0.5); color: #fca5a5; }
:root[data-theme="dark"] .trend-target-tag { background: transparent; }

/* ---------- 跌倒风险问询与待办（老年人体检 fall 面板：问询下拉行 / 分级线 / 待办勾选） ---------- */
.fall-ask-row { margin-top: 6px; }
.fall-ask-item { flex: none; }
.fall-ask-sel { flex: 0 1 150px; }
.fall-todo-check { display: flex; flex-direction: column; gap: 4px; margin: 8px 0; }
.fall-todo-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--sand-600);
  cursor: pointer;
}
.fall-todo-item input { accent-color: var(--eir-500); flex: none; }
.fall-todo-meta { font-size: 12px; color: var(--sand-500); }
.fall-due-line, .fall-level-line, .fall-todo-line { margin: 4px 0 0; font-size: 13px; }

/* ---------- 官网 hero 左栏（防止长词撑破两栏布局） ---------- */
.hero-copy { min-width: 0; }

/* v2.240（D组 P3）：登记完成徽标暗色变体——浅绿在暗底下对比不足 */
:root[data-theme="dark"] .risk-cv-registered {
  color: #4ade80;
  background: rgba(74, 222, 128, 0.10);
  border-color: rgba(74, 222, 128, 0.30);
}
