:root {
  --paper: #fcfcfa;
  --panel: #ffffff;
  --ink: #171815;
  --muted: #696c66;
  --line: #e1e4de;
  --green: #198754;
  --green-deep: #11683f;
  --green-soft: #eaf7ef;
  --radius: 16px;
  --font: "SF Pro Text", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--paper); scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100dvh;
  color: var(--ink);
  background-color: var(--paper);
  background-image: radial-gradient(circle, rgba(20, 20, 20, .09) .7px, transparent .8px);
  background-size: 18px 18px;
  font-family: var(--font);
  line-height: 1.75;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }

a:focus-visible { outline: 3px solid rgba(25, 135, 84, .22); outline-offset: 3px; }

.legal-site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  width: min(1180px, calc(100% - 40px));
  min-height: 72px;
  margin: 0 auto;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(20, 20, 20, .08);
  background: rgba(252, 252, 250, .92);
  backdrop-filter: blur(16px);
}

.legal-brand { display: inline-flex; min-height: 48px; align-items: center; gap: 10px; font-weight: 820; letter-spacing: -.02em; }
.legal-brand img { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 10px; object-fit: cover; }
.legal-back-link { display: inline-flex; min-height: 44px; align-items: center; color: var(--green-deep); font-size: 14px; font-weight: 760; }
.legal-back-link::before { content: "←"; margin-right: 7px; }

.legal-site-main { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 52px 0 88px; }

.legal-document-switcher {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  max-width: 760px;
  margin: 0 auto 28px;
  padding: 4px;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .86);
}

.legal-document-switcher a { display: flex; min-height: 46px; padding: 8px 14px; align-items: center; justify-content: center; border-radius: 8px; color: var(--muted); font-size: 14px; font-weight: 720; text-align: center; }
.legal-document-switcher a:hover { color: var(--green-deep); background: var(--green-soft); }
.legal-document-switcher a.is-active { color: white; background: var(--green-deep); }

.legal-document { max-width: 880px; margin: 0 auto; padding: clamp(28px, 5vw, 64px); border: 1px solid var(--line); border-radius: 24px; background: rgba(255, 255, 255, .96); box-shadow: 0 28px 80px rgba(24, 41, 31, .08); }

.legal-document-hero { padding-bottom: 36px; border-bottom: 1px solid var(--line); }
.legal-document-hero > span { color: var(--green-deep); font-size: 12px; font-weight: 820; letter-spacing: .14em; text-transform: uppercase; }
.legal-document-hero h1 { margin: 10px 0 14px; font-size: clamp(38px, 7vw, 64px); line-height: 1.05; letter-spacing: -.055em; }
.legal-document-hero p { max-width: 680px; margin: 0; color: var(--muted); font-size: 18px; }
.legal-meta { display: flex; margin-top: 24px; align-items: center; flex-wrap: wrap; gap: 8px 20px; color: var(--muted); font-size: 13px; }

.legal-status-note { margin: 28px 0 4px; padding: 18px 20px; border: 1px solid #c7e8d3; border-radius: 12px; background: var(--green-soft); }
.legal-status-note strong { color: var(--green-deep); font-size: 14px; }
.legal-status-note p { margin: 3px 0 0; color: #3e5b49; font-size: 14px; }

.legal-prose { font-size: 16px; }
.legal-section { padding: 40px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 92px; }
.legal-section:last-child { padding-bottom: 0; border-bottom: 0; }
.legal-section-number { display: block; margin-bottom: 8px; color: var(--green-deep); font-size: 12px; font-weight: 820; letter-spacing: .08em; text-transform: uppercase; }
.legal-section h2 { margin: 0 0 14px; font-size: clamp(22px, 4vw, 30px); line-height: 1.25; letter-spacing: -.035em; }
.legal-section p { margin: 0 0 14px; color: #3f423d; }
.legal-section p:last-child { margin-bottom: 0; }
.legal-section ul { margin: 0; padding-left: 1.25em; color: #3f423d; }
.legal-section li + li { margin-top: 10px; }
.legal-section strong { color: var(--ink); }

.legal-plan-table { max-width: 100%; margin: 20px 0; overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.legal-plan-table table { width: 100%; min-width: 620px; border-collapse: collapse; font-size: 14px; }
.legal-plan-table th, .legal-plan-table td { padding: 14px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.legal-plan-table thead th { color: var(--muted); background: #f4f6f2; font-size: 12px; letter-spacing: .04em; }
.legal-plan-table tbody tr:last-child th, .legal-plan-table tbody tr:last-child td { border-bottom: 0; }
.legal-plan-table tbody th { color: var(--green-deep); }

.legal-contact-list { display: grid; margin: 22px 0 0; border-top: 1px solid var(--line); }
.legal-contact-list > div { display: grid; grid-template-columns: 160px minmax(0, 1fr); padding: 12px 0; gap: 18px; border-bottom: 1px solid var(--line); }
.legal-contact-list dt { color: var(--muted); font-size: 13px; }
.legal-contact-list dd { margin: 0; font-weight: 680; overflow-wrap: anywhere; }
.legal-contact-list a { color: var(--green-deep); text-decoration: underline; text-underline-offset: 3px; }

.legal-site-footer { display: flex; width: min(1180px, calc(100% - 40px)); min-height: 110px; margin: 0 auto; padding: 28px 0; align-items: center; justify-content: space-between; gap: 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.legal-site-footer nav { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 20px; }
.legal-site-footer a { display: inline-flex; min-height: 44px; align-items: center; color: var(--ink); font-weight: 700; }
.legal-site-footer a:hover { color: var(--green-deep); text-decoration: underline; text-underline-offset: 4px; }

@media (max-width: 680px) {
  .legal-site-header, .legal-site-main, .legal-site-footer { width: min(100% - 28px, 1180px); }
  .legal-site-main { padding: 28px 0 56px; }
  .legal-document-switcher { grid-template-columns: 1fr; }
  .legal-document-switcher a { justify-content: flex-start; }
  .legal-document { padding: 28px 20px; border-radius: 18px; }
  .legal-document-hero h1 { font-size: 40px; }
  .legal-document-hero p { font-size: 16px; }
  .legal-section { padding: 32px 0; }
  .legal-contact-list > div { grid-template-columns: 1fr; gap: 2px; }
  .legal-site-footer { align-items: flex-start; flex-direction: column; }
  .legal-site-footer nav { align-items: flex-start; flex-direction: column; }
}

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