:root {
  --bg: #f7f7f4;
  --surface: #ffffff;
  --ink: #1b1d1f;
  --muted: #5d6368;
  --line: #e2e2dc;
  --accent: #0f766e;
  --accent-ink: #ffffff;
  --accent-soft: #e3f2ef;
  --warn: #b45309;
  --bad: #b91c1c;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "PingFang TC", "Microsoft JhengHei", sans-serif;
  --r: 10px;
  /* placeholder hues */
  --c-email: #dbeafe; --c-phone: #fce7f3; --c-person: #fef3c7; --c-company: #e0e7ff;
  --c-secret: #fee2e2; --c-num: #ede9fe; --c-net: #dcfce7; --c-misc: #f1f5f9;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121416; --surface: #1a1d20; --ink: #e8e8e4; --muted: #9aa1a7; --line: #2c3136;
    --accent: #2dd4bf; --accent-ink: #062723; --accent-soft: #11302c;
    --c-email: #1e3a5f; --c-phone: #4a1d36; --c-person: #4a3a10; --c-company: #2b2f5e;
    --c-secret: #5a1f1f; --c-num: #382a5c; --c-net: #173d26; --c-misc: #283038;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 var(--sans); }
a { color: var(--accent); }
code { font-family: var(--mono); font-size: .88em; background: var(--accent-soft); padding: .1em .35em; border-radius: 4px; }
main { max-width: 1180px; margin: 0 auto; padding: 0 20px 40px; }

header.site, footer.site { max-width: 1180px; margin: 0 auto; padding: 18px 20px; display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.brand { font-weight: 700; color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 10px; letter-spacing: -.01em; }
.logo { width: 22px; height: 22px; border-radius: 6px; background: var(--accent); position: relative; }
.logo::after { content: ""; position: absolute; left: 4px; right: 4px; top: 8px; height: 6px; border-radius: 2px; background: var(--accent-ink); }
header nav, footer nav { display: flex; gap: 18px; flex-wrap: wrap; }
header nav a, footer nav a { color: var(--muted); text-decoration: none; font-size: .95rem; }
header nav a:hover, footer nav a:hover, header nav a[aria-current] { color: var(--ink); }
footer.site { border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; margin-top: 40px; }

.hero, .tool-intro { padding: 28px 0 22px; }
/* max-width: 820px;  */
.hero h1 { font-size: clamp(1.7rem, 3.6vw, 2.5rem); line-height: 1.15; letter-spacing: -.02em; margin: 0 0 12px; }
.lede { color: var(--muted); font-size: 1.08rem; margin: 0 0 16px; }
.trust { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: .92rem; color: var(--muted); }
.trust li::before { content: "✓ "; color: var(--accent); font-weight: 700; }

.tool { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px; margin: 18px 0; }
.step-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.step-head h2 { margin: 0; font-size: 1.15rem; display: flex; align-items: center; gap: 10px; }
.num { width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: inline-grid; place-items: center; font-size: .85rem; }
.actions { display: flex; gap: 8px; }
.panes { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pane { display: flex; flex-direction: column; min-width: 0; }
.pane-head, .pane-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 34px; }
.pane-foot { margin-top: 8px; }
.pane-head label, .label { font-weight: 600; font-size: .92rem; }
textarea, .output { width: 100%; min-height: 320px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); color: var(--ink); font: 14px/1.55 var(--mono); resize: vertical; }
.output { white-space: pre-wrap; overflow-wrap: anywhere; overflow: auto; max-height: 560px; background: var(--surface); }
textarea:focus, .output:focus, input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.placeholder-text { color: var(--muted); font-family: var(--sans); }

mark { color: inherit; border-radius: 4px; padding: 0 2px; }
mark.ph { background: var(--c-misc); font-weight: 600; }
.t-EMAIL { background: var(--c-email) !important; }
.t-PHONE { background: var(--c-phone) !important; }
.t-PERSON { background: var(--c-person) !important; }
.t-COMPANY, .t-PROJECT { background: var(--c-company) !important; }
.t-API_KEY, .t-SSN, .t-CARD { background: var(--c-secret) !important; }
.t-IBAN, .t-DATE { background: var(--c-num) !important; }
.t-IP, .t-URL, .t-LOCATION { background: var(--c-net) !important; }
mark.restored { background: var(--accent-soft); box-shadow: inset 0 -2px 0 var(--accent); }
mark.unknown { background: transparent; color: var(--bad); box-shadow: inset 0 -2px 0 var(--bad); }

button, .file { font: inherit; font-size: .9rem; cursor: pointer; border-radius: 8px; padding: 7px 14px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); display: inline-block; }
button:hover, .file:hover { border-color: var(--muted); }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
button.primary.ok { filter: saturate(.6); }
button.ghost, .ghost { background: transparent; }
button.link { background: none; border: none; padding: 0; color: var(--accent); text-decoration: underline; font-size: .85rem; }
button.icon { border: none; background: none; padding: 0 6px; font-size: 1.1rem; line-height: 1; color: var(--muted); margin-left: auto; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { border: none; border-radius: 0; padding: 4px 12px; font-size: .82rem; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }

.wrapper { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.wrapper summary { cursor: pointer; font-weight: 600; font-size: .95rem; }
.wrap-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 20px; margin-top: 12px; }
.wrap-grid textarea { min-height: 80px; font-family: var(--sans); font-size: .95rem; margin: 6px 0 8px; }
.wrap-grid label { font-weight: 600; font-size: .9rem; }
.bud { display: grid; grid-template-columns: 44px 1fr 44px; gap: 10px; align-items: center; font: .82rem var(--mono); color: var(--muted); margin: 8px 0; }
.bar { height: 8px; background: var(--bg); border: 1px solid var(--line); border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); }
.bud.warn .bar i { background: var(--warn); }
.bud.over .bar i { background: var(--bad); }
.bud.over span:last-child { color: var(--bad); }

