:root {
  --blue: #247fc0;
  --blue-dark: #11547f;
  --blue-soft: #e8f4fc;
  --coral: #d96f57;
  --coral-dark: #a54532;
  --coral-soft: #fff0eb;
  --ink: #123b52;
  --muted: #526d7b;
  --line: #cfdee7;
  --mist: #f3f8fb;
  --paper: #ffffff;
  --danger: #a53030;
  --danger-soft: #fff0ef;
  --success: #23765c;
  --success-soft: #e8f6f1;
  --shadow: 0 16px 40px rgba(18, 59, 82, 0.12);
  --header-height: 74px;
  --nav-height: 76px;
  color-scheme: light;
  font-family: "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  background: #eaf2f7;
  color: var(--ink);
  letter-spacing: 0;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: #eaf2f7;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
video:focus-visible {
  outline: 3px solid #f3b44d;
  outline-offset: 3px;
}

img,
video {
  display: block;
  max-width: 100%;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  transform: translateY(-150%);
  border-radius: 6px;
  background: var(--ink);
  color: white;
}

.skip-link:focus {
  transform: translateY(0);
}

.app-shell {
  width: min(100%, 760px);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.app-header {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  height: var(--header-height);
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 max(16px, env(safe-area-inset-left));
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.97);
}

.brand-button {
  display: flex;
  min-width: 0;
  align-items: center;
  padding: 4px 0;
  border: 0;
  background: transparent;
}

.brand-logo {
  width: 184px;
  height: auto;
}

.header-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.icon-button,
.font-button {
  display: inline-grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
}

.font-button {
  width: auto;
  min-width: 52px;
  padding: 0 10px;
  font-size: 16px;
  font-weight: 800;
}

.font-button[aria-pressed="true"] {
  border-color: var(--blue);
  background: var(--blue-soft);
  color: var(--blue-dark);
}

.icon-button svg {
  width: 24px;
  height: 24px;
}

.page {
  min-height: calc(100vh - var(--header-height));
  padding: 22px 20px calc(var(--nav-height) + 34px);
}

.page.no-nav {
  padding-bottom: 34px;
}

.page.home {
  padding-top: 0;
}

.hero {
  position: relative;
  min-height: 250px;
  margin: 0 -20px;
  overflow: hidden;
  background: var(--blue-soft);
}

.hero::after {
  position: absolute;
  inset: 0;
  background: rgba(8, 43, 62, 0.36);
  content: "";
}

.hero img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  object-position: 58% center;
}

.hero-copy {
  position: absolute;
  z-index: 1;
  right: 20px;
  bottom: 20px;
  left: 20px;
  color: white;
  text-shadow: 0 2px 12px rgba(8, 43, 62, 0.45);
}

.hero-copy p {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 750;
}

.hero-copy h1 {
  max-width: 560px;
  margin: 0;
  font-size: clamp(30px, 8vw, 42px);
  line-height: 1.2;
}

.intro {
  margin: 16px 0 14px;
  color: var(--muted);
  font-size: 18px;
  font-weight: 650;
  line-height: 1.55;
}

.question-label,
.section-label {
  margin: 18px 0 10px;
  color: var(--blue-dark);
  font-size: 16px;
  font-weight: 800;
}

.branch-grid,
.option-grid,
.goal-grid,
.quick-grid {
  display: grid;
  gap: 12px;
}

.branch-grid,
.option-grid,
.goal-grid,
.quick-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.branch-card,
.option-card,
.goal-card,
.quick-button {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  text-align: left;
}

.branch-card {
  min-height: 168px;
  padding: 18px;
  border-width: 2px;
  border-color: var(--blue);
}

.branch-card.goal {
  border-color: var(--coral);
  background: var(--coral-soft);
}

.card-icon,
.option-icon,
.result-icon,
.service-icon {
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--blue-soft);
  color: var(--blue-dark);
}

.card-icon {
  width: 46px;
  height: 46px;
}

.goal .card-icon {
  background: white;
  color: var(--coral);
}

.branch-card strong {
  font-size: 23px;
  line-height: 1.3;
}

.branch-card small,
.option-card small,
.goal-card small {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.4;
}

.quick-button {
  min-height: 62px;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  padding: 12px 14px;
  font-size: 17px;
  font-weight: 750;
}

.quick-button svg {
  color: var(--blue);
}

.eyebrow,
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 10px;
  color: var(--coral-dark);
  font-size: 15px;
  font-weight: 800;
}

.breadcrumb button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
}

.page-title {
  margin: 0;
  font-size: clamp(29px, 7vw, 38px);
  line-height: 1.3;
}

.page-lead {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
}

.progress-block {
  margin: 20px 0;
}

.progress-copy {
  display: flex;
  justify-content: space-between;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 8px;
  background: var(--blue-soft);
}

.progress-value {
  height: 100%;
  border-radius: inherit;
  background: var(--coral);
}

