:root {
  color-scheme: light;
  --color-page: #ffffff;
  --color-subtle: #fafaf8;
  --color-hover: #f5f5f3;
  --color-text: #111111;
  --color-secondary: #5f6368;
  --color-muted: #858585;
  --color-border: #e5e5e5;
  --color-focus: #111111;
  --color-notice: #982b2f;
  --color-action-bg: #e8f1ff;
  --color-action-bg-hover: #143d73;
  --color-action-text: #143d73;
  --font-sans: "Inter", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  --content-max: 1360px;
  --measure: 800px;
  --toc-width: 248px;
  --header-height: 72px;
  --page-x: clamp(24px, 5vw, 72px);
  --section-gap: clamp(24px, 3.5vw, 34px);
  --transition: 160ms ease;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 28px);
}

body {
  margin: 0;
  background: var(--color-page);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.86;
  letter-spacing: 0;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--color-action-text);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition: color var(--transition), background-color var(--transition), text-decoration-thickness var(--transition), transform var(--transition);
}

a:hover {
  color: var(--color-action-bg-hover);
  text-decoration-thickness: 2px;
}

a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 4px;
}

img {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  color: var(--color-text);
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.2;
  text-wrap: balance;
}

h1 {
  margin-bottom: 22px;
  font-size: clamp(42px, 5.1vw, 60px);
}

h2 {
  margin-bottom: 20px;
  font-size: clamp(26px, 3vw, 31px);
}

h3 {
  margin-bottom: 12px;
  font-size: 20px;
}

p {
  margin-bottom: 22px;
}

ul,
ol {
  margin: 16px 0 0;
  padding-left: 1.35rem;
}

li + li {
  margin-top: 8px;
}

strong {
  font-weight: 600;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: var(--header-height);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-page);
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(100%, var(--content-max));
  min-height: var(--header-height);
  margin: 0 auto;
  padding: 0 var(--page-x);
  gap: 40px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--color-text);
  text-decoration: none;
  white-space: nowrap;
}

.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 4px;
  object-fit: cover;
  flex: 0 0 auto;
}

.brand-name {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1;
}

.nav-toggle {
  display: none;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--color-border);
  border-radius: 2px;
  background: var(--color-page);
  color: var(--color-text);
  font: inherit;
  font-size: 14px;
  line-height: 1;
}

.nav-overlay,
.nav-close {
  display: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 34px;
}

.nav-links a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: var(--header-height);
  color: var(--color-secondary);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.nav-links a::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 1px;
  background: transparent;
  transition: background-color var(--transition);
}

.nav-links a[aria-current="page"],
.nav-links a:hover {
  color: var(--color-text);
}

.nav-links a[aria-current="page"]::after {
  background: var(--color-notice);
}

body.has-open-menu {
  overflow: hidden;
}

.site-main {
  width: min(100%, var(--content-max));
  margin: 0 auto;
  padding: 0 var(--page-x);
}

.home-main {
  padding-top: clamp(56px, 7vw, 84px);
  padding-bottom: 72px;
}

.home-intro,
.home-section {
  width: min(100%, var(--measure));
  min-width: 0;
  margin-right: auto;
  margin-left: auto;
  text-align: left;
}

.home-intro {
  margin-bottom: clamp(42px, 6vw, 64px);
}

.lede {
  max-width: 780px;
  color: var(--color-secondary);
  font-size: clamp(18px, 2vw, 21px);
  line-height: 1.78;
}

.link-index {
  margin: 0 0 58px;
  border-top: 1px solid var(--color-border);
}

.link-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  align-items: center;
  padding: 20px 14px;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
  text-decoration: none;
}

.link-row:hover {
  background: var(--color-hover);
  color: var(--color-text);
}

.link-row:hover .link-action {
  transform: translateX(3px);
}

.link-title {
  display: block;
  margin-bottom: 6px;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.35;
}

.link-summary {
  display: block;
  max-width: 640px;
  color: var(--color-secondary);
  font-size: 16px;
  line-height: 1.75;
}

.link-action {
  color: var(--color-secondary);
  font-size: 15px;
  white-space: nowrap;
  transition: transform var(--transition), color var(--transition);
}

.link-row:hover .link-action {
  color: var(--color-text);
}

.metadata-list,
.info-list {
  width: 100%;
  min-width: 0;
  margin: 18px 0 0;
  border-top: 1px solid var(--color-border);
}

.metadata-row,
.info-row {
  display: grid;
  grid-template-columns: minmax(150px, 230px) minmax(0, 1fr);
  gap: 28px;
  padding: 14px 0;
  border-bottom: 1px solid var(--color-border);
}

.metadata-row dt,
.info-row dt {
  color: var(--color-secondary);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.7;
  padding-left: 14px;
}

