:root {
  --ink: #11243b;
  --muted: #607086;
  --paper: #f3f6f8;
  --card: #ffffff;
  --navy: #0b2038;
  --blue: #1d5f8c;
  --blue-soft: #eaf4fb;
  --teal: #0f766e;
  --teal-soft: #e8f6f3;
  --gold: #c8952e;
  --gold-soft: #fff6df;
  --danger: #a23a32;
  --danger-soft: #fff1ef;
  --border: #d9e2e8;
  --shadow: 0 18px 48px rgba(17, 36, 59, 0.09);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 2%, rgba(29, 95, 140, 0.12), transparent 28rem),
    var(--paper);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", "PingFang TC", sans-serif;
  line-height: 1.65;
}

button,
a {
  font: inherit;
}

a {
  color: inherit;
}

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

.topbar,
main,
footer {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 0;
}

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

.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, var(--navy), var(--blue));
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
}

.brand strong {
  font-size: 1rem;
}

.topbar-actions {
  display: flex;
  gap: 10px;
}

.home-link,
.print-button {
  min-height: 42px;
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.86);
  text-decoration: none;
  font-weight: 800;
  cursor: pointer;
}

.print-button {
  color: #fff;
  border-color: var(--blue);
  background: var(--blue);
}

.home-link:hover,
.home-link:focus-visible,
.print-button:hover,
.print-button:focus-visible {
  outline: 3px solid rgba(29, 95, 140, 0.2);
  outline-offset: 2px;
}

main {
  display: grid;
  gap: 22px;
  padding-bottom: 30px;
}

.hero {
  min-height: 430px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(430px, 0.95fr);
  align-items: center;
  gap: 44px;
  padding: clamp(34px, 6vw, 72px);
  color: #fff;
  border-radius: 12px;
  background:
    radial-gradient(circle at 82% 23%, rgba(40, 142, 160, 0.3), transparent 25rem),
    linear-gradient(135deg, #071629, var(--navy));
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--teal);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.13em;
}

.hero .eyebrow {
  color: #7cd9d0;
}

.hero h1 {
  margin: 0 0 20px;
  font-size: clamp(2.7rem, 6vw, 5.2rem);
  line-height: 1.03;
  letter-spacing: -0.055em;
}

.hero-title-line {
  white-space: nowrap;
}

.hero-intro {
  max-width: 670px;
  margin: 0;
  color: #dce8f2;
  font-size: 1.04rem;
}

.generation-visual {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 10px;
}

.generation-visual article {
  min-height: 210px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 18px 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  text-align: center;
}

.generation-visual span {
  color: #9ee4dd;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.generation-visual strong {
  margin: 12px 0 8px;
  font-size: 2.3rem;
  line-height: 1;
}

.generation-visual small {
  color: #dce8f2;
  line-height: 1.5;
}

.generation-visual i {
  color: #e9c26e;
  font-size: 1.35rem;
  font-style: normal;
}

.role-section,
.journey-section,
.check-section,
.sources {
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  box-shadow: var(--shadow);
}

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

.section-heading h2,
.warning-section h2 {
  margin: 0;
  font-size: clamp(1.55rem, 3vw, 2.3rem);
  line-height: 1.25;
  letter-spacing: -0.03em;
}

.section-heading > p {
  margin: 0;
  color: var(--muted);
}

.status-chip {
  flex: none;
  padding: 7px 11px;
  border: 1px solid #b8d7e9;
  border-radius: 999px;
  color: var(--blue);
  background: var(--blue-soft);
  font-size: 0.78rem;
  font-weight: 850;
}

.role-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.role-grid article {
  padding: 20px;
  border: 1px solid var(--border);
  border-top: 5px solid var(--blue);
  border-radius: 8px;
  background: #fbfdfe;
}

.role-grid article:nth-child(3),
.role-grid article:nth-child(4) {
  border-top-color: var(--teal);
}

.role-label {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.role-grid strong {
  display: block;
  margin: 7px 0;
  font-size: 1.08rem;
  line-height: 1.35;
}

.role-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

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

.stage-tabs button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 70px;
  padding: 14px 17px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--ink);
  background: #f7fafc;
  text-align: left;
  cursor: pointer;
}

.stage-tabs button span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.stage-tabs button[aria-selected="true"] {
  color: #fff;
  border-color: var(--blue);
  background: linear-gradient(135deg, var(--navy), var(--blue));
  box-shadow: 0 10px 24px rgba(29, 95, 140, 0.2);
}

.stage-tabs button[aria-selected="true"] span {
  color: #bfe1f3;
}

.stage-tabs button:focus-visible {
  outline: 3px solid rgba(29, 95, 140, 0.22);
  outline-offset: 2px;
}

.stage-panels {
  margin-top: 14px;
}