.option-card,
.goal-card {
  min-height: 126px;
  padding: 15px;
}

.option-card.selected,
.goal-card.selected,
.choice-row.selected {
  border: 2px solid var(--coral);
  background: var(--coral-soft);
}

.option-icon {
  width: 44px;
  height: 44px;
}

.option-card strong,
.goal-card strong {
  font-size: 20px;
  line-height: 1.35;
}

.selected-mark {
  position: absolute;
  top: 10px;
  right: 10px;
  display: none;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: var(--coral);
  color: white;
}

.selected .selected-mark {
  display: grid;
}

.choice-list,
.result-list,
.service-list {
  display: grid;
  gap: 11px;
  margin-top: 18px;
}

.choice-row {
  position: relative;
  display: grid;
  min-height: 78px;
  grid-template-columns: 32px 1fr;
  gap: 13px;
  align-items: center;
  padding: 13px 15px;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  text-align: left;
}

.choice-dot {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: white;
}

.selected .choice-dot {
  border-color: var(--coral);
  background: var(--coral);
  color: white;
}

.choice-row strong {
  display: block;
  font-size: 19px;
  line-height: 1.4;
}

.choice-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}

.sticky-actions {
  position: sticky;
  z-index: 10;
  bottom: var(--nav-height);
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 10px;
  margin: 24px -20px calc(-1 * var(--nav-height) - 34px);
  padding: 13px 20px calc(13px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.98);
}

.page.no-nav .sticky-actions {
  bottom: 0;
  margin-bottom: -34px;
}

.button {
  display: inline-flex;
  min-height: 56px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 18px;
  font-weight: 800;
  text-decoration: none;
}

.button.primary {
  background: var(--blue);
  color: white;
}

.button.secondary {
  border-color: var(--line);
  background: white;
  color: var(--ink);
}

.button.coral {
  background: var(--coral);
  color: white;
}

.button.full {
  width: 100%;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.helper,
.disclaimer,
.result-reason {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  padding: 14px;
  border-radius: 8px;
  line-height: 1.55;
}

.helper {
  border-left: 4px solid var(--blue);
  border-radius: 0 8px 8px 0;
  background: var(--mist);
}

.disclaimer {
  padding: 12px 0;
  color: var(--muted);
  font-size: 14px;
}

.helper svg,
.disclaimer svg,
.result-reason svg {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
}

.safety-panel {
  margin: 22px 0;
  padding: 20px;
  border: 2px solid var(--coral);
  border-radius: 8px;
  background: var(--coral-soft);
}

.safety-panel h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: var(--coral-dark);
  font-size: 24px;
}

.safety-panel p {
  margin: 10px 0 0;
  font-size: 18px;
  line-height: 1.65;
}

.safety-actions {
  display: grid;
  gap: 12px;
}

.urgent-wrap {
  text-align: center;
}

.urgent-icon {
  display: grid;
  width: 82px;
  height: 82px;
  margin: 8px auto 18px;
  place-items: center;
  border-radius: 50%;
  background: var(--danger-soft);
  color: var(--danger);
}

.urgent-icon svg {
  width: 42px;
  height: 42px;
}

.urgent-box {
  margin: 18px 0;
  padding: 20px;
  border: 2px solid var(--danger);
  border-radius: 8px;
  background: var(--danger-soft);
  text-align: left;
}

.urgent-box h2 {
  margin: 0;
  color: var(--danger);
  font-size: 27px;
}

.urgent-box p {
  margin: 10px 0 0;
  font-size: 19px;
  line-height: 1.65;
}

.result-reason {
  background: var(--blue-soft);
  color: var(--blue-dark);
}

.result-card {
  padding: 16px;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: white;
}

.result-card.primary-result {
  border: 2px solid var(--blue);
}

.result-card button {
  display: grid;
  width: 100%;
  grid-template-columns: 50px 1fr 42px;
  gap: 12px;
  align-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.result-icon,
.service-icon {
  width: 50px;
  height: 50px;
}

.result-card h3,
.service-card h3 {
  margin: 0;
  font-size: 21px;
}

.result-card p,
.service-card p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.5;
}

.round-arrow {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: var(--blue);
  color: white;
}

.media-card {
  margin-top: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--mist);
}

.media-card video {
  width: 100%;
  max-height: 460px;
  background: #0d2838;
  object-fit: contain;
}

.media-copy {
  padding: 16px;
}

.media-copy .eyebrow {
  margin-bottom: 6px;
}

.media-copy h2 {
  margin: 0;
  font-size: 23px;
  line-height: 1.35;
}

