:root {
 color-scheme: light;
 --bg: #f3efe6;
 --surface: #fffdf8;
 --paper: #fffef9;
 --text: #22201c;
 --muted: #6f6a60;
 --line: #ddd6c8;
 --line-strong: #b9b0a0;
 --accent: #c2362b;
 --accent-ink: #ffffff;
 --accent-soft: #f8e3df;
 --ok: #2f6b3a;
 --focus: #2f62c9;
 --mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", "Noto Sans Mono CJK TC", "Microsoft JhengHei UI", monospace;
 --sans: system-ui, -apple-system, "Segoe UI", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
}
:root[data-color-scheme="dark"] {
 color-scheme: dark;
 --bg: #17151a;
 --surface: #211f25;
 --paper: #f4efe3;
 --text: #ece8df;
 --muted: #a7a196;
 --line: #3a3640;
 --line-strong: #5a5560;
 --accent: #ff6a5c;
 --accent-ink: #1b0d0b;
 --accent-soft: #3d1f1d;
 --ok: #7fc98b;
 --focus: #8fb0ff;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
 margin: 0; min-height: 100vh; display: flex; flex-direction: column; color: var(--text); font: 16px/1.7 var(--sans);
 background: var(--bg) url("/pattern-light.svg") repeat; background-size: 240px;
}
:root[data-color-scheme="dark"] body { background-image: url("/pattern-dark.svg"); }
a { color: inherit; }
code { font-family: var(--mono); font-size: .9em; background: var(--line); padding: 1px 5px; border-radius: 4px; word-break: break-all; }
h1, h2 { line-height: 1.3; font-weight: 700; }
h1:focus, h2:focus { outline: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
[hidden] { display: none !important; }

button, .store-links a, .file-pick span {
 font: inherit; font-size: 15px; color: var(--text); background: var(--surface); border: 1px solid var(--line-strong);
 border-radius: 10px; padding: 9px 16px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; min-height: 42px;
}
button:hover, .store-links a:hover, .file-pick span:hover { border-color: var(--text); }
button:focus-visible, a:focus-visible, select:focus-visible, .file-pick input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
button:disabled { opacity: .55; cursor: progress; }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
button.primary:hover { filter: brightness(1.06); }
button.danger { color: var(--accent); border-color: var(--accent); }
.link-button { border: 0; background: none; padding: 4px 0; min-height: 0; color: var(--muted); text-decoration: underline; font-family: var(--mono); font-size: 13px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 6px; }
.actions.center { justify-content: center; }
select { font: inherit; font-size: 14px; color: var(--text); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px; padding: 4px 8px; }

.site-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; max-width: 920px; width: 100%; margin: 0 auto; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; text-decoration: none; font-size: 17px; }
.brand-mark { display: inline-grid; place-items: center; width: 32px; height: 32px; border: 2px solid var(--accent); color: var(--accent); border-radius: 6px; transform: rotate(-8deg); font-size: 17px; }
.site-header nav { display: flex; align-items: center; gap: 14px; font-size: 14px; }
main { flex: 1; width: 100%; max-width: 720px; margin: 0 auto; padding: 8px 20px 40px; }
.site-footer { text-align: center; color: var(--muted); font-size: 12px; padding: 18px 20px 28px; }

.intro { padding: 5vh 0 4vh; display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 28px; align-items: center; }
.intro-text { grid-row: 1; grid-column: 1; }
.hero-art { grid-row: 1; grid-column: 2; width: 100%; height: auto; transform: rotate(3deg); }
.sting {
 text-align: center; font-size: 19px; line-height: 1.6; margin: 26px auto 8px; padding: 16px 18px; max-width: 30em;
 border: 2px dashed var(--accent); border-radius: 14px; background: var(--surface);
}
.sting em { font-style: normal; color: var(--accent); font-weight: 700; }
.eyebrow { color: var(--accent); font-weight: 700; font-size: 14px; letter-spacing: .08em; margin: 0 0 10px; }
.intro h1 { font-size: clamp(34px, 7vw, 56px); margin: 0 0 18px; letter-spacing: -.01em; }
.lead { font-size: 18px; color: var(--muted); max-width: 34em; margin: 0; }
.fineprint { font-size: 13px; color: var(--muted); margin-top: 18px; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 20px 22px 24px; margin-top: 12px; }
.panel h1 { font-size: 26px; margin: 6px 0 4px; }
.panel h2 { font-size: 20px; margin: 18px 0 6px; }
.panel ol { padding-left: 1.3em; }
.panel li { margin: 6px 0; }
.back-link { border: 0; background: none; padding: 0; min-height: 0; color: var(--muted); font-size: 14px; }
.steps { list-style: none; padding: 0 !important; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 16px 0 4px; }
.steps li { margin: 0 !important; }
.steps button { width: 100%; justify-content: center; font-size: 13px; padding: 8px 4px; min-height: 38px; }
.steps button[aria-current="step"] { background: var(--text); color: var(--surface); border-color: var(--text); font-weight: 700; }
.host-list { display: grid; gap: 8px; margin: 10px 0; }
.host-list div { display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px dashed var(--line-strong); border-radius: 10px; padding: 8px 8px 8px 12px; }
.host-list button { min-height: 34px; padding: 4px 12px; font-size: 13px; flex: none; }
details { margin: 14px 0; }
summary { cursor: pointer; color: var(--muted); font-size: 14px; }
.feedback { margin: 14px 0 0; padding: 10px 14px; border-radius: 10px; background: var(--bg); font-size: 14px; }
.feedback.error { background: var(--accent-soft); color: var(--accent); }
.file-pick { display: inline-block; margin: 14px 0 4px; }
.file-pick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.file-pick span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }

