/* 行距计算器 · 印刷工坊标尺设计系统（前缀 lh-）
   浅色：纸白 + 铅灰 + 朱红；深色：墨灰 + 米白 + 亮朱 */
.lh-page, .lh-modal, .ws-toast {
    --lh-bg: #f9f8f4; --lh-paper: #fffefa; --lh-ink: #33383d; --lh-sub: #7c817f;
    --lh-brand: #2b5f8a; --lh-red: #c1442e; --lh-line: #dedbd1; --lh-fill: #f1efe7;
    --lh-grid: rgba(193,68,46,.16); --lh-shadow: 0 10px 26px rgba(51,56,61,.09);
    --lh-font: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
}
:root[data-theme="dark"] .lh-page, :root[data-theme="dark"] .lh-modal, :root[data-theme="dark"] .ws-toast {
    --lh-bg: #15181a; --lh-paper: #1e2225; --lh-ink: #e7e4dc; --lh-sub: #a5a8a4;
    --lh-brand: #8fbde6; --lh-red: #ef7a63; --lh-line: #333a3e; --lh-fill: #252b2f;
    --lh-grid: rgba(239,122,99,.18); --lh-shadow: 0 14px 32px rgba(0,0,0,.36);
}
.lh-page { background: var(--lh-bg); color: var(--lh-ink); font-family: var(--lh-font);
    font-size: 14.5px; line-height: 1.8; padding-bottom: 56px; }
.lh-wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.lh-page .detail-breadcrumb { padding: 18px 0 0; font-size: 13px; color: var(--lh-sub); }
.lh-page .detail-breadcrumb a { color: var(--lh-brand); text-decoration: none; }
.lh-page .detail-breadcrumb .sep { margin: 0 8px; }
.lh-page b { font-weight: 700; }
.lh-kicker { font-size: 11px; letter-spacing: .16em; color: var(--lh-red); }

/* 首屏 */
.lh-hero { display: grid; grid-template-columns: 1.5fr .62fr; gap: 22px; margin: 22px 0 22px; }
.lh-hero-copy { background: var(--lh-paper); border: 1px solid var(--lh-line); border-radius: 3px;
    padding: 28px 30px; box-shadow: var(--lh-shadow); border-top: 5px solid var(--lh-ink); }
.lh-hero h1 { font-size: clamp(24px, 2.9vw, 34px); line-height: 1.4; margin: 10px 0 8px; }
.lh-sub { font-size: 14px; line-height: 1.95; color: var(--lh-sub); margin: 0 0 18px; max-width: 690px; }
.lh-sub b { color: var(--lh-red); }
.lh-page input, .lh-page select, .lh-page textarea { font: inherit; color: var(--lh-ink); background: var(--lh-paper);
    border: 1px solid var(--lh-line); border-radius: 3px; padding: 9px 11px; outline: none; box-sizing: border-box; }
.lh-page input:focus, .lh-page select:focus, .lh-page textarea:focus { border-color: var(--lh-red); }
.lh-field { display: flex; flex-direction: column; gap: 5px; font-size: 11.5px; color: var(--lh-sub); }
.lh-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.lh-form .lh-field { flex: 1 1 130px; }
.lh-btn { font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; border: 1px solid var(--lh-line);
    background: var(--lh-paper); color: var(--lh-ink); border-radius: 3px; padding: 9px 15px; white-space: nowrap; }
.lh-btn:hover { border-color: var(--lh-red); }
.lh-btn--main { background: var(--lh-ink); color: #fff; border-color: var(--lh-ink); }
.lh-btn--main:hover { background: var(--lh-red); border-color: var(--lh-red); }
.lh-presets { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 14px; }
.lh-preset { font: inherit; font-size: 11.5px; cursor: pointer; border: 1px dashed var(--lh-line);
    background: var(--lh-fill); color: var(--lh-brand); padding: 3px 10px; border-radius: 2px; }
.lh-preset:hover, .lh-preset.is-on { border-style: solid; border-color: var(--lh-red); color: var(--lh-red); }
.lh-err { color: var(--lh-red); font-size: 12.5px; min-height: 20px; margin: 8px 0 0; }
.lh-hint { font-size: 11.5px; color: var(--lh-sub); line-height: 1.85; margin: 12px 0 0; }
.lh-result { background: var(--lh-fill); border: 1px solid var(--lh-line); border-radius: 3px; padding: 18px 20px; box-shadow: var(--lh-shadow); }
.lh-result-h { font-size: 10px; letter-spacing: .14em; color: var(--lh-sub); border-bottom: 1px solid var(--lh-line); padding-bottom: 9px; }
.lh-big { display: flex; align-items: baseline; gap: 8px; margin: 12px 0 14px; }
.lh-big b { font: 700 46px Georgia, serif; line-height: 1; color: var(--lh-red); font-variant-numeric: tabular-nums; }
.lh-big span { font-size: 12px; color: var(--lh-sub); }
.lh-unit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.lh-unit-grid div { background: var(--lh-paper); border: 1px solid var(--lh-line); padding: 8px 10px; border-radius: 2px; }
.lh-unit-grid span { display: block; font-size: 10.5px; color: var(--lh-sub); }
.lh-unit-grid b { font: 700 17px Georgia, serif; font-variant-numeric: tabular-nums; }
.lh-note { font-size: 11.5px; line-height: 1.8; color: var(--lh-sub); margin-top: 12px; border-top: 1px dashed var(--lh-line); padding-top: 10px; }
.lh-note.is-warn { color: var(--lh-red); }

/* 标尺与样例 */
.lh-layout { display: grid; grid-template-columns: 1.35fr .65fr; gap: 18px; align-items: start; }
.lh-panel { background: var(--lh-paper); border: 1px solid var(--lh-line); border-radius: 3px;
    padding: 18px 20px; box-shadow: var(--lh-shadow); min-width: 0; margin-top: 18px; }
.lh-layout .lh-panel { margin-top: 0; }
.lh-panel-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
    border-bottom: 2px solid var(--lh-ink); padding-bottom: 10px; margin-bottom: 14px; }
