:root {
  --ink: #1a1216;
  --ink-soft: #3d3236;
  --muted: #7a6b70;
  --rose: #e23b62;
  --rose-soft: #fce8ed;
  --rose-line: rgba(226, 59, 98, 0.22);
  --bg: #fff6f7;
  --surface: #ffffff;
  --line: rgba(26, 18, 22, 0.08);
  --shadow: 0 12px 40px rgba(26, 18, 22, 0.06);
  --radius: 14px;
  --header-h: 3.5rem;
  --font-sans: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-display: Fraunces, var(--font-sans), serif;
}

html[data-font="tc"] {
  --font-sans: "Noto Sans TC", "PingFang HK", "Microsoft JhengHei", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 1rem); }

body {
  font-family: var(--font-sans);
  color: var(--ink-soft);
  background:
    radial-gradient(ellipse 80% 50% at 100% 0%, rgba(226, 59, 98, 0.07), transparent 55%),
    radial-gradient(ellipse 60% 40% at 0% 100%, rgba(226, 59, 98, 0.05), transparent 50%),
    var(--bg);
  line-height: 1.8;
  font-size: 0.98rem;
}

a { color: var(--rose); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--rose); outline-offset: 3px; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0 1.25rem;
  background: rgba(255, 246, 247, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.brand {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.brand:hover { text-decoration: none; filter: brightness(1.05); }

.topbar-actions { display: flex; align-items: center; gap: 0.45rem; flex-wrap: wrap; justify-content: flex-end; }

.region-nav {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  overflow: hidden;
}
.region-nav a {
  padding: 0.32rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  text-decoration: none;
  line-height: 1.2;
}
.region-nav a:hover {
  background: var(--rose-soft);
  color: var(--rose);
  text-decoration: none;
}
.region-nav a.is-active {
  background: var(--rose-soft);
  color: var(--rose);
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
}

.lang-switch {
  display: inline-flex;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  overflow: hidden;
}
.lang-switch button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
}
.lang-switch button[aria-pressed="true"] {
  background: var(--rose);
  color: #fff;
}

.btn-contact {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #ff5d7e, var(--rose));
  box-shadow: 0 6px 18px rgba(226, 59, 98, 0.22);
}
.btn-contact:hover { text-decoration: none; filter: brightness(1.05); }

.layout {
  max-width: 1080px;
  margin: 0 auto;
  padding: 1.75rem 1.25rem 3.5rem;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
}
.layout--single {
  grid-template-columns: 1fr;
  max-width: 820px;
}

.toc {
  position: sticky;
  top: calc(var(--header-h) + 1rem);
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.toc-title {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.75rem;
}
.toc ol { list-style: none; display: grid; gap: 0.15rem; }
.toc a {
  display: block;
  padding: 0.38rem 0.5rem;
  border-radius: 8px;
  font-size: 0.82rem;
  color: var(--ink-soft);
  text-decoration: none;
  line-height: 1.45;
}
.toc a:hover,
.toc a.active {
  background: var(--rose-soft);
  color: var(--rose);
  text-decoration: none;
}

.hero {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 2px);
  box-shadow: var(--shadow);
  padding: 1.75rem 1.6rem 1.5rem;
  margin-bottom: 1.25rem;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  background: var(--rose-soft);
  color: var(--rose);
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 0.85rem;
}
h1 {
  font-family: var(--font-display);
  font-size: clamp(1.65rem, 4vw, 2.15rem);
  line-height: 1.25;
  color: var(--ink);
  letter-spacing: -0.02em;
  margin-bottom: 0.55rem;
}
.hero-meta { color: var(--muted); font-size: 0.88rem; }
.hero-intro {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
}

.section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem 1.1rem;
  margin-bottom: 0.85rem;
  box-shadow: 0 4px 18px rgba(26, 18, 22, 0.03);
}
.section h2 {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 0.65rem;
  line-height: 1.4;
}
.section-num {
  flex: 0 0 auto;
  font-family: Fraunces, serif;
  font-size: 0.92rem;
  color: var(--rose);
  opacity: 0.85;
}
.section p { margin-bottom: 0.75rem; }
.section p:last-child { margin-bottom: 0; }
.section ul, .section ol { margin: 0 0 0.75rem 1.15rem; }
.section li { margin-bottom: 0.35rem; }

.section--contact,
.section.contact {
  border-color: var(--rose-line);
  background: linear-gradient(135deg, rgba(255, 93, 126, 0.08), rgba(226, 59, 98, 0.04));
}

.table-wrap { overflow-x: auto; margin: 0.4rem 0 0.85rem; }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  line-height: 1.55;
}
table.data th,
table.data td {
  border: 1px solid var(--line);
  padding: 0.55rem 0.65rem;
  text-align: left;
  vertical-align: top;
}
table.data th {
  background: #fff1f4;
  color: var(--ink);
  font-weight: 700;
  white-space: nowrap;
}
table.data tr:nth-child(even) td { background: #fffafb; }

.note {
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  background: #f7f4f5;
  color: var(--ink-soft);
  font-size: 0.9rem;
}
.contact-card {
  margin-top: 0.25rem;
  padding: 1.1rem 1.2rem;
  border-radius: calc(var(--radius) - 2px);
  background: linear-gradient(135deg, rgba(255, 93, 126, 0.08), rgba(226, 59, 98, 0.04));
  border: 1px solid var(--rose-line);
}
.contact-card p:last-child { margin-bottom: 0; }

footer {
  margin-top: 1rem;
  padding: 1.25rem 0.5rem 0;
  text-align: center;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.65;
}
footer p + p { margin-top: 0.35rem; }
.footer-regions a { font-weight: 600; }

.toc-mobile { display: none; margin-bottom: 1rem; }
.toc-mobile select {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  font: inherit;
}

html[lang="en"] .zh { display: none; }
html:not([lang="en"]) .en { display: none; }

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; padding-top: 1.25rem; }
  .toc { display: none; }
  .toc-mobile { display: block; }
  .chip { display: none; }
  .region-nav a { padding: 0.32rem 0.45rem; font-size: 0.68rem; }
}

@media print {
  .topbar, .toc, .toc-mobile, .lang-switch, .region-nav { display: none !important; }
  body { background: #fff; color: #000; }
  .layout { display: block; max-width: none; padding: 0; }
  .hero, .section { box-shadow: none; border-color: #ddd; break-inside: avoid; }
  a { color: #000; text-decoration: underline; }
  .zh, .en { display: block !important; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

.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;
}
