:root {
  color-scheme: light;
  --ink: #152a3b;
  --body: #355166;
  --muted: #6d8293;
  --blue: #245f8c;
  --blue-deep: #174a70;
  --blue-pale: #eaf6fb;
  --line: rgba(36, 95, 140, 0.13);
  --paper: rgba(255, 255, 255, 0.94);
  --warm: #fff7f2;
  --warning: #a15037;
  --shadow: 0 24px 70px rgba(34, 82, 116, 0.1);
  --serif: "Songti SC", "STSong", "Noto Serif CJK SC", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 11% 5%, rgba(255, 255, 255, 0.96), transparent 25rem),
    linear-gradient(180deg, #e8f5fb 0, #f9fcfc 34rem, #f7f2ea 100%);
  font-family: var(--sans);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

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

.site-header {
  position: relative;
  z-index: 10;
  display: flex;
  width: min(1440px, calc(100% - 48px));
  min-height: 84px;
  margin: 0 auto;
  align-items: center;
  justify-content: space-between;
}

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

.brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 50% 50% 48% 52% / 53% 48% 52% 47%;
  color: #fff;
  background: var(--blue);
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  transform: rotate(-3deg);
}

.brand > span:last-child {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.brand strong {
  font-family: var(--serif);
  font-size: 20px;
  letter-spacing: 0.08em;
}

.brand small {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.28em;
}

.privacy-status {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 1px solid rgba(36, 95, 140, 0.11);
  border-radius: 999px;
  padding: 9px 14px;
  color: var(--blue-deep);
  background: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 8px 28px rgba(30, 84, 122, 0.06);
  backdrop-filter: blur(12px);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #44a078;
  box-shadow: 0 0 0 4px rgba(68, 160, 120, 0.13);
}

main {
  width: min(1440px, calc(100% - 48px));
  margin: 0 auto;
}

.hero {
  position: relative;
  min-height: clamp(390px, 42vw, 560px);
  overflow: hidden;
  border-radius: 32px;
  background: #318ec5;
  box-shadow: var(--shadow);
  isolation: isolate;
}

.hero > img,
.hero-shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero > img {
  object-fit: cover;
  object-position: center 42%;
  transform: scale(1.012);
}

.hero-shade {
  background:
    linear-gradient(90deg, rgba(7, 53, 83, 0.68) 0%, rgba(12, 74, 112, 0.27) 54%, rgba(7, 49, 76, 0.08) 100%),
    linear-gradient(0deg, rgba(6, 50, 79, 0.24), transparent 60%);
}

.hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  width: min(680px, 64%);
  min-height: clamp(390px, 42vw, 560px);
  padding: clamp(42px, 7vw, 96px);
  flex-direction: column;
  justify-content: center;
  color: #fff;
  text-shadow: 0 2px 10px rgba(9, 45, 69, 0.2);
}

.eyebrow,
.step-label {
  margin: 0;
  color: rgba(255, 255, 255, 0.76);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.17em;
}

.hero h1 {
  margin: 24px 0 14px;
  font-family: var(--serif);
  font-size: clamp(52px, 7.2vw, 92px);
  line-height: 1.05;
  letter-spacing: 0.03em;
}

.hero-content > p:last-child {
  max-width: 560px;
  margin: 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: clamp(16px, 1.6vw, 20px);
  line-height: 1.8;
}

.hero-privacy {
  position: absolute;
  right: clamp(24px, 4vw, 58px);
  bottom: clamp(24px, 4vw, 48px);
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 13px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 16px;
  padding: 15px 18px;
  color: #fff;
  background: rgba(12, 58, 87, 0.34);
  box-shadow: 0 15px 40px rgba(7, 41, 63, 0.12);
  backdrop-filter: blur(16px);
}

.hero-privacy > span {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  color: #1b6d50;
  background: #e9fff3;
  font-weight: 900;
}

.hero-privacy div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hero-privacy strong {
  font-size: 13px;
}

.hero-privacy small {
  color: rgba(255, 255, 255, 0.75);
  font-size: 11px;
}

