    :root {
      --bg: #f7f7f8;
      --panel: #ffffff;
      --panel-2: #f3f4f6;
      --ink: #1f2328;
      --muted: #667085;
      --line: #e5e7eb;
      --accent: #1f7a5a;
      --accent-strong: #166046;
      --shadow: 0 8px 30px rgba(15, 23, 42, 0.06);
    }
    * { box-sizing: border-box; }
    body {
      margin: 0;
      font-family: "IBM Plex Sans", "Noto Sans SC", "PingFang SC", sans-serif;
      color: var(--ink);
      background: var(--bg);
      min-height: 100vh;
    }
    .workspace {
      min-height: 100vh;
      display: grid;
      grid-template-columns: 280px minmax(0, 1fr);
    }
    .history-sidebar {
      position: sticky;
      top: 0;
      height: 100vh;
      max-height: 100vh;
      overflow: hidden;
      border-right: 1px solid var(--line);
      background: linear-gradient(180deg, #f3f5f6 0%, #eef1f2 100%);
      padding: 16px 12px 12px;
      display: flex;
      flex-direction: column;
      gap: 10px;
      min-height: 0;
    }
    .history-sidebar-head {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 12px;
      flex: 0 0 auto;
    }
    .sidebar-tab-bar,
    .history-new-btn,
    .health-actions {
      flex: 0 0 auto;
    }
    .history-sidebar-kicker {
      font-size: 11px;
      color: var(--accent-strong);
      letter-spacing: 0.16em;
      text-transform: uppercase;
      font-weight: 700;
      margin-bottom: 6px;
    }
    .history-sidebar-title {
      font-size: 20px;
      font-weight: 780;
      line-height: 1.15;
      color: #102018;
    }
    .history-sidebar-meta {
      color: var(--muted);
      font-size: 12px;
      line-height: 1.65;
      padding: 0 2px;
      flex: 0 0 auto;
    }
    .history-new-btn {
      width: 100%;
      border: 0;
      border-radius: 14px;
      padding: 12px 14px;
      font: inherit;
      font-weight: 700;
      color: white;
      background: linear-gradient(135deg, var(--accent), var(--accent-strong));
      box-shadow: 0 12px 28px rgba(31, 122, 90, 0.18);
      cursor: pointer;
      text-align: left;
    }
    .history-sidebar-close {
      display: none;
      padding: 8px 12px;
      border-radius: 12px;
      font-size: 13px;
    }
    .history-sidebar-backdrop[hidden] {
      display: none;
    }
    .history-sidebar-backdrop {
      position: fixed;
      inset: 0;
      background: rgba(15, 23, 42, 0.42);
      backdrop-filter: blur(6px);
      z-index: 39;
    }
    .app {
      min-height: 100vh;
      display: grid;
      grid-template-rows: auto 1fr auto;
      min-width: 0;
    }
    .topbar {
      position: sticky;
      top: 0;
      z-index: 20;
      background: rgba(247, 247, 248, 0.92);
      backdrop-filter: blur(10px);
      border-bottom: 1px solid var(--line);
    }
    .topbar-inner {
      max-width: 980px;
      margin: 0 auto;
      padding: 14px 18px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
    }
    .topbar-actions {
      display: flex;
      align-items: center;
      gap: 12px;
    }
    .history-toggle-btn {
      display: none;
    }
    .brand {
      display: flex;
      align-items: center;
      gap: 12px;
      min-width: 0;
    }
    .brand-mark {
      width: 36px;
      height: 36px;
      border-radius: 12px;
      object-fit: cover;
      box-shadow: var(--shadow);
    }
    .brand-text {
      min-width: 0;
    }
    .brand-title {
      font-size: 15px;
      font-weight: 700;
    }
    .brand-subtitle {
      font-size: 12px;
      color: var(--muted);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .ghost-btn, .send-btn {
      border: 0;
      border-radius: 14px;
      padding: 10px 14px;
      font: inherit;
      font-weight: 600;
      cursor: pointer;
    }
    .ghost-btn {
      color: var(--ink);
      background: white;
      border: 1px solid var(--line);
    }
    .send-btn {
      color: white;
      background: linear-gradient(135deg, var(--accent), var(--accent-strong));
      box-shadow: 0 10px 24px rgba(31, 122, 90, 0.18);
    }
    .account-summary {
      display: grid;
      gap: 2px;
      min-width: 0;
      text-align: right;
      padding: 8px 12px;
      border: 1px solid var(--line);
      border-radius: 14px;
      background: rgba(255, 255, 255, 0.88);
      cursor: default;
    }
    .account-plan {
      font-size: 12px;
      font-weight: 700;
      color: var(--accent-strong);
      letter-spacing: 0.03em;
      text-transform: uppercase;
    }
    .account-usage {
      font-size: 11px;
      color: var(--muted);
      white-space: nowrap;
    }
    .account-dock {
      flex: 0 0 auto;
      padding-top: 10px;
      border-top: 1px solid rgba(15, 23, 42, 0.07);
    }
    .account-menu-button {
      display: flex;
      align-items: center;
      gap: 9px;
      width: 100%;
      min-width: 0;
      border: 1px solid rgba(15, 23, 42, 0.08);
      border-radius: 14px;
      padding: 8px 9px;
      background: rgba(255, 255, 255, 0.76);
      cursor: pointer;
      text-align: left;
      color: var(--ink);
      transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
    }
    .account-menu-button:hover {
      background: rgba(255, 255, 255, 0.96);
      border-color: rgba(31, 122, 90, 0.18);
      transform: translateY(-1px);
    }
    .account-avatar {
      width: 30px;
      height: 30px;
      border-radius: 10px;
      display: inline-grid;
      place-items: center;
      flex: 0 0 auto;
      color: white;
      font-size: 13px;
      font-weight: 800;
      background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    }
    .account-menu-copy {
      min-width: 0;
      display: grid;
      gap: 2px;
    }
    .account-menu-title {
      font-size: 12px;
      font-weight: 760;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .account-menu-subtitle {
      font-size: 11px;
      color: var(--muted);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .ghost-btn:disabled, .send-btn:disabled {
      cursor: wait;
      opacity: 0.68;
    }
    .thread-shell {
      width: 100%;
    }
    .thread {
      max-width: 980px;
      margin: 0 auto;
      padding: 18px 18px 160px;
      display: grid;
      gap: 18px;
    }
    .welcome {
      min-height: calc(100vh - 240px);
      display: grid;
      gap: 20px;
      align-content: start;
      padding: 28px 0 10px;
    }
    .welcome-hero {
      position: relative;
      overflow: hidden;
      border: 1px solid rgba(31, 122, 90, 0.16);
      border-radius: 28px;
      background:
        radial-gradient(circle at top left, rgba(31, 122, 90, 0.18), transparent 32%),
        radial-gradient(circle at bottom right, rgba(22, 96, 70, 0.14), transparent 28%),
        linear-gradient(135deg, #ffffff, #f7fbf9 58%, #f0f6f3);
      box-shadow: 0 20px 48px rgba(15, 23, 42, 0.08);
      padding: 26px 24px 22px;
      text-align: left;
    }
    .welcome-kicker {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 6px 10px;
      border-radius: 999px;
      background: rgba(15, 23, 42, 0.04);
      color: var(--accent-strong);
      font-size: 12px;
      font-weight: 700;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      margin-bottom: 16px;
    }
    .welcome-card {
      max-width: 700px;
    }
    .welcome-title {
      margin: 0 0 12px;
      font-size: clamp(30px, 4.4vw, 48px);
      line-height: 1.02;
      font-weight: 780;
      letter-spacing: -0.04em;
      text-wrap: balance;
    }
    .welcome-subtitle {
      margin: 0;
      color: var(--muted);
      line-height: 1.82;
      font-size: 15px;
      max-width: 62ch;
    }
    .welcome-badges {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      margin-top: 18px;
    }
    .welcome-badge {
      display: inline-flex;
      align-items: center;
      border-radius: 999px;
      padding: 7px 11px;
      background: rgba(255, 255, 255, 0.86);
      border: 1px solid rgba(31, 122, 90, 0.12);
      color: #183a2f;
      font-size: 12px;
      font-weight: 700;
      box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
    }
    .welcome-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 14px;
    }
    .feature-card {
      text-align: left;
      width: 100%;
      border: 1px solid var(--line);
      border-radius: 22px;
      padding: 18px 18px 16px;
      background: linear-gradient(180deg, #ffffff, #fafbfb);
      cursor: pointer;
      box-shadow: var(--shadow);
      transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
    }
    .feature-card:hover {
      transform: translateY(-2px);
      border-color: rgba(31, 122, 90, 0.26);
      box-shadow: 0 18px 32px rgba(15, 23, 42, 0.08);
    }
    .feature-card-accent {
      background: linear-gradient(180deg, #f8fcfa, #eef7f2);
      border-color: rgba(31, 122, 90, 0.22);
    }
    .feature-title {
      font-size: 15px;
      font-weight: 780;
      color: #102018;
      margin-bottom: 8px;
    }
    .feature-body {
      color: var(--muted);
      font-size: 13px;
      line-height: 1.72;
    }
    .welcome-suggestions {
      border: 1px solid var(--line);
      border-radius: 22px;
      background: rgba(255, 255, 255, 0.8);
      padding: 16px 16px 14px;
    }
    .welcome-section-title {
      font-size: 13px;
      font-weight: 780;
      color: #123b2d;
      margin-bottom: 12px;
      letter-spacing: 0.02em;
    }
    .prompt-chip-row {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
    }
    .prompt-chip {
      border: 1px solid rgba(31, 122, 90, 0.14);
      background: #ffffff;
      color: #1f2328;
      border-radius: 16px;
      padding: 10px 12px;
      font: inherit;
      font-size: 13px;
      line-height: 1.45;
      cursor: pointer;
      text-align: left;
      box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
      transition: border-color 140ms ease, transform 140ms ease;
    }
    .prompt-chip:hover {
      transform: translateY(-1px);
      border-color: rgba(31, 122, 90, 0.26);
    }
    .welcome-footnote {
      padding: 0 4px;
      color: var(--muted);
      font-size: 12px;
      line-height: 1.75;
    }
    .case-workbench {
      display: grid;
      gap: 12px;
      padding: 12px 12px 10px;
      border: 1px solid rgba(31, 122, 90, 0.12);
      border-radius: 18px;
      background:
        radial-gradient(circle at top right, rgba(31, 122, 90, 0.08), transparent 28%),
        linear-gradient(180deg, #fbfefd, #f4faf7);
      margin-bottom: 10px;
    }
    .case-workbench-head {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 12px;
    }
    .case-workbench-kicker {
      font-size: 11px;
      font-weight: 800;
      letter-spacing: 0.12em;
      text-transform: uppercase;
      color: var(--accent-strong);
      margin-bottom: 4px;
    }
    .case-workbench-title {
      font-size: 14px;
      line-height: 1.6;
      color: #123b2d;
      font-weight: 650;
      max-width: 58ch;
    }
    .case-workbench-actions {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      justify-content: flex-end;
    }
    .case-template-grid {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
    }
    .case-template-chip {
      border: 1px solid rgba(31, 122, 90, 0.12);
      background: rgba(255, 255, 255, 0.92);
      color: #183a2f;
      border-radius: 999px;
      padding: 7px 11px;
      font: inherit;
      font-size: 12px;
      font-weight: 700;
      cursor: pointer;
      box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
      transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
    }
    .case-template-chip:hover {
      transform: translateY(-1px);
      border-color: rgba(31, 122, 90, 0.26);
      background: #ffffff;
    }
    .case-form-panel {
      display: grid;
      gap: 10px;
      padding-top: 4px;
      border-top: 1px dashed rgba(31, 122, 90, 0.16);
    }
    .case-form-panel[hidden] {
      display: none;
    }
    .case-form-backdrop {
      display: none;
    }
    .case-form-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 10px;
    }
    .case-form-field {
      display: grid;
      gap: 6px;
      align-content: start;
    }
    .case-form-field-wide {
      grid-column: 1 / -1;
    }
    .case-form-label {
      font-size: 12px;
      font-weight: 780;
      color: #123b2d;
      letter-spacing: 0.02em;
    }
    .case-form-input {
      width: 100%;
      min-width: 0;
      border: 1px solid rgba(15, 23, 42, 0.1);
      border-radius: 14px;
      background: rgba(255, 255, 255, 0.96);
      padding: 10px 12px;
      font: inherit;
      font-size: 13px;
      line-height: 1.55;
      color: var(--ink);
      outline: none;
      transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
    }
    .case-form-input:focus {
      border-color: rgba(31, 122, 90, 0.34);
      box-shadow: 0 0 0 3px rgba(31, 122, 90, 0.08);
      background: #ffffff;
    }
    .case-form-textarea {
      resize: vertical;
      min-height: 72px;
    }
    .case-form-actions {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      justify-content: flex-start;
      padding-top: 2px;
    }
    .case-divider {
      display: flex;
      align-items: center;
      gap: 12px;
      color: var(--muted);
      font-size: 12px;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      margin: 6px 0 2px;
    }
    .case-divider::before,
    .case-divider::after {
      content: "";
      height: 1px;
      flex: 1;
      background: var(--line);
    }
    .message-row {
      display: flex;
      gap: 14px;
      align-items: flex-start;
    }
    .message-row.user {
      justify-content: flex-end;
    }
    .avatar {
      flex: 0 0 34px;
      width: 34px;
      height: 34px;
      border-radius: 10px;
      display: grid;
      place-items: center;
      font-size: 13px;
      font-weight: 700;
      color: white;
      background: linear-gradient(135deg, var(--accent), var(--accent-strong));
      box-shadow: var(--shadow);
    }
    .user .avatar {
      background: linear-gradient(135deg, #0f172a, #334155);
      order: 2;
    }
    .bubble {
      max-width: min(760px, calc(100vw - 96px));
      background: var(--panel);
      border: 1px solid var(--line);
      border-radius: 20px;
      padding: 16px 18px;
      line-height: 1.8;
      white-space: pre-wrap;
      box-shadow: var(--shadow);
    }
    .user .bubble {
      background: #ffffff;
      border-bottom-right-radius: 8px;
    }
    .assistant .bubble {
      border-bottom-left-radius: 8px;
      background: #fcfcfd;
    }
    .bubble-rich {
      display: grid;
      gap: 8px;
    }
    .case-answer {
      display: grid;
      gap: 10px;
    }
    .case-role-hint {
      display: grid;
      gap: 4px;
      padding: 10px 12px;
      border-radius: 14px;
      border: 1px solid rgba(31, 122, 90, 0.18);
      background: linear-gradient(180deg, rgba(31, 122, 90, 0.1), rgba(31, 122, 90, 0.03));
    }
    .case-role-hint-label {
      font-size: 12px;
      font-weight: 800;
      letter-spacing: 0.04em;
      color: var(--accent-strong);
    }
    .case-role-hint-detail {
      font-size: 13px;
      line-height: 1.55;
      color: var(--ink-subtle);
    }
    .case-answer-card {
      display: grid;
      gap: 8px;
      padding: 12px 13px;
      border-radius: 16px;
      border: 1px solid rgba(15, 23, 42, 0.08);
      background: #ffffff;
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.62);
    }
    .case-answer-card-primary {
      background: linear-gradient(180deg, rgba(31, 122, 90, 0.16), rgba(31, 122, 90, 0.05));
      border-color: rgba(31, 122, 90, 0.22);
    }
    .case-answer-card-secondary {
      background: linear-gradient(180deg, rgba(15, 23, 42, 0.06), rgba(15, 23, 42, 0.02));
    }
    .case-answer-card-formula {
      background: linear-gradient(180deg, rgba(184, 115, 51, 0.12), rgba(184, 115, 51, 0.04));
      border-color: rgba(184, 115, 51, 0.18);
    }
    .case-answer-card-missing {
      background: linear-gradient(180deg, rgba(23, 92, 211, 0.08), rgba(23, 92, 211, 0.02));
      border-color: rgba(23, 92, 211, 0.14);
    }
    .case-answer-card-warning {
      background: linear-gradient(180deg, rgba(180, 35, 24, 0.08), rgba(180, 35, 24, 0.02));
      border-color: rgba(180, 35, 24, 0.12);
    }
    .case-answer-card-title {
      font-size: 12px;
      font-weight: 800;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      color: var(--accent-strong);
    }
    .case-answer-card-body {
      display: grid;
      gap: 8px;
    }
    .case-answer-card-body .bubble-rich {
      gap: 6px;
    }
    .answer-line {
      white-space: pre-wrap;
      word-break: break-word;
    }
    .answer-table-wrap {
      width: 100%;
      overflow-x: auto;
      border: 1px solid rgba(15, 23, 42, 0.08);
      border-radius: 14px;
      background: #ffffff;
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
    }
    .answer-table {
      width: 100%;
      min-width: 420px;
      border-collapse: collapse;
      font-size: 14px;
      line-height: 1.7;
    }
    .answer-table th,
    .answer-table td {
      padding: 10px 12px;
      text-align: left;
      vertical-align: top;
      border-bottom: 1px solid rgba(15, 23, 42, 0.08);
      white-space: normal;
      word-break: break-word;
    }
    .answer-table th {
      background: linear-gradient(180deg, rgba(31, 122, 90, 0.12), rgba(31, 122, 90, 0.04));
      color: #123b2d;
      font-weight: 800;
    }
    .answer-table tbody tr:nth-child(even) td {
      background: rgba(248, 250, 252, 0.7);
    }
    .answer-table tbody tr:last-child td {
      border-bottom: 0;
    }
    .answer-line-core {
      font-size: 16px;
      line-height: 1.95;
    }
    .answer-line-main-formula {
      display: grid;
      gap: 6px;
      padding: 10px 12px;
      border-radius: 14px;
      background: linear-gradient(180deg, rgba(31, 122, 90, 0.12), rgba(31, 122, 90, 0.04));
      border: 1px solid rgba(31, 122, 90, 0.16);
    }
    .answer-formula-label {
      display: inline-block;
      color: #475467;
      font-weight: 700;
      letter-spacing: 0.02em;
    }
    .answer-formula-label-main {
      color: var(--accent-strong);
      font-size: 13px;
    }
    .answer-formula-name {
      display: inline-block;
      padding: 2px 10px;
      border-radius: 999px;
      background: rgba(31, 122, 90, 0.14);
      color: #0f5137;
      font-weight: 850;
      font-size: 16px;
      letter-spacing: 0.01em;
    }
    .answer-formula-name-main {
      display: block;
      width: fit-content;
      max-width: 100%;
      padding: 6px 14px;
      font-size: 20px;
      line-height: 1.5;
      border-radius: 14px;
      background: rgba(31, 122, 90, 0.18);
      box-shadow: inset 0 0 0 1px rgba(31, 122, 90, 0.12);
    }
    .answer-herb-dose {
      color: #0f5137;
      font-weight: 800;
    }
    .answer-section-label {
      display: inline-block;
      padding: 1px 7px;
      margin: 0 2px;
      border-radius: 8px;
      background: rgba(15, 23, 42, 0.08);
      color: #0f172a;
      font-weight: 800;
    }
    .answer-line-subitem {
      color: #1f2937;
      padding-left: 4px;
      line-height: 1.85;
    }
    .answer-subitem-number {
      color: #667085;
      font-weight: 600;
    }
    .answer-line-heading {
      display: flex;
      align-items: baseline;
      gap: 6px;
      padding: 6px 10px;
      border-left: 4px solid rgba(31, 122, 90, 0.9);
      border-radius: 10px;
      background: linear-gradient(90deg, rgba(31, 122, 90, 0.1), rgba(31, 122, 90, 0.02));
      color: #123b2d;
    }
    .answer-heading-number {
      font-weight: 800;
      color: var(--accent-strong);
      letter-spacing: 0.02em;
      flex: 0 0 auto;
    }
    .answer-heading-text {
      font-weight: 800;
      color: #0f172a;
    }
    .answer-spacer {
      height: 8px;
    }
    @media (max-width: 640px) {
      .bubble {
        max-width: calc(100vw - 44px);
        padding: 14px 14px;
      }
      .answer-line-main-formula {
        padding: 9px 10px;
      }
      .answer-formula-name-main {
        font-size: 18px;
      }
      .answer-table {
        min-width: 360px;
        font-size: 13px;
      }
      .answer-table th,
      .answer-table td {
        padding: 9px 10px;
      }
    }
    .message-stack {
      display: grid;
      gap: 10px;
      max-width: min(760px, calc(100vw - 96px));
    }
    .report-card {
      border: 1px solid var(--line);
      border-radius: 18px;
      background: linear-gradient(180deg, #ffffff 0%, #f8fbfa 100%);
      padding: 14px 16px;
      box-shadow: var(--shadow);
    }
    .report-card-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 10px;
    }
    .report-card-title {
      font-size: 14px;
      font-weight: 700;
    }
    .report-chip {
      display: inline-flex;
      align-items: center;
      border-radius: 999px;
      padding: 4px 9px;
      font-size: 12px;
      font-weight: 700;
      background: rgba(31, 122, 90, 0.12);
      color: var(--accent-strong);
    }
    .report-sections {
      display: grid;
      gap: 10px;
    }
    .report-section {
      border-top: 1px solid var(--line);
      padding-top: 10px;
    }
    .report-section:first-child {
      border-top: 0;
      padding-top: 0;
    }
    .report-section-title {
      font-size: 12px;
      font-weight: 700;
      letter-spacing: 0.04em;
      color: var(--muted);
      text-transform: uppercase;
      margin-bottom: 6px;
    }
    .report-list {
      margin: 0;
      padding-left: 18px;
      display: grid;
      gap: 4px;
      line-height: 1.65;
      font-size: 14px;
    }
    .report-empty {
      font-size: 14px;
      color: var(--muted);
      line-height: 1.6;
    }
    .lab-item-name {
      font-weight: 700;
    }
    .lab-flag-high {
      color: #b42318;
      font-weight: 700;
    }
    .lab-flag-low {
      color: #175cd3;
      font-weight: 700;
    }
    .lab-flag-positive {
      color: #b42318;
      font-weight: 700;
    }
    .status-line {
      max-width: 980px;
      margin: 0 auto;
      padding: 0 18px 10px;
      color: var(--muted);
      font-size: 13px;
    }
    .modal-shell[hidden] {
      display: none;
    }
    .modal-shell {
      position: fixed;
      inset: 0;
      z-index: 50;
      display: grid;
      place-items: center;
      padding: 18px;
    }
    .modal-backdrop {
      position: absolute;
      inset: 0;
      background: rgba(15, 23, 42, 0.45);
      backdrop-filter: blur(8px);
    }
    .modal-card {
      position: relative;
      width: min(920px, calc(100vw - 24px));
      max-height: min(82vh, 920px);
      overflow: auto;
      background: linear-gradient(180deg, #ffffff 0%, #f8fbfa 100%);
      border: 1px solid rgba(255, 255, 255, 0.58);
      border-radius: 28px;
      box-shadow: 0 30px 80px rgba(15, 23, 42, 0.22);
      padding: 22px;
    }
    .modal-head {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 16px;
      margin-bottom: 14px;
    }
    .modal-kicker {
      font-size: 11px;
      color: var(--accent-strong);
      letter-spacing: 0.16em;
      text-transform: uppercase;
      font-weight: 700;
      margin-bottom: 6px;
    }
    .modal-title {
      margin: 0;
      font-size: clamp(24px, 3vw, 32px);
      line-height: 1.1;
    }
    .modal-meta {
      color: var(--muted);
      font-size: 14px;
      line-height: 1.7;
      margin-bottom: 16px;
    }
    .history-list {
      display: grid;
      align-content: start;
      gap: 2px;
      flex: 1 1 auto;
      min-height: 0;
      overflow-y: auto;
      overscroll-behavior: contain;
      padding: 2px 0 8px;
      scrollbar-width: thin;
      scrollbar-color: rgba(31, 122, 90, 0.26) transparent;
    }
    .history-list::-webkit-scrollbar {
      width: 8px;
    }
    .history-list::-webkit-scrollbar-thumb {
      background: rgba(31, 122, 90, 0.22);
      border-radius: 999px;
    }
    .history-item {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      align-items: center;
      min-height: 50px;
      border: 0;
      border-radius: 10px;
      background: transparent;
      position: relative;
      overflow: hidden;
      transition: background 120ms ease;
    }
    .history-item:hover {
      background: rgba(255, 255, 255, 0.7);
    }
    .history-item.is-active {
      background: rgba(31, 122, 90, 0.11);
    }
    .history-item.is-active::before {
      content: "";
      position: absolute;
      left: 0;
      top: 8px;
      bottom: 8px;
      width: 3px;
      border-radius: 999px;
      background: var(--accent);
    }
    .history-item-main {
      border: 0;
      background: transparent;
      width: 100%;
      min-width: 0;
      min-height: 50px;
      padding: 7px 8px 7px 12px;
      text-align: left;
      cursor: pointer;
      color: inherit;
      font: inherit;
      display: grid;
      align-content: center;
      gap: 2px;
    }
    .history-item-delete {
      border: 0;
      background: transparent;
      color: #667085;
      width: 28px;
      height: 28px;
      margin-right: 6px;
      border-radius: 8px;
      font-size: 16px;
      line-height: 1;
      cursor: pointer;
      opacity: 0;
      pointer-events: none;
      transition: opacity 120ms ease, background 120ms ease, color 120ms ease;
    }
    .history-item:hover .history-item-delete,
    .history-item:focus-within .history-item-delete {
      opacity: 1;
      pointer-events: auto;
    }
    .history-item-delete:hover {
      background: rgba(180, 35, 24, 0.08);
      color: #b42318;
    }
    .history-item-title {
      font-size: 13px;
      font-weight: 620;
      color: #1f2a24;
      line-height: 1.35;
      margin-bottom: 0;
      display: -webkit-box;
      -webkit-box-orient: vertical;
      -webkit-line-clamp: 2;
      overflow: hidden;
    }
    .history-item-meta {
      color: var(--muted);
      font-size: 11px;
      line-height: 1.35;
      opacity: 0;
      max-height: 0;
      overflow: hidden;
      transition: opacity 120ms ease, max-height 120ms ease;
    }
    .history-item:hover .history-item-meta,
    .history-item:focus-within .history-item-meta {
      opacity: 1;
      max-height: 16px;
    }
    .history-item-preview {
      display: none;
    }
    .history-card-head {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 14px;
      margin-bottom: 10px;
    }
    .history-title {
      font-size: 15px;
      font-weight: 780;
      color: #102018;
      margin-bottom: 4px;
    }
    .history-meta-line {
      color: var(--muted);
      font-size: 12px;
      line-height: 1.5;
    }
    .history-preview {
      color: #344054;
      font-size: 13px;
      line-height: 1.7;
      display: -webkit-box;
      -webkit-box-orient: vertical;
      -webkit-line-clamp: 2;
      overflow: hidden;
    }
    .history-actions {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
      justify-content: flex-end;
    }
    .history-action-btn {
      padding: 8px 12px;
      border-radius: 12px;
      font-size: 13px;
    }
    .history-action-danger {
      color: #b42318;
      border-color: rgba(180, 35, 24, 0.18);
      background: rgba(180, 35, 24, 0.04);
    }
    .history-empty {
      border: 1px dashed var(--line);
      border-radius: 18px;
      padding: 18px;
      background: rgba(255, 255, 255, 0.72);
      color: var(--muted);
      font-size: 14px;
      line-height: 1.7;
      text-align: center;
    }
    .membership-toolbar {
      display: flex;
      justify-content: flex-end;
      margin-bottom: 16px;
    }
    .auth-panel {
      border: 1px solid var(--line);
      border-radius: 22px;
      padding: 16px;
      background: rgba(255, 255, 255, 0.88);
      box-shadow: var(--shadow);
      margin-bottom: 16px;
      display: grid;
      gap: 12px;
    }
    .auth-modal-card {
      width: min(520px, calc(100vw - 24px));
    }
    .auth-modal-card .auth-panel {
      margin-bottom: 0;
      border-radius: 18px;
      box-shadow: none;
    }
    .auth-modal-card .auth-form {
      grid-template-columns: minmax(0, 1fr) auto;
    }
    .auth-note {
      margin-top: 12px;
      color: var(--muted);
      font-size: 13px;
      line-height: 1.7;
      text-align: center;
    }
    .account-modal-card {
      width: min(640px, calc(100vw - 24px));
    }
    .account-panel-head {
      display: flex;
      align-items: center;
      gap: 14px;
      border: 1px solid var(--line);
      border-radius: 20px;
      padding: 14px;
      background: rgba(255,255,255,0.78);
      margin-bottom: 14px;
    }
    .account-panel-avatar {
      width: 54px;
      height: 54px;
      border: 0;
      border-radius: 18px;
      display: inline-grid;
      place-items: center;
      flex: 0 0 auto;
      color: white;
      font-size: 20px;
      font-weight: 850;
      background: linear-gradient(135deg, var(--accent), var(--accent-strong));
      cursor: pointer;
      transition: transform 140ms ease, box-shadow 140ms ease;
    }
    .account-panel-avatar:hover {
      transform: translateY(-1px);
      box-shadow: 0 10px 24px rgba(15,23,42,0.16);
    }
    .account-panel-email {
      color: var(--ink);
      font-size: 15px;
      font-weight: 780;
      word-break: break-all;
    }
    .account-panel-status {
      color: var(--muted);
      font-size: 13px;
      line-height: 1.6;
    }
    .account-avatar-change {
      margin-top: 6px;
      border: 0;
      padding: 0;
      background: transparent;
      color: var(--accent-strong);
      font: inherit;
      font-size: 12px;
      font-weight: 760;
      cursor: pointer;
    }
    .account-avatar-change:hover {
      text-decoration: underline;
    }
    .account-settings-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 12px;
      margin-bottom: 14px;
    }
    .account-field {
      display: grid;
      gap: 6px;
    }
    .account-field-wide {
      grid-column: 1 / -1;
    }
    .account-field-label {
      color: #344054;
      font-size: 13px;
      font-weight: 680;
    }
    .account-plan-card {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 10px;
      border: 1px solid var(--line);
      border-radius: 20px;
      padding: 14px;
      background: linear-gradient(180deg, rgba(255,255,255,0.88), rgba(246,250,247,0.86));
      margin-bottom: 14px;
    }
    .account-plan-card-label {
      color: var(--muted);
      font-size: 12px;
      line-height: 1.5;
    }
    .account-plan-card-value {
      color: var(--ink);
      font-size: 14px;
      font-weight: 760;
      line-height: 1.5;
      word-break: break-word;
    }
    .account-panel-actions {
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 10px;
      flex-wrap: wrap;
    }
    .account-logout-btn {
      color: #b42318;
      border-color: rgba(180,35,24,0.18);
      background: rgba(180,35,24,0.04);
    }
    .auth-head {
      display: grid;
      gap: 4px;
    }
    .auth-title {
      font-size: 15px;
      font-weight: 700;
    }
    .auth-subtitle {
      color: var(--muted);
      font-size: 13px;
      line-height: 1.6;
    }
    .auth-form {
      display: grid;
      grid-template-columns: minmax(0, 1.4fr) auto minmax(0, 1fr) auto;
      gap: 10px;
      align-items: center;
    }
    .auth-input {
      width: 100%;
      border: 1px solid var(--line);
      border-radius: 14px;
      padding: 11px 12px;
      font: inherit;
      color: var(--ink);
      background: white;
      outline: none;
    }
    .auth-input:focus {
      border-color: rgba(31, 122, 90, 0.35);
      box-shadow: 0 0 0 3px rgba(31, 122, 90, 0.12);
    }
    .auth-actions {
      display: flex;
      align-items: center;
    }
    .auth-dev-code {
      border-radius: 14px;
      padding: 10px 12px;
      background: rgba(31, 122, 90, 0.08);
      color: var(--accent-strong);
      font-size: 13px;
      line-height: 1.6;
    }
    .plan-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 14px;
    }
    .plan-card {
      border: 1px solid var(--line);
      border-radius: 22px;
      padding: 18px;
      background: rgba(255, 255, 255, 0.92);
      box-shadow: var(--shadow);
      display: grid;
      gap: 14px;
      align-content: start;
    }
    .plan-card.active {
      border-color: rgba(31, 122, 90, 0.32);
      box-shadow: 0 18px 42px rgba(31, 122, 90, 0.14);
      background: linear-gradient(180deg, #ffffff 0%, #eef8f4 100%);
    }
    .plan-card-header {
      display: grid;
      gap: 6px;
    }
    .plan-badge {
      display: inline-flex;
      width: fit-content;
      border-radius: 999px;
      padding: 5px 9px;
      font-size: 11px;
      font-weight: 700;
      letter-spacing: 0.04em;
      text-transform: uppercase;
      background: rgba(31, 122, 90, 0.12);
      color: var(--accent-strong);
    }
    .plan-name {
      font-size: 20px;
      font-weight: 700;
    }
    .plan-note {
      color: var(--muted);
      font-size: 13px;
      line-height: 1.6;
    }
    .plan-feature-list {
      margin: 0;
      padding-left: 18px;
      display: grid;
      gap: 6px;
      line-height: 1.6;
      font-size: 14px;
    }
    .plan-product-list {
      display: grid;
      gap: 8px;
      border-top: 1px solid var(--line);
      padding-top: 12px;
    }
    .plan-product-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      padding: 10px 12px;
      border-radius: 16px;
      background: rgba(247, 247, 248, 0.9);
      border: 1px solid rgba(15, 23, 42, 0.05);
    }
    .plan-product-copy {
      display: grid;
      gap: 2px;
    }
    .plan-product-actions {
      display: flex;
      flex-wrap: wrap;
      justify-content: flex-end;
      gap: 8px;
    }
    .plan-product-name {
      font-size: 13px;
      font-weight: 700;
    }
    .plan-product-note {
      font-size: 12px;
      color: var(--muted);
    }
    .plan-product-btn {
      border: 1px solid rgba(31, 122, 90, 0.18);
      border-radius: 12px;
      padding: 8px 12px;
      font: inherit;
      font-size: 12px;
      font-weight: 700;
      color: var(--accent-strong);
      background: rgba(31, 122, 90, 0.08);
      cursor: pointer;
      white-space: nowrap;
    }
    .plan-product-btn:disabled {
      opacity: 0.62;
      cursor: default;
    }
    .plan-actions {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      margin-top: auto;
    }
    .plan-status {
      font-size: 12px;
      color: var(--muted);
    }
    .plan-select-btn {
      border: 0;
      border-radius: 14px;
      padding: 10px 14px;
      font: inherit;
      font-size: 13px;
      font-weight: 700;
      color: white;
      background: linear-gradient(135deg, var(--accent), var(--accent-strong));
      cursor: pointer;
    }
    .plan-select-btn[disabled] {
      opacity: 0.62;
      cursor: default;
    }
    .composer-wrap {
      position: sticky;
      bottom: 0;
      z-index: 20;
      background: linear-gradient(180deg, rgba(247,247,248,0) 0%, rgba(247,247,248,0.94) 22%, rgba(247,247,248,1) 100%);
      padding: 0 12px 18px;
    }
    .composer {
      max-width: 920px;
      margin: 0 auto;
      background: white;
      border: 1px solid var(--line);
      border-radius: 24px;
      box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
      padding: 12px;
    }
    .composer-textarea {
      width: 100%;
      border: 0;
      resize: none;
      min-height: 56px;
      max-height: 220px;
      padding: 10px 12px 8px;
      font: inherit;
      color: var(--ink);
      background: transparent;
      outline: none;
      line-height: 1.7;
    }
    .composer-actions {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      padding: 6px 6px 2px;
    }
    .composer-right {
      display: flex;
      align-items: center;
      gap: 10px;
    }
    .upload-btn {
      border: 1px solid var(--line);
      background: white;
      color: var(--ink);
      border-radius: 14px;
      padding: 10px 12px;
      font: inherit;
      font-size: 13px;
      font-weight: 600;
      cursor: pointer;
    }
    .voice-btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border: 1px solid var(--line);
      background: white;
      color: var(--muted);
      border-radius: 14px;
      width: 40px;
      height: 40px;
      padding: 0;
      cursor: pointer;
      transition: color 140ms ease, border-color 140ms ease, background 140ms ease;
    }
    .voice-btn:hover {
      color: var(--accent-strong);
      border-color: rgba(31,122,90,0.22);
    }
    .voice-btn.is-recording {
      color: white;
      background: var(--danger, #e74c3c);
      border-color: var(--danger, #e74c3c);
      animation: voice-pulse 1.2s ease-in-out infinite;
    }
    @keyframes voice-pulse {
      0%, 100% { box-shadow: 0 0 0 0 rgba(231,76,60,0.4); }
      50% { box-shadow: 0 0 0 8px rgba(231,76,60,0); }
    }
    .voice-btn[hidden] { display: none; }
    .upload-btn[hidden] {
      display: none;
    }
    .composer-tip {
      color: var(--muted);
      font-size: 12px;
    }
    body.case-form-open {
      overflow: hidden;
    }
    @media (max-width: 880px) {
      .workspace {
        display: block;
      }
      .history-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100dvh;
        max-height: 100dvh;
        z-index: 40;
        width: min(320px, calc(100vw - 32px));
        max-width: calc(100vw - 32px);
        transform: translateX(-104%);
        transition: transform 180ms ease;
        box-shadow: 0 24px 60px rgba(15, 23, 42, 0.24);
      }
      .history-sidebar.is-open {
        transform: translateX(0);
      }
      .history-sidebar-close,
      .history-toggle-btn {
        display: inline-flex;
      }
      .topbar-inner, .thread, .status-line {
        padding-left: 12px;
        padding-right: 12px;
      }
      .welcome-grid {
        grid-template-columns: 1fr;
      }
      .composer-wrap {
        padding: 0 8px 12px;
      }
      .bubble {
        max-width: calc(100vw - 74px);
      }
      .brand-subtitle, .composer-tip {
        display: none;
      }
      .account-summary {
        padding: 7px 9px;
        border-radius: 12px;
      }
      .account-plan {
        font-size: 11px;
      }
      .account-usage {
        display: none;
      }
      .account-menu-button {
        padding: 8px 9px;
      }
      .welcome-hero {
        padding: 20px 18px 18px;
        border-radius: 24px;
      }
      .welcome-title {
        font-size: 30px;
      }
      .welcome-badges,
      .prompt-chip-row {
        gap: 8px;
      }
      .case-workbench-head {
        grid-template-columns: 1fr;
        display: grid;
      }
      .case-workbench-title {
        font-size: 13px;
        line-height: 1.5;
      }
      .case-workbench-actions {
        justify-content: flex-start;
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        width: 100%;
      }
      .case-workbench-actions .ghost-btn {
        min-width: 0;
        padding-left: 0;
        padding-right: 0;
        font-size: 12px;
        justify-content: center;
      }
      .case-template-grid {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 2px;
        scrollbar-width: none;
      }
      .case-template-grid::-webkit-scrollbar {
        display: none;
      }
      .case-template-chip {
        flex: 0 0 auto;
      }
      .case-template-chip:nth-child(n + 7) {
        display: none;
      }
      .case-form-backdrop {
        position: fixed;
        inset: 0;
        z-index: 59;
        display: block;
        background: rgba(15, 23, 42, 0.42);
        backdrop-filter: blur(2px);
      }
      .case-form-backdrop[hidden] {
        display: none;
      }
      .case-form-panel {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 60;
        max-height: 76vh;
        overflow: auto;
        padding: 16px 14px calc(16px + env(safe-area-inset-bottom));
        border-top: 1px solid rgba(31, 122, 90, 0.12);
        border-right: 0;
        border-left: 0;
        border-bottom: 0;
        border-radius: 24px 24px 0 0;
        background: linear-gradient(180deg, #ffffff 0%, #f7fbf9 100%);
        box-shadow: 0 -24px 60px rgba(15, 23, 42, 0.18);
      }
      .case-form-grid {
        grid-template-columns: 1fr;
      }
      .case-template-chip,
      .prompt-chip {
        width: 100%;
      }
      .plan-grid {
        grid-template-columns: 1fr;
      }
      .modal-card {
        padding: 18px;
      }
      .auth-form {
        grid-template-columns: 1fr;
      }
      .account-settings-grid,
      .account-plan-card {
        grid-template-columns: 1fr;
      }
      .account-panel-actions {
        justify-content: stretch;
      }
      .account-panel-actions .ghost-btn,
      .account-panel-actions .send-btn {
        width: 100%;
      }
      .history-card-head {
        flex-direction: column;
      }
      .history-actions {
        width: 100%;
        justify-content: flex-start;
      }
      .history-item {
        grid-template-columns: minmax(0, 1fr) auto;
      }
      .history-item-main {
        padding: 7px 8px 7px 12px;
      }
    }

    /* ── QR 收款码 / 客服码 ── */
    .qr-payment-section {
      position: relative;
      scroll-margin-top: 24px;
      margin-top: 20px;
      padding: 20px;
      background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(244, 249, 246, 0.96));
      border-radius: 18px;
      border: 1px solid var(--line);
    }
    .membership-open-anchor {
      position: absolute;
      top: -18px;
      left: 0;
      width: 1px;
      height: 1px;
    }
    .qr-section-title {
      font-size: 16px;
      font-weight: 700;
      margin-bottom: 14px;
      color: var(--ink, #1a1a1a);
    }
    .qr-steps {
      display: flex;
      flex-direction: column;
      gap: 8px;
      margin-bottom: 18px;
    }
    .qr-step {
      display: flex;
      align-items: center;
      gap: 10px;
      font-size: 13px;
      color: var(--muted, #555);
    }
    .qr-step-num {
      display: inline-grid;
      place-items: center;
      width: 22px;
      height: 22px;
      border-radius: 50%;
      background: var(--accent, #2d6a4f);
      color: white;
      font-size: 12px;
      font-weight: 700;
      flex-shrink: 0;
    }
    .qr-code-row {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
      gap: 14px;
      margin-bottom: 16px;
    }
    .qr-code-card {
      text-align: center;
      display: grid;
      justify-items: center;
      gap: 8px;
      border: 1px solid var(--line);
      border-radius: 16px;
      background: rgba(255, 255, 255, 0.78);
      padding: 14px;
    }
    .qr-code-img {
      width: min(150px, 100%);
      height: auto;
      aspect-ratio: 1;
      object-fit: contain;
      border-radius: 12px;
      border: 1px solid var(--line);
      background: white;
      padding: 6px;
    }
    .qr-code-label {
      font-size: 12px;
      color: var(--muted, #666);
      margin-top: 0;
    }
    .qr-service-row {
      border-top: 1px dashed var(--line);
      padding-top: 16px;
      display: grid;
      grid-template-columns: minmax(150px, auto) 1fr;
      align-items: center;
      gap: 16px;
    }
    .qr-service-head {
      font-size: 13px;
      font-weight: 600;
      color: var(--ink, #333);
      grid-column: 1 / -1;
      margin-bottom: -4px;
    }
    .qr-service-card .qr-code-img {
      border-color: var(--accent, #2d6a4f);
    }
    .qr-wechat-id {
      font-size: 13px;
      color: var(--muted, #555);
      line-height: 1.7;
    }
    .qr-wechat-id strong {
      color: var(--ink, #1a1a1a);
      font-size: 14px;
      user-select: all;
    }
    @media (max-width: 640px) {
      .qr-payment-section {
        padding: 16px;
      }
      .qr-code-row,
      .qr-service-row {
        grid-template-columns: 1fr;
      }
      .qr-code-img {
        width: min(160px, 100%);
      }
    }

/* ── 侧边栏 Tab 切换 ── */
.sidebar-tab-bar {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255,255,255,0.6);
  margin: 0 14px 8px;
}
.sidebar-tab {
  flex: 1;
  border: 0;
  padding: 9px 0;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease;
}
.sidebar-tab.is-active {
  color: white;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
}
.sidebar-tab:not(.is-active):hover {
  background: rgba(255,255,255,0.9);
  color: var(--ink);
}
.health-actions {
  margin: 0 14px 6px;
}
.health-actions[hidden] { display: none; }

/* ── 健康档案列表项 ── */
.health-item {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: start;
  gap: 8px;
  border: 1px solid rgba(15,23,42,0.06);
  border-radius: 16px;
  background: rgba(255,255,255,0.82);
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}
.health-item:hover {
  border-color: rgba(31,122,90,0.18);
  background: rgba(255,255,255,0.96);
  transform: translateY(-1px);
}
.health-item.is-active {
  border-color: rgba(31,122,90,0.28);
  background: rgba(31,122,90,0.08);
  box-shadow: inset 3px 0 0 var(--accent);
}
.health-item-main {
  border: 0; background: transparent; width: 100%;
  padding: 12px 0 12px 12px; text-align: left; cursor: pointer;
  color: inherit; font: inherit;
}
.health-item-name {
  font-size: 14px; font-weight: 700; color: #102018;
  margin-bottom: 4px;
}
.health-item-meta {
  color: var(--muted); font-size: 11px; line-height: 1.5;
  margin-bottom: 2px;
}
.health-item-preview {
  color: #667085; font-size: 12px; line-height: 1.55;
  display: -webkit-box; -webkit-box-orient: vertical;
  -webkit-line-clamp: 2; overflow: hidden;
}
.health-item-badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 700;
  background: rgba(31,122,90,0.10); color: var(--accent-strong);
  margin-right: 6px;
}

/* ── 新建档案表单 ── */
.new-record-form {
  display: grid; gap: 10px; margin-bottom: 16px;
}
.new-record-label {
  font-size: 13px; font-weight: 600; color: #344054;
}
.new-record-actions {
  display: flex; justify-content: flex-end;
}

/* ── 存入档案选择列表 ── */
.save-record-list {
  display: grid; gap: 8px; margin-bottom: 14px;
  max-height: 320px; overflow-y: auto;
}
.save-record-option {
  border: 1px solid var(--line); border-radius: 14px;
  padding: 10px 12px; cursor: pointer; background: rgba(255,255,255,0.85);
  transition: border-color 140ms ease;
}
.save-record-option:hover {
  border-color: rgba(31,122,90,0.26);
}
.save-record-option.is-disabled {
  cursor: not-allowed;
  opacity: 0.58;
  background: rgba(248,250,252,0.78);
}
.save-record-option-name {
  font-size: 14px; font-weight: 700; color: #102018;
}
.save-record-option-meta {
  font-size: 12px; color: var(--muted);
}
.save-record-new { padding-top: 8px; border-top: 1px solid var(--line); }

/* ── 档案模式指示器 ── */
.record-context-bar {
  max-width: 980px; margin: 0 auto; padding: 8px 18px;
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--accent-strong);
  background: linear-gradient(90deg, rgba(31,122,90,0.08), transparent);
  border-radius: 0 0 14px 14px;
}
.record-context-bar strong { font-weight: 700; }

/* ── 档案时间线详情 ── */
.health-detail-panel { padding: 0 2px; }
.health-detail-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-bottom: 14px;
}
.health-detail-name {
  font-size: 16px; font-weight: 780; color: #102018;
}
.health-detail-back {
  padding: 6px 10px; border-radius: 10px; font-size: 12px;
}
.health-detail-info {
  border: 1px solid var(--line); border-radius: 14px;
  padding: 10px 12px; margin-bottom: 14px;
  background: rgba(255,255,255,0.8);
  font-size: 12px; color: var(--muted); line-height: 1.65;
}
.health-timeline { position: relative; padding-left: 20px; }
.health-timeline::before {
  content: ""; position: absolute; left: 6px; top: 4px; bottom: 4px;
  width: 2px; background: var(--line); border-radius: 1px;
}
.health-visit-card {
  position: relative; margin-bottom: 12px;
  border: 1px solid rgba(15,23,42,0.06); border-radius: 14px;
  background: rgba(255,255,255,0.82); padding: 12px;
}
.health-visit-card::before {
  content: ""; position: absolute; left: -17px; top: 16px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent); border: 2px solid white;
}
.health-visit-date {
  font-size: 11px; color: var(--muted); margin-bottom: 4px;
}
.health-visit-title {
  font-size: 13px; font-weight: 700; color: #102018;
  margin-bottom: 4px;
}
.health-visit-summary {
  font-size: 12px; color: #475467; line-height: 1.55;
}
.health-visit-action { margin-top: 8px; }
.health-visit-continue-btn {
  border: 1px solid rgba(31,122,90,0.18); border-radius: 10px;
  padding: 6px 10px; font: inherit; font-size: 12px; font-weight: 700;
  color: var(--accent-strong); background: rgba(31,122,90,0.06);
  cursor: pointer;
}
.message-actions {
  display: flex;
  justify-content: flex-start;
  margin-top: 8px;
}
.health-workspace {
  max-width: 980px;
  width: 100%;
  margin: 0 auto;
  padding: 10px 18px 24px;
}
.health-workspace-hero,
.health-detail-hero {
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 22px;
  background:
    radial-gradient(circle at 12% 12%, rgba(31,122,90,0.13), transparent 32%),
    linear-gradient(180deg, rgba(255,255,255,0.94), rgba(246,250,247,0.92));
  box-shadow: 0 18px 50px rgba(15,23,42,0.08);
}
.health-detail-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.health-detail-page-title {
  margin: 0 0 8px;
  color: #102018;
  font-size: clamp(26px, 4vw, 40px);
  line-height: 1.08;
}
.health-detail-page-meta,
.health-limit-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}
.health-record-continue-btn {
  white-space: nowrap;
}
.health-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.health-panel-card {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px;
  background: rgba(255,255,255,0.86);
  box-shadow: 0 14px 36px rgba(15,23,42,0.06);
}
.health-panel-wide {
  grid-column: 1 / -1;
}
.health-panel-title {
  color: #102018;
  font-size: 15px;
  font-weight: 780;
  margin-bottom: 10px;
}
.health-panel-body {
  color: #475467;
  font-size: 13px;
  line-height: 1.75;
  white-space: pre-line;
}
.health-prescription-note {
  margin-top: 10px;
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(31,122,90,0.08);
  color: var(--accent-strong);
  font-size: 13px;
  line-height: 1.65;
}
.health-report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}
.health-report-card,
.health-empty-card,
.health-timeline-card {
  border: 1px solid rgba(15,23,42,0.06);
  border-radius: 16px;
  padding: 12px;
  background: rgba(248,250,252,0.78);
}
.health-report-title {
  font-size: 13px;
  font-weight: 760;
  color: #102018;
  margin-bottom: 4px;
}
.health-report-meta,
.health-report-files {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
}
.health-report-summary {
  margin-top: 8px;
  font-size: 12px;
  color: #475467;
  line-height: 1.6;
}
.health-empty-card {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}
.health-timeline-main {
  display: grid;
  gap: 10px;
}
.health-timeline-card {
  position: relative;
  padding-left: 14px;
}
.health-timeline-type {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  padding: 2px 8px;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 760;
  background: rgba(31,122,90,0.10);
  color: var(--accent-strong);
}
.health-timeline-type.report {
  background: rgba(30,64,175,0.08);
  color: #1d4ed8;
}
@media (max-width: 880px) {
  .health-detail-hero {
    flex-direction: column;
  }
  .health-record-continue-btn {
    width: 100%;
  }
  .health-detail-grid {
    grid-template-columns: 1fr;
  }
}
