:root {
  color-scheme: light;
  --agreement-bg: #ffffff;
  --agreement-ink: #202124;
  --agreement-muted: #62666d;
  --agreement-line: #e2e3e5;
  --agreement-soft: #f7f7f8;
  --agreement-focus: #7b3657;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--agreement-ink);
  background: var(--agreement-bg);
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.82;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--agreement-ink);
  text-underline-offset: .2em;
}

a:hover { text-decoration-thickness: 2px; }

a:focus-visible {
  outline: 3px solid rgba(123, 54, 87, .28);
  outline-offset: 3px;
  border-radius: 3px;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 16px;
  z-index: 5;
  padding: 8px 12px;
  color: #ffffff;
  background: var(--agreement-focus);
  transform: translateY(-160%);
}

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

.agreement-site-header {
  position: sticky;
  top: 0;
  z-index: 3;
  border-bottom: 1px solid var(--agreement-line);
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(8px);
}

.agreement-site-header-inner {
  width: min(100% - 40px, 800px);
  min-height: 58px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  font-size: 14px;
}

.agreement-site-header-inner > span { font-size: 16px; font-weight: 700; }
.agreement-brand { justify-self: start; font-weight: 700; text-decoration: none; }
.agreement-back { justify-self: end; }

.agreement-page {
  width: min(100% - 40px, 800px);
  margin: 0 auto;
  padding: 48px 0 64px;
}

.agreement-title {
  padding-bottom: 30px;
  border-bottom: 1px solid var(--agreement-line);
}

.agreement-title h1 {
  margin: 0;
  font-size: clamp(28px, 5vw, 38px);
  line-height: 1.32;
  letter-spacing: -.02em;
}

.agreement-meta {
  margin: 22px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 28px;
  color: var(--agreement-muted);
  font-size: 14px;
}

.agreement-meta div { display: flex; gap: 6px; }
.agreement-meta dt,
.agreement-meta dd { margin: 0; }
.agreement-meta dt::after { content: "："; }

.agreement-article { padding-top: 34px; }
.agreement-article section { padding-top: 6px; }

.agreement-article h2 {
  margin: 44px 0 18px;
  scroll-margin-top: 80px;
  font-size: 24px;
  line-height: 1.45;
}

.agreement-article p {
  margin: 0 0 16px;
  text-align: justify;
  overflow-wrap: anywhere;
}

.agreement-article strong { color: #111214; font-weight: 750; }
.agreement-welcome { font-size: 18px; }
.agreement-clause-number { font-variant-numeric: tabular-nums; }

.agreement-actions {
  margin-top: 54px;
  padding-top: 24px;
  border-top: 1px solid var(--agreement-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.agreement-actions a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.agreement-return {
  padding: 8px 16px;
  border: 1px solid #2a2c30;
  border-radius: 6px;
  text-decoration: none;
}

.agreement-return:hover { background: var(--agreement-soft); }

.agreement-footer {
  padding: 26px 20px calc(26px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--agreement-line);
  color: var(--agreement-muted);
  background: var(--agreement-soft);
  text-align: center;
  font-size: 13px;
}

.agreement-footer p { margin: 4px 0; }
.agreement-footer a { color: inherit; }

@media (max-width: 700px) {
  body { line-height: 1.75; }
  .agreement-site-header-inner { width: min(100% - 24px, 800px); min-height: 54px; }
  .agreement-site-header-inner > span { font-size: 15px; }
  .agreement-brand { font-size: 0; }
  .agreement-brand::before { content: "返回"; font-size: 14px; font-weight: 400; }
  .agreement-back { visibility: hidden; }
  .agreement-page { width: min(100% - 32px, 800px); padding: 34px 0 48px; }
  .agreement-title { padding-bottom: 24px; }
  .agreement-title h1 { font-size: 28px; }
  .agreement-meta { display: grid; gap: 4px; }
  .agreement-article { padding-top: 28px; }
  .agreement-article h2 { margin: 38px 0 15px; font-size: 21px; }
  .agreement-article p { text-align: left; }
}

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

@media print {
  .agreement-site-header,
  .agreement-actions,
  .agreement-footer,
  .skip-link { display: none !important; }
  .agreement-page { width: 100%; padding: 0; }
  .agreement-article h2 { break-after: avoid; }
  .agreement-article p { orphans: 3; widows: 3; }
}