.media-copy p {
  margin: 7px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.department-hero {
  margin: -22px -20px 20px;
  padding: 25px 20px;
  background: var(--blue-soft);
}

.department-hero .option-icon {
  margin-bottom: 12px;
  background: var(--blue);
  color: white;
}

.department-hero h1 {
  margin: 0;
  font-size: 36px;
}

.department-hero p {
  max-width: 620px;
  margin: 8px 0 0;
  color: var(--blue-dark);
  font-size: 18px;
  line-height: 1.55;
}

.info-row {
  display: flex;
  gap: 10px;
  margin: 12px 0;
  font-size: 17px;
  line-height: 1.5;
}

.info-row svg {
  width: 23px;
  height: 23px;
  flex: 0 0 23px;
  color: var(--coral);
}

.doctor-grid {
  display: grid;
  gap: 12px;
}

.doctor-card {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 14px;
  padding: 14px;
  border: 1.5px solid var(--line);
  border-radius: 8px;
}

.doctor-card.primary {
  border: 2px solid var(--blue);
  background: var(--blue-soft);
}

.doctor-card img {
  width: 82px;
  height: 100px;
  border-radius: 8px;
  object-fit: cover;
  object-position: center top;
}

.doctor-card h3 {
  margin: 0;
  font-size: 22px;
}

.doctor-card .role {
  margin: 3px 0 7px;
  color: var(--coral-dark);
  font-weight: 750;
}

.doctor-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.article-intro {
  margin: -22px -20px 20px;
  padding: 26px 20px;
  background: var(--mist);
}

.article-intro h1 {
  margin: 0;
  font-size: clamp(28px, 7vw, 38px);
  line-height: 1.3;
}

.article-intro p {
  margin: 9px 0 0;
  color: var(--muted);
}

.article-section {
  margin: 24px 0;
}

.article-section h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 9px;
  font-size: 23px;
}

.step-number {
  display: inline-grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  place-items: center;
  border-radius: 50%;
  background: var(--coral);
  color: white;
  font-size: 16px;
}

.article-section p,
.article-section li {
  font-size: 18px;
  line-height: 1.7;
}

.service-tabs,
.search-tabs {
  display: flex;
  gap: 8px;
  margin: 18px 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.service-tab,
.search-tab {
  min-height: 44px;
  flex: 0 0 auto;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--muted);
  font-weight: 750;
}

.service-tab.active,
.search-tab.active {
  border-color: var(--blue);
  background: var(--blue-soft);
  color: var(--blue-dark);
}

.service-card {
  display: grid;
  grid-template-columns: 50px 1fr 24px;
  gap: 12px;
  align-items: center;
  min-height: 84px;
  padding: 14px;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: white;
}

.search-input-wrap {
  display: flex;
  height: 62px;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  padding: 0 14px;
  border: 2px solid var(--blue);
  border-radius: 8px;
  background: white;
}

.search-input-wrap input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  font-size: 19px;
}

.search-empty {
  padding: 36px 18px;
  color: var(--muted);
  text-align: center;
  line-height: 1.6;
}

.bottom-nav {
  position: fixed;
  z-index: 15;
  right: max(0px, calc((100vw - 760px) / 2));
  bottom: 0;
  left: max(0px, calc((100vw - 760px) / 2));
  display: grid;
  min-height: var(--nav-height);
  grid-template-columns: repeat(4, 1fr);
  padding-bottom: env(safe-area-inset-bottom);
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.98);
}

.nav-button {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.nav-button.active {
  color: var(--blue-dark);
}

.nav-button svg {
  width: 23px;
  height: 23px;
}

.toast {
  position: fixed;
  z-index: 60;
  right: 20px;
  bottom: calc(var(--nav-height) + 20px);
  left: 20px;
  max-width: 520px;
  margin: 0 auto;
  padding: 13px 16px;
  transform: translateY(140%);
  opacity: 0;
  pointer-events: none;
  border-radius: 8px;
  background: var(--ink);
  color: white;
  text-align: center;
  transition: transform 180ms ease, opacity 180ms ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.large-text {
  font-size: 118%;
}

.large-text .page-title,
.large-text .hero-copy h1,
.large-text .article-intro h1 {
  font-size: 38px;
}

@media (min-width: 660px) {
  .page {
    padding-right: 34px;
    padding-left: 34px;
  }

  .hero,
  .department-hero,
  .article-intro {
    margin-right: -34px;
    margin-left: -34px;
  }

  .hero img,
  .hero {
    height: 330px;
  }

  .hero {
    min-height: 330px;
  }

  .hero-copy {
    right: 34px;
    bottom: 28px;
    left: 34px;
  }

  .sticky-actions {
    margin-right: -34px;
    margin-left: -34px;
    padding-right: 34px;
    padding-left: 34px;
  }

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

@media (max-width: 380px) {
  .brand-logo {
    width: 158px;
  }

  .font-button {
    min-width: 48px;
    padding: 0 7px;
  }

  .branch-card,
  .option-card,
  .goal-card {
    padding: 13px;
  }

  .branch-card strong {
    font-size: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
