:root {
  color-scheme: light dark;
  --ink: #0f3040;
  --muted: #526a73;
  --paper: #f4fbf7;
  --surface: rgba(255, 255, 255, 0.86);
  --surface-strong: #ffffff;
  --line: rgba(15, 48, 64, 0.14);
  --brand: #096a71;
  --brand-bright: #08a4b5;
  --emergency: #d14932;
  --navy: #08273d;
  --shadow: 0 24px 70px rgba(8, 39, 61, 0.12);
  --radius-large: 28px;
  --radius-medium: 18px;
  --content: 1120px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(8, 164, 181, 0.16), transparent 30rem),
    radial-gradient(circle at 88% 18%, rgba(209, 73, 50, 0.1), transparent 25rem),
    var(--paper);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC",
    "PingFang TC", sans-serif;
  line-height: 1.65;
}

a {
  color: var(--brand);
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--brand-bright);
}

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

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

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

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom: 1px solid var(--line);
  background: rgba(244, 251, 247, 0.84);
  backdrop-filter: blur(18px);
}

.nav-shell {
  width: min(calc(100% - 32px), var(--content));
  min-height: 72px;
  margin: auto;
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
  letter-spacing: -0.02em;
}

.signal-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 13px;
  background: var(--navy);
  box-shadow: 0 8px 22px rgba(8, 39, 61, 0.2);
}

.signal-mark svg {
  width: 34px;
  height: 24px;
}

.site-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}

.site-nav a,
.language-toggle a,
.language-toggle button {
  min-height: 42px;
  padding: 9px 13px;
  color: var(--muted);
  border: 0;
  border-radius: 12px;
  background: transparent;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.site-nav a:hover,
.site-nav a[aria-current="page"],
.language-toggle a:hover,
.language-toggle a[aria-current="page"],
.language-toggle button:hover,
.language-toggle button[aria-pressed="true"] {
  color: var(--ink);
  background: rgba(9, 106, 113, 0.1);
}

.language-toggle {
  display: flex;
  gap: 2px;
  padding-left: 8px;
  border-left: 1px solid var(--line);
}

main {
  overflow: hidden;
}

.shell {
  width: min(calc(100% - 32px), var(--content));
  margin: auto;
}

.hero {
  position: relative;
  padding: clamp(72px, 11vw, 132px) 0 74px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  align-items: center;
  gap: clamp(42px, 8vw, 96px);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 18px;
  color: var(--brand);
  font-size: 0.82rem;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow::before {
  width: 28px;
  height: 3px;
  content: "";
  border-radius: 999px;
  background: var(--emergency);
}

h1,
h2,
h3 {
  line-height: 1.18;
  letter-spacing: -0.035em;
  line-break: strict;
  text-wrap: balance;
}

h1 {
  max-width: 780px;
  margin: 0;
  font-size: clamp(2.65rem, 6vw, 5.2rem);
}

.page-hero h1 {
  font-size: clamp(2.4rem, 6vw, 4.7rem);
}

.page-hero .support-ja-title {
  font-size: clamp(2.4rem, 5.1vw, 4rem);
}

h2 {
  margin: 0 0 18px;
  font-size: clamp(1.8rem, 4vw, 3rem);
}

.content-stack .policy-section > h2 {
  font-size: clamp(1.65rem, 3vw, 2.45rem);
}

h3 {
  margin: 0 0 10px;
  font-size: 1.2rem;
}

.section-subheading {
  margin-top: 32px;
}

.lede {
  max-width: 700px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.28rem);
}

.release-highlight {
  max-width: 760px;
  margin-top: 28px;
  padding: 18px 20px;
  border: 1px solid rgba(8, 164, 181, 0.32);
  border-left: 5px solid var(--brand-bright);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 12px 36px rgba(8, 39, 61, 0.08);
}

.release-highlight strong {
  display: block;
  color: var(--brand);
  font-size: 1.05rem;
}

.release-highlight p {
  margin: 5px 0 0;
  color: var(--ink);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

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

.button-primary {
  color: white;
  background: var(--brand);
  box-shadow: 0 12px 30px rgba(9, 106, 113, 0.22);
}

.button-primary:hover {
  color: white;
  background: #075b61;
}

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

button.button {
  font: inherit;
  cursor: pointer;
}

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

.hero-visual {
  position: relative;
  min-height: 390px;
  display: grid;
  place-items: center;
}

.signal-orbit {
  position: absolute;
  width: min(390px, 92vw);
  aspect-ratio: 1;
  border: 1px solid rgba(9, 106, 113, 0.14);
  border-radius: 50%;
  background:
    repeating-conic-gradient(
      from -9deg,
      rgba(8, 164, 181, 0.05) 0deg 14deg,
      transparent 14deg 34deg
    );
}

.signal-orbit::before,
.signal-orbit::after {
  position: absolute;
  inset: 12%;
  content: "";
  border: 1px solid rgba(9, 106, 113, 0.12);
  border-radius: inherit;
}

.signal-orbit::after {
  inset: 30%;
  background: rgba(9, 106, 113, 0.06);
}

.signal-card {
  position: relative;
  z-index: 2;
  width: min(300px, 75vw);
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 32px;
  color: white;
  background: linear-gradient(145deg, #0d415d, #071f35);
  box-shadow: 0 34px 80px rgba(8, 39, 61, 0.28);
}

.morse-line {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 26px;
}

.dot,
.dash {
  height: 18px;
  display: block;
  background: white;
  box-shadow: 0 0 18px rgba(255, 255, 255, 0.35);
}

.dot {
  width: 18px;
  border-radius: 50%;
}

.dash {
  width: 58px;
  border-radius: 999px;
}

.signal-card strong {
  display: block;
  margin-bottom: 4px;
  font-size: 1.28rem;
}

.signal-card p {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
}

.section {
  padding: 76px 0;
}

.section-soft {
  border-block: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.48);
}

.section-heading {
  max-width: 720px;
  margin-bottom: 34px;
}

.section-heading p,
.card p,
.policy-section p,
.policy-section li,
.faq-item p {
  color: var(--muted);
}

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

.card {
  min-height: 100%;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius-medium);
  background: var(--surface);
  box-shadow: 0 12px 35px rgba(8, 39, 61, 0.06);
}

.card-number {
  width: 38px;
  height: 38px;
  margin-bottom: 22px;
  display: grid;
  place-items: center;
  color: white;
  border-radius: 12px;
  background: var(--brand);
  font-weight: 850;
}

.card p:last-child {
  margin-bottom: 0;
}

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

.route-card {
  position: relative;
  min-height: 260px;
  padding: 34px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-large);
  color: var(--ink);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
  text-decoration: none;
}

