:root {
  color-scheme: light;
  --ink: #17212b;
  --muted: #566575;
  --paper: #f5f7f8;
  --line: #cdd5dc;
  --signal: #b8ff47;
  --lavender: #e7e9ff;
  --card: #ffffff;
  --link: #244f87;
}

* { box-sizing: border-box; }
html { background: var(--paper); }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.65;
}

a { color: var(--link); text-underline-offset: 0.18em; }
a:hover { color: #102e56; }
a:focus-visible,
button:focus-visible { outline: 3px solid #6c2bd9; outline-offset: 3px; }

.site-header { border-bottom: 1px solid var(--line); background: rgba(245, 247, 248, 0.96); }
.header-inner {
  width: min(1400px, calc(100% - 80px));
  min-height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 26px;
}
.brand {
  color: var(--ink);
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 0.23em;
  text-decoration: none;
}
.edition {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}
nav {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-left: auto;
  overflow-x: auto;
  white-space: nowrap;
}
nav a { color: var(--ink); font-size: 0.88rem; font-weight: 720; text-decoration: none; }
.locale-switcher { display: inline-flex; flex: 0 0 auto; align-items: stretch; border: 1px solid var(--ink); background: var(--card); }
.locale-switcher a, .locale-switcher span { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.42rem 0.55rem; color: var(--ink); font-size: 0.76rem; font-weight: 800; line-height: 1; text-decoration: none; }
.locale-switcher [aria-current="page"] { color: #fff; background: var(--ink); }
.locale-switcher small { color: inherit; font-size: 0.64rem; font-weight: 700; }

main { width: min(1400px, 100%); margin: 0 auto; padding: 0 0 72px; }
.preview-status {
  width: min(1400px, calc(100% - 80px));
  margin: 0 auto;
  padding: 13px 0;
  color: var(--muted);
  font-size: 0.84rem;
}
.preview-status::before {
  content: "本地預覽";
  display: inline-block;
  margin-right: 8px;
  padding: 1px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: var(--card);
  font-weight: 750;
}

.edition-bar {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  padding: 14px clamp(2.5rem, 5vw, 5rem);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.86rem;
}

.product-path-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(360px, 0.94fr);
  min-height: 568px;
  border-bottom: 1px solid var(--line);
  background: var(--card);
}
.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.5rem;
  padding: clamp(2.25rem, 5vw, 4.25rem) clamp(2.5rem, 5vw, 5rem) 2rem;
}
.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}
.product-path-hero h1,
.reader h1,
.hero h1 {
  max-width: 10.5em;
  margin: 1rem 0 1.25rem;
  color: var(--ink);
  font-size: clamp(2.45rem, 4.5vw, 4.6rem);
  line-height: 1.06;
  letter-spacing: -0.055em;
}
.summary {
  max-width: 54ch;
  margin: 0;
  color: #314152;
  font-size: clamp(1.05rem, 1.3vw, 1.25rem);
  line-height: 1.7;
}
.task-path {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}
.task-path li {
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--ink);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}
.code-strip {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  max-width: 620px;
  padding: 0.76rem 0.85rem 0.76rem 1rem;
  border: 1px solid var(--ink);
  background: var(--card);
}
.code-strip span:first-child { color: var(--muted); font-size: 0.88rem; }
.review-strip { display: grid; gap: 0.35rem; max-width: 620px; padding: 0.9rem 1rem; border: 1px solid var(--ink); background: var(--card); }
.review-strip span { color: var(--muted); font-size: 0.78rem; }
.review-strip strong { font-size: 0.88rem; line-height: 1.45; }
code { font: 800 1.12rem/1.2 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: 0.1em; }
.copy-button {
  min-height: 42px;
  padding: 0.55rem 0.75rem;
  border: 0;
  color: #fff;
  background: var(--ink);
  cursor: pointer;
  font: 800 0.78rem/1 Inter, ui-sans-serif, sans-serif;
  letter-spacing: 0.04em;
}
.copy-status { min-height: 1.2em; margin: 0.55rem 0 0; color: var(--muted); font-size: 0.82rem; }
.invite-benefit, .invite-benefit-note { grid-column: 1 / -1; margin: 0; }
.invite-benefit { color: var(--ink); font-weight: 800; font-size: 0.92rem; line-height: 1.4; }
.invite-benefit-note { color: var(--muted); font-size: 0.78rem; line-height: 1.4; }
.registration-spotlight {
  display: grid;
  gap: 0.25rem;
  max-width: 620px;
  padding: 0.85rem 1rem;
  border: 1px solid var(--ink);
  color: var(--ink);
  background: var(--signal);
  text-decoration: none;
}
.registration-spotlight span { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.1em; }
.registration-spotlight strong { font-size: 1rem; }
.registration-spotlight small { color: #314152; line-height: 1.45; }
.content-link {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding-bottom: 0.35rem;
  border-bottom: 2px solid var(--ink);
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}
.content-link::after { content: "→"; font-size: 1.25rem; line-height: 1; }

.hero-visual {
  display: grid;
  align-items: center;
  margin: 0;
  padding: clamp(1.5rem, 4vw, 4.75rem);
  background: var(--lavender);
}
.visual-frame { overflow: hidden; border: 1px solid rgba(23, 33, 43, 0.24); background: var(--ink); box-shadow: 18px 18px 0 var(--signal); }
.visual-frame img { display: block; width: 100%; height: auto; }
.hero-visual figcaption { margin-top: 1rem; color: var(--muted); font-size: 0.8rem; line-height: 1.5; }

.promise {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 1.2rem;
  padding: 1.35rem clamp(2.5rem, 5vw, 5rem) 1.65rem;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.promise-mark { color: #4a7a00; font-size: 0.76rem; font-weight: 800; letter-spacing: 0.1em; }
.promise p { max-width: 76ch; margin: 0; color: #314152; }

.guide-index { border-bottom: 1px solid var(--line); background: var(--card); }
.task-band {
  display: grid;
  grid-template-columns: 112px minmax(0, 1.15fr) minmax(260px, 0.85fr);
  gap: 1.5rem;
  padding: 2rem clamp(2.5rem, 5vw, 5rem);
  border-top: 1px solid var(--line);
}
.task-band:first-child { border-top: 0; }
.task-band-mark { color: #4a7a00; font-size: 0.76rem; font-weight: 800; letter-spacing: 0.1em; }
.task-band h2 { margin: 0; font-size: clamp(1.35rem, 2vw, 1.75rem); line-height: 1.2; }
.task-band h2 a { color: var(--ink); text-decoration: none; }
.task-band h2 a:hover { color: var(--link); }
.task-band p { margin: 0.55rem 0 0; color: var(--muted); }
.task-band-links p { margin-top: 0; font-size: 0.86rem; }
.task-band-links ul { margin: 0.45rem 0 0.75rem; padding-left: 1.1rem; }
.task-band-links li { margin: 0.28rem 0; }
.text-link { color: var(--ink); font-size: 0.9rem; font-weight: 800; }

.reader,
.hero:not(.product-path-hero) {
  width: min(900px, calc(100% - 80px));
  margin: 28px auto;
  padding: clamp(28px, 5vw, 62px);
  border: 1px solid var(--line);
  background: var(--card);
}
.reader > .eyebrow { color: #4a7a00; }
.reader > h1 { font-size: clamp(2rem, 4.2vw, 3.25rem); }
.lede { max-width: 720px; margin: 24px 0 38px; color: #394b65; font-size: 1.15rem; }
.reader section { margin-top: 36px; }
.reader h2 { margin: 0 0 12px; font-size: 1.3rem; line-height: 1.28; }
.reader p { max-width: 760px; }
.reader li { margin: 7px 0; }
.safety-note { margin: 28px 0 38px; padding: 22px 24px; border-left: 4px solid #6c2bd9; background: #f0efff; }
.safety-note p:last-child { margin-bottom: 0; }
.registration-invite { padding: 22px 24px; border: 1px solid var(--ink); background: #f7ffe9; }
.registration-invite h2 { margin: 0 0 0.5rem; }
.registration-invite p { margin: 0 0 1rem; }
.invite-code-panel { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 0.8rem; padding: 0.76rem 0.85rem 0.76rem 1rem; border: 1px solid var(--ink); background: var(--card); }
.invite-code-panel .copy-status { grid-column: 1 / -1; margin: 0; }
.record-list { display: grid; gap: 14px; margin-top: 28px; }
.record-list article { padding: 24px; border: 1px solid var(--line); background: var(--card); }
.record-list h2 { margin: 0; font-size: 1.3rem; }
.record-list h2 a { color: var(--ink); text-decoration: none; }
.metadata { color: var(--muted); font-size: 0.9rem; }
details { margin-top: 38px; padding: 16px 18px; border: 1px solid var(--line); background: #f9fbfe; }
summary { cursor: pointer; font-weight: 800; }
details ul { color: var(--muted); }

@media (max-width: 720px) {
  .header-inner,
  .preview-status { width: min(100% - 28px, 1400px); }
  .header-inner { min-height: 60px; gap: 14px; }
  .edition { display: none; }
  nav { gap: 16px; }
  nav a { font-size: 0.81rem; }
  .preview-status { padding: 10px 0; font-size: 0.76rem; }
  .edition-bar { padding: 0.75rem 1.25rem; font-size: 0.78rem; }
  .edition-bar span:last-child { display: none; }
  .product-path-hero { grid-template-columns: 1fr; min-height: 0; }
  .hero-copy { padding: 2rem 1.25rem 1.5rem; gap: 1.25rem; }
  .product-path-hero h1,
  .reader h1,
  .hero h1 { max-width: 11ch; margin: 0.65rem 0 0.85rem; font-size: clamp(2.15rem, 10.2vw, 2.65rem); }
  .summary { font-size: 0.98rem; line-height: 1.55; }
  .task-path { gap: 0.35rem; }
  .task-path li { padding: 0.42rem 0.48rem; font-size: 0.61rem; }
  .code-strip { grid-template-columns: 1fr auto; gap: 0.55rem; }
  .code-strip span:first-child { grid-column: 1 / -1; }
  .copy-button { min-width: 72px; }
  .registration-spotlight { padding: 0.75rem 0.8rem; }
  .hero-visual { padding: 1.75rem 1.25rem 2.5rem; }
  .visual-frame { box-shadow: 10px 10px 0 var(--signal); }
  .promise { grid-template-columns: 1fr; gap: 0.55rem; padding: 1.2rem 1.25rem 1.4rem; }
  .task-band { grid-template-columns: 1fr; gap: 0.65rem; padding: 1.55rem 1.25rem; }
  .task-band-links { padding-top: 0.5rem; border-top: 1px solid var(--line); }
  .reader,
  .hero:not(.product-path-hero) { width: min(100% - 28px, 900px); padding: 28px 22px; }
  .invite-code-panel { grid-template-columns: 1fr auto; gap: 0.55rem; }
  .invite-code-panel span { grid-column: 1 / -1; }
}

/* 2026-07-31 audit fixes: accessibility, mobile header, tools and footer. */
.skip-link {
  position: fixed;
  z-index: 20;
  top: 8px;
  left: 8px;
  transform: translateY(-150%);
  padding: 0.65rem 0.85rem;
  border: 2px solid var(--ink);
  color: var(--ink);
  background: var(--signal);
  font-weight: 800;
}
.skip-link:focus { transform: translateY(0); }

nav a,
.locale-switcher a,
.locale-switcher span,
.copy-button {
  min-height: 44px;
}
nav a,
.locale-switcher a,
.locale-switcher span {
  display: inline-flex;
  align-items: center;
}
nav {
  scrollbar-width: none;
}
nav::-webkit-scrollbar { display: none; }
.copy-button { min-height: 44px; }
.code-strip .copy-status,
.invite-code-panel .copy-status { grid-column: 1 / -1; margin: 0; }

.tool-workbench {
  margin: 2rem 0;
  padding: clamp(1.25rem, 4vw, 2rem);
  border: 1px solid var(--ink);
  background: #f7ffe9;
}
.tool-kicker {
  margin: 0;
  color: #4a7a00;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.tool-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}
.tool-fields label:not(.check-field) {
  display: grid;
  gap: 0.4rem;
  color: var(--ink);
  font-weight: 750;
}
.tool-fields input[type="number"],
.tool-fields select {
  width: 100%;
  min-height: 44px;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--ink);
  color: var(--ink);
  background: var(--card);
  font: inherit;
}
.check-field {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 0.65rem;
  min-height: 44px;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--line);
  background: var(--card);
}
.check-field input { width: 22px; height: 22px; margin: 0; }
.tool-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.25rem; }
.tool-actions button {
  min-height: 44px;
  padding: 0.65rem 1rem;
  border: 1px solid var(--ink);
  cursor: pointer;
  font: 800 0.9rem/1.2 inherit;
}
.tool-submit { color: #fff; background: var(--ink); }
.tool-reset { color: var(--ink); background: var(--card); }
.tool-error { padding: 0.75rem; border-left: 4px solid #a61b1b; color: #7a1111; background: #fff0f0; }
.tool-result { margin-top: 1.25rem; padding: 1rem; border: 1px solid var(--ink); background: var(--card); }
.tool-result h3 { margin: 0 0 0.55rem; font-size: 1rem; }
.tool-result p:last-child { margin-bottom: 0; }

.site-footer {
  width: min(1400px, calc(100% - 80px));
  margin: 0 auto;
  padding: 1.5rem 0 2rem;
  border-top: 1px solid var(--line);
}
.site-footer p { margin: 0 0 0.75rem; color: var(--muted); }
.site-footer nav { justify-content: flex-start; margin-left: 0; }

.language-gateway {
  width: min(760px, calc(100% - 32px));
  min-height: 70vh;
  display: grid;
  align-content: center;
  gap: 1rem;
  padding: 3rem 0;
}
.language-gateway h1 { margin: 0; font-size: clamp(2.2rem, 7vw, 4.5rem); line-height: 1.05; }
.language-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.language-options a { display: grid; gap: 0.35rem; min-height: 96px; padding: 1rem; border: 1px solid var(--ink); color: var(--ink); background: var(--card); text-decoration: none; }
.language-options strong { font-size: 1.3rem; }
.language-options span { color: var(--muted); }

@media (max-width: 720px) {
  .header-inner { flex-wrap: wrap; align-content: center; padding: 0.45rem 0; }
  .brand { order: 1; }
  .locale-switcher { order: 2; margin-left: auto; }
  .header-inner > nav { order: 3; flex: 1 0 100%; width: 100%; margin-left: 0; gap: 6px; }
  .header-inner > nav a { flex: 0 0 auto; padding: 0.55rem 0.65rem; }
  .preview-status::before { content: none; }
  .product-path-hero h1 { font-size: clamp(2rem, 9.6vw, 2.5rem); }
  .hero-copy { padding-top: 1.5rem; }
  .code-strip { padding: 0.7rem; }
  .tool-fields { grid-template-columns: 1fr; }
  .site-footer { width: min(100% - 28px, 1400px); }
  .site-footer nav { gap: 6px; }
  .site-footer nav a { padding: 0.55rem 0.65rem; }
  .language-options { grid-template-columns: 1fr; }
}

 .header-inner > nav { min-width: 0; flex: 1 1 auto; }
nav a { min-height: 44px; }
.locale-switcher a, .locale-switcher span { min-height: 44px; }
