/* 深色 = 琥珀磷光屏（DEC VT220 血统）。亮色见文件末尾的 body.light，那是打印终端的纸，不是本主题的反色。 */
:root {
  --bg:#131110; --surface:#1A1715; --surface-2:#211D1A;
  --line:#332D27; --line-soft:#26211D;
  --text:#EDE6DC; --muted:#9A9088; --dim:#6E655D;
  --accent:#E8A33D; --accent-ink:#1A1206; --accent-soft:#3A2A11;
  --danger:#E0714B; --ok:#A9B84A;
  --syntax-key:#8FB3C4; --syntax-str:#D9C27E; --syntax-num:#D79A6A; --syntax-bool:#B99BD4; --syntax-null:#7E8A93;
  --mono:"JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
  --sans:"Noto Sans SC", system-ui, sans-serif;
  --radius:2px;
  /* 编辑区高度跟视口联动，不设上限：高屏一路长到填满，下方不留空。
     348px = 顶栏 82 + 面板留白 34 + 标题 65 + 卡片头 38 + 状态行 56 + 下留白 30，
     再留少量余量，确保默认的 JSON 面板不产生滚动。 */
  --editor-h:max(280px, calc(100vh - 348px));
}
* { box-sizing:border-box; }
html { scroll-behavior:smooth; }
body { margin:0; min-width:320px; color:var(--text); background:var(--bg); font-family:var(--sans); }
button, input, textarea, select { font:inherit; }
button { cursor:pointer; }
.app-shell { min-height:100vh; display:grid; grid-template-columns:238px minmax(0, 1fr); }
.sidebar { position:sticky; top:0; height:100vh; padding:24px 13px 18px; border-right:1px solid var(--line); background:var(--surface); display:flex; flex-direction:column; }
.brand { display:flex; align-items:center; gap:9px; padding:0 8px; color:var(--text); font:500 17px var(--mono); text-decoration:none; letter-spacing:-.3px; }
.brand span span { color:var(--accent); }
.brand-mark { width:26px; height:26px; display:grid; place-items:center; border:1px solid var(--line); color:var(--accent); background:var(--bg); font-family:var(--mono); font-size:10px; }
.tool-nav { margin-top:40px; }
.nav-label { margin:0 8px 9px; color:var(--dim); font:500 10px var(--mono); letter-spacing:1.4px; text-transform:uppercase; }
.nav-label-gap { margin-top:26px; }
/* hover/active 用左侧亮条表达，不依赖背景色 —— 两套主题都不会出现深底深字。 */
.nav-item { position:relative; height:38px; display:flex; align-items:center; gap:11px; padding:0 10px 0 13px; margin:1px 0; color:var(--muted); border:0; border-radius:0; text-decoration:none; font-size:13px; transition:color .15s ease; }
.nav-item::before { content:""; position:absolute; left:0; top:50%; width:2px; height:0; background:var(--accent); transform:translateY(-50%); transition:height .15s ease; }
.nav-item:hover { color:var(--text); }
.nav-item:hover::before { height:16px; }
.nav-item svg { width:16px; height:16px; stroke-width:1.7; }
.nav-item.active { color:var(--accent); background:var(--surface-2); }
.nav-item.active::before { height:100%; }
.side-footer { margin-top:auto; display:flex; gap:8px; align-items:flex-start; padding:14px 8px 0; border-top:1px solid var(--line-soft); color:var(--dim); font-size:10.5px; line-height:1.65; }
.side-footer svg { flex:0 0 auto; width:14px; margin-top:2px; color:var(--accent); }
.side-footer p { margin:0; }
.workspace { width:min(1420px, 100%); padding:38px clamp(26px, 3.4vw, 50px) 30px; margin:0 auto; }
/* 顶栏取 tmux 状态行的形制：左侧路径式标题，右侧状态指示。 */
.topbar { min-height:64px; display:flex; align-items:flex-start; justify-content:space-between; border-bottom:1px solid var(--line); padding-bottom:18px; }
.eyebrow { margin:0 0 6px; color:var(--dim); font:10px var(--mono); letter-spacing:1.5px; }
.topbar h1 { display:flex; align-items:center; gap:2px; margin:0; font:500 22px var(--mono); letter-spacing:-.4px; line-height:1.2; }
/* Signature：标题后的实心块光标。 */
.topbar h1::after { content:"▊"; color:var(--accent); font-size:17px; animation:blink 1.2s steps(2, start) infinite; }
@keyframes blink { 50% { opacity:0; } }
@media (prefers-reduced-motion:reduce) { .topbar h1::after { animation:none; } }
.topbar-actions { display:flex; align-items:center; gap:11px; }
.local-badge { display:flex; align-items:center; gap:6px; color:var(--muted); font:10.5px var(--mono); letter-spacing:.6px; }
.local-badge svg { width:13px; color:var(--ok); }
.icon-button { width:30px; height:30px; display:grid; place-items:center; color:var(--muted); border:1px solid var(--line); border-radius:var(--radius); background:transparent; transition:.15s ease; }
.icon-button:hover { color:var(--accent); border-color:var(--accent); }
.icon-button svg { width:15px; }
.tool-panel { padding-top:34px; }
.panel-heading { display:flex; justify-content:space-between; align-items:flex-start; gap:22px; margin-bottom:20px; }
.panel-heading h2 { margin:0 0 6px; font:500 16px var(--mono); letter-spacing:-.2px; line-height:1.4; }
.panel-heading p { margin:0; color:var(--muted); font-size:12.5px; line-height:1.7; }
.action-row { display:flex; align-items:center; gap:7px; }
.primary-button,.secondary-button { min-height:32px; display:inline-flex; align-items:center; justify-content:center; gap:7px; padding:0 12px; border-radius:var(--radius); border:1px solid; font:500 12px var(--mono); letter-spacing:.2px; white-space:nowrap; transition:.15s ease; }
.primary-button svg,.secondary-button svg { width:14px; }
.primary-button { color:var(--accent-ink); border-color:var(--accent); background:var(--accent); }
.primary-button:hover { background:#F2B457; border-color:#F2B457; }
.secondary-button { color:var(--muted); background:transparent; border-color:var(--line); }
.secondary-button:hover { border-color:var(--accent); color:var(--accent); }
.secondary-button.mode-active { color:var(--accent); border-color:var(--accent); background:var(--accent-soft); }
:where(button, a, input, textarea, select):focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.editor-layout,.key-grid { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.editor-card,.key-card,.form-card,.hash-card,.cron-entry,.cron-result { border:1px solid var(--line); background:var(--surface); border-radius:var(--radius); }
.editor-card { overflow:hidden; min-height:calc(var(--editor-h) + 38px); }
/* 卡片头取终端窗口标题栏：小号等宽、字距拉开、全大写。 */
.editor-header,.key-heading,.hash-card-heading { height:38px; display:flex; align-items:center; justify-content:space-between; padding:0 13px; border-bottom:1px solid var(--line); color:var(--muted); font:500 10px var(--mono); letter-spacing:1.1px; text-transform:uppercase; }
.editor-header span:first-child,.key-heading span,.hash-card-heading span { display:flex; align-items:center; gap:7px; }
.editor-header-actions { display:flex; align-items:center; gap:11px; }
.editor-header svg,.key-heading svg,.hash-card-heading svg { width:13px; color:var(--accent); }
.code-input,.code-output,.key-output { width:100%; height:var(--editor-h); display:block; margin:0; padding:15px; border:0; outline:0; resize:none; background:transparent; color:var(--text); font:12.5px/1.7 var(--mono); tab-size:2; }
.code-input::placeholder,.key-output::placeholder { color:var(--dim); }
.code-output { white-space:pre-wrap; overflow:auto; }
.placeholder-output { color:var(--dim); }
.character-count { color:var(--dim); font:10px var(--mono); letter-spacing:.5px; text-transform:none; }
.copy-text { padding:3px 0; border:0; color:var(--muted); background:transparent; font:10px var(--mono); letter-spacing:.5px; text-transform:uppercase; transition:color .15s ease; }
.copy-text:hover { color:var(--accent); }
.copy-text[disabled] { color:var(--dim); cursor:default; opacity:.55; }
.copy-text[disabled]:hover { color:var(--dim); }
.copy-text[aria-pressed="true"] { color:var(--accent); }
.json-output { white-space:pre-wrap; }
.json-output.tree-view { white-space:normal; padding:10px 13px; line-height:1.5; }
.tree-node { position:relative; padding-left:17px; }
.tree-line { display:flex; align-items:baseline; min-height:22px; gap:6px; white-space:nowrap; }
.tree-toggle { position:absolute; left:0; top:3px; width:15px; height:15px; padding:0; color:var(--dim); border:0; background:transparent; font-size:12px; line-height:1; transition:color .15s ease; }
.tree-toggle:hover { color:var(--accent); }
.tree-toggle.leaf { cursor:default; }
.tree-key { color:var(--syntax-key); }
.tree-value.string { color:var(--syntax-str); }
.tree-value.number { color:var(--syntax-num); }
.tree-value.boolean { color:var(--syntax-bool); }
.tree-value.null { color:var(--syntax-null); }
.tree-summary { color:var(--dim); font-size:10.5px; }
.tree-children { padding-left:12px; margin-left:3px; border-left:1px solid var(--line-soft); }
.tree-more { display:block; margin:4px 0 2px; padding:3px 8px; color:var(--accent); border:1px dashed var(--line); border-radius:var(--radius); background:transparent; font:10.5px var(--mono); transition:.15s ease; }
.tree-more:hover { border-color:var(--accent); background:var(--accent-soft); }
.tree-node.collapsed > .tree-children { display:none; }
/* 左侧输入卡底部有转义/压缩按钮条，减去它的高度。 */
.json-input-card .code-input { height:calc(var(--editor-h) - 52px); }
.json-input-actions { display:flex; gap:6px; padding:8px 11px; border-top:1px solid var(--line); background:var(--surface-2); }
.json-input-actions .secondary-button { min-height:30px; flex:1; padding:0 8px; font-size:11px; }
#json:fullscreen { width:100vw; height:100vh; overflow:auto; padding:32px clamp(20px, 4vw, 72px) 28px; background:var(--bg); }
.tool-panel:fullscreen::backdrop { background:var(--bg); }
#json:fullscreen .editor-layout { min-height:calc(100vh - 230px); }
#json:fullscreen .editor-card { min-height:calc(100vh - 230px); }
#json:fullscreen .code-output { height:calc(100vh - 276px); }
#json:fullscreen .json-input-card .code-input { height:calc(100vh - 332px); }
/* Signature 之二：面板底部状态行，取 tmux / vim statusline 的形制。 */
.footer-actions { display:flex; align-items:center; justify-content:space-between; gap:18px; margin-top:12px; padding:7px 11px; border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); }
.validation-state { display:flex; align-items:center; gap:7px; font:10.5px var(--mono); letter-spacing:.4px; }
.validation-state svg { width:13px; }
.status-metrics { display:flex; gap:14px; color:var(--dim); font:10.5px var(--mono); letter-spacing:.4px; }
.status-metrics b { color:var(--muted); font-weight:500; }
.neutral { color:var(--muted); }
.success { color:var(--ok); }
.error { color:var(--danger); }
.cron-entry { padding:18px; }
.cron-entry label,.form-card label,.select-field label { display:block; margin-bottom:8px; color:var(--muted); font:500 10px var(--mono); letter-spacing:1.1px; text-transform:uppercase; }
.cron-input-row { display:flex; gap:8px; }
.cron-input { min-width:0; flex:1; height:40px; padding:0 12px; color:var(--accent); border:1px solid var(--line); border-radius:var(--radius); outline:none; background:var(--bg); font:14px var(--mono); letter-spacing:.5px; }
.cron-input:focus, input:focus, select:focus, textarea:focus { border-color:var(--accent); }
.input-hint { margin:10px 0 0; color:var(--dim); font-size:11.5px; }
.input-hint code { color:var(--accent); font-family:var(--mono); }
.cron-result { display:grid; grid-template-columns:.9fr 1.1fr; gap:0; margin-top:14px; }
.human-cron,.next-runs { padding:18px; }
.human-cron { display:flex; flex-direction:column; justify-content:center; border-right:1px solid var(--line); }
.result-label { margin:0 0 9px; color:var(--dim); font:500 10px var(--mono); letter-spacing:1.1px; text-transform:uppercase; }
.human-cron strong { color:var(--accent); font-size:15px; font-weight:500; line-height:1.65; }
.result-heading { display:flex; justify-content:space-between; align-items:center; }
.result-heading span { color:var(--dim); font:10px var(--mono); }
/* 执行时间是等宽数据，用行号式前缀强化「一条条读」的终端语感。 */
.run-list { padding:0; margin:2px 0 0; list-style:none; counter-reset:run; color:var(--text); font:11.5px var(--mono); line-height:2; }
.run-list li { counter-increment:run; }
.run-list li::before { content:counter(run) "  "; color:var(--accent); }
.field-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(126px,1fr)); gap:8px; margin-top:14px; }
.cron-field { padding:11px; border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); }
.cron-field span { display:block; color:var(--dim); font:10px var(--mono); letter-spacing:.8px; text-transform:uppercase; }
.cron-field b { display:block; margin-top:6px; color:var(--accent); font:15px var(--mono); }
.cron-field p { min-height:30px; margin:6px 0 0; color:var(--muted); font-size:10.5px; line-height:1.5; }
.security-layout { display:grid; grid-template-columns:.85fr 1.15fr; gap:16px; }
.form-card,.hash-card { padding:18px; }
.password-field { position:relative; }
.password-field input { width:100%; height:40px; padding:0 42px 0 12px; color:var(--text); outline:none; border:1px solid var(--line); border-radius:var(--radius); background:var(--bg); font:12.5px var(--mono); }
.inner-icon { position:absolute; top:5px; right:5px; border:0; }
.range-row { display:flex; align-items:center; justify-content:space-between; gap:13px; margin:18px 0; }
.range-row label { margin:0; }
.range-row label span { color:var(--accent); font-family:var(--mono); }
.range-row p { margin:5px 0 0; color:var(--dim); font-size:10.5px; text-transform:none; letter-spacing:0; }
.range-row input { width:126px; accent-color:var(--accent); }
.wide-button { width:100%; }
.hash-card { min-width:0; display:flex; flex-direction:column; }
.hash-card-heading { height:auto; padding:0 0 12px; }
.hash-output { display:block; flex:1; min-height:106px; padding:15px 0; overflow-wrap:anywhere; color:var(--accent); font:12.5px/1.85 var(--mono); }
.hash-meta { display:flex; gap:20px; padding-top:12px; border-top:1px solid var(--line); color:var(--dim); font:10px var(--mono); letter-spacing:.5px; text-transform:uppercase; }
.hash-meta b { color:var(--text); margin-left:4px; }
.privacy-note { display:flex; align-items:center; gap:7px; margin:12px 2px 0; color:var(--dim); font-size:10.5px; }
.privacy-note svg { width:14px; color:var(--ok); }
.rsa-controls { display:flex; align-items:end; gap:12px; padding:16px 18px; margin-bottom:14px; border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); }
.select-field { min-width:164px; }
.select-field label { margin-bottom:7px; }
.select-field select { width:100%; height:33px; padding:0 9px; color:var(--text); outline:0; border:1px solid var(--line); border-radius:var(--radius); background:var(--bg); font:11.5px var(--mono); }
.rsa-format-note { margin:0 0 8px; color:var(--dim); font-size:10.5px; }
.rsa-controls .primary-button { margin-left:auto; }
.key-card { overflow:hidden; }
/* RSA 面板下方另有私钥警告条，编辑区略收。 */
.key-output { height:calc(var(--editor-h) - 58px); }
.private-key .key-heading svg { color:var(--danger); }
.private-warning { display:flex; align-items:center; gap:8px; margin-top:12px; padding:9px 11px; border:1px solid rgba(224,113,75,.3); border-radius:var(--radius); color:var(--danger); background:rgba(224,113,75,.07); font-size:10.5px; }
.private-warning svg { flex:0 0 auto; width:14px; }
.toast { position:fixed; z-index:3; left:50%; bottom:22px; padding:9px 13px; color:var(--accent-ink); border-radius:var(--radius); background:var(--accent); box-shadow:0 6px 24px rgba(0,0,0,.3); font:500 11.5px var(--mono); opacity:0; transform:translate(-50%, 10px); pointer-events:none; transition:.18s ease; }
.toast.show { opacity:1; transform:translate(-50%, 0); }
.timestamp-grid { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.inline-field { display:flex; gap:7px; }
.inline-field input,.form-card > input { width:100%; height:40px; min-width:0; padding:0 12px; color:var(--text); border:1px solid var(--line); border-radius:var(--radius); outline:0; background:var(--bg); font:12.5px var(--mono); }
.inline-field select { width:86px; padding:0 8px; color:var(--text); border:1px solid var(--line); border-radius:var(--radius); outline:0; background:var(--bg); font:11.5px var(--mono); }
.timestamp-grid .wide-button { margin-top:13px; }
.timestamp-result { display:flex; flex-direction:column; gap:6px; min-height:74px; margin-top:17px; padding-top:13px; border-top:1px solid var(--line); }
.timestamp-result span { color:var(--dim); font:10px var(--mono); letter-spacing:.8px; text-transform:uppercase; }
.timestamp-result strong { color:var(--accent); font:13.5px var(--mono); font-weight:500; }
.timestamp-result code { color:var(--muted); font:10.5px var(--mono); }
/* 这两个面板在编辑区上方多一条控制栏，局部下调编辑区高度避免溢出。 */
#regex { --editor-h:max(260px, calc(100vh - 392px)); }
#rsa { --editor-h:max(260px, calc(100vh - 404px)); }
.regex-bar { display:flex; align-items:center; gap:8px; padding:10px; margin-bottom:14px; border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); }
.regex-slash { color:var(--accent); font:19px var(--mono); }
.regex-pattern { min-width:0; flex:1; height:33px; padding:0 7px; color:var(--syntax-str); border:0; outline:0; background:transparent; font:12.5px var(--mono); }
.regex-bar label { display:flex; align-items:center; gap:4px; color:var(--muted); font:11.5px var(--mono); }
.regex-bar label input { accent-color:var(--accent); }
.match-output { height:var(--editor-h); padding:11px; overflow:auto; color:var(--text); font:11.5px/1.6 var(--mono); }
.match-item { display:flex; gap:9px; align-items:flex-start; padding:8px 0; border-bottom:1px solid var(--line-soft); }
.match-item:last-child { border-bottom:0; }
.match-index { flex:0 0 44px; color:var(--dim); }
.match-value { overflow-wrap:anywhere; color:var(--syntax-str); }
.match-empty { padding:5px; color:var(--dim); }
.markdown-output { height:var(--editor-h); padding:14px 16px; overflow:auto; color:var(--text); font-size:12.5px; line-height:1.8; }
.markdown-output h1,.markdown-output h2,.markdown-output h3 { margin:0 0 11px; color:var(--text); font-family:var(--mono); font-weight:500; line-height:1.4; }
.markdown-output h1 { font-size:19px; }
.markdown-output h2 { font-size:16px; }
.markdown-output h3 { font-size:14px; }
.markdown-output p { margin:0 0 11px; }
.markdown-output ul,.markdown-output ol { margin:0 0 11px; padding-left:19px; }
.markdown-output blockquote { margin:0 0 11px; padding:7px 11px; border-left:2px solid var(--accent); color:var(--muted); background:var(--surface-2); }
.markdown-output code { padding:2px 5px; color:var(--accent); border-radius:var(--radius); background:var(--surface-2); font:10.5px var(--mono); }
.markdown-output pre { margin:0 0 11px; padding:11px; overflow:auto; border:1px solid var(--line); border-radius:var(--radius); background:var(--bg); }
.markdown-output pre code { padding:0; background:transparent; }
.markdown-output a { color:var(--accent); }
.jwt-input-card { min-height:auto; }
.jwt-input { width:100%; height:104px; padding:13px 15px; resize:vertical; color:var(--text); border:0; outline:0; background:transparent; font:11.5px/1.6 var(--mono); }
.jwt-grid { display:grid; grid-template-columns:1fr 1fr; gap:14px; margin-top:14px; }
.jwt-output-card { min-height:0; }
/* Header/Payload 两栏也跟视口联动：减去上方 Token 输入卡与下方声明条的高度。 */
.jwt-output-card .code-output { height:auto; min-height:104px; max-height:calc(var(--editor-h) - 150px); }
.jwt-details { display:flex; flex-wrap:wrap; gap:8px; margin-top:12px; }
.jwt-detail { padding:7px 10px; color:var(--muted); border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); font-size:10.5px; }
.jwt-detail b { color:var(--accent); margin-left:5px; font-family:var(--mono); }
.password-generator { display:grid; grid-template-columns:.75fr 1.25fr; border:1px solid var(--line); border-radius:var(--radius); overflow:hidden; background:var(--surface); }
.password-result { display:flex; align-items:center; gap:11px; min-width:0; padding:26px; border-right:1px solid var(--line); background:var(--surface-2); }
.password-result code { min-width:0; flex:1; max-height:390px; overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere; color:var(--accent); font:16px/1.75 var(--mono); }
.password-options { padding:24px; }
.password-options .range-row { margin:0 0 18px; }
.password-quantity { display:flex; align-items:center; justify-content:space-between; gap:14px; margin:-4px 0 18px; padding:12px 0; border-top:1px solid var(--line-soft); border-bottom:1px solid var(--line-soft); }
.password-quantity label { color:var(--muted); font:500 10px var(--mono); letter-spacing:1.1px; text-transform:uppercase; }
.password-quantity > div { display:flex; align-items:center; gap:9px; }
.password-quantity input { width:58px; height:32px; padding:0 8px; color:var(--accent); border:1px solid var(--line); border-radius:var(--radius); outline:0; background:var(--bg); font:12.5px var(--mono); }
.password-quantity span { color:var(--dim); font-size:10.5px; }
.check-grid { display:grid; grid-template-columns:1fr 1fr; gap:9px; margin-bottom:17px; }
.check-grid label { display:flex; align-items:center; gap:7px; color:var(--muted); font-size:11.5px; }
.check-grid input { accent-color:var(--accent); }
.check-grid code { color:var(--dim); font:10px var(--mono); }

