/* 回憶 Amemori — 舊紙、墨、苔、朱印：有厚度的紙感介面 */
:root {
  --paper: #f4efe4;
  --paper-2: #ebe3d2;
  --card: #fdfbf6;
  --lip: rgba(92, 70, 30, .13);
  --hi: rgba(255, 255, 255, .75);
  --c-money: #2e5a47; --c-life: #3b6683; --c-image: #b0522f; --c-text: #5a4a86; --c-fun: #a87a14; --c-dev: #46525d;
  --ink: #1c211e;
  --ink-2: #4b534e;
  --ink-3: #7c837d;
  --line: #d8d1c1;
  --line-2: #c6bda9;
  --moss: #2e5a47;
  --moss-2: #234838;
  --moss-soft: #dfe8e0;
  --rain: #4f6b80;
  --rain-soft: #e1e8ec;
  --stamp: #b8432c;
  --stamp-ink: #fbf3ea;
  --warn: #9a5b12;
  --bad: #a3321f;
  --good: #2e6b44;
  --focus: #2e5a47;
  --shadow: 0 1px 0 rgba(28, 33, 30, .04), 0 8px 24px -16px rgba(28, 33, 30, .25);
  --r: 6px;
  --serif: "Noto Serif TC", "Noto Serif JP", "Noto Serif KR", "Source Han Serif", "Songti TC", "Hiragino Mincho ProN", "Yu Mincho", "Nanum Myeongjo", "AppleMyungjo", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", "PingFang TC", "Hiragino Sans", "Apple SD Gothic Neo", "Microsoft JhengHei", "Yu Gothic UI", "Malgun Gothic", "Noto Sans CJK TC", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, "Roboto Mono", monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #151917; --paper-2: #1b201d; --card: #1d2320;
    --ink: #e9e5db; --ink-2: #b8b6ad; --ink-3: #868a83;
    --line: #2e3531; --line-2: #3c4540;
    --moss: #86bea2; --moss-2: #a3d2b9; --moss-soft: #22322a;
    --rain: #9ab3c6; --rain-soft: #222c33;
    --stamp: #d0614a; --stamp-ink: #1a1512;
    --warn: #e2a85a; --bad: #ef8b76; --good: #8fcf9f; --focus: #a3d2b9;
    --shadow: 0 1px 0 rgba(0,0,0,.2), 0 10px 30px -18px rgba(0,0,0,.6);
    --lip: rgba(0, 0, 0, .45); --hi: rgba(255, 255, 255, .04);
    --c-money: #86bea2; --c-life: #8db4d2; --c-image: #e39072; --c-text: #b4a6e6; --c-fun: #e2bd5c; --c-dev: #a9b6c2;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 16px/1.7 var(--sans); letter-spacing: .01em;
  background-image: radial-gradient(rgba(120, 100, 60, .045) 1px, transparent 1px);
  background-size: 5px 5px;
  min-height: 100vh; display: flex; flex-direction: column;
}
main { flex: 1; }
a { color: var(--moss); text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { color: var(--moss-2); }
img, svg, canvas { max-width: 100%; }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.3; letter-spacing: .02em; margin: 0; text-wrap: balance; }
.lead { text-wrap: pretty; }
p { margin: 0 0 1em; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
.wrap { width: min(1080px, 100% - 32px); margin-inline: auto; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; z-index: 99; background: var(--card); padding: 6px 12px; }
.muted { color: var(--ink-3); }
[hidden] { display: none !important; }

/* ---------- header ---------- */
.site-head { border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 20; }
.site-head .wrap { display: flex; align-items: center; gap: 20px; height: 58px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-family: var(--serif); font-weight: 700; font-size: 18px; letter-spacing: .06em; white-space: nowrap; }
.brand:hover { color: var(--ink); }
.brand .mark { width: 28px; height: 28px; flex: none; }
.brand.small { font-size: 15px; } .brand.small .mark { width: 22px; height: 22px; }
.cats { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; flex: 1; mask-image: linear-gradient(90deg, #000 90%, transparent); }
.cats::-webkit-scrollbar { display: none; }
.cats a { color: var(--ink-2); text-decoration: none; font-size: 14px; padding: 6px 10px; border-radius: 4px; white-space: nowrap; }
.cats a:hover, .cats a[aria-current] { color: var(--ink); background: var(--paper-2); }
.lang { position: relative; flex: none; }
.lang summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ink-2); padding: 6px 10px; border: 1px solid var(--line); border-radius: 4px; background: var(--card); }
.lang summary::-webkit-details-marker { display: none; }
.lang summary svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.4; }
.lang ul { position: absolute; right: 0; top: calc(100% + 6px); list-style: none; margin: 0; padding: 6px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); min-width: 150px; }
.lang li a { display: block; padding: 7px 12px; border-radius: 4px; color: var(--ink); text-decoration: none; font-size: 14px; }
.lang li a:hover { background: var(--paper-2); }
.lang li a[aria-current] { color: var(--moss); font-weight: 600; }
@media (max-width: 720px) {
  .site-head .wrap { flex-wrap: wrap; height: auto; padding: 10px 0 0; gap: 8px 12px; }
  .brand { flex: 1; }
  .cats { order: 3; flex-basis: 100%; margin: 0 -16px; padding: 0 12px 8px; }
  .lang summary span { display: none; }
}