.legal-note {
  display: flex;
  margin: 22px 0 34px;
  align-items: flex-start;
  gap: 12px;
  border: 1px solid #efd8cb;
  border-radius: 18px;
  padding: 18px 22px;
  color: #815b2c;
  background: rgba(255, 248, 243, 0.88);
}

.note-icon {
  display: grid;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(129, 91, 44, 0.55);
  border-radius: 50%;
  font-family: var(--serif);
  font-size: 13px;
  font-style: italic;
  font-weight: 700;
}

.legal-note p {
  margin: 0;
  font-size: 13px;
  line-height: 1.7;
}

.workspace {
  display: grid;
  align-items: start;
  grid-template-columns: minmax(0, 1.25fr) minmax(390px, 0.75fr);
  gap: 30px;
}

.form-column,
.preview-sticky {
  min-width: 0;
}

.section-heading,
.preview-heading {
  display: flex;
  margin-bottom: 18px;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}

.step-label {
  color: #668196;
  font-size: 11px;
}

.section-heading h2,
.preview-heading h2 {
  margin: 7px 0 0;
  font-family: var(--serif);
  font-size: 28px;
  line-height: 1.25;
}

.section-heading > span {
  color: var(--muted);
  font-size: 12px;
}

#medicalForm {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-section {
  min-width: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 26px;
  background: var(--paper);
  box-shadow: 0 16px 46px rgba(34, 82, 116, 0.065);
}

.form-section legend {
  display: flex;
  width: 100%;
  margin-bottom: 22px;
  padding: 0;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 700;
}

.section-number {
  display: grid;
  width: 31px;
  height: 31px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 10px;
  color: var(--blue);
  background: var(--blue-pale);
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.04em;
}

.form-section legend em {
  margin-left: auto;
  border-radius: 999px;
  padding: 7px 11px;
  color: var(--warning);
  background: #ffede5;
  font-family: var(--sans);
  font-size: 11px;
  font-style: normal;
}

.warning-section {
  border-color: #edd1c3;
  background: rgba(255, 251, 248, 0.96);
}

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

.field-grid.single-column {
  grid-template-columns: minmax(0, 1fr);
}

.field.full-width {
  grid-column: 1 / -1;
}

.field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 9px;
  color: #29475d;
  font-size: 13px;
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(36, 95, 140, 0.16);
  border-radius: 15px;
  outline: none;
  color: var(--ink);
  background: #fbfdfe;
  font-size: 15px;
  font-weight: 400;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
  appearance: none;
}

.field input,
.field select {
  height: 50px;
  padding: 0 15px;
}

.field select {
  padding-right: 42px;
  background-image:
    linear-gradient(45deg, transparent 50%, #557286 50%),
    linear-gradient(135deg, #557286 50%, transparent 50%);
  background-position:
    calc(100% - 20px) 22px,
    calc(100% - 15px) 22px;
  background-repeat: no-repeat;
  background-size: 5px 5px, 5px 5px;
}

.field textarea {
  min-height: 104px;
  resize: vertical;
  padding: 14px 15px;
  line-height: 1.65;
}

.field input::placeholder,
.field textarea::placeholder {
  color: #9aabb7;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: #4b8dbb;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(61, 135, 184, 0.1);
}

.preview-sticky {
  position: sticky;
  top: 18px;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #3f7563;
  font-size: 11px;
  font-weight: 700;
}

.live-badge i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #45a27b;
  box-shadow: 0 0 0 4px rgba(69, 162, 123, 0.12);
}

.medical-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 25px;
  background: #fff;
  box-shadow: 0 24px 68px rgba(34, 82, 116, 0.12);
}

.card-cover {
  position: relative;
  min-height: 184px;
  overflow: hidden;
  color: #fff;
}

.card-cover > img,
.card-cover-shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.card-cover > img {
  object-fit: cover;
  object-position: center 37%;
}

.card-cover-shade {
  background: linear-gradient(90deg, rgba(8, 54, 84, 0.64), rgba(8, 54, 84, 0.12));
}

.card-cover-content {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 184px;
  padding: 25px;
  flex-direction: column;
  justify-content: center;
}

.card-cover-content small {
  color: rgba(255, 255, 255, 0.72);
  font-size: 9px;
}

