/* 設計師 AI 工具箱：共用樣式。黑白灰為主，顏色只用在狀態；全部黑體，用粗細做層次 */
:root {
  --bg: #f6f7f8; --surface: #ffffff; --ink: #15171c; --muted: #6b7080; --faint: #9a9fac;
  --line: #e3e5e9; --accent: #15171c; --on-accent: #ffffff; --hover: #f0f1f3;
  --red: #c0453a; --amber: #a86e00; --green: #2e7b53; --green-bg: #e9f4ee; --blue: #3b6897;
  --f-body: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1013; --surface: #16171b; --ink: #ececef; --muted: #9a9eab; --faint: #6b6f7b; --line: #25272d;
    --accent: #ececef; --on-accent: #0f1013; --hover: #1c1e23;
    --red: #f08a80; --amber: #e3ad55; --green: #74c99c; --green-bg: #14261c; --blue: #8fb5df;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1013; --surface: #16171b; --ink: #ececef; --muted: #9a9eab; --faint: #6b6f7b; --line: #25272d;
  --accent: #ececef; --on-accent: #0f1013; --hover: #1c1e23;
  --red: #f08a80; --amber: #e3ad55; --green: #74c99c; --green-bg: #14261c; --blue: #8fb5df;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 15px; line-height: 1.75;
  -webkit-font-smoothing: antialiased; padding-inline: 20px; padding-block: 28px 80px; }
.wrap { max-width: 760px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; }
a { color: var(--ink); text-underline-offset: 3px; text-decoration-color: var(--faint); }

.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
.topbar a { color: var(--muted); text-decoration: none; font-weight: 500; }
.topbar a:hover { color: var(--ink); }
.brand { display: inline-flex; align-items: center; gap: 8px; letter-spacing: .08em; }
.brand::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--ink); }

header { display: grid; gap: 12px; }
.mark { font-size: 11px; font-weight: 500; letter-spacing: .14em; color: var(--faint); }
h1 { font-weight: 700; font-size: clamp(28px, 5vw, 38px); line-height: 1.25; letter-spacing: .02em; margin: 0; text-wrap: balance; }
h2 { font-size: 18px; font-weight: 700; margin: 0; }
h3 { font-size: 15px; font-weight: 700; margin: 0; }
.lede { margin: 0; color: var(--muted); font-weight: 300; font-size: 16px; max-width: 36em; }
.hint, .note { margin: 0; font-size: 13px; color: var(--faint); }
.note { color: var(--muted); max-width: 42em; }

section.block { display: grid; gap: 16px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding-bottom: 10px; border-bottom: 1px solid var(--line); }

.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 18px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field label, .label { font-size: 13px; font-weight: 500; color: var(--muted); }
input[type="text"], input[type="number"], select, textarea {
  width: 100%; font: inherit; font-size: 15px; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; min-width: 0; }
textarea { line-height: 1.7; resize: vertical; min-height: 90px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); }
input[type="number"] { font-variant-numeric: tabular-nums; }

.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface);
  border-radius: 999px; padding: 6px 13px; font-size: 14px; cursor: pointer; user-select: none; }
.opt input { accent-color: var(--ink); margin: 0; }
.opt:has(input:checked) { border-color: var(--ink); }

.btn { font: inherit; font-size: 15px; font-weight: 700; letter-spacing: .04em; color: var(--on-accent); background: var(--accent);
  border: 0; border-radius: 999px; padding: 11px 24px; cursor: pointer; }
.btn.small { font-size: 13px; padding: 6px 14px; }
.btn.line { color: var(--ink); background: none; border: 1px solid var(--line); }
.btn.line:hover { border-color: var(--ink); }
.btn:disabled { opacity: .35; cursor: not-allowed; }
.ghost { font: inherit; font-size: 13px; color: var(--muted); background: none; border: 0; padding: 0; cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line); }
.ghost:hover { color: var(--ink); }
.btn:focus-visible, .ghost:focus-visible, .opt:focus-within { outline: 2px solid var(--ink); outline-offset: 3px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px; display: grid; gap: 12px; min-width: 0; }
.out { display: grid; gap: 10px; }
.out-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.out pre { white-space: pre-wrap; word-break: break-word; font: inherit; font-size: 14px; line-height: 1.75; margin: 0;
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.step-no { font-size: 12px; font-weight: 700; color: var(--on-accent); background: var(--accent); border-radius: 999px; padding: 1px 9px; }
.toast { font-size: 13px; font-weight: 500; color: var(--green); }

.tabular { font-variant-numeric: tabular-nums; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th, table.t td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t th { font-size: 12px; font-weight: 500; color: var(--faint); }
table.t td.num, table.t th.num { text-align: right; font-variant-numeric: tabular-nums; }
.scroll { overflow-x: auto; }

footer { font-size: 12px; color: var(--faint); border-top: 1px solid var(--line); padding-top: 18px; }

@media (max-width: 600px) {
  body { padding-inline: 16px; padding-block: 20px 64px; }
  .grid2, .grid3 { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