/* ---------- typographic bits ---------- */
.kicker { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-3); letter-spacing: .08em; margin: 0 0 12px; }
.no { font-family: var(--mono); font-size: 12px; color: var(--stamp); border: 1px solid currentColor; padding: 1px 6px; border-radius: 3px; letter-spacing: .04em; }
.tag { font-size: 11px; color: var(--rain); background: var(--rain-soft); padding: 1px 7px; border-radius: 3px; margin-left: 6px; letter-spacing: .04em; font-family: var(--sans); font-weight: 500; vertical-align: 2px; }
.lead { color: var(--ink-2); font-size: 17px; max-width: 46em; }

/* ---------- home ---------- */
.hero { padding: 56px 0 28px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.hero h1 { font-size: clamp(30px, 5.2vw, 52px); max-width: 15em; margin-bottom: 16px; }
.search { margin-top: 24px; display: flex; align-items: center; gap: 10px; max-width: 520px; background: var(--card); border: 1px solid var(--line-2); border-radius: var(--r); padding: 0 14px; box-shadow: var(--shadow); }
.search:focus-within { border-color: var(--moss); }
.search svg { width: 18px; height: 18px; fill: none; stroke: var(--ink-3); stroke-width: 1.6; flex: none; }
.search input[type=search] { border: 0; background: none; padding: 13px 0; font: inherit; color: var(--ink); width: 100%; outline: none; box-shadow: none; border-radius: 0; -webkit-appearance: none; appearance: none; }
.empty { margin-top: 18px; color: var(--ink-3); }
.cat { padding: 32px 0 8px; scroll-margin-top: 80px; }
.cat > header { display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1px dashed var(--line-2); }
.cat > header h2 { font-size: 22px; }
.cat > header .count { margin-left: auto; color: var(--ink-3); font-size: 13px; }
.cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 12px; }
.card { display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 16px 18px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); text-decoration: none; color: var(--ink); transition: border-color .15s, transform .15s; position: relative; }
.card::after { content: ""; position: absolute; right: 14px; top: 18px; width: 7px; height: 7px; border-top: 1.5px solid var(--line-2); border-right: 1.5px solid var(--line-2); transform: rotate(45deg); transition: border-color .15s, right .15s; }
.card:hover { border-color: var(--moss); color: var(--ink); }
.card:hover::after { border-color: var(--moss); right: 11px; }
.card strong { font-size: 16px; padding-right: 18px; }
.card span:not(.tag) { font-size: 13.5px; color: var(--ink-2); line-height: 1.55; }

