/* =====================================================================
   H15 工具站设计系统 · 2026 重构版
   - 全新配色：暖纸底 + 墨青/铜橙，深色为深墨蓝绿，彻底区别于旧版蓝紫
   - 全新字体层级：正文 15px/1.8，标题独立字阶与字族，数字统一等宽
   - 主题：跟随导航 #themeToggle（localStorage.theme = auto/light/dark）
     浅色默认取 --a1，深色取 --a2；每个工具在自己的 CSS 里只覆盖这两组色
   - 所有规则限定在 .h15 作用域，不污染线上已有页面
   ===================================================================== */

.h15 {
    /* 字族 */
    --h15-font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
    --h15-font-serif: "Songti SC", "STSong", "Noto Serif CJK SC", "SimSun", Georgia, serif;
    --h15-font-num: ui-monospace, "SFMono-Regular", "Cascadia Code", Consolas, "Liberation Mono", monospace;

    /* 字阶：层级清晰，行距充足 */
    --h15-fs-11: 11px;
    --h15-fs-12: 12px;
    --h15-fs-13: 13px;
    --h15-fs-14: 14px;
    --h15-fs-15: 15px;
    --h15-fs-16: 16px;
    --h15-fs-18: 18px;
    --h15-fs-22: 22px;
    --h15-fs-28: 28px;
    --h15-fs-36: 36px;
    --h15-lh: 1.8;
    --h15-lh-tight: 1.3;
    --h15-h1: clamp(28px, 3.4vw, 40px);
    --h15-h2: 19px;
    --h15-h3: 15px;

    /* 主题色：由各工具 CSS 覆盖 --a1 / --a2 */
    --h15-accent: var(--a1, #0f7c73);
    --h15-accent-2: var(--a1b, #c2683a);
    --h15-accent-soft: var(--a1s, #e7f3f0);
    --h15-accent-ink: var(--a1i, #0a5750);

    /* 中性色 */
    --h15-page: #f4f2ec;
    --h15-card: #fffefb;
    --h15-card-2: #faf8f2;
    --h15-ink: #1b2a30;
    --h15-ink-2: #43565d;
    --h15-ink-3: #77878c;
    --h15-line: #e3ded2;
    --h15-line-2: #eeeae0;
    --h15-ok: #1c8a63;
    --h15-warn: #b8791c;
    --h15-bad: #c0453b;
    --h15-up: #d0403a;   /* A 股习惯：红涨 */
    --h15-down: #178a68; /* 绿跌 */

    --h15-r: 16px;
    --h15-r-sm: 10px;
    --h15-shadow: 0 1px 2px rgba(27, 42, 48, .04), 0 14px 38px rgba(27, 42, 48, .07);
    --h15-shadow-sm: 0 1px 3px rgba(27, 42, 48, .06);
    --h15-maxw: 1180px;

    max-width: var(--h15-maxw);
    margin: 0 auto;
    padding: 0 22px 72px;
    color: var(--h15-ink);
    font-family: var(--h15-font);
    font-size: var(--h15-fs-15);
    line-height: var(--h15-lh);
    -webkit-font-smoothing: antialiased;
}

.h15 *, .h15 *::before, .h15 *::after { box-sizing: border-box; }
.h15 [hidden] { display: none !important; }
.h15 p { margin: 0 0 12px; }
.h15 strong, .h15 b { font-weight: 700; color: var(--h15-ink); }
.h15 code, .h15 kbd { font-family: var(--h15-font-num); font-size: .92em; }
.h15 a { color: var(--h15-accent-ink); text-decoration: none; }
.h15 a:hover { text-decoration: underline; }
.h15 ::selection { background: var(--h15-accent-soft); }

/* ---------- 深色主题：由导航按钮切换，layout 的 head 脚本同步写入 data-theme ---------- */
:root[data-theme="dark"] .h15 {
    --h15-accent: var(--a2, #63d3c0);
    --h15-accent-2: var(--a2b, #f0ad72);
    --h15-accent-soft: var(--a2s, rgba(99, 211, 192, .14));
    --h15-accent-ink: var(--a2i, #9ae6d9);
    --h15-page: #0c1418;
    --h15-card: #141f25;
    --h15-card-2: #19262d;
    --h15-ink: #e7efec;
    --h15-ink-2: #b3c3c1;
    --h15-ink-3: #849892;
    --h15-line: #294047;
    --h15-line-2: #22333a;
    --h15-ok: #58c69b;
    --h15-warn: #e0ae5b;
    --h15-bad: #f07d73;
    --h15-up: #f0736c;
    --h15-down: #4ec49a;
    --h15-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 16px 42px rgba(0, 0, 0, .34);
    --h15-shadow-sm: 0 1px 3px rgba(0, 0, 0, .3);
}
:root[data-theme="dark"] .h15 strong,
:root[data-theme="dark"] .h15 b { color: #f4faf8; }

/* ---------- 面包屑（复用公共 partials.tool-station.crumb 的 DOM） ---------- */
.tsk-crumb-bar { background: transparent; border: 0; }
.h15 ~ .tsk-crumb-bar, .tsk-crumb-bar { }
.tsk-crumb-bar-in { max-width: var(--h15-maxw, 1180px); margin: 0 auto; padding: 18px 22px 0; }
.tsk-crumb { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: var(--h15-fs-13, 13px); line-height: 1.5; }
.tsk-crumb a { color: var(--h15-ink-3, #77878c); }
.tsk-crumb a:hover { color: var(--h15-accent, #0f7c73); }
.tsk-crumb-sep { color: var(--h15-ink-3, #77878c); opacity: .6; }
.tsk-crumb-cur { color: var(--h15-ink-2, #43565d); font-weight: 600; }
:root[data-theme="dark"] .tsk-crumb a { color: #849892; }
:root[data-theme="dark"] .tsk-crumb-cur { color: #b3c3c1; }

/* ---------- 首屏：3 秒内讲清价值，操作入口直接可见 ---------- */
.h15-hero {
    position: relative;
    overflow: hidden;
    margin: 20px 0 24px;
    padding: 34px 38px 32px;
    border: 1px solid var(--h15-line);
    border-radius: calc(var(--h15-r) + 6px);
    background:
        radial-gradient(760px 260px at 92% -20%, var(--h15-accent-soft) 0%, transparent 70%),
        linear-gradient(140deg, var(--h15-card) 0%, var(--h15-card-2) 100%);
    box-shadow: var(--h15-shadow-sm);
}
.h15-hero::before {
    content: ""; position: absolute; inset: 0 auto 0 0; width: 5px;
    background: linear-gradient(180deg, var(--h15-accent), var(--h15-accent-2));
}
.h15-eyebrow {
    display: inline-flex; align-items: center; gap: 7px;
    margin: 0 0 12px; padding: 3px 11px;
    border: 1px solid var(--h15-line); border-radius: 999px;
    background: var(--h15-card);
    color: var(--h15-accent-ink); font-size: var(--h15-fs-12); font-weight: 700;
    letter-spacing: .06em;
}
.h15-eyebrow-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--h15-accent); }
.h15-h1 {
    margin: 0 0 10px;
    font-size: var(--h15-h1);
    font-weight: 800;
    line-height: var(--h15-lh-tight);
    letter-spacing: -.01em;
    color: var(--h15-ink);
}
.h15-h1 em { font-style: normal; color: var(--h15-accent-ink); }
.h15-sub {
    max-width: 760px; margin: 0 0 20px;
    font-size: var(--h15-fs-16); line-height: 1.75;
    color: var(--h15-ink-2);
}
.h15-sub strong { color: var(--h15-accent-ink); }
.h15-hero-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.h15-hero-meta {
    display: flex; flex-wrap: wrap; gap: 8px 18px;
    margin-top: 18px; padding-top: 16px;
    border-top: 1px dashed var(--h15-line);
    color: var(--h15-ink-3); font-size: var(--h15-fs-12);
}
.h15-hero-meta span { display: inline-flex; align-items: center; gap: 5px; }

/* ---------- 布局骨架 ---------- */
.h15-row { display: grid; gap: 20px; align-items: start; }
.h15-row--2 { grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); }
.h15-row--side { grid-template-columns: 320px minmax(0, 1fr); }
.h15-row--dash { grid-template-columns: minmax(0, 1fr) 300px; }
.h15-row--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.h15-stack { display: grid; gap: 18px; }

.h15-panel {
    padding: 22px;
    border: 1px solid var(--h15-line);
    border-radius: var(--h15-r);
    background: var(--h15-card);
    box-shadow: var(--h15-shadow-sm);
}
.h15-panel--flat { box-shadow: none; background: var(--h15-card-2); }
.h15-panel-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.h15-panel-t { margin: 0; font-size: var(--h15-h2); font-weight: 750; letter-spacing: -.01em; }
.h15-panel-n {
    display: inline-grid; place-items: center; width: 26px; height: 26px; margin-right: 8px;
    border-radius: 8px; background: var(--h15-accent-soft); color: var(--h15-accent-ink);
    font-family: var(--h15-font-num); font-size: var(--h15-fs-12); font-weight: 700; vertical-align: 2px;
}
.h15-panel-d { margin: -6px 0 16px; color: var(--h15-ink-3); font-size: var(--h15-fs-13); }
.h15-h2 { margin: 34px 0 14px; font-size: var(--h15-fs-22); font-weight: 750; letter-spacing: -.01em; }
.h15-h3 { margin: 0 0 8px; font-size: var(--h15-h3); font-weight: 700; }
.h15-lead { color: var(--h15-ink-2); font-size: var(--h15-fs-14); }

/* ---------- 表单 ---------- */
.h15-field { margin-bottom: 15px; }
.h15-field:last-child { margin-bottom: 0; }
.h15-label { display: block; margin-bottom: 6px; font-size: var(--h15-fs-13); font-weight: 700; color: var(--h15-ink-2); }
.h15-label small { font-weight: 400; color: var(--h15-ink-3); }
.h15-input, .h15-select, .h15-textarea {
    width: 100%; padding: 9px 12px;
    border: 1px solid var(--h15-line); border-radius: var(--h15-r-sm);
    background: var(--h15-card); color: var(--h15-ink);
    font-family: inherit; font-size: var(--h15-fs-14); line-height: 1.6;
    outline: none; transition: border-color .16s, box-shadow .16s;
}
.h15-textarea { min-height: 92px; resize: vertical; font-family: var(--h15-font-num); font-size: var(--h15-fs-13); }
.h15-input:focus, .h15-select:focus, .h15-textarea:focus {
    border-color: var(--h15-accent); box-shadow: 0 0 0 3px var(--h15-accent-soft);
}
.h15-input::placeholder, .h15-textarea::placeholder { color: var(--h15-ink-3); }
.h15-input[aria-invalid="true"], .h15-textarea[aria-invalid="true"] { border-color: var(--h15-bad); }
:root[data-theme="dark"] .h15 .h15-input,
:root[data-theme="dark"] .h15 .h15-select,
:root[data-theme="dark"] .h15 .h15-textarea { background: rgba(255, 255, 255, .025); border-color: var(--h15-line); color: var(--h15-ink); }
.h15-hint { margin: 5px 0 0; font-size: var(--h15-fs-12); color: var(--h15-ink-3); line-height: 1.6; }
.h15-err { min-height: 18px; margin: 6px 0 0; font-size: var(--h15-fs-12); color: var(--h15-bad); font-weight: 600; }
.h15-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.h15-grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 14px; }
.h15-check { display: inline-flex; align-items: center; gap: 7px; font-size: var(--h15-fs-13); color: var(--h15-ink-2); cursor: pointer; }
.h15-check input { accent-color: var(--h15-accent); width: 15px; height: 15px; }
.h15-range { width: 100%; accent-color: var(--h15-accent); }

/* ---------- 按钮 ---------- */
.h15-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    padding: 10px 18px; border: 1px solid transparent; border-radius: 999px;
    background: var(--h15-accent); color: #fff;
    font-family: inherit; font-size: var(--h15-fs-14); font-weight: 700; line-height: 1.4;
    cursor: pointer; transition: transform .14s, filter .14s, background .14s, border-color .14s;
}
.h15-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.h15-btn:active { transform: none; }
.h15-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; filter: none; }
.h15-btn--ghost { background: transparent; color: var(--h15-accent-ink); border-color: var(--h15-line); }
.h15-btn--ghost:hover { border-color: var(--h15-accent); background: var(--h15-accent-soft); }
.h15-btn--soft { background: var(--h15-accent-soft); color: var(--h15-accent-ink); }
.h15-btn--sm { padding: 6px 12px; font-size: var(--h15-fs-12); }
.h15-btn--ai { background: linear-gradient(120deg, var(--h15-accent), var(--h15-accent-2)); }
:root[data-theme="dark"] .h15 .h15-btn { color: #071316; }
:root[data-theme="dark"] .h15 .h15-btn--ghost { color: var(--h15-accent-ink); background: transparent; }
:root[data-theme="dark"] .h15 .h15-btn--soft { color: var(--h15-accent-ink); background: var(--h15-accent-soft); }
.h15-btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

/* ---------- 标签 / 徽标 ---------- */
.h15-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.h15-chip {
    padding: 5px 12px; border: 1px solid var(--h15-line); border-radius: 999px;
    background: var(--h15-card); color: var(--h15-ink-2);
    font-size: var(--h15-fs-12); font-weight: 600; cursor: pointer;
    transition: all .14s;
}
.h15-chip:hover { border-color: var(--h15-accent); }
.h15-chip.is-on { background: var(--h15-accent); border-color: var(--h15-accent); color: #fff; }
:root[data-theme="dark"] .h15 .h15-chip.is-on { color: #071316; }
.h15-tag { display: inline-block; padding: 2px 9px; border-radius: 6px; background: var(--h15-accent-soft); color: var(--h15-accent-ink); font-size: var(--h15-fs-11); font-weight: 700; }
.h15-tag--ok { background: rgba(28, 138, 99, .12); color: var(--h15-ok); }
.h15-tag--warn { background: rgba(184, 121, 28, .14); color: var(--h15-warn); }
.h15-tag--bad { background: rgba(192, 69, 59, .13); color: var(--h15-bad); }

/* ---------- 结果 / 数据 ---------- */
.h15-result { min-height: 60px; }
.h15-empty { padding: 26px 16px; border: 1px dashed var(--h15-line); border-radius: var(--h15-r-sm); text-align: center; color: var(--h15-ink-3); font-size: var(--h15-fs-13); }
.h15-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.h15-kpi { padding: 13px 14px; border: 1px solid var(--h15-line); border-radius: var(--h15-r-sm); background: var(--h15-card-2); }
.h15-kpi-v { display: block; font-family: var(--h15-font-num); font-size: var(--h15-fs-22); font-weight: 700; color: var(--h15-ink); line-height: 1.3; }
.h15-kpi-l { display: block; font-size: var(--h15-fs-12); color: var(--h15-ink-3); }
.h15-kpi--accent .h15-kpi-v { color: var(--h15-accent-ink); }
.h15-num { font-family: var(--h15-font-num); font-variant-numeric: tabular-nums; }
.h15-up { color: var(--h15-up); }
.h15-down { color: var(--h15-down); }

.h15-tbl-wrap { overflow: auto; border: 1px solid var(--h15-line); border-radius: var(--h15-r-sm); }
.h15-tbl { width: 100%; border-collapse: collapse; font-size: var(--h15-fs-13); }
.h15-tbl th, .h15-tbl td { padding: 9px 11px; border-bottom: 1px solid var(--h15-line-2); text-align: left; white-space: nowrap; }
.h15-tbl th { position: sticky; top: 0; background: var(--h15-card-2); color: var(--h15-ink-2); font-size: var(--h15-fs-12); font-weight: 700; z-index: 1; }
.h15-tbl tr:last-child td { border-bottom: 0; }
.h15-tbl tbody tr:hover { background: var(--h15-accent-soft); }
.h15-tbl td.h15-num, .h15-tbl th.h15-num { text-align: right; }

.h15-list { margin: 0; padding: 0; list-style: none; }
.h15-list li { position: relative; padding: 8px 0 8px 20px; border-bottom: 1px dashed var(--h15-line-2); font-size: var(--h15-fs-14); }
.h15-list li:last-child { border-bottom: 0; }
.h15-list li::before { content: ""; position: absolute; left: 3px; top: 17px; width: 6px; height: 6px; border-radius: 50%; background: var(--h15-accent); }
.h15-note { padding: 12px 14px; border-left: 3px solid var(--h15-accent); border-radius: 0 var(--h15-r-sm) var(--h15-r-sm) 0; background: var(--h15-accent-soft); color: var(--h15-ink-2); font-size: var(--h15-fs-13); line-height: 1.75; }
.h15-note--warn { border-left-color: var(--h15-warn); background: rgba(184, 121, 28, .09); }

/* ---------- 图文：压缩矢量图 + 原生懒加载 ---------- */
.h15-figure { margin: 14px 0; text-align: center; }
.h15-figure img { max-width: 100%; height: auto; border-radius: var(--h15-r-sm); border: 1px solid var(--h15-line); }

/* ---------- FAQ / 正文分段：降低阅读阻力 ---------- */
.h15-faq { display: grid; gap: 10px; }
.h15-faq-item { padding: 16px 18px; border: 1px solid var(--h15-line); border-radius: var(--h15-r-sm); background: var(--h15-card); }
.h15-faq-q { margin: 0 0 7px; font-size: var(--h15-fs-15); font-weight: 750; color: var(--h15-ink); }
.h15-faq-a { margin: 0; font-size: var(--h15-fs-14); line-height: 1.85; color: var(--h15-ink-2); }
.h15-faq-a strong { color: var(--h15-accent-ink); }
.h15-prose { font-size: var(--h15-fs-15); line-height: 1.95; color: var(--h15-ink-2); }
.h15-prose p { margin-bottom: 14px; }
.h15-foot { margin-top: 34px; padding-top: 18px; border-top: 1px solid var(--h15-line); color: var(--h15-ink-3); font-size: var(--h15-fs-12); line-height: 1.8; }

/* ---------- 弹窗：仅由用户完成操作后打开，页面加载绝不自动弹 ---------- */
.h15-modal[hidden] { display: none !important; }
.h15-modal { position: fixed; inset: 0; z-index: 9000; display: grid; place-items: center; padding: 20px; }
.h15-modal-mask { position: absolute; inset: 0; background: rgba(12, 20, 24, .58); backdrop-filter: blur(3px); }
.h15-modal-box {
    position: relative; width: min(620px, 100%); max-height: 84vh; overflow: auto;
    padding: 26px; border-radius: var(--h15-r); border: 1px solid var(--h15-line);
    background: var(--h15-card); color: var(--h15-ink); box-shadow: 0 24px 70px rgba(0, 0, 0, .28);
}
.h15-modal-x { position: absolute; right: 14px; top: 12px; border: 0; background: transparent; color: var(--h15-ink-3); font-size: 24px; line-height: 1; cursor: pointer; }
.h15-modal-t { margin: 0 0 12px; font-size: var(--h15-fs-18); font-weight: 750; }

.h15-toast {
    position: fixed; left: 50%; bottom: 34px; z-index: 9500;
    transform: translate(-50%, 18px); opacity: 0; pointer-events: none;
    padding: 10px 20px; border-radius: 999px;
    background: var(--h15-ink); color: var(--h15-card);
    font-size: var(--h15-fs-13); font-weight: 600;
    transition: opacity .2s, transform .2s;
}
.h15-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.h15-toast.is-bad { background: var(--h15-bad); color: #fff; }

/* ---------- 窄屏防横向溢出（仅作用于加载本样式的 H15 页面） ----------
   grid 子项默认 min-width:auto，会被 min-width 较大的表格撑开整列；
   公共「下一步推荐」在窄屏的 1fr 列同理。统一允许收缩，表格在自己的
   .h15-tbl-wrap 内横向滚动，不改动任何公共文件与其它页面。 */
.h15 [class*="-desk"], .h15 .h15-row { min-width: 0; }
.h15 [class*="-desk"] > *, .h15 .h15-row > *, .h15-panel, .h15-tbl-wrap { min-width: 0; max-width: 100%; }
@media (max-width: 1000px) {
    .tool-rec { width: calc(100% - 24px); max-width: 100%; min-width: 0; box-sizing: border-box; }
    .tool-rec-item, .tool-rec-body { min-width: 0; max-width: 100%; }
}
@media (max-width: 640px) {
    .tool-rec-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- 响应式 ---------- */
@media (max-width: 960px) {
    .h15-row--2, .h15-row--side, .h15-row--dash, .h15-row--3 { grid-template-columns: 1fr; }
    .h15-hero { padding: 26px 22px; }
}
@media (max-width: 620px) {
    .h15 { padding: 0 14px 56px; }
    .tsk-crumb-bar-in { padding: 14px 14px 0; }
    .h15-hero { margin-top: 14px; padding: 22px 18px; }
    .h15-grid2, .h15-grid3 { grid-template-columns: 1fr; }
    .h15-panel { padding: 17px; }
    .h15-h1 { font-size: 27px; }
    .h15-sub { font-size: var(--h15-fs-15); }
}
@media (prefers-reduced-motion: reduce) {
    .h15 *, .h15 *::before, .h15 *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@media print {
    .h15-hero-actions, .h15-btn, .h15-toast, .h15-modal, .tsk-crumb-bar { display: none !important; }
    .h15 { max-width: none; padding: 0; }
    .h15-panel { box-shadow: none; break-inside: avoid; }
}
