:root {
  --ground: #f5f5f2;
  --card: #ffffff;
  --ink: #121212;
  --body: #262626;
  --muted: #656562;
  --hairline: #e6e6e1;
  --tile: #f1f1ec;
  --accent: #3f5aa6;
  --accent-ink: #34489a;
  --accent-tint: #eeedff;
  --note: #fff8e6;
  --note-border: #eedfb5;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #121212;
    --card: #1b1b1b;
    --ink: #f2f2ee;
    --body: #dcdcd7;
    --muted: #a4a49e;
    --hairline: #2c2c2a;
    --tile: #222220;
    --accent: #a5b4ff;
    --accent-ink: #b9c4ff;
    --accent-tint: #23253a;
    --note: #2a2618;
    --note-border: #4a4226;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --ground: #121212;
  --card: #1b1b1b;
  --ink: #f2f2ee;
  --body: #dcdcd7;
  --muted: #a4a49e;
  --hairline: #2c2c2a;
  --tile: #222220;
  --accent: #a5b4ff;
  --accent-ink: #b9c4ff;
  --accent-tint: #23253a;
  --note: #2a2618;
  --note-border: #4a4226;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

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

.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 16px;
}

header.site {
  border-bottom: 1px solid var(--hairline);
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.brand img { width: 28px; height: 28px; }

nav.crumbs {
  font-size: 15px;
  color: var(--muted);
}

nav.crumbs a { color: var(--muted); }

main { padding: 40px 0 64px; }

h1 {
  color: var(--ink);
  font-size: 32px;
  line-height: 1.3;
  margin: 0 0 8px;
  letter-spacing: 0.01em;
}

h2 {
  color: var(--ink);
  font-size: 22px;
  line-height: 1.4;
  margin: 40px 0 12px;
}

h3 {
  color: var(--ink);
  font-size: 18px;
  margin: 24px 0 8px;
}

p { margin: 0 0 14px; }

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

.lede {
  font-size: 19px;
  color: var(--muted);
  margin-bottom: 28px;
}

.meta {
  font-size: 15px;
  color: var(--muted);
  margin-bottom: 24px;
}

.card {
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: 16px;
  padding: 20px;
}

.product {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  text-decoration: none;
  color: inherit;
}

.product img {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  flex: none;
}

.product h3 { margin: 0 0 4px; }

.product p { margin: 0; color: var(--muted); font-size: 16px; }

.product:hover h3 { color: var(--accent-ink); }

.hero { margin-bottom: 20px; align-items: center; }

.hero h1 { margin: 0; }

.hero .lede { margin: 0; }

.tag {
  display: inline-block;
  font-size: 13px;
  line-height: 1.6;
  padding: 1px 10px;
  border-radius: 999px;
  background: var(--accent-tint);
  color: var(--accent-ink);
  margin-left: 6px;
  vertical-align: 2px;
}

ul, ol { padding-left: 1.4em; margin: 0 0 14px; }

li { margin: 4px 0; }

.table-scroll {
  overflow-x: auto;
  margin: 0 0 16px;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: var(--card);
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 560px;
  font-size: 15px;
  line-height: 1.6;
}

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

th {
  color: var(--ink);
  background: var(--tile);
  font-weight: 600;
}

tr:last-child td { border-bottom: none; }

.note {
  background: var(--note);
  border: 1px solid var(--note-border);
  border-radius: 12px;
  padding: 14px 16px;
  margin: 0 0 20px;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.links a {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: var(--card);
  text-decoration: none;
  color: var(--ink);
  font-size: 15px;
}

.links a:hover { border-color: var(--accent); }

footer.site {
  border-top: 1px solid var(--hairline);
  padding: 24px 0 40px;
  font-size: 14px;
  color: var(--muted);
}

footer.site a { color: var(--muted); }

@media (max-width: 600px) {
  .table-scroll { border: none; background: none; overflow: visible; }
  table, thead, tbody, tr, td { display: block; min-width: 0; }
  thead { display: none; }
  tr {
    background: var(--card);
    border: 1px solid var(--hairline);
    border-radius: 12px;
    padding: 6px 0;
    margin: 0 0 10px;
  }
  td { border: none; padding: 4px 14px; }
  td::before {
    content: attr(data-label);
    display: block;
    font-size: 13px;
    color: var(--muted);
  }
  td:first-child::before { display: none; }
  td:first-child { color: var(--ink); }
}

@media (max-width: 480px) {
  body { font-size: 16px; }
  h1 { font-size: 26px; }
  h2 { font-size: 20px; }
  main { padding: 28px 0 48px; }
}