.route-card::after {
  position: absolute;
  right: -50px;
  bottom: -70px;
  width: 190px;
  height: 190px;
  content: "";
  border-radius: 50%;
  background: rgba(8, 164, 181, 0.09);
}

.route-card:hover {
  color: var(--ink);
  border-color: rgba(9, 106, 113, 0.35);
  transform: translateY(-2px);
}

.route-card p {
  max-width: 34rem;
  color: var(--muted);
}

.route-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  color: var(--brand);
  font-weight: 850;
}

.safety-note {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  padding: 26px;
  border: 1px solid rgba(209, 73, 50, 0.2);
  border-radius: var(--radius-medium);
  background: rgba(209, 73, 50, 0.07);
}

.safety-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: white;
  border-radius: 13px;
  background: var(--emergency);
  font-weight: 900;
}

.safety-note h2 {
  margin: 2px 0 8px;
  font-size: 1.25rem;
}

.safety-note p {
  margin: 0;
  color: var(--muted);
}

.page-hero {
  padding: clamp(62px, 9vw, 104px) 0 52px;
}

.page-hero .lede {
  max-width: 780px;
}

.content-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  align-items: start;
  gap: clamp(34px, 7vw, 84px);
}

.toc {
  position: sticky;
  top: 100px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.toc strong {
  display: block;
  margin-bottom: 10px;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.toc a {
  display: block;
  padding: 7px 8px;
  color: var(--muted);
  border-radius: 9px;
  font-size: 0.94rem;
  text-decoration: none;
}

.toc a:hover {
  color: var(--ink);
  background: rgba(9, 106, 113, 0.08);
}

.content-stack {
  min-width: 0;
}

.policy-section {
  padding: 0 0 52px;
  scroll-margin-top: 104px;
}

.policy-section + .policy-section {
  padding-top: 52px;
  border-top: 1px solid var(--line);
}

.policy-section ul,
.policy-section ol {
  padding-left: 1.35rem;
}

.policy-section li + li {
  margin-top: 9px;
}

.fact-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.fact {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.fact strong {
  display: block;
  margin-bottom: 5px;
}

.fact p {
  margin: 0;
}

.test-notice {
  margin: 24px 0;
  padding: 18px 20px;
  border: 1px solid rgba(9, 106, 113, 0.22);
  border-radius: 16px;
  background: rgba(8, 164, 181, 0.08);
}

.test-notice strong {
  display: block;
  margin-bottom: 5px;
}

.test-notice p {
  margin: 0;
}

.test-message-picker {
  display: grid;
  grid-template-columns: auto minmax(160px, 240px) minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  margin: 0 0 18px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.test-message-picker label {
  font-weight: 900;
}

.test-message-picker select {
  width: 100%;
  min-height: 44px;
  padding: 8px 36px 8px 12px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-strong);
  font: inherit;
  font-weight: 800;
}

.test-message-picker p {
  margin: 0;
  color: var(--muted);
}

.test-message-picker code {
  color: var(--brand);
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

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

.signal-test-card {
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-medium);
  background: var(--surface);
  box-shadow: 0 14px 42px rgba(8, 39, 61, 0.08);
}

.signal-test-heading {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 14px;
}

.signal-test-heading h3 {
  margin-top: 2px;
}

.signal-test-heading p {
  margin: 0;
}

.test-kind {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 5px 8px;
  color: white;
  border-radius: 8px;
  background: var(--brand);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.audio-test-visual,
.optical-test-stage {
  height: 240px;
  margin: 22px 0;
  overflow: hidden;
  border-radius: 18px;
  background: #061820;
}

.audio-test-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.audio-test-visual span {
  width: 8px;
  height: 34px;
  border-radius: 999px;
  background: #49c6c8;
}

.audio-test-visual span:nth-child(2),
.audio-test-visual span:nth-child(4) {
  height: 72px;
}

.audio-test-visual span:nth-child(3) {
  height: 112px;
  background: white;
}

.audio-test-visual strong {
  margin-left: 12px;
  color: white;
  font-size: 1rem;
}

.audio-test-visual.is-running {
  box-shadow: inset 0 0 0 2px rgba(73, 198, 200, 0.72);
}

.optical-test-stage {
  position: relative;
  display: grid;
  place-items: center;
}

.optical-test-signal {
  width: min(170px, 52vw);
  aspect-ratio: 1;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  background: #111b20;
  box-shadow: inset 0 0 28px rgba(0, 0, 0, 0.72);
}

.optical-test-stage.is-on .optical-test-signal {
  border-color: white;
  background: white;
  box-shadow:
    0 0 36px rgba(255, 255, 255, 0.82),
    0 0 86px rgba(73, 198, 200, 0.4);
}

.optical-test-label {
  position: absolute;
  right: 12px;
  bottom: 10px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.test-actions,
.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.test-actions .button {
  flex: 1 1 180px;
}

.test-status {
  min-height: 1.65em;
  margin: 12px 0 0;
  color: var(--brand);
  font-weight: 800;
}

.button-stop-all {
  width: 100%;
  margin-top: 18px;
  color: white;
  border-color: transparent;
  background: var(--emergency);
}

.button-stop-all:hover:not(:disabled) {
  color: white;
  background: #b83b28;
}

.signal-test-safety {
  margin-top: 18px;
}

.signal-test-safety h3 {
  margin: 2px 0 8px;
}

.flash-warning-dialog {
  width: min(calc(100% - 32px), 520px);
  padding: 0;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}

.flash-warning-dialog::backdrop {
  background: rgba(2, 15, 22, 0.72);
  backdrop-filter: blur(5px);
}

.flash-warning-dialog form {
  padding: 26px;
}

.flash-warning-dialog h2 {
  margin: 18px 0 10px;
  font-size: 1.7rem;
}

.flash-warning-dialog p {
  color: var(--muted);
}

.dialog-actions {
  justify-content: flex-end;
  margin-top: 22px;
}

.faq-list {
  display: grid;
  gap: 12px;
}

.faq-item {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.faq-item p:last-child {
  margin-bottom: 0;
}

.contact-panel {
  padding: clamp(26px, 5vw, 42px);
  border-radius: var(--radius-large);
  color: white;
  background:
    radial-gradient(circle at 90% 10%, rgba(8, 164, 181, 0.38), transparent 18rem),
    var(--navy);
  box-shadow: var(--shadow);
}

.contact-panel h2 {
  margin-bottom: 12px;
}

.contact-panel p {
  max-width: 720px;
  color: rgba(255, 255, 255, 0.72);
}

.contact-panel .button-primary {
  color: var(--navy);
  background: white;
  box-shadow: none;
}

.meta-line {
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.92rem;
}

.site-footer {
  padding: 44px 0;
  border-top: 1px solid var(--line);
}

.footer-shell {
  display: flex;
  align-items: center;
  gap: 20px;
  color: var(--muted);
  font-size: 0.92rem;
}

.footer-shell nav {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.footer-shell a {
  color: var(--muted);
}

[data-lang="en"] .lang-zh,
[data-lang="en"] .lang-ja,
[data-lang="zh"] .lang-en,
[data-lang="zh"] .lang-ja,
[data-lang="ja"] .lang-zh,
[data-lang="ja"] .lang-en {
  display: none !important;
}

:focus-visible {
  outline: 3px solid rgba(8, 164, 181, 0.48);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: no-preference) {
  .route-card,
  .button {
    transition:
      transform 160ms ease,
      border-color 160ms ease,
      background-color 160ms ease;
  }
}

@media (max-width: 820px) {
  .test-message-picker {
    grid-template-columns: 1fr;
  }

  .nav-shell {
    min-height: 64px;
    gap: 12px;
  }

  .brand-link span:last-child {
    display: none;
  }

  .site-nav {
    gap: 0;
  }

  .site-nav a {
    padding-inline: 9px;
  }

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

  .hero-visual {
    min-height: 330px;
  }

  .card-grid,
  .route-grid,
  .signal-test-grid {
    grid-template-columns: 1fr;
  }

  .content-layout {
    grid-template-columns: 1fr;
  }

  .toc {
    position: static;
  }
}

@media (max-width: 560px) {
  .nav-shell {
    width: min(calc(100% - 20px), var(--content));
    flex-wrap: wrap;
    padding-block: 8px;
  }

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

  .site-nav {
    order: 3;
    width: 100%;
    margin-left: 0;
    justify-content: center;
    border-top: 1px solid var(--line);
  }

  .site-nav a {
    min-height: 36px;
    padding-block: 6px;
    font-size: 0.9rem;
  }

  .language-toggle {
    margin-left: auto;
    padding-left: 3px;
  }

  .language-toggle a,
  .language-toggle button {
    min-height: 36px;
    padding: 6px 7px;
    font-size: 0.78rem;
  }

  .shell {
    width: min(calc(100% - 24px), var(--content));
  }

  .hero {
    padding-top: 58px;
  }

  h1,
  .page-hero h1 {
    font-size: clamp(2.2rem, 11vw, 2.65rem);
  }

  h2,
  .content-stack .policy-section > h2 {
    font-size: clamp(1.55rem, 7vw, 2rem);
  }

  .hero-actions {
    display: grid;
  }

  .button {
    width: 100%;
  }

  .fact-list {
    grid-template-columns: 1fr;
  }

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

  .footer-shell nav {
    margin-left: 0;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #ecfaf5;
    --muted: #a6c7c5;
    --paper: #091d26;
    --surface: rgba(15, 48, 59, 0.82);
    --surface-strong: #10323d;
    --line: rgba(196, 235, 225, 0.14);
    --brand: #49c6c8;
    --brand-bright: #7be1dc;
    --navy: #061820;
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.26);
  }

  body {
    background:
      radial-gradient(circle at 12% 8%, rgba(8, 164, 181, 0.12), transparent 30rem),
      radial-gradient(circle at 88% 18%, rgba(209, 73, 50, 0.08), transparent 25rem),
      var(--paper);
  }

  .site-header {
    background: rgba(9, 29, 38, 0.84);
  }

  .section-soft {
    background: rgba(3, 17, 24, 0.28);
  }
}