.card-cover-content strong {
  margin-top: 22px;
  font-family: var(--serif);
  font-size: 34px;
}

.card-cover-content span {
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 11px;
}

.blood-badge {
  position: absolute;
  right: 22px;
  bottom: 22px;
  z-index: 2;
  display: grid;
  min-width: 62px;
  height: 62px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 50%;
  padding: 6px;
  color: #fff;
  background: rgba(18, 74, 108, 0.46);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  backdrop-filter: blur(10px);
}

.card-content {
  display: flex;
  padding: 23px;
  flex-direction: column;
  gap: 15px;
}

.identity-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.identity-row > div {
  min-width: 0;
  border-radius: 13px;
  padding: 13px;
  background: #f2f8fb;
}

.identity-row small {
  display: block;
  margin-bottom: 6px;
  color: #6b8395;
  font-size: 9px;
}

.identity-row strong {
  display: block;
  overflow-wrap: anywhere;
  color: #24465f;
  font-size: 12px;
  line-height: 1.45;
}

.preview-alert,
.preview-block {
  border-radius: 16px;
  padding: 16px;
  background: var(--warm);
}

.preview-block {
  background: #f5fafc;
}

.preview-section-title {
  display: flex;
  margin-bottom: 10px;
  align-items: center;
  gap: 8px;
  color: var(--warning);
  font-size: 12px;
}

.preview-block .preview-section-title {
  color: var(--blue);
}

.preview-section-title span {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 7px;
  color: #fff;
  background: #bd6b50;
  font-size: 11px;
  font-weight: 900;
}

.preview-block .preview-section-title span {
  background: var(--blue);
}

.preview-alert dl,
.preview-details dl {
  display: flex;
  margin: 0;
  flex-direction: column;
  gap: 8px;
}

.preview-alert dl > div,
.preview-details dl > div {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 10px;
}

.preview-alert dt,
.preview-details dt {
  color: #7d6c64;
  font-size: 10px;
}

.preview-alert dd,
.preview-details dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: #3d4f5c;
  font-size: 11px;
  line-height: 1.55;
}

.preview-block p {
  margin: 0;
  overflow-wrap: anywhere;
  color: #38556a;
  font-size: 12px;
  line-height: 1.6;
}

.preview-block p b {
  margin: 0 7px;
  color: #a2b1bb;
}

.preview-details {
  border: 1px solid rgba(36, 95, 140, 0.1);
  border-radius: 16px;
  padding: 0 15px;
  background: #fff;
}

.preview-details summary {
  padding: 14px 0;
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
  list-style-position: inside;
}

.preview-details dl {
  padding: 0 0 15px;
}

.preview-details dl > div {
  padding-top: 8px;
  border-top: 1px solid rgba(36, 95, 140, 0.08);
}

.card-footer {
  border-top: 1px solid rgba(36, 95, 140, 0.09);
  padding: 13px 22px;
  color: #788d9c;
  background: #f8fbfc;
  font-size: 9px;
  line-height: 1.6;
  text-align: center;
}