.lh-panel-h b { font-size: 16px; }
.lh-panel-h span { font-size: 11.5px; color: var(--lh-sub); }
.lh-ruler { height: 54px; border: 1px solid var(--lh-line); background: var(--lh-fill); position: relative; overflow: hidden; margin-bottom: 14px; }
.lh-ruler i { position: absolute; bottom: 0; width: 1px; background: var(--lh-sub); }
.lh-ruler i.is-major { height: 20px; background: var(--lh-ink); }
.lh-ruler i.is-minor { height: 10px; }
.lh-ruler span { position: absolute; top: 5px; font: 10px Georgia, serif; color: var(--lh-sub); transform: translateX(-50%); }
.lh-ruler em { position: absolute; left: 0; right: 0; bottom: 20px; height: 3px; background: var(--lh-red); opacity: .8; }
.lh-specimen { display: grid; grid-template-columns: 92px 1fr; gap: 14px; align-items: stretch; }
.lh-glyph { position: relative; border: 1px solid var(--lh-line); background: repeating-linear-gradient(0deg, var(--lh-fill) 0 1px, transparent 1px 12px);
    display: flex; align-items: center; justify-content: center; min-height: 150px; }
.lh-glyph span { font: 700 54px Georgia, serif; color: var(--lh-ink); }
.lh-glyph i { position: absolute; right: 6px; top: 12px; width: 2px; background: var(--lh-red); }
.lh-glyph i::before, .lh-glyph i::after { content: ""; position: absolute; left: -3px; width: 8px; height: 8px;
    border-left: 2px solid var(--lh-red); border-top: 2px solid var(--lh-red); }
.lh-glyph i::before { top: 0; transform: rotate(45deg); }
.lh-glyph i::after { bottom: 0; transform: rotate(225deg); }
.lh-para { border: 1px solid var(--lh-line); padding: 16px 18px; background: var(--lh-paper);
    background-image: repeating-linear-gradient(0deg, transparent 0 calc(var(--lh-grid-step, 24px) - 1px), var(--lh-grid) calc(var(--lh-grid-step, 24px) - 1px) var(--lh-grid-step, 24px)); }
.lh-para p { margin: 0 0 1em; font-size: 15px; }
.lh-css { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; padding-top: 12px;
    border-top: 1px dashed var(--lh-line); font-size: 12px; }
.lh-css code { background: var(--lh-fill); border: 1px solid var(--lh-line); padding: 4px 9px; border-radius: 2px;
    font-family: Consolas, monospace; color: var(--lh-brand); }
.lh-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.lh-table th, .lh-table td { padding: 8px 9px; border-bottom: 1px solid var(--lh-line); text-align: left; }
.lh-table th { background: var(--lh-fill); color: var(--lh-sub); font-weight: 600; white-space: nowrap; }
.lh-table-scroll { overflow-x: auto; margin-top: 10px; }
.lh-batch td { font-variant-numeric: tabular-nums; }
.lh-empty { text-align: center; color: var(--lh-sub); padding: 18px; }
.lh-panel textarea { width: 100%; resize: vertical; font: 12.5px Consolas, monospace; }
.lh-btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

/* 弹窗：批量完成后触发 */
.lh-modal[hidden] { display: none !important; }
.lh-modal { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center;
    background: rgba(30,34,36,.62); padding: 20px; }
.lh-modal-box { position: relative; width: min(440px, 100%); background: var(--lh-paper); color: var(--lh-ink);
    padding: 28px 30px; border-radius: 3px; border-top: 5px solid var(--lh-red); box-shadow: 0 22px 54px rgba(0,0,0,.32); }
.lh-modal-x { position: absolute; right: 12px; top: 6px; border: 0; background: none; font-size: 24px; color: var(--lh-sub); cursor: pointer; }
.lh-modal-box h2 { margin: 8px 0 10px; font-size: 22px; }
.lh-modal-box p { font-size: 14px; color: var(--lh-sub); line-height: 1.9; }
.ws-toast { position: fixed; left: 50%; bottom: 30px; transform: translate(-50%, 16px); z-index: 10000;
    background: var(--lh-ink); color: var(--lh-paper); padding: 10px 20px; border-radius: 3px;
    font-size: 13px; opacity: 0; pointer-events: none; transition: .25s; }
.ws-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.ws-toast.is-err { background: var(--lh-red); color: #fff; }

@media (max-width: 960px) { .lh-hero, .lh-layout { grid-template-columns: 1fr; } }
@media (max-width: 480px) {
    .lh-wrap { padding: 0 12px; } .lh-hero-copy, .lh-panel { padding: 18px 14px; }
    .lh-specimen { grid-template-columns: 1fr; } .lh-glyph { min-height: 90px; }
    .lh-table { min-width: 0; }
}

/* dark button contrast fix */
:root[data-theme="dark"] .lh-btn--main { background: #ef7a63; border-color: #ef7a63; color: #1a1210; }
