:root {
  --blue: #1e5cad;
  --blue-dark: #184a8b;
  --blue-soft: #e9f1ff;
  --green: #087b67;
  --green-soft: #e4f4f0;
  --red: #a23c35;
  --red-soft: #fdeae7;
  --amber: #8a5708;
  --amber-soft: #fff3d8;
  --ink: #162131;
  --muted: #5d6877;
  --line: #c5ced8;
  --canvas: #eef2f6;
  --surface: #fff;
  --soft: #f6f8fa;
  --shadow: 0 12px 34px rgba(24, 49, 80, .12);
  --radius: 16px;
}

* { box-sizing: border-box; }

html { min-width: 320px; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background: var(--canvas);
  font-family: "Microsoft YaHei", "Noto Sans SC", Arial, sans-serif;
  font-size: 20px;
  line-height: 1.6;
}

button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .48; }

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 4px solid #ffbf47;
  outline-offset: 3px;
}

h1, h2, h3, p { margin: 0; }
h1 { font-size: 1.75rem; line-height: 1.35; }
h2 { font-size: 1.35rem; line-height: 1.4; }
h3 { font-size: 1.05rem; line-height: 1.4; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hospital-shell { min-height: 100vh; display: flex; flex-direction: column; }

.hospital-header {
  color: #fff;
  background: linear-gradient(130deg, var(--blue-dark), var(--blue));
  box-shadow: 0 4px 16px rgba(16, 55, 102, .2);
}

.header-inner {
  width: min(1160px, calc(100% - 32px));
  min-height: 82px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.hospital-brand { display: flex; align-items: center; gap: 13px; }

.hospital-mark {
  width: 50px;
  height: 50px;
  border: 2px solid rgba(255,255,255,.72);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.55rem;
  font-weight: 700;
}

.hospital-name { font-size: 1.18rem; font-weight: 700; }
.hospital-subtitle { color: #deebff; font-size: .72rem; }

.header-home {
  min-height: 48px;
  padding: 8px 14px;
  color: #fff;
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 9px;
  background: rgba(255,255,255,.08);
  font-weight: 700;
}

.simulation-notice {
  width: min(1160px, calc(100% - 32px));
  margin: 14px auto;
  padding: 13px 16px;
  color: #5b4512;
  border: 1px solid #d6b35f;
  border-radius: 11px;
  background: #fff8df;
  font-size: .88rem;
  line-height: 1.55;
}

.progress-area {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.progress-inner {
  width: min(1160px, calc(100% - 32px));
  min-height: 68px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
}

.progress-label { color: var(--muted); font-size: .85rem; font-weight: 700; white-space: nowrap; }

.progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #dce3ea;
}

.progress-bar { height: 100%; border-radius: inherit; background: var(--blue); transition: width .25s ease; }

.main-wrap {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  padding: 30px 0 54px;
  flex: 1;
}

.page-card {
  min-height: 640px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.page-bar {
  min-height: 72px;
  padding: 10px 22px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  background: var(--soft);
}

.page-title { flex: 1; font-size: 1.35rem; line-height: 1.4; font-weight: 700; }

.back-button {
  width: 56px;
  height: 56px;
  padding: 0;
  color: var(--blue);
  border: 2px solid #9cb3d1;
  border-radius: 10px;
  background: var(--surface);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
}

.page-content {
  padding: 30px;
  display: grid;
  gap: 20px;
}

.eyebrow {
  color: var(--blue);
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .06em;
}

.lead { color: var(--muted); }

.registration-type-list { display: grid; gap: 14px; }

.registration-type-button {
  width: 100%;
  min-height: 104px;
  padding: 17px 20px;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 14px;
  color: var(--ink);
  border: 2px solid #aeb9c6;
  border-radius: 14px;
  background: var(--surface);
  text-align: left;
}

.registration-type-button.featured { border-color: var(--blue); background: var(--blue-soft); }
.registration-type-button:hover { border-color: var(--blue); background: var(--blue-soft); }
.registration-type-button small { display: block; color: var(--muted); font-weight: 400; }
.service-entry-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  color: var(--blue);
}

.service-entry-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.type-arrow { color: #748399; font-size: 2rem; line-height: 1; }

.service-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.service-button {
  min-height: 152px;
  padding: 20px;
  display: grid;
  align-content: center;
  gap: 8px;
  color: var(--ink);
  border: 2px solid #aeb9c6;
  border-radius: 14px;
  background: var(--surface);
  text-align: center;
}

.service-button:hover { border-color: var(--blue); background: var(--blue-soft); }
.service-icon { color: var(--blue); font-size: 2rem; font-weight: 700; }
.service-button small { color: var(--muted); }

.order-preview,
.info-box,
.warning-box,
.danger-box,
.success-box,
.assistant-box,
.notification {
  padding: 16px 18px;
  border: 2px solid;
  border-radius: 12px;
}

.order-preview, .info-box {
  color: #2b4e78;
  border-color: #9db5d3;
  background: var(--blue-soft);
}

.warning-box {
  color: var(--amber);
  border-color: #ddb96c;
  background: var(--amber-soft);
}

.danger-box {
  color: #7e302b;
  border-color: #dfa39e;
  background: var(--red-soft);
}

.success-box {
  color: #075f50;
  border-color: #82bbae;
  background: var(--green-soft);
}

.assistant-box {
  color: #075f50;
  border-color: #82bbae;
  background: #f0faf7;
}

.assistant-question {
  padding: 16px 18px;
  color: #263b58;
  border: 2px solid #8fa8c8;
  border-radius: 12px;
  background: #f5f8fc;
}

.notification {
  border-color: #7c8999;
  background: #f9fbfd;
}

.option-list { display: grid; gap: 13px; }

.option-button {
  width: 100%;
  min-height: 82px;
  padding: 16px 18px;
  display: grid;
  grid-template-columns: 26px 1fr;
  align-items: center;
  gap: 14px;
  color: var(--ink);
  border: 2px solid #aeb9c6;
  border-radius: 12px;
  background: var(--surface);
  text-align: left;
  font-weight: 700;
}

.option-button small { display: block; color: var(--muted); font-weight: 400; }
.option-button.selected { border-color: var(--blue); background: var(--blue-soft); }

.option-dot {
  width: 22px;
  height: 22px;
  border: 3px solid #8592a2;
  border-radius: 50%;
}

.option-button.selected .option-dot { border: 7px solid var(--blue); }

.summary-list {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.summary-row {
  padding: 14px 16px;
  display: grid;
  grid-template-columns: minmax(130px, .36fr) minmax(0, 1fr);
  gap: 14px;
  border-bottom: 1px solid #dde3e9;
}

.summary-row:last-child { border-bottom: 0; }
.summary-row dt { color: var(--muted); }
.summary-row dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }

.button-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }

.primary-button,
.secondary-button,
.danger-button,
.key-button,
.record-button {
  min-height: 58px;
  padding: 13px 21px;
  border: 2px solid transparent;
  border-radius: 10px;
  font-weight: 700;
}

.primary-button { color: #fff; background: var(--blue); }
.primary-button:hover { background: var(--blue-dark); }
.secondary-button { color: var(--blue); border-color: #8eadd8; background: var(--surface); }
.danger-button { color: #fff; background: var(--red); }

.code-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 22px;
  align-items: start;
}

.code-field { display: grid; gap: 8px; }

.code-input {
  width: 100%;
  min-height: 70px;
  padding: 12px;
  color: var(--ink);
  border: 3px solid #8797aa;
  border-radius: 11px;
  background: var(--surface);
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: .45em;
  text-align: center;
}

.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.key-button { padding: 8px; color: var(--ink); border-color: #9ba9b9; background: var(--surface); }
.key-button.utility { color: var(--blue); background: var(--blue-soft); }

.success-symbol {
  width: 90px;
  height: 90px;
  margin: 6px auto;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  border-radius: 50%;
  background: var(--green);
  font-size: 2.7rem;
  font-weight: 700;
}

.center { text-align: center; }

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  color: var(--muted);
}

.spinner {
  width: 26px;
  height: 26px;
  border: 4px solid #cad2dc;
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin .9s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.records { display: grid; gap: 13px; }

.record-button {
  min-height: 100px;
  display: grid;
  align-content: center;
  gap: 4px;
  color: var(--ink);
  border-color: #aeb9c6;
  background: var(--surface);
  text-align: left;
}

.record-button small { color: var(--muted); }
.record-status { color: var(--blue); font-size: .82rem; }

/* Realistic registration sub-pages */
.substep-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.substep-line > span:not(.substep-chip) {
  min-height: 38px;
  padding: 5px 12px;
  display: inline-flex;
  align-items: center;
  color: #34465e;
  border: 1px solid #aeb9c6;
  border-radius: 999px;
  background: var(--surface);
  font-size: .78rem;
  font-weight: 700;
  line-height: 1.3;
}

.substep-line > strong {
  min-width: 0;
  color: var(--blue-dark);
  overflow-wrap: anywhere;
}

.substep-chip,
.status-chip {
  min-height: 38px;
  padding: 5px 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #34465e;
  border: 1px solid #aeb9c6;
  border-radius: 999px;
  background: var(--surface);
  font-size: .78rem;
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.substep-chip.current,
.substep-chip.active,
.substep-chip[aria-current="step"],
.status-chip.current,
.status-chip.active {
  color: #fff;
  border-color: var(--blue);
  background: var(--blue);
}

.substep-chip.complete,
.status-chip.success,
.status-chip.complete {
  color: #075f50;
  border-color: #72ad9f;
  background: var(--green-soft);
}

.status-chip.warning {
  color: var(--amber);
  border-color: #d6ac58;
  background: var(--amber-soft);
}

.status-chip.error,
.status-chip.danger {
  color: #7e302b;
  border-color: #d79590;
  background: var(--red-soft);
}

.notice-list {
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
  list-style: none;
}

.notice-list > li {
  min-height: 48px;
  padding: 9px 12px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  color: #28445f;
  border: 1px solid #c4d3e3;
  border-radius: 10px;
  background: #f7fafd;
  overflow-wrap: anywhere;
}

.notice-list > li::before {
  content: "✓";
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  color: #fff;
  border-radius: 50%;
  background: var(--green);
  font-size: .76rem;
  font-weight: 800;
  line-height: 1;
}

.check-row {
  min-height: 52px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  color: #28445f;
  border: 1px solid #c4d3e3;
  border-radius: 10px;
  background: #f7fafd;
  overflow-wrap: anywhere;
}

.check-row input[type="checkbox"] {
  width: 28px;
  height: 28px;
  margin: 0;
  accent-color: var(--blue);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  min-width: 0;
}

.field-label,
.form-grid > label {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 7px;
  color: #33455d;
  font-weight: 700;
}

.field-label.full-width,
.field-label.wide { grid-column: 1 / -1; }

.field-label small,
.form-grid > label small,
.field-hint {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 400;
  line-height: 1.45;
}

.text-input {
  width: 100%;
  min-width: 0;
  min-height: 58px;
  padding: 10px 13px;
  color: var(--ink);
  border: 2px solid #8d9cae;
  border-radius: 10px;
  background: var(--surface);
}

select.text-input {
  cursor: pointer;
}

.text-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(30, 92, 173, .13);
}

.text-input::placeholder { color: #7b8795; opacity: 1; }
.text-input:read-only { color: #435269; background: #f3f6f9; }

.text-input.error,
.text-input[aria-invalid="true"] {
  border-color: var(--red);
  background: var(--red-soft);
}

.code-input.text-input {
  min-height: 70px;
  padding: 12px;
  border-width: 3px;
  text-align: center;
}

.field-error {
  color: #842f29;
  font-size: .78rem;
  font-weight: 700;
}

.selection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
  gap: 14px;
  min-width: 0;
}

.selection-card,
.campus-card {
  width: 100%;
  min-width: 0;
  min-height: 92px;
  padding: 15px 16px;
  display: grid;
  align-content: center;
  gap: 5px;
  color: var(--ink);
  border: 2px solid #aeb9c6;
  border-radius: 12px;
  background: var(--surface);
  text-align: left;
  overflow-wrap: anywhere;
}

.campus-card { min-height: 116px; }

.selection-card strong,
.campus-card strong { font-size: 1.02rem; }

.selection-card small,
.campus-card small {
  color: var(--muted);
  font-size: .8rem;
  font-weight: 400;
}

.selection-card > .status-chip,
.campus-card > .status-chip { justify-self: start; }

.selection-card:has(> .option-dot) {
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  align-content: center;
}

.selection-card:has(> .option-dot) > span:last-child {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.selection-card.selected .option-dot,
.selection-card[aria-pressed="true"] .option-dot {
  border: 7px solid var(--blue);
}

.selection-card:hover,
.campus-card:hover { border-color: var(--blue); background: #f6f9ff; }

.selection-card.selected,
.campus-card.selected,
.selection-card.active,
.campus-card.active,
.selection-card[aria-selected="true"],
.campus-card[aria-selected="true"],
.selection-card[aria-pressed="true"],
.campus-card[aria-pressed="true"] {
  border-color: var(--blue);
  background: var(--blue-soft);
  box-shadow: inset 5px 0 0 var(--blue);
}

.selection-card.error,
.campus-card.error {
  border-color: var(--red);
  background: var(--red-soft);
}

.department-layout {
  min-width: 0;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  align-items: start;
  gap: 16px;
}

.category-tabs,
.department-list {
  min-width: 0;
  display: grid;
  gap: 10px;
}

.category-tabs {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--soft);
}

.vertical-tabs {
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  scrollbar-gutter: stable;
}

.scrollable-tabs,
.department-results {
  max-height: min(460px, 66vh);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #8fa6c1 #edf1f5;
}

.scrollable-tabs::-webkit-scrollbar,
.department-results::-webkit-scrollbar { width: 10px; }

.scrollable-tabs::-webkit-scrollbar-track,
.department-results::-webkit-scrollbar-track {
  border-radius: 999px;
  background: #edf1f5;
}

.scrollable-tabs::-webkit-scrollbar-thumb,
.department-results::-webkit-scrollbar-thumb {
  border: 2px solid #edf1f5;
  border-radius: 999px;
  background: #8fa6c1;
}

.department-results {
  min-width: 0;
  padding: 2px 8px 6px 2px;
}

.department-results > div { min-width: 0; }
.department-results .eyebrow { margin-bottom: 10px; }
.department-results .selection-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.vertical-tabs > button.selected,
.vertical-tabs > button[aria-selected="true"] {
  position: relative;
  z-index: 1;
  box-shadow: inset 6px 0 0 var(--blue), 0 2px 8px rgba(30, 92, 173, .12);
  font-weight: 800;
}

.department-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.category-tabs > button,
.department-list > button {
  width: 100%;
  min-width: 0;
  min-height: 54px;
  padding: 10px 12px;
  color: var(--ink);
  border: 2px solid transparent;
  border-radius: 9px;
  background: var(--surface);
  text-align: left;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.category-tabs > button:hover,
.department-list > button:hover { border-color: #89a7ce; background: var(--blue-soft); }

.category-tabs > button.selected,
.department-list > button.selected,
.category-tabs > button[aria-selected="true"],
.department-list > button[aria-selected="true"] {
  color: var(--blue-dark);
  border-color: var(--blue);
  background: var(--blue-soft);
}

.doctor-card {
  width: 100%;
  min-width: 0;
  min-height: 128px;
  padding: 16px;
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  color: var(--ink);
  border: 2px solid #aeb9c6;
  border-radius: 14px;
  background: var(--surface);
  text-align: left;
  overflow-wrap: anywhere;
}

.doctor-card > span:last-child { min-width: 0; }

button.doctor-card:hover { border-color: var(--blue); background: #f6f9ff; }

.doctor-card.selected,
.doctor-card[aria-selected="true"],
.doctor-card[aria-pressed="true"] {
  border-color: var(--blue);
  background: var(--blue-soft);
  box-shadow: inset 5px 0 0 var(--blue);
}

.doctor-avatar {
  width: 76px;
  height: 76px;
  overflow: hidden;
  display: grid;
  place-items: center;
  color: var(--blue);
  border: 2px solid #aac0dc;
  border-radius: 50%;
  background: #edf4fc;
  font-size: 1.45rem;
  font-weight: 800;
}

.doctor-avatar img { width: 100%; height: 100%; object-fit: cover; }

.doctor-meta {
  min-width: 0;
  margin-top: 6px;
  display: block;
  color: var(--muted);
  font-size: .8rem;
  line-height: 1.45;
}

.date-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 10px;
  min-width: 0;
}

.date-strip .selection-card {
  min-height: 70px;
  place-items: center;
  text-align: center;
}

.date-button,
.slot-button {
  width: 100%;
  min-width: 0;
  min-height: 70px;
  padding: 10px 12px;
  color: var(--ink);
  border: 2px solid #aeb9c6;
  border-radius: 11px;
  background: var(--surface);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.date-button { display: grid; place-items: center; gap: 2px; text-align: center; }
.date-button small { color: var(--muted); font-size: .74rem; font-weight: 400; }

.date-button:hover,
.slot-button:hover { border-color: var(--blue); background: #f6f9ff; }

.date-button.selected,
.slot-button.selected,
.date-button[aria-selected="true"],
.slot-button[aria-selected="true"],
.date-button[aria-pressed="true"],
.slot-button[aria-pressed="true"] {
  color: var(--blue-dark);
  border-color: var(--blue);
  background: var(--blue-soft);
  box-shadow: inset 0 -5px 0 var(--blue);
}

.date-button.unavailable,
.slot-button.unavailable,
.date-button:disabled,
.slot-button:disabled {
  color: #6f7884;
  border-color: #c8cfd7;
  background: #eef1f4;
  box-shadow: none;
}

.slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
  gap: 12px;
  min-width: 0;
}

.slot-button {
  min-height: 88px;
  display: grid;
  align-content: center;
  gap: 4px;
  text-align: left;
}

.slot-status,
.slot-button small {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 400;
}

.slot-button.selected .slot-status,
.slot-button.selected small,
.slot-button[aria-selected="true"] .slot-status,
.slot-button[aria-selected="true"] small { color: var(--blue-dark); }

.patient-card {
  width: 100%;
  min-width: 0;
  min-height: 102px;
  padding: 15px 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  gap: 10px 16px;
  color: var(--ink);
  border: 2px solid #aeb9c6;
  border-radius: 13px;
  background: var(--surface);
  text-align: left;
  overflow-wrap: anywhere;
}

.patient-card > .form-grid,
.patient-card > .summary-list { min-width: 0; width: 100%; }

button.patient-card:hover { border-color: var(--blue); background: #f6f9ff; }

.patient-card.selected,
.patient-card[aria-selected="true"],
.patient-card[aria-pressed="true"] {
  border-color: var(--blue);
  background: var(--blue-soft);
  box-shadow: inset 5px 0 0 var(--blue);
}

.masked-value {
  color: #2f4056;
  font-family: "Microsoft YaHei", "Noto Sans SC", Arial, sans-serif;
  font-weight: 700;
  letter-spacing: .04em;
  overflow-wrap: anywhere;
}

.identity-banner {
  min-width: 0;
  padding: 14px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  color: #244a75;
  border: 2px solid #9db5d3;
  border-radius: 12px;
  background: var(--blue-soft);
  overflow-wrap: anywhere;
}

.identity-banner.error,
.identity-banner.mismatch {
  color: #7e302b;
  border-color: #d79590;
  background: var(--red-soft);
}

.order-header {
  min-width: 0;
  padding: 15px 17px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--soft);
  overflow-wrap: anywhere;
}

.countdown {
  min-height: 42px;
  padding: 6px 12px;
  display: inline-flex;
  align-items: center;
  color: #6e4100;
  border: 2px solid #d8a642;
  border-radius: 9px;
  background: var(--amber-soft);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.countdown.urgent,
.countdown.error {
  color: #7e302b;
  border-color: #d79590;
  background: var(--red-soft);
}

.order-summary,
.fee-details {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.order-summary > :not(.summary-row),
.fee-details > :not(.summary-row) {
  min-width: 0;
  padding: 13px 16px;
  overflow-wrap: anywhere;
}

.order-summary > :not(:last-child),
.fee-details > :not(:last-child) { border-bottom: 1px solid #dde3e9; }

.fee-details .summary-row,
.fee-details > div {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto;
  align-items: baseline;
  gap: 14px;
}

.fee-details dd,
.fee-details .amount {
  color: #253b55;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.fee-details .total,
.fee-details .remaining {
  color: var(--blue-dark);
  background: var(--blue-soft);
  font-size: 1.05rem;
  font-weight: 800;
}

.phone-notification {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
  min-width: 0;
  min-height: 86px;
  margin: 0 auto;
  padding: 13px 16px;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  color: #fff;
  border: 1px solid #29384a;
  border-radius: 18px;
  background: #17212d;
  box-shadow: 0 12px 26px rgba(17, 32, 49, .22);
  overflow: hidden;
}

.phone-notification-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  color: #fff;
  border-radius: 14px;
  background: #178655;
  font-size: 1.25rem;
  font-weight: 800;
}

.phone-notification > span:first-child:not(.phone-notification-content):not(.phone-notification-icon) {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  color: #fff;
  border-radius: 14px;
  background: #178655;
  font-size: .82rem;
  font-weight: 800;
}

.phone-notification > strong,
.phone-notification > p,
.phone-notification > small {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

button.phone-notification {
  grid-template-columns: 52px minmax(0, 1fr);
  text-align: left;
}

button.phone-notification > span:first-child { grid-row: 1 / span 2; }

button.phone-notification > strong,
button.phone-notification > small { grid-column: 2; }

button.phone-notification > small {
  color: #ccd5df;
  font-size: .72rem;
  line-height: 1.4;
}

.assistant-body .phone-notification {
  grid-template-columns: minmax(0, 1fr);
  justify-items: start;
}

.phone-notification-content,
.phone-notification .content {
  min-width: 0;
  display: grid;
  gap: 2px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.phone-notification-content small,
.phone-notification .content small { color: #ccd5df; font-size: .72rem; }

.notification-code {
  color: #fff;
  font-size: 1.18rem;
  font-weight: 800;
  letter-spacing: .08em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.permission-card {
  min-width: 0;
  padding: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 14px 16px;
  border: 2px solid #aeb9c6;
  border-radius: 14px;
  background: var(--surface);
  overflow-wrap: anywhere;
}

.permission-card:has(> .permission-icon) {
  grid-template-columns: 64px minmax(0, 1fr);
}

.permission-card > strong,
.permission-card > p { min-width: 0; margin: 0; }

.permission-icon {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  color: var(--blue);
  border-radius: 50%;
  background: var(--blue-soft);
  font-size: 1.55rem;
  font-weight: 800;
}

.permission-card > .button-row,
.permission-card > .notice-list,
.permission-card > .warning-box { grid-column: 1 / -1; }

.issue-panel {
  min-width: 0;
  padding: 17px 18px;
  display: grid;
  gap: 12px;
  color: #61420b;
  border: 2px solid #d6ac58;
  border-radius: 13px;
  background: var(--amber-soft);
  overflow-wrap: anywhere;
}

.issue-panel.error,
.issue-panel.danger,
.issue-panel.mismatch {
  color: #7e302b;
  border-color: #d79590;
  background: var(--red-soft);
}

.issue-panel.success {
  color: #075f50;
  border-color: #72ad9f;
  background: var(--green-soft);
}

.issue-panel > .status-chip { justify-self: start; }

.status-line {
  min-width: 0;
  padding: 10px 0;
  display: grid;
  grid-template-columns: minmax(130px, .38fr) minmax(0, 1fr);
  align-items: start;
  gap: 10px 14px;
  border-bottom: 1px solid rgba(93, 104, 119, .24);
  overflow-wrap: anywhere;
}

.status-line:last-child { border-bottom: 0; }
.status-line > :first-child { color: var(--muted); }
.status-line > :last-child { font-weight: 700; }

.receipt-card {
  min-width: 0;
  padding: 20px;
  display: grid;
  gap: 15px;
  color: #174637;
  border: 2px solid #72ad9f;
  border-top: 8px solid var(--green);
  border-radius: 14px;
  background: #f7fcfa;
  box-shadow: 0 10px 24px rgba(15, 91, 72, .1);
  overflow-wrap: anywhere;
}

.receipt-card > header {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
}

.receipt-card > header > strong { min-width: 0; overflow-wrap: anywhere; }
.receipt-card > .summary-list { color: var(--ink); background: var(--surface); }

.camera-view {
  width: min(560px, 100%);
  min-width: 0;
  margin: 0 auto;
  padding: 22px;
  display: grid;
  justify-items: center;
  gap: 15px;
  border: 2px solid #83a3c9;
  border-radius: 16px;
  background: #f2f7fd;
  overflow: hidden;
}

.camera-view.ready {
  border-color: #72ad9f;
  background: #f3faf8;
}

.camera-view.failed {
  border-color: #d79590;
  background: var(--red-soft);
}

.face-frame {
  position: relative;
  width: min(280px, 100%);
  aspect-ratio: 4 / 5;
  overflow: hidden;
  display: grid;
  place-items: center;
  color: #d9e8f6;
  border: 4px solid var(--green);
  border-radius: 44% 44% 40% 40% / 36% 36% 48% 48%;
  background: radial-gradient(circle at 50% 38%, #34475d 0, #26384c 45%, #172535 100%);
  box-shadow: inset 0 0 0 8px rgba(255, 255, 255, .08), 0 10px 24px rgba(19, 44, 68, .16);
}

.camera-view.failed .face-frame { border-color: var(--red); }

.face-frame svg {
  width: min(68%, 190px);
  height: auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.scan-line {
  position: absolute;
  z-index: 2;
  top: 17%;
  right: 10%;
  left: 10%;
  height: 4px;
  border-radius: 999px;
  background: #62e2c7;
  box-shadow: 0 0 12px 3px rgba(98, 226, 199, .54);
  pointer-events: none;
  animation: face-scan 2.4s ease-in-out infinite;
}

.camera-view.failed .scan-line {
  top: 50%;
  background: #ffaaa4;
  box-shadow: 0 0 12px 3px rgba(255, 170, 164, .48);
  animation: none;
}

@keyframes face-scan {
  0%, 100% { top: 17%; opacity: .48; }
  50% { top: 80%; opacity: 1; }
}

.face-guide {
  max-width: 440px;
  color: #253b55;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.5;
  text-align: center;
  overflow-wrap: anywhere;
}

.face-status {
  width: min(440px, 100%);
  min-width: 0;
  min-height: 48px;
  padding: 9px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #075f50;
  border: 2px solid #72ad9f;
  border-radius: 10px;
  background: var(--green-soft);
  font-weight: 800;
  line-height: 1.45;
  text-align: center;
  overflow-wrap: anywhere;
}

.face-status.warning,
.face-status.failed {
  color: #7e302b;
  border-color: #d79590;
  background: #fff4f2;
}

/* Final real-world mobile registration flow */
.page-card[data-screen="campus"] .selection-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.page-card[data-screen="campus"] .selection-card {
  min-height: 122px;
}

.page-card[data-screen="schedule"] .page-content > h2 {
  padding: 10px 14px;
  color: var(--blue-dark);
  border-left: 6px solid var(--blue);
  border-radius: 8px;
  background: var(--blue-soft);
  overflow-wrap: anywhere;
}

.page-card[data-screen="schedule"] .slot-grid + h2 {
  margin-top: 4px;
}

.patient-card .form-grid { align-items: start; }

.patient-card .form-grid > label > span {
  color: #2c4059;
  font-weight: 800;
}

.check-row:has(> .status-chip) {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  padding: 14px 16px;
}

.check-row:has(> .status-chip) > span { min-width: 0; }
.check-row:has(> .status-chip) > .status-chip { justify-self: end; }

.page-card[data-screen="location-settings"] .permission-card,
.page-card[data-screen="camera-settings"] .permission-card {
  width: min(720px, 100%);
  border-color: #92abd0;
  background: #f6f9ff;
}

.page-card[data-screen="location-settings"] .check-row,
.page-card[data-screen="camera-settings"] .check-row {
  min-height: 88px;
  background: var(--surface);
}

.warning-box[data-test="payment-countdown"] {
  padding: 20px;
  color: #774300;
  border-width: 3px;
  border-color: #d49a26;
  background: #fff7bd;
  font-size: 1.03rem;
  text-align: center;
}

[data-countdown="payment"] {
  color: #a83a16;
  font-size: 1.34rem;
  font-weight: 900;
  letter-spacing: .02em;
  font-variant-numeric: tabular-nums;
}

.issue-panel[data-test="payment-timeout"] {
  border-width: 3px;
  border-color: var(--red);
  background: #fff1ee;
}

.issue-panel[data-test="payment-timeout"] h1 { color: #7e302b; }

button:disabled {
  color: #66717f;
  border-color: #c8cfd7;
  background: #edf0f3;
  box-shadow: none;
  cursor: not-allowed;
  opacity: 1;
}

.assistant-overlay {
  position: fixed;
  z-index: 50;
  inset: 0;
  padding: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(18, 31, 47, .48);
}

.assistant-panel {
  width: min(680px, 100%);
  max-height: calc(100vh - 44px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 18px 54px rgba(11, 30, 52, .28);
}

.assistant-head {
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: #fff;
  background: var(--green);
}

.assistant-close {
  width: 48px;
  height: 48px;
  color: #fff;
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 9px;
  background: rgba(255,255,255,.08);
  font-size: 1.4rem;
}

.assistant-body { padding: 22px; display: grid; gap: 16px; overflow: auto; }

.assistant-body .button-row {
  position: sticky;
  bottom: 0;
  padding: 12px 0 2px;
  background: var(--surface);
}

.footer-note {
  padding: 17px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  background: var(--surface);
  font-size: .82rem;
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }

  .spinner { animation: none; border-top-color: #cad2dc; }
  .scan-line { top: 50%; animation: none; opacity: .65; }
  .progress-bar { transition: none; }
}

@media (max-height: 720px) {
  .main-wrap { padding-top: 16px; padding-bottom: 28px; }
  .page-card { min-height: 0; }
  .page-content { padding-top: 20px; padding-bottom: 22px; }
}

@media (max-width: 820px) {
  body { font-size: 19px; }
  .service-grid { grid-template-columns: 1fr; }
  .service-button { min-height: 106px; grid-template-columns: 50px 1fr; align-items: center; text-align: left; }
  .code-layout { grid-template-columns: 1fr; }
  .keypad { max-width: 380px; }
  .progress-inner { grid-template-columns: 1fr auto; gap: 8px 14px; padding: 10px 0; }
  .progress-track { grid-column: 1 / -1; grid-row: 2; }
  .form-grid { grid-template-columns: 1fr; }
  .field-label.full-width,
  .field-label.wide { grid-column: auto; }
  .department-layout { grid-template-columns: 210px minmax(0, 1fr); gap: 12px; }
  .category-tabs { grid-template-columns: minmax(0, 1fr); }
  .scrollable-tabs,
  .department-results { max-height: min(460px, 64vh); }
  .department-results .selection-grid { grid-template-columns: minmax(0, 1fr); }
  .doctor-card { grid-template-columns: 70px minmax(0, 1fr); }
  .doctor-avatar { width: 70px; height: 70px; }
  .doctor-card > :nth-child(n + 3) { grid-column: 1 / -1; }
  .order-header { align-items: flex-start; }
}

@media (max-width: 560px) {
  body { font-size: 18px; }
  .header-inner, .progress-inner, .main-wrap { width: calc(100% - 20px); }
  .header-inner { min-height: 72px; }
  .hospital-mark { width: 44px; height: 44px; }
  .hospital-subtitle { display: none; }
  .header-home { padding: 7px 10px; }
  .main-wrap { padding-top: 14px; }
  .page-card { min-height: 0; }
  .page-bar { padding: 8px 12px; }
  .page-content { padding: 18px; }
  .registration-type-button { grid-template-columns: 46px minmax(0, 1fr) 20px; padding: 14px 12px; gap: 9px; }
  .service-entry-icon { width: 40px; height: 40px; }
  .summary-row { grid-template-columns: 1fr; gap: 3px; }
  .button-row { align-items: stretch; }
  .button-row > button { flex: 1 1 220px; }
  .code-input { letter-spacing: .22em; }
  .assistant-overlay { padding: 10px; }
  .substep-line { gap: 6px; }
  .substep-chip,
  .status-chip { padding-inline: 10px; }
  .selection-grid,
  .department-list,
  .category-tabs,
  .slot-grid { grid-template-columns: 1fr; }
  .page-card[data-screen="campus"] .selection-grid { grid-template-columns: minmax(0, 1fr); }
  .department-layout { grid-template-columns: minmax(108px, .42fr) minmax(0, 1fr); gap: 8px; }
  .category-tabs { padding: 6px; gap: 7px; }
  .category-tabs > button { min-height: 62px; padding: 8px; }
  .scrollable-tabs,
  .department-results { max-height: min(460px, 62vh); }
  .department-results { padding-right: 2px; }
  .department-results .selection-card { padding: 12px 10px; }
  .date-strip {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
  }
  .date-strip .selection-card { flex: 0 0 116px; scroll-snap-align: start; }
  .doctor-card { grid-template-columns: 62px minmax(0, 1fr); padding: 13px; gap: 12px; }
  .doctor-avatar { width: 62px; height: 62px; }
  .patient-card { grid-template-columns: 1fr; }
  .identity-banner { align-items: flex-start; }
  .status-line { grid-template-columns: 1fr; gap: 2px; }
  .phone-notification {
    padding: 12px;
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 10px;
    border-radius: 15px;
  }
  button.phone-notification { grid-template-columns: 46px minmax(0, 1fr); }
  .phone-notification-icon,
  .phone-notification > span:first-child:not(.phone-notification-content):not(.phone-notification-icon) { width: 46px; height: 46px; border-radius: 12px; }
  .notification-code { grid-column: 2; justify-self: start; white-space: normal; }
  .permission-card { grid-template-columns: minmax(0, 1fr); padding: 15px; }
  .permission-card:has(> .permission-icon) { grid-template-columns: 54px minmax(0, 1fr); }
  .permission-icon { width: 54px; height: 54px; }
  .fee-details .summary-row,
  .fee-details > div { grid-template-columns: minmax(0, 1fr) auto; }
  .receipt-card { padding: 16px; }
  .camera-view { padding: 16px 12px; }
  .face-frame { width: min(230px, 100%); }
  .face-guide { font-size: .94rem; }
  .warning-box[data-test="payment-countdown"] { padding: 16px 12px; font-size: 1rem; }
  [data-countdown="payment"] { display: inline-block; font-size: 1.25rem; }
}

/* A 组普通搜索：只扩展页面布局，不参与六节点状态与进度。 */
.a-search-layout {
  min-width: 0;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 24px;
}

.a-search-layout > * {
  min-width: 0;
  max-width: 100%;
}

.a-search-panel {
  min-width: 0;
  width: 100%;
  padding: 20px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-content: stretch;
  gap: 16px;
  overflow-wrap: anywhere;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.a-search-top,
.a-search-scroll {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 12px;
}

.a-search-top {
  position: relative;
  z-index: 2;
  padding-bottom: 4px;
  background: var(--surface);
}

.a-search-top h2 { margin: 0 0 6px; }
.a-search-top p { margin: 0; color: var(--muted); line-height: 1.5; }

.a-search-scroll {
  min-height: 0;
  gap: 14px;
}

.a-search-panel h2,
.a-search-panel h3,
.a-search-panel p { min-width: 0; overflow-wrap: anywhere; }

.a-search-panel button { min-height: 48px; }

.a-search-form {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.a-search-query {
  width: 100%;
  min-width: 0;
  min-height: 58px;
  padding: 12px 14px;
  color: var(--ink);
  border: 2px solid #8fa2b8;
  border-radius: 10px;
  background: var(--surface);
}

.a-search-query::placeholder { color: #687587; }

.a-search-submit {
  width: 100%;
  min-width: 0;
  min-height: 58px;
  padding: 12px 18px;
  color: #fff;
  border: 2px solid var(--blue);
  border-radius: 10px;
  background: var(--blue);
  font-weight: 700;
}

.a-search-submit:hover { border-color: var(--blue-dark); background: var(--blue-dark); }

.a-search-results {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.a-search-result-card {
  width: 100%;
  min-width: 0;
  min-height: 84px;
  padding: 14px 15px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: center;
  gap: 7px;
  color: var(--ink);
  border: 2px solid #aeb9c6;
  border-radius: 12px;
  background: var(--surface);
  text-align: left;
  text-decoration: none;
  overflow-wrap: anywhere;
}

button.a-search-result-card,
a.a-search-result-card { cursor: pointer; }

.a-search-result-card:hover,
.a-search-result-card[aria-selected="true"],
.a-search-result-card.selected {
  border-color: var(--blue);
  background: var(--blue-soft);
}

.a-search-result-title {
  min-width: 0;
  color: var(--blue-dark);
  font-weight: 800;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.a-search-result-summary {
  min-width: 0;
  color: var(--muted);
  font-size: .84rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.a-search-result-detail {
  min-width: 0;
  padding: 15px 16px;
  color: #2b4e78;
  border: 2px solid #9db5d3;
  border-radius: 12px;
  background: var(--blue-soft);
  overflow-wrap: anywhere;
}

.a-search-status,
.a-search-empty,
.a-search-safety {
  min-width: 0;
  padding: 13px 15px;
  border: 2px solid;
  border-radius: 12px;
  overflow-wrap: anywhere;
}

.a-search-status {
  color: #2b4e78;
  border-color: #9db5d3;
  background: #f4f8fd;
}

.a-search-empty {
  color: var(--muted);
  border-color: var(--line);
  background: var(--soft);
}

.a-search-safety {
  color: var(--amber);
  border-color: #ddb96c;
  background: var(--amber-soft);
}

@media (min-width: 1180px) {
  .main-wrap { width: min(1460px, calc(100% - 32px)); }

  .a-search-layout {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 360px);
  }

  .a-search-panel {
    position: sticky;
    top: 20px;
    height: calc(100vh - 40px);
    max-height: calc(100vh - 40px);
    overflow: hidden;
    overscroll-behavior: contain;
    scrollbar-width: thin;
  }

  .a-search-scroll {
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
  }
}

@media (max-width: 560px) {
  .a-search-layout { gap: 16px; }
  .a-search-panel { padding: 16px; gap: 14px; }
  .a-search-result-card { padding: 13px; }
  .a-search-result-detail,
  .a-search-status,
  .a-search-empty,
  .a-search-safety { padding: 12px 13px; }
}