.metadata-row dd,
.info-row dd {
  min-width: 0;
  margin: 0;
  color: var(--color-text);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.document-main {
  padding-top: clamp(42px, 5vw, 62px);
  padding-bottom: 76px;
}

.document-shell {
  display: grid;
  grid-template-columns: var(--toc-width) minmax(0, var(--measure));
  gap: clamp(52px, 6vw, 82px);
  align-items: start;
}

.document-sidebar {
  position: sticky;
  top: calc(var(--header-height) + 44px);
  max-height: calc(100vh - var(--header-height) - 72px);
  overflow: auto;
}

.document-toc-title {
  margin: 0 0 16px;
  color: var(--color-text);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
}

.document-toc {
  display: grid;
  gap: 2px;
}

.document-toc a {
  display: block;
  padding: 5px 0 5px 13px;
  border-left: 1px solid transparent;
  color: var(--color-secondary);
  font-size: 14px;
  line-height: 1.65;
  text-decoration: none;
}

.document-toc a:hover,
.document-toc a[aria-current="true"] {
  border-left-color: var(--color-text);
  color: var(--color-text);
}

.document {
  min-width: 0;
  max-width: var(--measure);
}

.page-intro {
  padding-bottom: var(--section-gap);
  margin-bottom: var(--section-gap);
  border-bottom: 1px solid var(--color-border);
}

.page-intro .lede {
  margin-bottom: 0;
}

.page-meta {
  margin: 0 0 22px;
  color: var(--color-secondary);
  font-size: 14px;
  line-height: 1.8;
}

.legal-section {
  scroll-margin-top: calc(var(--header-height) + 32px);
  padding-bottom: var(--section-gap);
  border-bottom: 1px solid var(--color-border);
}

.legal-section + .legal-section {
  padding-top: var(--section-gap);
}

.legal-section p,
.legal-section li,
.document-note,
.faq-item p {
  color: var(--color-text);
  overflow-wrap: anywhere;
}

.legal-section > p:last-child,
.legal-section > ul:last-child,
.legal-section > ol:last-child,
.document-note:last-child {
  margin-bottom: 0;
}

.legal-section .document-note {
  margin: 24px 0;
  padding: 20px 22px;
  border: 0;
  border-radius: 0;
  background: var(--color-notice);
  color: var(--color-page);
  line-height: 1.78;
}

.legal-section .document-note strong {
  color: var(--color-page);
}

.action-link {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--color-action-bg);
  border-radius: 2px;
  background: var(--color-action-bg);
  color: var(--color-action-text);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
}

.action-link:hover {
  border-color: var(--color-action-bg-hover);
  background: var(--color-action-bg-hover);
  color: var(--color-page);
}

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

.small {
  font-size: 14px;
  line-height: 1.75;
}

.faq-list {
  margin-top: 14px;
  border-top: 1px solid var(--color-border);
}

.faq-item {
  border-bottom: 1px solid var(--color-border);
}

.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 0;
  color: var(--color-text);
  cursor: pointer;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.5;
  list-style: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  flex: 0 0 auto;
  color: var(--color-secondary);
  font-size: 20px;
  font-weight: 400;
  line-height: 1;
}

.faq-item[open] summary::after {
  content: "-";
}

.faq-item p {
  margin-bottom: 22px;
  color: var(--color-secondary);
}

.site-footer {
  border-top: 1px solid var(--color-border);
  background: var(--color-subtle);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(100%, var(--content-max));
  margin: 0 auto;
  padding: 22px var(--page-x);
  gap: 24px;
}

.footer-inner p {
  margin: 0;
  color: var(--color-secondary);
  font-size: 14px;
  line-height: 1.7;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  justify-content: flex-end;
}

.footer-links a {
  color: var(--color-secondary);
  font-size: 14px;
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--color-text);
}

@media (max-width: 980px) {
  :root {
    --header-height: 68px;
  }

  body {
    font-size: 16px;
    line-height: 1.84;
  }

  .site-nav {
    gap: 0 20px;
    padding-top: 0;
    padding-bottom: 0;
  }

  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .nav-overlay {
    position: fixed;
    inset: 0;
    z-index: 30;
    display: block;
    background: rgba(17, 17, 17, 0.36);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition);
  }

  .nav-overlay[hidden] {
    display: none;
  }

  .site-header.is-menu-open .nav-overlay {
    opacity: 1;
    pointer-events: auto;
  }

  .nav-links {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    display: flex;
    width: min(84vw, 340px);
    height: 100dvh;
    padding: 22px 24px 28px;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    border-right: 1px solid var(--color-border);
    background: var(--color-page);
    transform: translateX(-100%);
    transition: transform 190ms ease;
  }

  .site-header.is-menu-open .nav-links {
    transform: translateX(0);
  }

  .nav-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: flex-end;
    min-height: 38px;
    margin-bottom: 18px;
    padding: 0 12px;
    border: 1px solid var(--color-border);
    border-radius: 2px;
    background: var(--color-page);
    color: var(--color-text);
    font: inherit;
    font-size: 14px;
    line-height: 1;
  }

  .nav-close:hover {
    background: var(--color-hover);
  }

  .nav-links a {
    min-height: 50px;
    align-items: center;
    border-bottom: 1px solid var(--color-border);
    font-size: 16px;
  }

  .nav-links a::after {
    display: none;
  }

  .document-shell {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .document-sidebar {
    position: static;
    max-height: none;
    overflow: visible;
    padding: 0 0 18px;
    border-bottom: 1px solid var(--color-border);
  }

  .document-toc {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 22px;
  }

  .document-toc a {
    padding-left: 0;
    border-left: 0;
  }

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

  .footer-links {
    justify-content: flex-start;
  }
}

@media (max-width: 820px) {
  .metadata-row,
  .info-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

@media (max-width: 620px) {
  :root {
    --page-x: 22px;
  }

  h1 {
    font-size: clamp(36px, 10vw, 42px);
  }

  h2 {
    font-size: 25px;
  }

  h3 {
    font-size: 19px;
  }

  .home-main,
  .document-main {
    padding-top: 42px;
    padding-bottom: 58px;
  }

  .lede {
    font-size: 17px;
  }

  .link-row {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 18px 12px;
  }

  .link-action {
    white-space: normal;
  }

  .metadata-row,
  .info-row {
    padding: 15px 0;
  }

  .document-toc {
    grid-template-columns: 1fr;
  }

  .page-intro {
    padding-bottom: var(--section-gap);
  }

  .legal-section {
    padding-bottom: var(--section-gap);
  }

  .faq-item summary {
    font-size: 17px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
