:root {
  color-scheme: light;
  --navy-950: #0a1a2b;
  --navy-900: #10283f;
  --navy-800: #173a58;
  --navy-700: #245274;
  --teal-600: #087e78;
  --teal-500: #0fa79c;
  --teal-100: #dff4f1;
  --amber-500: #e8a42d;
  --amber-100: #fff1d6;
  --red-600: #b84c4c;
  --red-100: #fae8e8;
  --ink: #17202a;
  --muted: #63717f;
  --line: #dbe2e8;
  --surface: #ffffff;
  --surface-soft: #f4f7f9;
  --shadow: 0 18px 45px rgb(16 40 63 / 10%);
  --radius-lg: 24px;
  --radius-md: 16px;
  --page: min(1180px, calc(100% - 40px));
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--surface);
  font-family:
    "PingFang TC",
    "Noto Sans TC",
    "Microsoft JhengHei",
    system-ui,
    sans-serif;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

button,
input,
select {
  font: inherit;
}

a {
  color: inherit;
}

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

:focus-visible {
  outline: 3px solid var(--amber-500);
  outline-offset: 3px;
}

.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;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 16px;
  color: #fff;
  background: var(--navy-950);
  border-radius: 10px;
  transform: translateY(-150%);
}

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

.page-width {
  width: var(--page);
  margin-inline: auto;
}

.hero {
  position: relative;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 86% 24%, rgb(15 167 156 / 20%) 0 2px, transparent 3px) 0 0 / 22px 22px,
    var(--navy-950);
}

.hero::after {
  position: absolute;
  right: -120px;
  bottom: -220px;
  width: 520px;
  height: 520px;
  content: "";
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 50%;
  box-shadow:
    0 0 0 70px rgb(255 255 255 / 3%),
    0 0 0 140px rgb(255 255 255 / 2%);
}

.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.7fr);
  gap: 72px;
  align-items: end;
  min-height: 610px;
  padding-block: 92px 74px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 14px;
  color: var(--teal-500);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.hero h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(3.2rem, 7vw, 6.6rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.hero-intro {
  max-width: 720px;
  margin: 30px 0 0;
  color: rgb(255 255 255 / 76%);
  font-size: clamp(1rem, 2vw, 1.24rem);
}

.scope-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 30px;
}

.scope-tags span {
  padding: 7px 12px;
  color: rgb(255 255 255 / 78%);
  font-size: 0.84rem;
  border: 1px solid rgb(255 255 255 / 20%);
  border-radius: 999px;
}

.hero-summary {
  padding: 34px;
  color: var(--navy-950);
  background: #fff;
  border-top: 5px solid var(--teal-500);
  border-radius: var(--radius-lg);
  box-shadow: 0 28px 70px rgb(0 0 0 / 24%);
}

.hero-summary > p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.hero-summary > strong {
  display: block;
  margin-top: 6px;
  font-size: clamp(3.2rem, 6vw, 5.2rem);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  letter-spacing: -0.06em;
}

