/* ==========================================================================
   江夏区第一人民医院 · 智能导诊助手  样式
   设计取向：医疗场景的克制与可信，留白充足、层级清晰、移动优先。
   ========================================================================== */

:root {
  --brand: #0f766e;
  --brand-dark: #115e59;
  --brand-light: #ccfbf1;
  --brand-soft: #f0fdfa;
  --ink: #0f172a;
  --ink-2: #334155;
  --ink-3: #64748b;
  --line: #e2e8f0;
  --bg: #f6f8fa;
  --surface: #ffffff;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --warn: #b45309;
  --warn-soft: #fffbeb;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 40px rgba(15, 23, 42, 0.16);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
}

* { box-sizing: border-box; }

/* 关键：多个组件用了 display:flex/grid，会覆盖 hidden 属性的默认 display:none，
   导致隐藏元素仍然显示。这里强制 hidden 优先。 */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  /* 固定视口高度：消息区内部滚动，避免快捷提示被输入框遮挡 */
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ============================== 顶栏 ============================== */
.topbar {
  position: relative;
  z-index: 30;
  flex: none;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
}

.topbar__inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

.brand__logo {
  width: 38px; height: 38px; flex: none;
  border-radius: 11px;
  background: linear-gradient(140deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #fff;
  display: grid; place-items: center;
  box-shadow: var(--shadow-sm);
}
.brand__logo svg { width: 21px; height: 21px; }

.brand__text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.brand__text strong {
  font-size: 14.5px; font-weight: 650; letter-spacing: -0.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.brand__text span { font-size: 11.5px; color: var(--ink-3); }

.icon-btn {
  width: 36px; height: 36px; flex: none;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 50%;
  color: var(--ink-3);
  display: grid; place-items: center;
  cursor: pointer;
  transition: all .15s ease;
}
.icon-btn:hover { color: var(--brand); border-color: var(--brand); background: var(--brand-soft); }
.icon-btn svg { width: 18px; height: 18px; }

.mode-banner {
  max-width: 760px;
  margin: 0 auto 10px;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  background: var(--warn-soft);
  border: 1px solid #fde68a;
  color: var(--warn);
  font-size: 12.5px;
  line-height: 1.5;
}

/* ============================== 急诊横幅 ============================== */
.emergency-banner {
  max-width: 760px;
  width: calc(100% - 24px);
  margin: 12px auto 0;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--danger-soft);
  border: 1.5px solid #fecaca;
  display: flex;
  gap: 12px;
  animation: pulseIn .35s ease;
}
@keyframes pulseIn {
  from { opacity: 0; transform: translateY(-6px) scale(.98); }
  to { opacity: 1; transform: none; }
}
.emergency-banner__icon { font-size: 24px; line-height: 1; flex: none; }
.emergency-banner__body strong { display: block; color: #991b1b; font-size: 15.5px; margin-bottom: 3px; }
.emergency-banner__body p { margin: 0 0 10px; color: #7f1d1d; font-size: 13.5px; }
.emergency-banner__body a { color: #991b1b; font-weight: 600; }
.emergency-banner__hint {
  margin: 0 !important;
  font-size: 12.5px !important;
  color: #b91c1c !important;
  font-weight: 600;
}

/* ============================== 需留意（caution）提示 ============================== */
.caution-box {
  margin-top: 10px;
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  background: var(--warn-soft);
  border: 1px solid #fde68a;
  border-left: 4px solid #f59e0b;
}
.caution-box__title {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px;
  font-weight: 650;
  color: var(--warn);
  margin-bottom: 5px;
}
.caution-box__text {
  font-size: 12.5px;
  color: #92400e;
  line-height: 1.65;
  margin: 0;
}
.caution-box__note {
  font-size: 11.5px;
  color: #a16207;
  margin-top: 6px;
  line-height: 1.55;
}

/* ============================== 对话区 ============================== */
.chat {
  flex: 1;
  min-height: 0;              /* flex 子项允许收缩，否则内部滚动失效 */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 18px 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.msg { display: flex; gap: 10px; animation: rise .28s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.msg--user { flex-direction: row-reverse; }

.msg__avatar {
  width: 32px; height: 32px; flex: none;
  border-radius: 9px;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 600;
}
.msg--bot .msg__avatar { background: var(--brand-light); color: var(--brand-dark); }
.msg--user .msg__avatar { background: #e2e8f0; color: var(--ink-2); }
.msg__avatar svg { width: 17px; height: 17px; }

.msg__content { max-width: min(88%, 620px); min-width: 0; }

.bubble {
  padding: 11px 14px;
  border-radius: var(--radius);
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.msg--bot .bubble {
  background: var(--surface);
  border: 1px solid var(--line);
  border-top-left-radius: 4px;
  box-shadow: var(--shadow-sm);
}
.msg--user .bubble {
  background: var(--brand);
  color: #fff;
  border-top-right-radius: 4px;
}

/* 只发图片不打字时，不显示空气泡 */
.msg__content > .bubble:empty { display: none; }

.bubble__section-label {
  display: block;
  font-weight: 650;
  color: var(--brand-dark);
  margin-top: 10px;
  margin-bottom: 2px;
  font-size: 13.5px;
}
.bubble__section-label:first-child { margin-top: 0; }

/* 打字光标 */
.typing-cursor::after {
  content: "";
  display: inline-block;
  width: 2px; height: 1em;
  background: var(--brand);
  vertical-align: -2px;
  margin-left: 2px;
  animation: blink .9s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* 加载三点 */
.dots { display: inline-flex; gap: 4px; align-items: center; padding: 3px 0; }
.dots i {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--brand); opacity: .45;
  animation: bounce 1.1s infinite ease-in-out;
}
.dots i:nth-child(2) { animation-delay: .16s; }
.dots i:nth-child(3) { animation-delay: .32s; }
@keyframes bounce { 0%, 80%, 100% { transform: scale(.7); opacity: .35; } 40% { transform: scale(1); opacity: 1; } }

/* ============================== 结构化卡片 ============================== */
.card {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.card__head {
  padding: 11px 14px;
  background: var(--brand-soft);
  border-bottom: 1px solid var(--line);
  font-weight: 650;
  font-size: 14px;
  color: var(--brand-dark);
  display: flex; align-items: center; gap: 7px;
}
.card__head svg { width: 16px; height: 16px; flex: none; }
.card__body { padding: 13px 14px; }

.field { margin-bottom: 12px; }
.field:last-child { margin-bottom: 0; }
.field__label {
  font-size: 11.5px;
  color: var(--ink-3);
  letter-spacing: .04em;
  margin-bottom: 5px;
  font-weight: 600;
}

.dept-list { display: flex; flex-direction: column; gap: 8px; }
.dept {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: #fcfdfe;
}
.dept--primary { border-color: #99f6e4; background: var(--brand-soft); }
.dept__tag {
  flex: none;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--line);
  color: var(--ink-3);
  margin-top: 2px;
}
.dept--primary .dept__tag { background: var(--brand); color: #fff; }
.dept__main { min-width: 0; }
.dept__name { font-weight: 650; font-size: 15px; }
.dept__level {
  display: inline-block;
  font-size: 10.5px;
  padding: 1px 6px;
  border-radius: 4px;
  background: #fef3c7;
  color: #92400e;
  margin-left: 6px;
  font-weight: 600;
  vertical-align: 1px;
}
.dept__desc { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; line-height: 1.5; }

.dir-list { margin: 0; padding-left: 4px; list-style: none; counter-reset: dir; }
.dir-list li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 5px;
  font-size: 13.5px;
  color: var(--ink-2);
}
.dir-list li::before {
  counter-increment: dir;
  content: counter(dir);
  position: absolute; left: 0; top: 3px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--brand-light);
  color: var(--brand-dark);
  font-size: 10px; font-weight: 700;
  display: grid; place-items: center;
}

.urgency {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 650;
}
.urgency--normal { background: #ecfdf5; color: #047857; }
.urgency--soon { background: var(--warn-soft); color: var(--warn); }
.urgency--now { background: var(--danger-soft); color: #b91c1c; }
.urgency__reason { font-size: 12.5px; color: var(--ink-3); margin-top: 6px; line-height: 1.55; }

/* 就诊前准备 */
.prep-list {
  margin: 0;
  padding-left: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.prep-list li {
  position: relative;
  padding-left: 20px;
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.55;
}
.prep-list li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 8px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--brand);
  opacity: .75;
}

/* 导诊小结 */
.visit-summary {
  margin-top: 12px;
  border: 1px solid #d5f5ef;
  border-radius: var(--radius-sm);
  background: #f8fffd;
  overflow: hidden;
}
.visit-summary__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  background: var(--brand-soft);
  border-bottom: 1px solid #d5f5ef;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--brand-dark);
}
.visit-summary__copy {
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--brand-dark);
  background: #fff;
  border: 1px solid #99f6e4;
  border-radius: 6px;
  padding: 2px 10px;
  cursor: pointer;
  transition: all .15s ease;
}
.visit-summary__copy:hover { background: var(--brand); color: #fff; border-color: var(--brand); }
.visit-summary__body {
  margin: 0;
  padding: 11px 12px;
  font-family: inherit;
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--ink-2);
  white-space: pre-wrap;
  word-break: break-word;
}
.visit-summary__tip {
  padding: 0 12px 10px;
  font-size: 11px;
  color: var(--ink-3);
  line-height: 1.5;
}

/* ============================== 按钮 ============================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 11px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 650;
  cursor: pointer;
  text-decoration: none;
  transition: all .16s ease;
  line-height: 1.3;
}
.btn svg { width: 17px; height: 17px; flex: none; }
.btn--primary { background: var(--brand); color: #fff; box-shadow: var(--shadow-sm); }
.btn--primary:hover { background: var(--brand-dark); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn--ghost { background: var(--surface); color: var(--brand-dark); border-color: #99f6e4; }
.btn--ghost:hover { background: var(--brand-soft); }
.btn--danger { background: var(--danger); color: #fff; }
.btn--block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ============================== 预约引导区 ============================== */
.booking {
  margin-top: 12px;
  border: 1px solid #99f6e4;
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--brand-soft) 0%, var(--surface) 45%);
  overflow: hidden;
}
.booking__head {
  padding: 12px 14px;
  display: flex; align-items: center; gap: 8px;
  font-weight: 650;
  color: var(--brand-dark);
  border-bottom: 1px solid #d5f5ef;
  font-size: 14.5px;
}
.booking__head svg { width: 18px; height: 18px; flex: none; }
.booking__body { padding: 13px 14px; }

.env-hint {
  font-size: 12.5px;
  color: var(--ink-3);
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 11px;
  margin-bottom: 11px;
  line-height: 1.55;
}

.channel-list { display: flex; flex-direction: column; gap: 9px; margin-bottom: 12px; }
.channel {
  display: flex; gap: 10px; align-items: flex-start;
  font-size: 13.5px; color: var(--ink-2);
  padding: 9px 11px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  line-height: 1.55;
}
.channel__num {
  flex: none;
  width: 19px; height: 19px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 11px; font-weight: 700;
  display: grid; place-items: center;
  margin-top: 2px;
}

.qr-box {
  text-align: center;
  padding: 16px;
  background: var(--surface);
  border: 1px dashed #99f6e4;
  border-radius: var(--radius);
  margin-bottom: 12px;
}
.qr-box img {
  width: 200px; height: 200px;
  object-fit: contain;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--line);
  padding: 6px;
  image-rendering: -webkit-optimize-contrast;   /* 二维码保持锐利 */
}
.qr-box__caption { font-size: 13px; color: var(--ink-2); margin-top: 10px; font-weight: 600; }
.qr-box__sub { font-size: 12px; color: var(--ink-3); margin-top: 4px; }

.placeholder-warn {
  margin-top: 10px;
  padding: 7px 10px;
  border-radius: 8px;
  background: var(--warn-soft);
  border: 1px solid #fde68a;
  color: var(--warn);
  font-size: 11.5px;
  line-height: 1.5;
  text-align: left;
}

.qr-placeholder {
  width: 168px; height: 168px;
  margin: 0 auto;
  border-radius: 8px;
  border: 2px dashed var(--line);
  display: grid; place-items: center;
  color: var(--ink-3);
  font-size: 12px;
  text-align: center;
  padding: 14px;
  line-height: 1.6;
  background: #fcfdfe;
}

.steps-toggle {
  width: 100%;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--brand-dark);
  cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  transition: all .15s ease;
}
.steps-toggle:hover { background: var(--brand-soft); border-color: #99f6e4; }
.steps-toggle svg { width: 15px; height: 15px; transition: transform .22s ease; }
.steps-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }

.steps-list {
  margin: 10px 0 0;
  padding: 13px 14px 13px 32px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--ink-2);
}
.steps-list li { margin-bottom: 8px; line-height: 1.6; }
.steps-list li:last-child { margin-bottom: 0; }
.steps-list li::marker { color: var(--brand); font-weight: 700; }

.offline-note {
  margin-top: 11px;
  padding: 10px 12px;
  background: #f8fafc;
  border-left: 3px solid var(--ink-3);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 12.5px;
  color: var(--ink-3);
  line-height: 1.6;
}
.offline-note strong { color: var(--ink-2); display: block; margin-bottom: 4px; font-size: 12.5px; }

/* ============================== 快捷回复 ============================== */
.quick-replies {
  flex: none;                 /* 不参与伸缩，永远在输入框上方完整显示 */
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
  padding: 0 16px 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 34vh;
  overflow-y: auto;
}
.quick-replies:empty { display: none; }
.quick-chip {
  padding: 8px 14px;
  background: var(--surface);
  border: 1px solid #99f6e4;
  border-radius: 999px;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--brand-dark);
  cursor: pointer;
  transition: all .15s ease;
  white-space: nowrap;
}
.quick-chip:hover { background: var(--brand); color: #fff; border-color: var(--brand); transform: translateY(-1px); }

/* ============================== 输入区 ============================== */
.composer {
  flex: none;                 /* 常驻底部，不再用 sticky 覆盖内容 */
  z-index: 25;
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
}

/* 图片上传按钮 */
.tool-btn {
  width: 44px; height: 44px; flex: none;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-3);
  display: grid; place-items: center;
  cursor: pointer;
  transition: all .15s ease;
}
.tool-btn:hover { color: var(--brand); border-color: var(--brand); background: var(--brand-soft); }
.tool-btn svg { width: 20px; height: 20px; }
.tool-btn:disabled { opacity: .5; cursor: not-allowed; }

/* 待发送图片预览 */
.image-preview {
  max-width: 760px;
  margin: 0 auto 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.image-preview__item {
  position: relative;
  width: 64px; height: 64px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #f8fafc;
}
.image-preview__item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.image-preview__del {
  position: absolute;
  top: 2px; right: 2px;
  width: 18px; height: 18px;
  border-radius: 50%;
  border: none;
  background: rgba(15, 23, 42, .72);
  color: #fff;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  display: grid; place-items: center;
  padding: 0;
}
.image-preview__del:hover { background: var(--danger); }

/* 用户消息里的图片 */
.bubble__images {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.bubble__images img {
  max-width: 160px;
  max-height: 160px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.35);
  display: block;
}
.composer__inner {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  gap: 9px;
  align-items: flex-end;
}
#input {
  flex: 1;
  min-height: 44px;
  max-height: 132px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 15px;
  line-height: 1.5;
  resize: none;
  outline: none;
  background: var(--surface);
  color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}
#input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(15, 118, 110, .1); }
#input::placeholder { color: #94a3b8; }

.send-btn {
  width: 44px; height: 44px; flex: none;
  border-radius: var(--radius);
  border: none;
  background: var(--brand);
  color: #fff;
  display: grid; place-items: center;
  cursor: pointer;
  transition: all .15s ease;
  box-shadow: var(--shadow-sm);
}
.send-btn:hover:not(:disabled) { background: var(--brand-dark); transform: translateY(-1px); box-shadow: var(--shadow); }
.send-btn:disabled { background: #cbd5e1; cursor: not-allowed; box-shadow: none; }
.send-btn svg { width: 19px; height: 19px; }

.disclaimer {
  max-width: 760px;
  margin: 8px auto 0;
  font-size: 11px;
  color: var(--ink-3);
  text-align: center;
  line-height: 1.5;
}

/* ============================== 抽屉与弹层 ============================== */
.drawer, .modal { position: fixed; inset: 0; z-index: 60; }
.drawer__mask, .modal__mask {
  position: absolute; inset: 0;
  background: rgba(15, 23, 42, .42);
  backdrop-filter: blur(2px);
  animation: fade .2s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.drawer__panel {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: min(420px, 92vw);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  animation: slideIn .26s cubic-bezier(.22, 1, .36, 1);
}
@keyframes slideIn { from { transform: translateX(100%); } to { transform: none; } }

.modal__panel {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: min(520px, 94vw);
  max-height: 88vh;
  background: var(--surface);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: popIn .24s cubic-bezier(.22, 1, .36, 1);
}
@keyframes popIn {
  from { opacity: 0; transform: translate(-50%, -46%) scale(.96); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.drawer__head, .modal__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
  flex: none;
}
.drawer__head h2, .modal__head h2 { margin: 0; font-size: 16.5px; font-weight: 680; }
.drawer__body, .modal__body { padding: 18px; overflow-y: auto; -webkit-overflow-scrolling: touch; }

.info-section { margin-bottom: 20px; }
.info-section:last-child { margin-bottom: 0; }
.info-section h3 {
  font-size: 12px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--ink-3); margin: 0 0 9px; font-weight: 700;
}
.info-row {
  display: flex; gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13.5px;
}
.info-row:last-child { border-bottom: none; }
.info-row dt { flex: none; width: 82px; color: var(--ink-3); margin: 0; }
.info-row dd { margin: 0; color: var(--ink-2); flex: 1; word-break: break-word; }
.info-row dd a { color: var(--brand); text-decoration: none; font-weight: 600; }
.info-row dd a:hover { text-decoration: underline; }

.tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  border: 1px solid #99f6e4;
  font-weight: 550;
}

/* ============================== 图文操作引导 ============================== */
.guide { position: fixed; inset: 0; z-index: 80; }
.guide__mask {
  position: absolute; inset: 0;
  background: rgba(15, 23, 42, .78);
  backdrop-filter: blur(3px);
  animation: fade .2s ease;
}
.guide__panel {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: min(430px, 94vw);
  max-height: 92vh;
  background: var(--surface);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  /* 动画只做位移，不做透明度：避免某些环境下动画未完成时面板半透明 */
  animation: guideIn .26s cubic-bezier(.22, 1, .36, 1);
}
@keyframes guideIn {
  from { transform: translate(-50%, -46%) scale(.97); }
  to { transform: translate(-50%, -50%) scale(1); }
}
.guide__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  flex: none;
}
.guide__counter {
  font-size: 12.5px;
  font-weight: 650;
  color: var(--brand-dark);
  background: var(--brand-soft);
  border: 1px solid #99f6e4;
  border-radius: 999px;
  padding: 3px 12px;
}
.guide__body {
  padding: 14px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}
.guide__image-wrap {
  background: #f1f5f9;
  border-radius: 12px;
  padding: 8px;
  text-align: center;
  margin-bottom: 14px;
}
.guide__image-wrap img {
  max-width: 100%;
  max-height: 46vh;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
}
.guide__title { margin: 0 0 6px; font-size: 15.5px; font-weight: 650; }
.guide__desc { margin: 0; font-size: 13.5px; color: var(--ink-2); line-height: 1.65; }
.guide__foot {
  display: flex; gap: 10px;
  padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  flex: none;
}
.guide__foot .btn { flex: 1; }

/* 到院路线卡片 */
.map-buttons {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.map-buttons .btn {
  flex: 1;
  min-width: 130px;
  padding: 11px 14px;
}
.bus-line {
  display: flex;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.6;
  margin-bottom: 5px;
}
.bus-line:last-child { margin-bottom: 0; }
.bus-line__label {
  flex: none;
  min-width: 62px;
  color: var(--ink-3);
  font-weight: 600;
}

/* 急诊卡片里的"备选门诊预约"入口 */
.booking__alt {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed #fecaca;
}
.booking__alt-title {
  font-size: 12.5px;
  font-weight: 650;
  color: var(--ink-2);
  margin-bottom: 10px;
}
.booking__alt-note {
  font-size: 12.5px;
  color: #1e40af;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-sm);
  padding: 8px 11px;
  margin-bottom: 9px;
}

/* 预约须知 */
.notice-box {
  margin-top: 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  overflow: hidden;
}
.notice-box__head {
  padding: 9px 12px;
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
  font-weight: 650;
  color: var(--ink-2);
}
.notice-box__body { padding: 10px 12px; }
.notice-row {
  display: flex; gap: 8px;
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.6;
  margin-bottom: 7px;
}
.notice-row:last-child { margin-bottom: 0; }
.notice-row dt { flex: none; color: var(--ink-3); font-weight: 600; }
.notice-row dd { margin: 0; }

/* 挂号大类提示条 */
.category-hint {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 10px 12px;
  margin-bottom: 11px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: #1e40af;
  line-height: 1.6;
}
.category-hint strong { font-weight: 650; }

/* ============================== Toast ============================== */
.toast {
  position: fixed;
  left: 50%;
  bottom: 96px;
  transform: translateX(-50%);
  z-index: 90;
  background: rgba(15, 23, 42, .93);
  color: #fff;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 13.5px;
  max-width: 86vw;
  text-align: center;
  box-shadow: var(--shadow-lg);
  animation: rise .22s ease;
  line-height: 1.5;
}

/* ============================== 演示标签 ============================== */
.demo-tag {
  align-self: center;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--warn-soft);
  border: 1px solid #fde68a;
  color: var(--warn);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}

/* ============================== Response 响应式 ============================== */
@media (max-width: 560px) {
  .brand__text span { display: none; }
  .chat { padding: 14px 12px 6px; gap: 14px; }
  .composer { padding-left: 12px; padding-right: 12px; }
  .quick-replies { padding-left: 12px; padding-right: 12px; }
  .msg__content { max-width: 92%; }
  .drawer__panel { width: 100%; }
  .modal__panel { width: 100%; max-height: 92vh; border-radius: 18px 18px 0 0; left: 0; right: 0; top: auto; bottom: 0; transform: none; }
  @keyframes popIn {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: none; }
  }
  .modal__panel { animation: popIn .26s cubic-bezier(.22, 1, .36, 1); }
}

@media (prefers-color-scheme: dark) {
  /* 保持浅色：医疗场景下浅色可信度更高，此处不做深色适配，避免对比度问题 */
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
