/* Design: "紅筆校稿" — the checker is a proofreading desk; red-pen wavy underline is the one bold element. */
:root {
  --desk: #eef1f4; --paper: #ffffff; --ink: #18212b; --muted: #5a6573; --rule: #d6dce3; --rule-strong: #b9c2cc;
  --pen: #c8233a; --pen-bg: #fdecef; --amber: #9a5b00; --amber-bg: #fff4e0; --leaf: #1d7a4c; --leaf-bg: #e6f4ec;
  --link: #2448a8; --btn: #18212b; --btn-text: #ffffff; --focus: #2448a8;
  --serif: "Noto Serif TC", "Source Han Serif TC", "PMingLiU", serif;
  --sans: system-ui, -apple-system, "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  --radius: 6px; --read: 760px; --wide: 1120px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --desk: #12161b; --paper: #1a2027; --ink: #e6e9ed; --muted: #9aa5b1; --rule: #2c343d; --rule-strong: #3d4752;
    --pen: #ff6b7f; --pen-bg: #3a1c23; --amber: #f0b45a; --amber-bg: #33270f; --leaf: #6fd09c; --leaf-bg: #15302a;
    --link: #8fb0ff; --btn: #e6e9ed; --btn-text: #12161b; --focus: #8fb0ff;
  }
}
:root[data-theme="dark"] {
  --desk: #12161b; --paper: #1a2027; --ink: #e6e9ed; --muted: #9aa5b1; --rule: #2c343d; --rule-strong: #3d4752;
  --pen: #ff6b7f; --pen-bg: #3a1c23; --amber: #f0b45a; --amber-bg: #33270f; --leaf: #6fd09c; --leaf-bg: #15302a;
  --link: #8fb0ff; --btn: #e6e9ed; --btn-text: #12161b; --focus: #8fb0ff;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--desk); color: var(--ink); font: 16px/1.75 var(--sans); }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.wrap { max-width: var(--read); margin: 0 auto; padding: 0 16px; }
body.wide .wrap { max-width: var(--wide); }

/* header / footer */
header.site { background: var(--paper); border-bottom: 1px solid var(--rule); }
header.site .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 24px; min-height: 60px; }
header.site .brand { font-family: var(--serif); font-weight: 700; font-size: 1.15rem; color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; gap: 10px; }
header.site .brand svg { flex: none; }
header.site nav { display: flex; flex-wrap: wrap; gap: 4px 20px; flex: 1; justify-content: flex-end; }
header.site nav a { color: var(--muted); text-decoration: none; font-size: .95rem; }
header.site nav a:hover { color: var(--ink); }
.theme-btn { background: none; border: 1px solid var(--rule); color: var(--muted); border-radius: var(--radius); padding: 4px 10px; cursor: pointer; font-size: .85rem; }
footer.site { border-top: 1px solid var(--rule); padding: 28px 0 48px; color: var(--muted); font-size: .9rem; background: var(--paper); }
footer.site a { color: var(--muted); }
footer.site nav { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-bottom: 10px; }
main { padding: 32px 0 64px; }

/* type */
h1, h2 { font-family: var(--serif); font-weight: 700; letter-spacing: .01em; }
h1 { font-size: clamp(1.7rem, 1.2rem + 2.2vw, 2.6rem); line-height: 1.3; margin: 0 0 12px; }
h2 { font-size: 1.35rem; line-height: 1.4; margin: 48px 0 14px; }
h3 { font-size: 1.05rem; margin: 22px 0 6px; }
.lead { font-size: 1.08rem; color: var(--muted); margin: 0 0 8px; max-width: 46em; }
.meta { font-size: .86rem; color: var(--muted); }
.breadcrumb { font-size: .88rem; color: var(--muted); margin: 0 0 14px; }
.breadcrumb a { color: var(--muted); }
p, li { max-width: 46em; }

/* home hero */
.hero { margin-bottom: 20px; }
.facts { display: flex; flex-wrap: wrap; gap: 6px 22px; padding: 0; margin: 14px 0 0; list-style: none; font-size: .92rem; color: var(--muted); }
.facts li { display: inline-flex; align-items: center; gap: 8px; }
.facts li::before { content: ""; width: 14px; height: 2px; background: var(--rule-strong); }