/* ---------- tool page ---------- */
.crumbs { display: flex; gap: 8px; font-size: 13px; color: var(--ink-3); padding: 20px 0 0; }
.crumbs a { color: var(--ink-3); text-decoration: none; } .crumbs a:hover { color: var(--moss); }
.tool-head { padding: 22px 0 22px; }
.tool-head h1 { font-size: clamp(28px, 4.4vw, 40px); margin-bottom: 10px; }
.tool { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: clamp(16px, 3vw, 28px); box-shadow: var(--shadow); }
.local-note { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-3); margin: 12px 2px 0; }
.local-note svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.3; flex: none; }
.notes { display: grid; gap: 8px; margin-top: 40px; max-width: 760px; }
.notes section { padding: 6px 0 14px; }
.notes h2, .related h2 { font-size: 20px; margin-bottom: 12px; display: flex; align-items: center; gap: 10px; }
.notes h2::before, .related h2::before { content: ""; width: 14px; height: 2px; background: var(--stamp); }
.notes p, .notes li { color: var(--ink-2); }
.how ol { margin: 0; padding-left: 1.3em; } .how li { margin-bottom: 4px; }
.faq details { border-top: 1px solid var(--line); padding: 2px 0; }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; padding: 12px 28px 12px 0; font-weight: 600; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 10px; font-family: var(--mono); color: var(--ink-3); font-size: 18px; }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 0 0 14px; }
.related { margin: 36px 0 56px; }
.ad { margin: 28px 0; min-height: 100px; text-align: center; }
.ad-label { display: block; font-size: 11px; color: var(--ink-3); letter-spacing: .1em; margin-bottom: 4px; }

/* ---------- footer ---------- */
.site-foot { border-top: 1px solid var(--line); margin-top: 48px; padding: 28px 0 36px; font-size: 13px; color: var(--ink-3); }
.site-foot .wrap { display: flex; flex-wrap: wrap; gap: 16px 40px; align-items: flex-start; }
.site-foot p { margin: 6px 0 0; }
.site-foot nav { display: flex; gap: 18px; margin-left: auto; }
.site-foot nav a { color: var(--ink-2); }
.site-foot .copy { flex-basis: 100%; }

/* ---------- static / root ---------- */
.prose { max-width: 720px; padding: 40px 0; }
.prose h1 { font-size: 34px; margin-bottom: 20px; }
.prose h2 { font-size: 19px; margin: 28px 0 8px; }
.prose p { color: var(--ink-2); }
.nf section { margin-bottom: 20px; }
.page-root { justify-content: center; }
.root-pick { width: min(560px, 100% - 32px); margin: 0 auto; padding: 64px 0; text-align: center; }
.root-pick .mark { width: 52px; height: 52px; }
.root-pick h1 { font-size: 30px; margin: 14px 0 28px; letter-spacing: .08em; }
.root-pick ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; text-align: left; }
.root-pick a { display: flex; flex-direction: column; padding: 16px 20px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); text-decoration: none; color: var(--ink); }
.root-pick a:hover { border-color: var(--moss); }
.root-pick a span { font-size: 14px; color: var(--ink-2); }

/* =========================================================
   Tool UI primitives
   ========================================================= */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 760px) { .grid2 { grid-template-columns: 1fr; gap: 18px; } .grid3, .grid4 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 420px) { .grid3 { grid-template-columns: 1fr; } }
.stack { display: grid; gap: 14px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.row.end { justify-content: flex-end; }
.spacer { flex: 1; }
hr.rule { border: 0; border-top: 1px dashed var(--line-2); margin: 20px 0; }
.sub { font-family: var(--serif); font-size: 16px; margin: 0 0 10px; }

.field { display: grid; gap: 6px; min-width: 0; }
.field > span, .lbl { font-size: 13px; font-weight: 600; color: var(--ink-2); letter-spacing: .02em; }
.field small, .hint { font-size: 12.5px; color: var(--ink-3); }
input[type=text], input[type=number], input[type=date], input[type=time], input[type=datetime-local], input[type=search], input[type=url], input[type=password], input:not([type]), select, textarea {
  font: inherit; font-size: 16px; color: var(--ink); background: var(--paper);
  border: 1px solid var(--line-2); border-radius: 5px; padding: 10px 12px; width: 100%; min-width: 0;
  transition: border-color .15s, background .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--moss); background: var(--card); box-shadow: 0 0 0 3px color-mix(in srgb, var(--moss) 18%, transparent); }