.hero-delta {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: baseline;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.hero-delta span {
  color: var(--muted);
  font-size: 0.9rem;
}

.hero-delta b {
  color: var(--teal-600);
  font-size: 1.22rem;
}

.hero-delta em {
  padding: 3px 8px;
  color: var(--teal-600);
  font-size: 0.82rem;
  font-style: normal;
  font-weight: 800;
  background: var(--teal-100);
  border-radius: 999px;
}

.hero-summary a {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  margin-top: 24px;
  color: var(--navy-800);
  font-size: 0.9rem;
  font-weight: 800;
  text-decoration: none;
}

.section-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  overflow-x: auto;
  background: rgb(255 255 255 / 94%);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.section-nav .page-width {
  display: flex;
  gap: 6px;
  padding-block: 12px;
}

.section-nav a {
  flex: 0 0 auto;
  padding: 8px 12px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  border-radius: 999px;
}

.section-nav a:hover {
  color: var(--navy-900);
  background: var(--surface-soft);
}

.section {
  padding-block: 92px;
  scroll-margin-top: 72px;
}

.section-tinted {
  background: var(--surface-soft);
}

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

.section-heading h2 {
  margin: 0;
  color: var(--navy-950);
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -0.045em;
}

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

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

.metric-card {
  min-height: 190px;
  padding: 25px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.metric-card span {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.metric-card strong {
  display: block;
  margin-top: 24px;
  color: var(--navy-900);
  font-size: clamp(2.1rem, 3.4vw, 3.2rem);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  letter-spacing: -0.05em;
}

.metric-card p {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.metric-card-primary {
  color: #fff;
  background: var(--navy-900);
  border-color: var(--navy-900);
}

.metric-card-primary span,
.metric-card-primary p {
  color: rgb(255 255 255 / 70%);
}

.metric-card-primary strong {
  color: #fff;
}

.insight-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 42px;
}

.insight-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  padding-top: 24px;
  border-top: 2px solid var(--navy-900);
}

.insight-index {
  color: var(--teal-600);
  font-size: 0.78rem;
  font-weight: 900;
}

.insight-card h3 {
  margin: 0;
  color: var(--navy-900);
  font-size: 1.05rem;
}

.insight-card p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.segmented-control,
.rank-control {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px;
  background: #e6ecef;
  border-radius: 12px;
}

.segmented-control button,
.rank-control button {
  padding: 8px 13px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
  background: transparent;
  border: 0;
  border-radius: 9px;
  cursor: pointer;
}

.segmented-control button[aria-pressed="true"],
.rank-control button[aria-pressed="true"] {
  color: var(--navy-950);
  background: #fff;
  box-shadow: 0 2px 8px rgb(16 40 63 / 10%);
}

.chart-card {
  padding: 30px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.chart-summary {
  min-height: 30px;
  color: var(--navy-800);
  font-weight: 800;
}

.chart-shell {
  position: relative;
  min-height: 360px;
  margin-top: 16px;
}

.chart-shell svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.chart-grid {
  stroke: #dfe6eb;
  stroke-dasharray: 3 5;
}

.chart-axis-label {
  fill: #6f7e8b;
  font-size: 13px;
  font-weight: 650;
}

.chart-line {
  fill: none;
  stroke: var(--teal-500);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-area {
  fill: rgb(15 167 156 / 10%);
}

.chart-point {
  fill: #fff;
  stroke: var(--teal-600);
  stroke-width: 4;
}

.chart-value {
  fill: var(--navy-950);
  font-size: 14px;
  font-weight: 850;
  text-anchor: middle;
}

.chart-bar {
  fill: var(--navy-800);
}

.chart-bar:last-of-type {
  fill: var(--teal-500);
}

.chart-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.company-toolbar {
  display: grid;
  grid-template-columns: 1.3fr 0.75fr 1.7fr auto;
  gap: 12px;
  align-items: end;
  padding: 18px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.search-field,
.select-field,
.rank-control {
  min-width: 0;
}

.search-field,
.select-field {
  display: grid;
  gap: 7px;
}

.search-field span,
.select-field span,
.rank-control > span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.search-field input,
.select-field select {
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #cbd6de;
  border-radius: 10px;
}

.rank-control {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.rank-control > span {
  grid-column: 1 / -1;
  padding-inline: 8px;
}

.download-button {
  min-height: 44px;
  padding: 9px 15px;
  color: #fff;
  font-size: 0.86rem;
  font-weight: 800;
  white-space: nowrap;
  background: var(--navy-900);
  border: 0;
  border-radius: 10px;
  cursor: pointer;
}

.result-status {
  min-height: 24px;
  margin: 18px 0 10px;
  color: var(--muted);
  font-size: 0.86rem;
}

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.company-table {
  width: 100%;
  min-width: 1080px;
  border-collapse: collapse;
  background: #fff;
}

.company-table th {
  padding: 13px 14px;
  color: var(--muted);
  font-size: 0.76rem;
  text-align: left;
  background: var(--surface-soft);
  border-bottom: 1px solid var(--line);
}

.company-table td {
  padding: 14px;
  border-bottom: 1px solid #e8edf0;
  vertical-align: middle;
}

.company-table tbody tr:last-child td {
  border-bottom: 0;
}

.company-table tbody tr:hover {
  background: #fafcfd;
}

.rank-cell {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.company-name {
  display: grid;
  gap: 3px;
  min-width: 280px;
}

.company-name strong {
  color: var(--navy-900);
  line-height: 1.35;
}

.company-name small {
  color: var(--muted);
  font-size: 0.74rem;
}

.scale-value {
  display: grid;
  grid-template-columns: minmax(70px, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-width: 190px;
  font-variant-numeric: tabular-nums;
  font-weight: 850;
}

.scale-track {
  height: 7px;
  overflow: hidden;
  background: #e8edef;
  border-radius: 999px;
}

.scale-track i {
  display: block;
  height: 100%;
  background: var(--teal-500);
  border-radius: inherit;
}

.mdrt-count {
  color: var(--teal-600);
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  font-weight: 850;
}

.mdrt-cell-meta {
  display: block;
  min-width: 170px;
  max-width: 240px;
  white-space: normal;
  overflow-wrap: anywhere;
  font-size: .72rem;
  line-height: 1.55;
  font-weight: 400;
  color: var(--muted, #65758b);
}

.mdrt-unavailable {
  display: inline-flex;
  width: fit-content;
  min-width: 76px;
  justify-content: center;
  padding: 4px 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  background: #edf1f3;
  border-radius: 999px;
}

.delta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  padding: 4px 8px;
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  font-weight: 850;
  border-radius: 999px;
}

.delta-positive {
  color: var(--teal-600);
  background: var(--teal-100);
}

.delta-negative {
  color: var(--red-600);
  background: var(--red-100);
}

.delta-flat {
  color: var(--muted);
  background: #edf1f3;
}

.compare-button {
  padding: 7px 11px;
  color: var(--navy-800);
  font-size: 0.8rem;
  font-weight: 800;
  background: #fff;
  border: 1px solid #b9c8d2;
  border-radius: 9px;
  cursor: pointer;
}

.compare-button[aria-pressed="true"] {
  color: #fff;
  background: var(--navy-900);
  border-color: var(--navy-900);
}

.comparison-card {
  margin-top: 34px;
  padding: 28px;
  background: var(--navy-950);
  border-radius: var(--radius-lg);
}

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

.comparison-heading h3 {
  margin: 0;
  color: #fff;
  font-size: clamp(1.5rem, 3vw, 2.3rem);
}

.comparison-heading > p {
  max-width: 420px;
  margin: 0;
  color: rgb(255 255 255 / 60%);
}

.comparison-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 35px;
  margin-top: 24px;
}

.legend-item {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  color: rgb(255 255 255 / 82%);
  font-size: 0.8rem;
}

.legend-item i {
  width: 22px;
  height: 4px;
  border-radius: 999px;
}

.comparison-chart {
  min-height: 390px;
  padding: 10px;
  background: rgb(255 255 255 / 5%);
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: 14px;
}

.comparison-chart .chart-grid {
  stroke: rgb(255 255 255 / 12%);
}

.comparison-chart .chart-axis-label {
  fill: rgb(255 255 255 / 58%);
}

.comparison-chart .chart-value {
  fill: #fff;
}

.selection-status {
  min-height: 24px;
  margin: 10px 0 0;
  color: rgb(255 255 255 / 66%);
  font-size: 0.84rem;
}

.section-dark {
  color: #fff;
  background: var(--navy-900);
}

.interpretation-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 74px;
  align-items: start;
}

.interpretation-grid h2 {
  margin: 0;
  font-size: clamp(2.2rem, 4.8vw, 4.4rem);
  line-height: 1.1;
  letter-spacing: -0.05em;
}

.boundary-list {
  display: grid;
}

.boundary-list article {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 18px;
  padding: 22px 0;
  border-top: 1px solid rgb(255 255 255 / 16%);
}

.boundary-list span {
  color: var(--teal-500);
  font-size: 0.84rem;
  font-weight: 850;
}

.boundary-list p {
  margin: 0;
  color: rgb(255 255 255 / 74%);
}

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

.source-card {
  padding: 24px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.source-card > span {
  color: var(--teal-600);
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.source-card h3 {
  margin: 16px 0 0;
  color: var(--navy-900);
  font-size: 1.03rem;
}

.source-card p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.source-card a {
  color: var(--teal-600);
  font-weight: 850;
}

.source-footnote {
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.page-footer {
  color: rgb(255 255 255 / 68%);
  background: var(--navy-950);
}

.page-footer .page-width {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  padding-block: 24px;
}

.page-footer p {
  margin: 0;
}

.page-footer a {
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}

@media (max-width: 1080px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 0.65fr);
    gap: 38px;
    min-height: 560px;
  }

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

  .company-toolbar {
    grid-template-columns: 1fr 0.65fr;
  }

  .rank-control,
  .download-button {
    align-self: stretch;
  }

  .download-button {
    width: 100%;
  }
}

@media (max-width: 780px) {
  :root {
    --page: min(100% - 28px, 1180px);
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 44px;
    min-height: 0;
    padding-block: 70px 54px;
  }

  .hero-summary {
    max-width: 520px;
  }

  .section {
    padding-block: 68px;
  }

  .section-heading,
  .comparison-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .section-heading {
    display: flex;
  }

  .metric-grid,
  .insight-grid,
  .source-grid {
    grid-template-columns: 1fr;
  }

  .insight-grid {
    gap: 30px;
  }

  .chart-card {
    padding: 18px 12px;
  }

  .chart-shell {
    min-height: 280px;
    overflow-x: auto;
  }

  .chart-shell svg {
    min-width: 680px;
  }

  .company-toolbar {
    grid-template-columns: 1fr;
  }

  .rank-control {
    grid-template-columns: 1fr;
  }

  .rank-control > span {
    grid-column: auto;
  }

  .comparison-card {
    padding: 22px 14px;
  }

  .interpretation-grid {
    grid-template-columns: 1fr;
    gap: 44px;
  }

  .boundary-list article {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

@media (max-width: 460px) {
  .hero h1 {
    font-size: 3.25rem;
  }

  .hero-summary {
    padding: 24px;
  }

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

  .metric-card {
    min-height: 165px;
  }

  .section-nav .page-width {
    width: auto;
    margin-left: 14px;
    padding-right: 14px;
  }

  .page-footer .page-width {
    align-items: flex-start;
    flex-direction: column;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .section-nav,
  .company-toolbar,
  .compare-button,
  .download-button,
  .page-footer {
    display: none !important;
  }

  .hero {
    color: var(--ink);
    background: #fff;
  }

  .hero-grid {
    min-height: 0;
    padding-block: 30px;
  }

  .hero-summary,
  .chart-card {
    box-shadow: none;
  }

  .section {
    padding-block: 36px;
  }
}