.side-grid { display: grid; grid-template-columns: 1fr 1.1fr 1.2fr; gap: 14px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; min-width: 0; }
.card h3 { margin: 0 0 8px; font-size: 1rem; display: flex; align-items: center; gap: 8px; }
.rules { display: grid; gap: 6px; }
.chk { display: flex; gap: 8px; align-items: center; font-size: .9rem; cursor: pointer; }
.chk code { margin-left: auto; font-size: .72rem; }
.chk.inline { font-size: .85rem; }
.term-form { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.term-form input { flex: 1 1 140px; min-width: 0; }
input, select { font: inherit; font-size: .9rem; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); }
.term-list { list-style: none; padding: 0; margin: 6px 0; max-height: 220px; overflow: auto; }
.term-list li { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.term { overflow-wrap: anywhere; }
.tag { font: 600 .68rem var(--mono); padding: 2px 6px; border-radius: 4px; }
.pill { font-size: .75rem; background: var(--accent-soft); color: var(--accent); padding: 1px 8px; border-radius: 99px; }
.table-wrap { max-height: 240px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; font-size: .85rem; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { position: sticky; top: 0; background: var(--surface); font-weight: 600; color: var(--muted); font-size: .78rem; }
td.val { font-family: var(--mono); font-size: .8rem; overflow-wrap: anywhere; }
td mark { font-family: var(--mono); font-size: .78rem; white-space: nowrap; }
.row { display: flex; gap: 8px; margin-top: 10px; }
.empty { color: var(--muted); font-size: .88rem; text-align: center; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

.prose { max-width: 760px; margin: 50px auto 0; }
.prose h1 { font-size: clamp(1.7rem, 3.4vw, 2.3rem); line-height: 1.2; letter-spacing: -.02em; }
.prose h2 { font-size: 1.45rem; margin-top: 2.2em; letter-spacing: -.01em; }
.prose h3 { font-size: 1.1rem; margin-top: 1.6em; }
.prose li { margin: .4em 0; }
.prose table { font-size: .9rem; margin: 1em 0; }
.prose pre { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; overflow: auto; font: 13px/1.55 var(--mono); white-space: pre-wrap; }
.prose pre code { background: none; padding: 0; }
.callout { border-left: 3px solid var(--accent); background: var(--accent-soft); padding: 12px 16px; border-radius: 0 var(--r) var(--r) 0; }
.toc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 20px; }
.meta { color: var(--muted); font-size: .9rem; }
.tpl { position: relative; }
.tpl button { position: absolute; top: 8px; right: 8px; font-size: .78rem; padding: 3px 10px; }

@media (max-width: 900px) {
  .panes, .wrap-grid, .side-grid { grid-template-columns: 1fr; }
  textarea, .output { min-height: 220px; }
}

/* ---------- Host pages: embedded tool + ads ---------- */
.tool-embed { margin: 8px 0 0; }
.tool-embed iframe { display: block; width: 100%; height: 900px; border: 0; background: transparent; color-scheme: normal; }
.tool-embed.mini iframe { height: 640px; }
.iso-note { font-size: .85rem; color: var(--muted); margin: 8px 2px 0; }
.ad-slot { margin: 40px auto; max-width: 970px; text-align: center; }
.ad-slot::before { content: "Advertisement"; display: block; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.ad-slot.placeholder { min-height: 120px; border: 1px dashed var(--line); border-radius: var(--r); display: grid; place-items: center; color: var(--muted); font-size: .85rem; }
.ad-slot.placeholder::before { content: none; }
.ad-slot.hidden { display: none; }
.prose .ad-slot { margin: 36px 0; }
.landing-hero { padding: 26px 0 6px; max-width: 860px; }
.landing-hero h1 { font-size: clamp(1.6rem, 3.2vw, 2.25rem); line-height: 1.18; letter-spacing: -.02em; margin: 0 0 10px; }
.landing-hero p { color: var(--muted); margin: 0; font-size: 1.04rem; }
.crumbs { font-size: .85rem; color: var(--muted); margin-top: 18px; }
.crumbs a { color: var(--muted); }
.iso-warning { background: #b91c1c; color: #fff; padding: 10px 14px; border-radius: 8px; font-size: .9rem; margin: 8px 0; }
.tool-fallback { border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 14px 16px; margin-bottom: 8px; font-size: .95rem; }
.tool-embed.failed iframe { height: 0 !important; }
.tool-embed.part-mask iframe { height: 620px; }
.tool-embed.part-rest iframe { height: 900px; }
.tool-workspace .ad-slot { margin: 0 auto 10px; }
.tool-header { text-align: center; }
.tool-header h1 { margin-bottom: 0; }
/* Grouped footer */
footer.site { display: block; }
.foot-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; padding: 12px 0 8px; }
.foot-grid h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink); margin: 0 0 10px; }
.foot-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.foot-grid a { color: var(--muted); text-decoration: none; font-size: .92rem; }
.foot-grid a:hover { color: var(--ink); }
.foot-note { margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--line); font-size: .85rem; }
@media (max-width: 760px) { .foot-grid { grid-template-columns: repeat(2, 1fr); } }