.printing { text-align: center; padding: 12vh 0; font-family: var(--mono); color: var(--muted); }
.printer { width: 180px; height: 120px; margin: 0 auto 18px; position: relative; overflow: hidden; }
.printer::before { content: ""; position: absolute; left: 10px; right: 10px; top: 0; height: 26px; background: var(--text); border-radius: 8px; z-index: 1; }
.paper { position: absolute; left: 30px; right: 30px; top: 14px; height: 120px; background: var(--paper); border: 1px solid var(--line-strong); animation: feed 1.2s linear infinite; }
.paper::after { content: ""; position: absolute; inset: 14px 12px; background: repeating-linear-gradient(#bbb 0 2px, transparent 2px 10px); opacity: .6; }
@keyframes feed { from { transform: translateY(-100%); } to { transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .paper { animation: none; } }

.receipt {
 position: relative; max-width: 440px; margin: 18px auto 0; padding: 26px 22px 34px; background: var(--paper); color: #24211c;
 font-family: var(--mono); font-size: 14px; line-height: 1.6; border: 1px solid #d9d1c0;
 -webkit-mask: radial-gradient(circle 7px at 50% 100%, transparent 6.5px, #000 7px) 0 0 / 16px 100% repeat-x;
 mask: radial-gradient(circle 7px at 50% 100%, transparent 6.5px, #000 7px) 0 0 / 16px 100% repeat-x;
}
.receipt p { margin: 0; }
.receipt-head { text-align: center; padding-bottom: 12px; border-bottom: 1.5px dashed #b6ad9c; margin-bottom: 10px; color: #4b463d; font-size: 13px; }
.receipt-title { font-size: 19px; font-weight: 700; color: #24211c; letter-spacing: .12em; margin-bottom: 4px !important; }
.lines { list-style: none; margin: 0; padding: 0; }
.lines li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; padding: 3px 0; align-items: baseline; }
.lines .item { overflow-wrap: anywhere; }
.lines .qty { color: #6b6559; }
.lines .sub { min-width: 5.5em; text-align: right; }
.lines .rest { color: #6b6559; }
.receipt .link-button { color: #6b6559; }
.total { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; border-top: 1.5px dashed #b6ad9c; margin-top: 10px; padding-top: 12px; }
.total span { font-size: 15px; }
.total strong { font-size: clamp(26px, 7vw, 34px); color: #b52a1f; letter-spacing: -.02em; transition: filter .3s; }
.total-sub { text-align: right; color: #6b6559; font-size: 12px; }
.receipt-foot { text-align: center; color: #8a8374; font-size: 11px; margin-top: 18px !important; }
.stamp {
 position: absolute; right: 18px; top: 92px; transform: rotate(-14deg); border: 3px solid #c2362b; color: #c2362b;
 border-radius: 8px; padding: 2px 12px; font: 700 20px/1.4 var(--sans); letter-spacing: .1em; opacity: .82; pointer-events: none;
}
.receipt.covered .lines .sub, .receipt.covered .total strong { filter: blur(9px); }

.verdict { text-align: center; margin: 26px auto 10px; max-width: 32em; }
.roast { font-size: 20px; font-weight: 700; margin: 0 0 6px; }
.jab { margin: 0; font-size: 15px; }
.compare { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 18px 0; }
.compare-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: grid; gap: 2px; }
.compare-card span { color: var(--muted); font-size: 13px; }
.compare-card strong { font-size: 22px; }
.compare-card small { font-size: 14px; font-weight: 400; color: var(--muted); }
.manage { max-width: 440px; margin: 10px auto 0; }

.guide h1 { font-size: 30px; margin: 10px 0 6px; }
.guide h2 { font-size: 20px; margin: 30px 0 6px; padding-top: 10px; border-top: 1px dashed var(--line-strong); }
.guide li { margin: 6px 0; }

@media (max-width: 640px) {
 .intro { grid-template-columns: 1fr; gap: 8px; padding-top: 2vh; }
 .hero-art { grid-row: 1; grid-column: 1; width: 170px; justify-self: center; }
 .intro-text { grid-row: 2; }
}
@media (max-width: 520px) {
 .site-header { padding: 12px 16px; }
 .sting { font-size: 17px; }
 main { padding: 4px 16px 32px; }
 .panel { padding: 16px; border-radius: 14px; }
 .steps button { font-size: 12px; }
 .receipt { padding: 22px 16px 30px; font-size: 13px; }
 .stamp { top: 84px; right: 10px; font-size: 17px; }
}
