:root {
  --bg: #f6f7f4;
  --surface: #ffffff;
  --text: #1d2520;
  --muted: #5f6b63;
  --line: #dde3dc;
  --accent: #2f6b4f;
  --accent-soft: #e6f0e9;
  --warning: #7a4b12;
  --warning-bg: #fff5e6;
  --max: 860px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC",
    "PingFang TC", "Microsoft JhengHei", sans-serif;
  line-height: 1.75;
  font-size: 16px;
}

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

a:hover {
  color: #1f4d38;
}

.wrap {
  width: min(calc(100% - 32px), var(--max));
  margin: 0 auto;
}

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

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}

.brand {
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--text);
}

.site-header nav {
  display: flex;
  gap: 18px;
  font-size: 14px;
}

.site-header nav a {
  text-decoration: none;
  color: var(--muted);
}

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

main {
  padding: 40px 0 56px;
}

.hero {
  padding: 24px 0 8px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 12px;
  font-size: clamp(30px, 5vw, 42px);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

h2 {
  margin: 36px 0 12px;
  font-size: 22px;
  line-height: 1.35;
}

h3 {
  margin: 24px 0 8px;
  font-size: 18px;
}

p,
ul,
ol {
  margin: 0 0 14px;
}

li {
  margin: 4px 0;
}

.lead {
  font-size: 18px;
  color: var(--muted);
  max-width: 68ch;
}

.meta,
.small {
  color: var(--muted);
  font-size: 13px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin: 28px 0;
}

.card {
  display: block;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  text-decoration: none;
  color: var(--text);
  transition: transform 120ms ease, border-color 120ms ease;
}

.card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.card h2 {
  margin: 0 0 8px;
  font-size: 20px;
}

.card p {
  color: var(--muted);
  font-size: 14px;
}

.card-link {
  color: var(--accent);
  font-weight: 600;
  font-size: 14px;
}

.notice,
.notice-inline {
  background: var(--warning-bg);
  border: 1px solid #f0d7b4;
  color: var(--warning);
  border-radius: 12px;
  padding: 16px 18px;
}

.notice h2 {
  margin-top: 0;
}

.notice p:last-child,
.notice-inline:last-child {
  margin-bottom: 0;
}

.document {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: clamp(22px, 4vw, 42px);
}

.document > .eyebrow,
.document > h1,
.document > .meta {
  margin-left: 0;
}

.toc {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 22px 0 8px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcfa;
  font-size: 13px;
}

.toc a {
  text-decoration: none;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 20px;
  font-size: 14px;
}

.table-wrap {
  overflow-x: auto;
  margin: 16px 0 20px;
}

.table-wrap table {
  margin: 0;
}

@media (min-width: 700px) {
  .table-wrap table {
    min-width: 680px;
  }
}

th,
td {
  border: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--accent-soft);
  font-weight: 700;
}

code {
  background: #f1f4f0;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 5px;
  font-size: 0.9em;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 24px 0 36px;
  color: var(--muted);
  font-size: 13px;
}

.site-footer p {
  margin: 4px 0;
}

@media (max-width: 620px) {
  .site-header .wrap {
    align-items: flex-start;
    flex-direction: column;
    padding: 12px 0;
    gap: 6px;
  }

  .site-header nav {
    gap: 14px;
  }

  main {
    padding-top: 26px;
  }

  .table-wrap {
    margin-left: -4px;
    margin-right: -4px;
    overflow-x: visible;
  }

  table {
    font-size: 12px;
    table-layout: fixed;
    width: 100%;
  }

  th,
  td {
    padding: 7px 6px;
    white-space: normal;
    word-break: break-word;
  }
}

@media print {
  .site-header,
  .site-footer,
  .toc {
    display: none;
  }

  body {
    background: #fff;
  }

  .document {
    border: 0;
    padding: 0;
  }

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