.stage-panels article {
  display: grid;
  grid-template-columns: auto minmax(0, 1.1fr) minmax(280px, 0.9fr);
  align-items: start;
  gap: 24px;
  min-height: 235px;
  padding: 28px;
  border: 1px solid #c6dfea;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--blue-soft), #fff 60%);
}

.stage-panels article[hidden] {
  display: none;
}

.stage-number {
  color: rgba(29, 95, 140, 0.24);
  font-size: 3.6rem;
  font-weight: 900;
  line-height: 1;
}

.stage-panels h3 {
  margin: 0 0 10px;
  font-size: 1.45rem;
  line-height: 1.32;
}

.stage-panels p {
  margin: 0;
  color: var(--muted);
}

.stage-panels ul {
  margin: 0;
  padding: 17px 18px 17px 35px;
  border-left: 4px solid var(--teal);
  border-radius: 6px;
  background: var(--teal-soft);
}

.stage-panels li + li {
  margin-top: 7px;
}

.warning-section {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 22px;
  padding: 28px;
  border: 1px solid #e7b2ad;
  border-left: 7px solid var(--danger);
  border-radius: 8px;
  background: var(--danger-soft);
  box-shadow: var(--shadow);
}

.warning-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--danger);
  font-size: 1.4rem;
  font-weight: 900;
}

.warning-section .eyebrow {
  color: var(--danger);
}

.warning-section p:last-child {
  max-width: 980px;
  margin: 12px 0 0;
  color: #75403c;
}

.checklist {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.checklist li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 13px;
  padding: 17px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfdfe;
}

.checklist li:last-child {
  grid-column: 1 / -1;
}

.checklist li > span {
  color: var(--blue);
  font-size: 0.8rem;
  font-weight: 900;
}

.checklist strong {
  display: block;
  margin-bottom: 3px;
}

.checklist p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.sources ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.sources li {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 0;
  border-top: 1px solid var(--border);
}

.sources li:first-child {
  border-top: 0;
}

.sources a {
  color: #0a5b82;
  font-weight: 800;
}

.sources li span {
  flex: none;
  color: var(--muted);
  font-size: 0.88rem;
}

.source-note {
  margin: 18px 0 0;
  padding: 15px;
  border: 1px solid #edd7a4;
  border-radius: 7px;
  color: #6f5724;
  background: var(--gold-soft);
  font-size: 0.9rem;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 0 34px;
  color: var(--muted);
  font-size: 0.88rem;
}

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

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

  .stage-panels article {
    grid-template-columns: auto 1fr;
  }

  .stage-panels ul {
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  .topbar,
  .section-heading,
  footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions {
    width: 100%;
  }

  .home-link,
  .print-button {
    flex: 1;
    text-align: center;
  }

  .hero {
    min-height: 0;
    padding: 32px 23px;
  }

  .hero-title-line {
    white-space: normal;
  }

  .generation-visual {
    grid-template-columns: 1fr;
  }

  .generation-visual article {
    min-height: 135px;
  }

  .generation-visual i {
    justify-self: center;
    transform: rotate(90deg);
  }

  .role-section,
  .journey-section,
  .check-section,
  .sources {
    padding: 20px;
  }

  .role-grid,
  .stage-tabs,
  .checklist {
    grid-template-columns: 1fr;
  }

  .checklist li:last-child {
    grid-column: auto;
  }

  .stage-panels article {
    grid-template-columns: 1fr;
    padding: 22px;
  }

  .stage-number {
    font-size: 2.5rem;
  }

  .stage-panels ul {
    grid-column: auto;
  }

  .warning-section {
    grid-template-columns: 1fr;
  }

  .sources li {
    flex-direction: column;
    gap: 4px;
  }
}

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

  body {
    background: #fff;
    font-size: 10pt;
  }

  .topbar-actions,
  .shield-related-cards {
    display: none !important;
  }

  .topbar,
  main,
  footer {
    width: 100%;
  }

  main {
    gap: 10px;
  }

  .hero {
    min-height: 0;
    grid-template-columns: 0.9fr 1.1fr;
    padding: 20px;
    break-inside: avoid;
    box-shadow: none;
  }

  .hero h1 {
    font-size: 30pt;
  }

  .generation-visual article {
    min-height: 140px;
  }

  .role-section,
  .journey-section,
  .check-section,
  .sources,
  .warning-section {
    padding: 16px;
    break-inside: avoid;
    box-shadow: none;
  }

  .role-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .stage-tabs {
    display: none;
  }

  .stage-panels {
    display: grid;
    gap: 8px;
  }

  .stage-panels article,
  .stage-panels article[hidden] {
    min-height: 0;
    display: grid;
    grid-template-columns: auto 1fr 1fr;
    padding: 15px;
    break-inside: avoid;
  }

  .stage-panels ul {
    grid-column: auto;
  }

  .checklist {
    grid-template-columns: repeat(2, 1fr);
  }

  a {
    text-decoration: none;
  }
}