textarea { resize: vertical; min-height: 140px; line-height: 1.6; }
textarea.mono, input.mono, .mono { font-family: var(--mono); font-size: 14px; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%); background-position: calc(100% - 17px) 55%, calc(100% - 12px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
input[type=number] { font-variant-numeric: tabular-nums; }
.affix { display: flex; align-items: stretch; }
.affix > input { border-radius: 5px 0 0 5px; }
.affix > b { display: flex; align-items: center; padding: 0 12px; background: var(--paper-2); border: 1px solid var(--line-2); border-left: 0; border-radius: 0 5px 5px 0; font-weight: 500; font-size: 14px; color: var(--ink-2); white-space: nowrap; }
.affix.pre > b { order: -1; border-left: 1px solid var(--line-2); border-right: 0; border-radius: 5px 0 0 5px; }
.affix.pre > input { border-radius: 0 5px 5px 0; }
input[type=range] { width: 100%; accent-color: var(--moss); }
input[type=checkbox], input[type=radio] { accent-color: var(--moss); width: 17px; height: 17px; margin: 0; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14.5px; cursor: pointer; user-select: none; }
input[type=color] { width: 46px; height: 42px; border: 1px solid var(--line-2); border-radius: 5px; padding: 3px; background: var(--paper); cursor: pointer; }

.btn { font: inherit; font-size: 15px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 5px; border: 1px solid var(--line-2); background: var(--card); color: var(--ink); cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s, transform .05s; white-space: nowrap; }
.btn:hover { border-color: var(--ink-3); color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--moss); border-color: var(--moss); color: var(--card); }
.btn.primary:hover { background: var(--moss-2); border-color: var(--moss-2); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--paper-2); }
.btn.sm { font-size: 13.5px; padding: 6px 12px; }
.btn.lg { font-size: 17px; padding: 14px 26px; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.icon-btn { width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 5px; border: 1px solid transparent; background: none; color: var(--ink-3); cursor: pointer; flex: none; font-size: 18px; line-height: 1; }
.icon-btn:hover { color: var(--bad); background: var(--paper-2); }

.seg { display: inline-flex; flex-wrap: wrap; background: var(--paper-2); border-radius: 6px; padding: 3px; gap: 2px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 6px 14px; border-radius: 4px; font-size: 14px; color: var(--ink-2); cursor: pointer; user-select: none; }
.seg input:checked + span { background: var(--card); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.seg input:focus-visible + span { outline: 2px solid var(--focus); }

.result { background: var(--moss-soft); border-radius: 8px; padding: 18px 20px; display: grid; gap: 4px; }
.result .lbl { color: var(--moss-2); }
.big { font-family: var(--mono); font-size: clamp(30px, 5vw, 44px); font-weight: 600; line-height: 1.15; color: var(--ink); font-variant-numeric: tabular-nums; word-break: break-all; }
.big .unit { font-family: var(--sans); font-size: .45em; color: var(--ink-2); margin-left: 6px; font-weight: 500; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.stat { border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px; background: var(--paper); min-width: 0; }
.stat b { display: block; font-family: var(--mono); font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.25; word-break: break-all; }
.stat span { font-size: 12.5px; color: var(--ink-3); }
.stat.hl { border-color: var(--moss); background: var(--moss-soft); }

.drop { display: grid; place-items: center; gap: 6px; text-align: center; border: 1.5px dashed var(--line-2); border-radius: 8px; padding: 36px 18px; background: var(--paper); cursor: pointer; transition: border-color .15s, background .15s; }
.drop:hover, .drop.over { border-color: var(--moss); background: var(--moss-soft); }
.drop input { display: none; }
.drop svg { width: 34px; height: 34px; fill: none; stroke: var(--ink-3); stroke-width: 1.4; }
.drop strong { font-size: 16px; }
.drop small { color: var(--ink-3); font-size: 13px; }

table.tbl { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.tbl th, .tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.tbl th { font-size: 12.5px; color: var(--ink-3); font-weight: 600; letter-spacing: .03em; }
.tbl td.num, .tbl th.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; background: var(--paper-2); font-size: 13.5px; border: 1px solid transparent; cursor: pointer; color: var(--ink); font-family: inherit; }
.chip[aria-pressed=true], .chip.on { background: var(--moss); color: var(--card); }

.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.thumb { border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--paper); display: flex; flex-direction: column; font-size: 12.5px; }
.thumb .img { aspect-ratio: 1; display: grid; place-items: center; background: repeating-conic-gradient(var(--paper-2) 0 25%, var(--card) 0 50%) 0 0 / 16px 16px; }
.thumb .img img, .thumb .img canvas { max-width: 100%; max-height: 100%; object-fit: contain; }
.thumb .meta { padding: 8px 10px; display: grid; gap: 2px; }
.thumb .meta b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thumb .meta span { color: var(--ink-3); font-family: var(--mono); }
.thumb .meta .good { color: var(--good); }
.thumb a.btn { margin: 0 10px 10px; }
.checker { background: repeating-conic-gradient(var(--paper-2) 0 25%, var(--card) 0 50%) 0 0 / 16px 16px; }
.pixelated { image-rendering: pixelated; image-rendering: crisp-edges; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--ink); color: var(--paper); padding: 9px 18px; border-radius: 6px; font-size: 14px; opacity: 0; pointer-events: none; transition: .2s; z-index: 99; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.err { color: var(--bad); font-size: 14px; }
.ok { color: var(--good); }
.pill { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: 13px; font-weight: 600; }
.pill.good { background: color-mix(in srgb, var(--good) 15%, transparent); color: var(--good); }
.pill.bad { background: color-mix(in srgb, var(--bad) 13%, transparent); color: var(--bad); }
.pill.warn { background: color-mix(in srgb, var(--warn) 15%, transparent); color: var(--warn); }
.kbd { font-family: var(--mono); font-size: 12px; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; }
.scale { display: flex; height: 10px; border-radius: 5px; overflow: hidden; margin: 10px 0 4px; }
.scale i { flex: 1; }
.marker { position: relative; height: 10px; }
.marker::before { content: ""; position: absolute; left: var(--x, 0%); top: -3px; width: 2px; height: 16px; background: var(--ink); transform: translateX(-1px); }

@media (max-width: 520px) {
  .tool { border-radius: 8px; }
  .btn { padding: 10px 14px; }
  .hero { padding-top: 36px; }
}
@media print {
  .site-head, .site-foot, .ad, .related, .local-note { display: none; }
  body { background: #fff; }
  .tool { box-shadow: none; }
}

/* =========================================================
   v2 · 紙感層次（tactile paper）
   參考 2026 趨勢：有厚度與光線的介面、人味、Bento 排版、大字標題
   ========================================================= */
.c-money { --c: var(--c-money); } .c-life { --c: var(--c-life); } .c-image { --c: var(--c-image); }
.c-text { --c: var(--c-text); } .c-fun { --c: var(--c-fun); } .c-dev { --c: var(--c-dev); }

body { background-image: radial-gradient(rgba(120, 95, 50, .05) 1px, transparent 1px), radial-gradient(1200px 520px at 85% -10%, color-mix(in srgb, var(--stamp) 7%, transparent), transparent 70%); background-size: 5px 5px, auto; background-repeat: repeat, no-repeat; }
.brand .mark { width: 30px; height: 30px; transform: rotate(-4deg); transition: transform .3s; }
.brand:hover .mark { transform: rotate(0deg) scale(1.04); }

/* 圖示方塊 */
.ic-wrap { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; color: var(--c, var(--ink-2)); background: color-mix(in srgb, var(--c, var(--ink-2)) 11%, var(--card)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c, var(--ink-2)) 20%, transparent); flex: none; }
.ic-wrap.lg { width: 48px; height: 48px; border-radius: 13px; }
.ic { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ic-wrap.lg .ic { width: 25px; height: 25px; }

/* 首頁 hero */
.hero { padding: 64px 0 34px; border-bottom: 0; }
.hero-title { font-size: clamp(30px, 6.4vw, 66px); line-height: 1.22; letter-spacing: .01em; max-width: none; margin-bottom: 20px; text-wrap: initial; }
.hero-title .ln { display: block; }
.hero-title.cjk .ln { white-space: nowrap; }
.hero-title.cjk { font-size: min(66px, max(16px, calc((100vw - 40px) / var(--n, 11)))); }
.hero-title .ln + .ln { color: var(--ink-2); }
.hand { font-style: normal; position: relative; display: inline-block; color: var(--stamp); }
.hand svg { position: absolute; left: -4%; bottom: -.18em; width: 108%; height: .34em; overflow: visible; fill: none; stroke: var(--stamp); stroke-width: 3.2; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.hero .lead { font-size: 17.5px; max-width: 38em; color: var(--ink-2); }
.search { border-radius: 12px; padding: 0 10px 0 16px; box-shadow: inset 0 1px 0 var(--hi), 0 2px 0 var(--lip), 0 14px 30px -22px rgba(70, 50, 10, .45); max-width: 560px; }
.search .kbd { color: var(--ink-3); background: var(--paper); }
@media (hover: none) { .search .kbd { display: none; } }

/* Bento 精選 */
.bento { margin: 6px 0 18px; }
.bento-h { font-size: 13px; font-family: var(--sans); letter-spacing: .14em; color: var(--ink-3); font-weight: 600; margin: 0 0 12px; text-transform: uppercase; }
.bento ul { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: minmax(150px, auto); gap: 14px; }
.bento li.big { grid-column: span 2; grid-row: span 2; }
.bento a { position: relative; display: flex; flex-direction: column; gap: 6px; height: 100%; padding: 20px; border-radius: 16px; background: var(--card); color: var(--ink); text-decoration: none; border: 1px solid var(--line); box-shadow: inset 0 1px 0 var(--hi), 0 3px 0 var(--lip), 0 18px 34px -26px rgba(70, 50, 10, .5); transition: transform .2s ease, box-shadow .2s ease, border-color .2s; overflow: hidden; }
.bento a:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--c) 45%, var(--line)); box-shadow: inset 0 1px 0 var(--hi), 0 5px 0 var(--lip), 0 24px 40px -26px rgba(70, 50, 10, .55); color: var(--ink); }
.bento strong { font-family: var(--serif); font-size: 18px; margin-top: auto; }
.bento .d { font-size: 13.5px; color: var(--ink-2); line-height: 1.55; }
.bento li.big a { background: linear-gradient(160deg, color-mix(in srgb, var(--c) 9%, var(--card)), var(--card) 55%); padding: 26px; }
.bento li.big strong { font-size: clamp(24px, 3vw, 32px); }
.bento li.big .d { font-size: 15px; max-width: 26em; }
.bento .cta { margin-top: 10px; align-self: flex-start; font-weight: 600; font-size: 14px; color: var(--card); background: var(--c); padding: 8px 16px; border-radius: 99px; box-shadow: 0 2px 0 var(--lip); }
.bento .art { width: min(100%, 300px); height: auto; margin: 0 0 8px -6px; }
.art .paper path { fill: var(--card); stroke: var(--ink-3); stroke-width: 1.4; stroke-linejoin: round; }
.art .ink path { stroke: var(--ink-2); stroke-width: 3; stroke-linecap: round; fill: none; opacity: .55; }
.art .faces circle { fill: color-mix(in srgb, var(--c) 18%, var(--card)); stroke: var(--c); stroke-width: 2; }
.art .faces circle:nth-child(2) { fill: color-mix(in srgb, var(--stamp) 18%, var(--card)); stroke: var(--stamp); }
.art .faces circle:nth-child(3) { fill: color-mix(in srgb, var(--c-fun) 22%, var(--card)); stroke: var(--c-fun); }
.art .ink2 path { stroke: var(--ink-3); stroke-width: 1.6; fill: none; stroke-linecap: round; }
@media (max-width: 860px) { .bento ul { grid-template-columns: 1fr 1fr; grid-auto-rows: minmax(140px, auto); } }
@media (max-width: 520px) { .bento li.big { grid-row: span 1; } .bento a { padding: 16px; border-radius: 14px; } .bento .art { width: 220px; } }

/* 分類區與卡片 */
.cat { padding-top: 40px; }
.cat > header { border-bottom: 0; padding-bottom: 0; margin-bottom: 18px; align-items: center; }
.cat > header h2 { font-size: 26px; }
.cat > header .no { font-size: 13px; border-radius: 6px; padding: 2px 8px; }
.cat > header::after { content: ""; flex: 1; height: 1px; background: repeating-linear-gradient(90deg, var(--line-2) 0 6px, transparent 6px 11px); order: 2; margin-left: 4px; }
.cat > header .count { order: 3; margin-left: 0; }
.cards { gap: 14px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.card { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto 1fr; column-gap: 14px; row-gap: 3px; padding: 16px 18px 17px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); box-shadow: inset 0 1px 0 var(--hi), 0 2px 0 var(--lip), 0 12px 26px -22px rgba(70, 50, 10, .45); transition: transform .18s ease, box-shadow .18s ease, border-color .18s; }
.card::after { display: none; }
.card .ic-wrap { grid-row: span 2; align-self: start; }
.card strong { font-size: 16px; padding-right: 0; align-self: center; }
.card .d { font-size: 13.5px; color: var(--ink-2); line-height: 1.55; }
.card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--c) 40%, var(--line)); box-shadow: inset 0 1px 0 var(--hi), 0 4px 0 var(--lip), 0 18px 30px -22px rgba(70, 50, 10, .5); }
.card:active { transform: translateY(1px); box-shadow: inset 0 1px 0 var(--hi), 0 1px 0 var(--lip); }

