:root {
  color-scheme: light dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --bg: #fffaf7;
  --surface: #ffffff;
  --surface-soft: #fff2eb;
  --surface-muted: #f8e7de;
  --text: #281c17;
  --muted: #6b5a52;
  --border: #ead5ca;
  --primary: #d94f18;
  --primary-soft: #ffddcb;
  --secondary: #514bb7;
  --tertiary: #0b796b;
  --shadow: 0 18px 48px rgb(72 37 25 / 10%);
  --radius-control: 14px;
  --radius-card: 22px;
  --radius-feature: 30px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
}

body {
  margin: 0;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    linear-gradient(rgb(217 79 24 / 3%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(217 79 24 / 3%) 1px, transparent 1px);
  background-size: 28px 28px;
  line-height: 1.68;
  overflow-wrap: anywhere;
}

a {
  color: var(--primary);
  text-underline-offset: 3px;
}

button,
input {
  font: inherit;
}

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

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 70%, white);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

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

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

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 86%, transparent);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(18px);
}

.site-header__inner,
main,
.site-footer {
  width: min(980px, calc(100% - 32px));
  margin-inline: auto;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
}

.brand {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 850;
  text-decoration: none;
}

.brand small {
  color: var(--muted);
  font-size: 0.72em;
  font-weight: 650;
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: var(--primary);
  letter-spacing: -2px;
  background: var(--primary-soft);
  border: 1px solid color-mix(in srgb, var(--primary) 20%, transparent);
  border-radius: 13px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.site-nav a {
  padding: 9px 11px;
  color: var(--muted);
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 720;
  text-decoration: none;
  white-space: nowrap;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--primary);
  background: var(--primary-soft);
}

main {
  padding-block: clamp(20px, 5vw, 48px) 56px;
}

.language-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: 0 8px 28px rgb(72 37 25 / 6%);
}