/* quiet risk note */
.disclaimer-bar { border-left: 3px solid var(--amber); background: var(--paper); padding: 10px 14px; margin: 16px 0; font-size: .92rem; color: var(--muted); border-radius: 0 var(--radius) var(--radius) 0; }
.disclaimer-bar strong { color: var(--ink); }

/* checker = proofreading desk */
.checker { display: grid; gap: 0; background: var(--paper); border: 1px solid var(--rule); border-radius: 10px; margin: 18px 0; overflow: hidden; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.pane { padding: 18px; min-width: 0; }
.pane-out { border-top: 1px solid var(--rule); background: var(--paper); }
body.wide .checker { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
body.wide .pane-out { border-top: 0; border-left: 1px solid var(--rule); }
@media (max-width: 880px) { body.wide .checker { grid-template-columns: 1fr; } body.wide .pane-out { border-left: 0; border-top: 1px solid var(--rule); } }
.pane-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-bottom: 10px; }
.pane-title { font-family: var(--serif); font-weight: 700; font-size: 1.05rem; margin: 0; }
.checker .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.checker label { font-size: .9rem; color: var(--muted); }
.checker select { font: inherit; font-size: .95rem; padding: 5px 10px; border-radius: var(--radius); border: 1px solid var(--rule); background: var(--paper); color: var(--ink); }
.checker textarea { width: 100%; min-height: 220px; font: inherit; font-size: 1.02rem; line-height: 1.8; padding: 12px 14px; border-radius: var(--radius); border: 1px solid var(--rule); background: var(--desk); color: var(--ink); resize: vertical;
  background-image: linear-gradient(transparent calc(1.8em - 1px), var(--rule) 1px); background-size: 100% 1.8em; background-position: 0 12px; background-attachment: local; }
.checker textarea:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: transparent; }
.actions { margin-top: 12px; }
.btn { font: inherit; font-size: .98rem; padding: 8px 16px; border-radius: var(--radius); border: 1px solid var(--rule-strong); background: var(--paper); color: var(--ink); cursor: pointer; }
.btn:hover { border-color: var(--ink); }
.btn.primary { background: var(--btn); color: var(--btn-text); border-color: var(--btn); font-weight: 700; padding-inline: 22px; }
.btn.primary:hover { opacity: .9; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.privacy-note { font-size: .86rem; color: var(--muted); margin: 10px 0 0; }

/* empty state shows what a marked line looks like */
.empty { color: var(--muted); font-size: .95rem; }
.empty .sample { font-size: 1.02rem; color: var(--ink); line-height: 2.1; margin: 6px 0 14px; }
.empty ul { padding-left: 1.1em; margin: 0; }
.result:not([hidden]) + .empty { display: none; }

/* results */
.summary { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 6px; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .84rem; font-weight: 700; white-space: nowrap; border: 1px solid transparent; }
.badge.red { background: var(--pen-bg); color: var(--pen); }
.badge.orange { background: var(--amber-bg); color: var(--amber); }
.badge.green { background: var(--leaf-bg); color: var(--leaf); }
.badge.none { background: var(--desk); color: var(--muted); }
.verdict-line { font-weight: 700; margin: 6px 0 10px; }
.highlight { white-space: pre-wrap; word-break: break-word; font-size: 1.02rem; line-height: 2.2; padding: 4px 0 8px; }
mark { background: none; color: inherit; cursor: pointer; padding: 0 1px; text-underline-offset: 5px; text-decoration-skip-ink: none; }
mark.red { text-decoration: underline wavy var(--pen); text-decoration-thickness: 1.5px; background: var(--pen-bg); }
mark.orange { text-decoration: underline dotted var(--amber); text-decoration-thickness: 2px; }
mark.green { text-decoration: underline solid var(--leaf); text-decoration-thickness: 1.5px; }
mark:hover { background: var(--desk); }
ol.cards { list-style: none; padding: 0; margin: 14px 0; display: grid; gap: 0; counter-reset: note; border-top: 1px solid var(--rule); }
ol.cards > li { counter-increment: note; position: relative; padding: 12px 4px 12px 40px; border-bottom: 1px solid var(--rule); }
ol.cards > li::before { content: counter(note); position: absolute; left: 4px; top: 14px; width: 24px; height: 24px; border-radius: 50%; font-size: .78rem; font-weight: 700; display: grid; place-items: center; background: var(--desk); color: var(--muted); }
ol.cards > li.red::before { background: var(--pen); color: #fff; }
ol.cards > li.orange::before { background: var(--amber); color: #fff; }
ol.cards > li.green::before { background: var(--leaf); color: #fff; }
ol.cards > li.flash { background: var(--desk); }
.card-title { font-weight: 700; display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; }
.card-title .ph { font-size: 1.05rem; }
.card p { margin: 6px 0; }
ol.cards p { margin: 4px 0; }
.tag { display: inline-block; font-size: .76rem; padding: 0 7px; border-radius: 4px; border: 1px solid var(--rule); color: var(--muted); font-weight: 400; }
.src { font-size: .86rem; color: var(--muted); margin: 6px 0 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 6px 0; list-style: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--rule); border-radius: var(--radius); padding: 2px 4px 2px 10px; background: var(--paper); font-size: .92rem; }
.chip button { border: 0; background: var(--desk); color: var(--ink); border-radius: 4px; padding: 1px 8px; cursor: pointer; font-size: .8rem; }
.chip button:hover { background: var(--rule); }
.chip button.copied { background: var(--leaf); color: #fff; }
ul.bad { padding-left: 1.2em; }
ul.bad li::marker { color: var(--pen); }

/* q pages: three-category verdict sheet */
.answers { display: grid; gap: 0; background: var(--paper); border: 1px solid var(--rule); border-radius: 10px; overflow: hidden; }
.answers .card { margin: 0; padding: 16px 18px; border-bottom: 1px solid var(--rule); }
.answers .card:last-child { border-bottom: 0; }
.answers h3 { margin: 0 0 4px; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.answers h3 .meta { font-size: .9rem; min-width: 4.5em; }
.card { background: var(--paper); border: 1px solid var(--rule); border-radius: 10px; padding: 16px; margin: 12px 0; }

/* fake door */
.fakedoor { background: var(--paper); border: 1px solid var(--rule); border-top: 3px solid var(--ink); border-radius: 0 0 10px 10px; padding: 20px; margin: 48px 0; }
.fakedoor h2 { margin-top: 0; }
.fakedoor form { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
.fakedoor input[type=email] { flex: 1 1 240px; font: inherit; padding: 8px 12px; border-radius: var(--radius); border: 1px solid var(--rule-strong); background: var(--paper); color: var(--ink); }
.fakedoor .hp { position: absolute; left: -9999px; }
.fd-msg { margin: 8px 0 0; font-size: .92rem; color: var(--muted); }

/* tables & link lists */
table.src-table { border-collapse: collapse; width: 100%; font-size: .9rem; background: var(--paper); }
table.src-table th, table.src-table td { border-bottom: 1px solid var(--rule); padding: 8px 10px; text-align: left; vertical-align: top; }
table.src-table th { color: var(--muted); font-weight: 600; border-bottom-color: var(--rule-strong); }
.grid-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 0 20px; padding: 0; margin: 0; list-style: none; }
.grid-links li { border-bottom: 1px solid var(--rule); }
.grid-links a { display: block; padding: 10px 2px; color: var(--ink); text-decoration: none; }
.grid-links a:hover { color: var(--link); text-decoration: underline; }
.two-col { display: grid; gap: 8px 40px; }
@media (min-width: 880px) { .two-col { grid-template-columns: 1fr 1fr; } }
.two-col h2 { margin-top: 32px; }

@media (max-width: 560px) {
  main { padding-top: 22px; }
  .pane { padding: 14px; }
  .actions .btn { flex: 1 1 auto; }
  header.site nav { justify-content: flex-start; order: 3; flex-basis: 100%; padding-bottom: 8px; }
  header.site .brand { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