/* 工具頁 */
.tool-head { padding: 22px 0 26px; }
.tool-title { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; }
.tool-title h1 { margin: 0; }
.tool { position: relative; isolation: isolate; border-radius: 18px; border: 1px solid var(--line); background: var(--card); box-shadow: inset 0 1px 0 var(--hi), 0 3px 0 var(--lip), 0 26px 50px -36px rgba(70, 50, 10, .55); padding: clamp(18px, 3.2vw, 32px); }
.tool-wrap { position: relative; isolation: isolate; }
.tool-wrap::before { content: ""; position: absolute; inset: 9px -7px -9px 7px; border-radius: 18px; background: var(--paper-2); border: 1px solid var(--line); z-index: -1; }
.result { border-radius: 14px; background: linear-gradient(165deg, var(--moss-soft), color-mix(in srgb, var(--moss-soft) 55%, var(--card))); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--moss) 14%, transparent); }
.stat { border-radius: 12px; background: var(--paper); }
.stat.hl { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--moss) 30%, transparent); border-color: transparent; }
input[type=text], input[type=number], input[type=date], input[type=time], input[type=datetime-local], input[type=url], input[type=password], input:not([type]), select, textarea { border-radius: 9px; box-shadow: inset 0 1px 2px rgba(70, 50, 10, .06); }
.affix > input { border-radius: 9px 0 0 9px; } .affix > b { border-radius: 0 9px 9px 0; }
.affix.pre > b { border-radius: 9px 0 0 9px; } .affix.pre > input { border-radius: 0 9px 9px 0; }
.btn { border-radius: 10px; box-shadow: inset 0 1px 0 var(--hi), 0 2px 0 var(--lip); transition: transform .08s, box-shadow .08s, background .15s, border-color .15s; }
.btn:active { transform: translateY(2px); box-shadow: inset 0 1px 0 var(--hi), 0 0 0 var(--lip); }
.btn.primary { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 2px 0 color-mix(in srgb, var(--moss) 60%, #000); }
.btn.ghost { box-shadow: none; }
.seg { border-radius: 11px; padding: 4px; box-shadow: inset 0 1px 2px rgba(70, 50, 10, .08); }
.seg span { border-radius: 8px; }
.seg input:checked + span { box-shadow: 0 1px 0 var(--lip), 0 2px 6px -2px rgba(70, 50, 10, .25); }
.drop { border-radius: 14px; }
.thumb, .px-card, .exp, .team { border-radius: 12px; }
.notes h2::before, .related h2::before { width: 18px; height: 3px; border-radius: 2px; }
.local-note { margin-top: 20px; }
.ad { border-radius: 12px; }
.site-head { background: color-mix(in srgb, var(--paper) 82%, transparent); }
.cats a { border-radius: 8px; }
.cats a[aria-current] { background: var(--card); box-shadow: inset 0 1px 0 var(--hi), 0 1px 0 var(--lip); color: var(--ink); }
.lang summary { border-radius: 10px; box-shadow: inset 0 1px 0 var(--hi), 0 2px 0 var(--lip); }
.lang ul { border-radius: 12px; }
.site-foot { background: color-mix(in srgb, var(--paper-2) 50%, transparent); }
.root-pick a { border-radius: 14px; box-shadow: inset 0 1px 0 var(--hi), 0 2px 0 var(--lip); }

@media (max-width: 720px) {
  .hero { padding: 40px 0 24px; }
  .tool-wrap::before { inset: 6px -4px -6px 4px; }
  .tool-title { gap: 12px; } .tool-title .ic-wrap.lg { width: 42px; height: 42px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
.tag { white-space: nowrap; display: inline-block; }
@media (max-width: 520px) { .bento li:not(.big) strong { font-size: 15.5px; line-height: 1.35; } .bento li:not(.big) .d { font-size: 12.5px; } .bento .ic-wrap.lg { width: 40px; height: 40px; } }