/* ── 亮色 = 打印终端的纸。不是磷光屏的反色：强调色换成色带的印刷棕橙，
      纸面带微黄。组件全部走变量，所以这里只覆盖 token 层。 ── */
body.light {
  --bg:#F2EEE6; --surface:#FBF8F2; --surface-2:#EDE8DE;
  --line:#D6CFC1; --line-soft:#E4DDD0;
  --text:#231E18; --muted:#6B6459; --dim:#918878;
  --accent:#9A5B14; --accent-ink:#FDFBF6; --accent-soft:#F0E4D0;
  --danger:#A8341A; --ok:#4F6B1E;
  --syntax-key:#2C5878; --syntax-str:#7A5A12; --syntax-num:#8C4A1C; --syntax-bool:#6A4189; --syntax-null:#656970;
}
.light .primary-button:hover { background:#B06A1C; border-color:#B06A1C; }
.light .toast { box-shadow:0 6px 24px rgba(60,45,25,.18); }
.light .private-warning { border-color:rgba(168,52,26,.28); background:rgba(168,52,26,.06); }
@media (max-width:800px) {
  .app-shell { display:block; }
  .sidebar { position:sticky; z-index:2; top:0; height:auto; padding:12px 16px 10px; border-right:0; border-bottom:1px solid var(--line); flex-direction:column; align-items:stretch; overflow:hidden; }
  .tool-nav { display:flex; width:100%; min-width:0; gap:3px; margin:11px 0 0; overflow-x:auto; }
  .nav-label,.side-footer { display:none; }
  .nav-item { flex:0 0 36px; width:36px; min-width:36px; height:36px; margin:0; padding:0; justify-content:center; }
  .nav-item span { display:none; }
  /* 横向排列时亮条移到底部，纵向的左侧条在这里没有意义。 */
  .nav-item::before { left:50%; top:auto; bottom:0; width:0; height:2px; transform:translateX(-50%); transition:width .15s ease; }
  .nav-item:hover::before { height:2px; width:16px; }
  .nav-item.active::before { height:2px; width:100%; }
  .workspace { padding:24px 16px 24px; }
  .topbar { min-height:52px; padding-bottom:16px; }
  .panel-heading { margin-bottom:18px; }
  .editor-layout,.key-grid,.security-layout,.cron-result,.timestamp-grid,.jwt-grid,.password-generator { grid-template-columns:1fr; }
  /* 窄屏两块编辑区上下堆叠，各取视口的一部分即可。 */
  :root,#regex,#rsa { --editor-h:clamp(200px, 42vh, 420px); }
  .editor-card { min-height:calc(var(--editor-h) + 38px); }
  .output-card { min-height:calc(var(--editor-h) + 38px); }
  .cron-result .human-cron { border-right:0; border-bottom:1px solid var(--line); }
  .field-grid { grid-template-columns:repeat(2,1fr); }
  .rsa-controls { align-items:stretch; flex-direction:column; }
  .select-field { min-width:0; }
  .rsa-controls .primary-button { margin:3px 0 0; }
  .key-output { height:var(--editor-h); }
  .password-result { border-right:0; border-bottom:1px solid var(--line); }
  .jwt-output-card .code-output { max-height:212px; }
}

@media (max-width:500px) {
  .brand { font-size:16px; }
  .brand-mark { width:25px; height:25px; }
  .topbar-actions .local-badge { display:none; }
  .topbar h1 { font-size:19px; }
  .topbar h1::after { font-size:15px; }
  .panel-heading { flex-direction:column; gap:13px; }
  .panel-heading .action-row { width:100%; }
  .panel-heading .secondary-button { flex:1; }
  .footer-actions { align-items:stretch; flex-direction:column; }
  .footer-actions .action-row { width:100%; }
  .footer-actions button { flex:1; }
  .cron-input-row { flex-direction:column; }
  .cron-input-row .primary-button { width:100%; }
  .field-grid { grid-template-columns:1fr 1fr; }
  .range-row { align-items:flex-start; flex-direction:column; }
  .range-row input { width:100%; }
  .topbar { align-items:flex-start; }
  .hash-meta { gap:12px; flex-wrap:wrap; }
}