.eyebrow {
  margin: 0;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.language-help {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.language-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.language-switch button {
  min-height: 42px;
  padding: 8px 13px;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 720;
}

.language-switch button:hover,
.language-switch button[aria-selected="true"] {
  color: #35150b;
  background: var(--primary-soft);
  border-color: color-mix(in srgb, var(--primary) 38%, var(--border));
}

.legal-hero {
  padding: clamp(24px, 6vw, 54px);
  background:
    radial-gradient(circle at 92% 14%, rgb(81 75 183 / 14%), transparent 24%),
    var(--primary-soft);
  border: 1px solid color-mix(in srgb, var(--primary) 22%, var(--border));
  border-radius: var(--radius-feature);
  box-shadow: var(--shadow);
}

.legal-hero h1 {
  max-width: 760px;
  margin: 10px 0 14px;
  font-size: clamp(2.15rem, 7vw, 4.4rem);
  line-height: 1.03;
  letter-spacing: -0.045em;
}

.lede {
  max-width: 760px;
  margin: 0;
  color: color-mix(in srgb, var(--text) 88%, var(--muted));
  font-size: clamp(1rem, 2.6vw, 1.18rem);
}

.meta-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.meta-list span {
  padding: 7px 11px;
  color: var(--muted);
  background: color-mix(in srgb, var(--surface) 76%, transparent);
  border: 1px solid color-mix(in srgb, var(--border) 72%, transparent);
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 700;
}

.highlights,
.contents-card,
.contact-card {
  margin-top: 18px;
  padding: clamp(20px, 4vw, 30px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
}

.highlights h2,
.contents-card h2,
.contact-card h2 {
  margin: 6px 0 16px;
  line-height: 1.2;
}

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

.fact-card {
  padding: 16px;
  background: var(--surface-soft);
  border: 1px solid color-mix(in srgb, var(--primary) 12%, var(--border));
  border-radius: var(--radius-control);
}

.fact-card h3 {
  margin: 0 0 5px;
  font-size: 1rem;
  line-height: 1.3;
}

.fact-card p,
.contact-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.contents-card ol {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 22px;
  margin: 0;
  padding-left: 22px;
}

.contents-card li::marker {
  color: var(--primary);
  font-weight: 800;
}

.contents-card a {
  color: var(--text);
  font-weight: 650;
  text-decoration-color: color-mix(in srgb, var(--primary) 34%, transparent);
}

.legal-sections {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.legal-section {
  padding: clamp(20px, 4vw, 30px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  scroll-margin-top: 100px;
}

.legal-section h2 {
  margin: 0 0 10px;
  font-size: clamp(1.15rem, 3vw, 1.4rem);
  line-height: 1.3;
}

.legal-section p {
  margin: 0;
  color: color-mix(in srgb, var(--text) 90%, var(--muted));
}

.contact-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: color-mix(in srgb, var(--tertiary) 9%, var(--surface));
  border-color: color-mix(in srgb, var(--tertiary) 24%, var(--border));
}

.contact-card__icon {
  display: grid;
  flex: 0 0 42px;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--tertiary);
  background: color-mix(in srgb, var(--tertiary) 13%, var(--surface));
  border-radius: var(--radius-control);
  font-size: 1.2rem;
  font-weight: 900;
}

.contact-card h2 {
  margin-top: 0;
}

.contact-link {
  display: inline-block;
  margin-top: 10px;
  color: var(--tertiary);
  font-weight: 800;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding-block: 26px 42px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  font-size: 0.86rem;
}

.site-footer p {
  margin: 0;
}

body:not([data-document]) main {
  margin-top: 32px;
  margin-bottom: 40px;
  padding: clamp(22px, 5vw, 48px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-feature);
  box-shadow: var(--shadow);
}

body:not([data-document]) main h1 {
  margin-top: 0;
  line-height: 1.15;
}

.muted {
  color: var(--muted);
}

.notice {
  padding: 14px 16px;
  background: var(--surface-soft);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-control);
}

form {
  display: grid;
  gap: 14px;
  max-width: 540px;
}

label {
  display: grid;
  gap: 6px;
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 48px;
  padding: 11px 14px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid color-mix(in srgb, var(--muted) 55%, var(--border));
  border-radius: var(--radius-control);
}

button {
  min-height: 46px;
  padding: 10px 16px;
  color: white;
  background: var(--primary);
  border: 0;
  border-radius: var(--radius-control);
  cursor: pointer;
  font-weight: 750;
}

button.secondary {
  color: var(--text);
  background: var(--surface-muted);
}

button.danger {
  background: #b3261e;
}

.page-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 10px 16px;
  color: white;
  background: var(--primary);
  border-radius: var(--radius-control);
  font-weight: 750;
  text-decoration: none;
}

.page-action.secondary {
  color: var(--text);
  background: var(--surface-muted);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

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

#status[aria-live] {
  min-height: 1.7em;
  font-weight: 700;
}

@media (max-width: 760px) {
  .site-header__inner {
    display: block;
    padding-block: 12px 0;
  }

  .brand {
    padding-inline: 2px;
  }

  .site-nav {
    gap: 2px;
    margin-inline: -16px;
    padding: 8px 16px 10px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .site-nav::-webkit-scrollbar {
    display: none;
  }

  .language-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .fact-grid,
  .contents-card ol {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 430px) {
  .site-header__inner,
  main,
  .site-footer {
    width: min(100% - 24px, 980px);
  }

  .language-switch button {
    flex: 1 1 auto;
  }

  .legal-hero,
  .highlights,
  .contents-card,
  .legal-section,
  .contact-card {
    border-radius: 18px;
  }

  .contact-card {
    flex-direction: column;
  }

  .actions > * {
    flex: 1 1 100%;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #181317;
    --surface: #241c20;
    --surface-soft: #33231f;
    --surface-muted: #3e2d29;
    --text: #f8efea;
    --muted: #cbbab1;
    --border: #4b393f;
    --primary: #ff9868;
    --primary-soft: #5a2b1d;
    --secondary: #aaa4ff;
    --tertiary: #58d8c4;
    --shadow: 0 18px 48px rgb(0 0 0 / 28%);
  }

  .language-switch button:hover,
  .language-switch button[aria-selected="true"] {
    color: #fff5ef;
  }
}

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