.actions {
  display: grid;
  margin-top: 18px;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.button {
  min-height: 49px;
  border: 0;
  border-radius: 999px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 800;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

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

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

.button-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #fff;
  background: var(--blue);
  box-shadow: 0 14px 30px rgba(36, 95, 140, 0.2);
}

.button-secondary {
  border: 1px solid rgba(36, 95, 140, 0.15);
  color: var(--blue);
  background: rgba(255, 255, 255, 0.78);
}

.minor-actions {
  display: flex;
  grid-column: 1 / -1;
  justify-content: center;
  gap: 22px;
}

.text-button {
  border: 0;
  padding: 9px 2px;
  color: #5d788b;
  background: transparent;
  font-size: 11px;
  font-weight: 700;
}

.text-button:hover {
  color: var(--blue);
}

.text-button.danger:hover {
  color: #a64a38;
}

.privacy-footnote {
  display: flex;
  margin: 10px 8px 0;
  align-items: flex-start;
  justify-content: center;
  gap: 7px;
  color: #7d909e;
  font-size: 10px;
  line-height: 1.6;
  text-align: center;
}

.site-footer {
  display: flex;
  width: min(1440px, calc(100% - 48px));
  margin: 70px auto 0;
  padding: 30px 0 calc(34px + env(safe-area-inset-bottom));
  justify-content: space-between;
  border-top: 1px solid rgba(36, 95, 140, 0.11);
  color: #718695;
  font-size: 11px;
}

.site-footer p {
  margin: 0;
}

.toast {
  position: fixed;
  bottom: calc(24px + env(safe-area-inset-bottom));
  left: 50%;
  z-index: 100;
  max-width: calc(100% - 40px);
  border-radius: 999px;
  padding: 12px 18px;
  color: #fff;
  background: rgba(19, 44, 61, 0.94);
  box-shadow: 0 15px 45px rgba(11, 41, 60, 0.25);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 1020px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .preview-sticky {
    position: static;
  }

  .medical-card,
  .actions,
  .privacy-footnote {
    max-width: 640px;
    margin-right: auto;
    margin-left: auto;
  }
}

@media (max-width: 720px) {
  .site-header,
  main,
  .site-footer {
    width: min(100% - 28px, 640px);
  }

  .site-header {
    min-height: 72px;
  }

  .privacy-status {
    padding: 8px 11px;
    font-size: 11px;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
  }

  .brand strong {
    font-size: 17px;
  }

  .brand small {
    font-size: 8px;
  }

  .hero {
    min-height: 460px;
    border-radius: 24px;
  }

  .hero-shade {
    background:
      linear-gradient(0deg, rgba(6, 50, 79, 0.68) 0%, rgba(6, 50, 79, 0.08) 72%),
      linear-gradient(90deg, rgba(7, 53, 83, 0.34), transparent);
  }

  .hero-content {
    width: 100%;
    min-height: 390px;
    padding: 38px 28px 80px;
    justify-content: flex-end;
  }

  .hero h1 {
    margin-top: 17px;
    font-size: 54px;
  }

  .hero-content > p:last-child {
    font-size: 15px;
    line-height: 1.65;
  }

  .hero-privacy {
    right: 18px;
    bottom: 18px;
    left: 18px;
    padding: 12px 14px;
  }

  .legal-note {
    margin: 16px 0 28px;
    padding: 15px 16px;
  }

  .section-heading,
  .preview-heading {
    align-items: flex-start;
  }

  .section-heading > span {
    max-width: 135px;
    padding-top: 5px;
    text-align: right;
  }

  .field-grid {
    grid-template-columns: 1fr;
  }

  .form-section {
    border-radius: 20px;
    padding: 21px 18px;
  }

  .form-section legend {
    font-size: 18px;
  }

  .card-cover,
  .card-cover-content {
    min-height: 172px;
  }

  .card-cover-content {
    padding: 22px;
  }

  .identity-row {
    grid-template-columns: 1fr 1fr;
  }

  .identity-row > div:last-child {
    grid-column: 1 / -1;
  }

  .card-content {
    padding: 17px;
  }

  .actions {
    grid-template-columns: 1fr;
  }

  .minor-actions {
    grid-column: 1;
  }

  .site-footer {
    margin-top: 50px;
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
}

@media (max-width: 390px) {
  .privacy-status {
    gap: 7px;
  }

  .brand small {
    display: none;
  }

  .hero h1 {
    font-size: 48px;
  }

  .section-heading > span {
    display: none;
  }

  .preview-alert dl > div,
  .preview-details dl > div {
    grid-template-columns: 74px minmax(0, 1fr);
  }
}

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

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}

@media print {
  @page {
    margin: 12mm;
    size: A4 portrait;
  }

  body {
    background: #fff;
  }

  .site-header,
  .hero,
  .legal-note,
  .form-column,
  .preview-heading,
  .actions,
  .privacy-footnote,
  .site-footer,
  .toast {
    display: none !important;
  }

  main,
  .workspace,
  .preview-column,
  .preview-sticky,
  .medical-card {
    display: block;
    width: 100%;
    max-width: none;
    margin: 0;
  }

  .medical-card {
    border: 1px solid #d8e2e8;
    box-shadow: none;
  }

  .preview-details {
    break-inside: avoid;
  }
}
