/* =====================================================================
 *  T19 工具站设计系统 · 第 31–49 号新工具独立页
 *  ---------------------------------------------------------------------
 *  设计基调：冷白石墨底 + 单一强调色 + 等宽数字，直角卡片 + 细网格纹理。
 *  与 H15（暖纸+铜橙）、tools200（蓝紫）明显区分，互不覆盖。
 *
 *  主题：跟随导航栏 #themeToggle（localStorage.theme = auto/light/dark）
 *    浅色取 --a1 系列，深色取 --a2 系列；每个工具只在自己的 CSS 里覆盖
 *    这两组变量，页面其余部分自动跟随导航上的黑夜模式按钮。
 *
 *  作用域：所有规则限定在 .t19 内，不污染线上已有页面。
 * ===================================================================== */

.t19 {
    /* ---- 字族 ---- */
    --t19-font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, -apple-system, "Segoe UI", sans-serif;
    --t19-font-num: ui-monospace, "SFMono-Regular", "Cascadia Code", "Consolas", "Liberation Mono", monospace;

    /* ---- 字阶与行距（阅读阻力最小化） ---- */
    --t19-fs-11: 11px;
    --t19-fs-12: 12px;
    --t19-fs-13: 13px;
    --t19-fs-14: 14px;
    --t19-fs-15: 15px;
    --t19-fs-16: 16px;
    --t19-fs-18: 18px;
    --t19-fs-21: 21px;
    --t19-fs-26: 26px;
    --t19-fs-34: 34px;
    --t19-lh: 1.82;
    --t19-lh-tight: 1.28;
    --t19-h1: clamp(27px, 3.2vw, 38px);
    --t19-h2: 20px;
    --t19-h3: 15px;

    /* ---- 强调色（由各工具 CSS 覆盖 --a1 / --a2） ---- */
    --t19-accent: var(--a1, #1f5fd8);
    --t19-accent-2: var(--a1b, #0e3f96);
    --t19-accent-soft: var(--a1s, #e8eefb);
    --t19-accent-ink: var(--a1i, #17408f);

    /* ---- 中性色 ---- */
    --t19-page: #eef1f5;
    --t19-card: #ffffff;
    --t19-card-2: #f7f9fb;
    --t19-ink: #171b22;
    --t19-ink-2: #454e5d;
    --t19-ink-3: #7c8798;
    --t19-line: #dfe4ea;
    --t19-line-2: #edf0f4;
    --t19-ok: #0f7b52;
    --t19-warn: #a86a09;
    --t19-bad: #c0392f;
    --t19-info: #0e7490;

    --t19-r: 14px;
    --t19-r-sm: 9px;
    --t19-shadow: 0 1px 2px rgba(23, 27, 34, .05), 0 12px 34px rgba(23, 27, 34, .07);
    --t19-shadow-sm: 0 1px 3px rgba(23, 27, 34, .06);
    --t19-maxw: 1180px;

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

.t19 *, .t19 *::before, .t19 *::after { box-sizing: border-box; }
.t19 [hidden] { display: none !important; }
.t19 p { margin: 0 0 12px; }
.t19 strong, .t19 b { font-weight: 700; color: var(--t19-ink); }
.t19 a { color: var(--t19-accent-ink); text-decoration: none; }
.t19 a:hover { text-decoration: underline; }
.t19 ::selection { background: var(--t19-accent-soft); }
.t19 ul, .t19 ol { margin: 0 0 12px; padding-left: 22px; }
.t19 li { margin: 0 0 6px; }

/* ---------- 深色主题：由导航按钮切换 ---------- */
:root[data-theme="dark"] .t19 {
    --t19-accent: var(--a2, #7aa8ff);
    --t19-accent-2: var(--a2b, #a9c6ff);
    --t19-accent-soft: var(--a2s, rgba(122, 168, 255, .14));
    --t19-accent-ink: var(--a2i, #a8c6ff);
    --t19-page: #0e1218;
    --t19-card: #161c25;
    --t19-card-2: #1b222c;
    --t19-ink: #e9eef5;
    --t19-ink-2: #b3bece;
    --t19-ink-3: #808d9f;
    --t19-line: #29313d;
    --t19-line-2: #222a35;
    --t19-ok: #4dc79a;
    --t19-warn: #e0ac59;
    --t19-bad: #f07f76;
    --t19-info: #4cc0dd;
    --t19-shadow: 0 1px 2px rgba(0, 0, 0, .34), 0 14px 38px rgba(0, 0, 0, .36);
    --t19-shadow-sm: 0 1px 3px rgba(0, 0, 0, .32);
}
:root[data-theme="dark"] .t19 strong,
:root[data-theme="dark"] .t19 b { color: #f6f9fd; }
:root[data-theme="dark"] .t19 input,
:root[data-theme="dark"] .t19 select,
:root[data-theme="dark"] .t19 textarea {
    background: rgba(255, 255, 255, .025);
    border-color: var(--t19-line);
    color: var(--t19-ink);
}

/* ---------- 面包屑（复用公共 partials.tool-station.crumb 的 DOM） ---------- */
.tsk-crumb-bar { background: transparent; border: 0; }
.tsk-crumb-bar-in { max-width: var(--t19-maxw, 1180px); margin: 0 auto; padding: 18px 22px 0; }
.tsk-crumb { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: var(--t19-fs-13, 13px); line-height: 1.6; }
.tsk-crumb a { color: var(--t19-ink-3, #7c8798); }
.tsk-crumb a:hover { color: var(--t19-accent, #1f5fd8); }
.tsk-crumb-sep { color: var(--t19-ink-3, #7c8798); opacity: .55; }
.tsk-crumb-cur { color: var(--t19-ink-2, #454e5d); font-weight: 600; }
:root[data-theme="dark"] .tsk-crumb a { color: #808d9f; }
:root[data-theme="dark"] .tsk-crumb-cur { color: #b3bece; }

/* ---------- 首屏：3 秒讲清价值，操作入口直接可见 ---------- */
.t19-hero {
    position: relative;
    overflow: hidden;
    margin: 18px 0 22px;
    padding: 32px 34px 30px;
    border: 1px solid var(--t19-line);
    border-radius: var(--t19-r);
    background:
        radial-gradient(720px 240px at 100% -30%, var(--t19-accent-soft) 0%, transparent 68%),
        linear-gradient(160deg, var(--t19-card) 0%, var(--t19-card-2) 100%);
    box-shadow: var(--t19-shadow-sm);
}
.t19-hero::after {
    content: "";
    position: absolute; inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(to right, var(--t19-line-2) 1px, transparent 1px),
        linear-gradient(to bottom, var(--t19-line-2) 1px, transparent 1px);
    background-size: 28px 28px;
    opacity: .5;
    mask-image: radial-gradient(460px 200px at 88% 0%, #000 0%, transparent 72%);
    -webkit-mask-image: radial-gradient(460px 200px at 88% 0%, #000 0%, transparent 72%);
}
.t19-hero > * { position: relative; z-index: 1; }
.t19-eyebrow {
    display: inline-flex; align-items: center; gap: 7px;
    margin: 0 0 11px; padding: 3px 11px;
    border: 1px solid var(--t19-line); border-radius: 4px;
    background: var(--t19-card);
    color: var(--t19-accent-ink); font-size: var(--t19-fs-12); font-weight: 700;
    letter-spacing: .04em;
}
.t19-eyebrow-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--t19-accent); }
.t19-h1 {
    margin: 0 0 9px;
    font-size: var(--t19-h1);
    font-weight: 800;
    line-height: var(--t19-lh-tight);
    letter-spacing: -.015em;
    color: var(--t19-ink);
}
.t19-h1 em { font-style: normal; color: var(--t19-accent-ink); }
.t19-sub {
    max-width: 780px; margin: 0 0 20px;
    font-size: var(--t19-fs-16); line-height: 1.78;
    color: var(--t19-ink-2);
}
.t19-sub strong { color: var(--t19-accent-ink); }
.t19-hero-meta {
    display: flex; flex-wrap: wrap; gap: 7px 18px;
    margin-top: 16px; padding-top: 14px;
    border-top: 1px dashed var(--t19-line);
    color: var(--t19-ink-3); font-size: var(--t19-fs-12);
}
.t19-hero-meta span { display: inline-flex; align-items: center; gap: 5px; }

/* ---------- 布局骨架 ---------- */
.t19-row { display: grid; gap: 18px; align-items: start; }
.t19-row--2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.t19-row--side { grid-template-columns: 340px minmax(0, 1fr); }
.t19-row--dash { grid-template-columns: minmax(0, 1fr) 312px; }
.t19-row--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.t19-stack { display: grid; gap: 16px; }

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

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

/* ---------- 按钮 ---------- */
.t19-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    padding: 10px 18px; border: 1px solid transparent; border-radius: var(--t19-r-sm);
    background: var(--t19-accent); color: #fff;
    font-family: inherit; font-size: var(--t19-fs-14); font-weight: 700; line-height: 1.4;
    cursor: pointer; transition: filter .14s, transform .14s, background .14s, border-color .14s;
}
.t19-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.t19-btn:active { transform: none; }
.t19-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; filter: none; }
.t19-btn--ghost { background: transparent; color: var(--t19-accent-ink); border-color: var(--t19-line); }
.t19-btn--ghost:hover { border-color: var(--t19-accent); background: var(--t19-accent-soft); }
.t19-btn--soft { background: var(--t19-accent-soft); color: var(--t19-accent-ink); }
.t19-btn--sm { padding: 6px 11px; font-size: var(--t19-fs-12); }
.t19-btn--ai { background: linear-gradient(120deg, var(--t19-accent), var(--t19-accent-2)); }
:root[data-theme="dark"] .t19 .t19-btn { color: #08101c; }
:root[data-theme="dark"] .t19 .t19-btn--ghost { color: var(--t19-accent-ink); background: transparent; }
:root[data-theme="dark"] .t19 .t19-btn--soft { color: var(--t19-accent-ink); background: var(--t19-accent-soft); }
.t19-btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 13px; }
.t19-quick {
    display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end;
    padding: 14px 16px; margin-bottom: 4px;
    border: 1px solid var(--t19-line); border-radius: var(--t19-r);
    background: var(--t19-card); box-shadow: var(--t19-shadow-sm);
}
.t19-quick-f { display: flex; flex-direction: column; gap: 5px; min-width: 132px; flex: 0 1 auto; }
.t19-quick-f > span { font-size: var(--t19-fs-12); font-weight: 700; color: var(--t19-ink-3); letter-spacing: .02em; }

/* ---------- 标签 / 徽标 ---------- */
.t19-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.t19-chip {
    padding: 5px 11px; border: 1px solid var(--t19-line); border-radius: var(--t19-r-sm);
    background: var(--t19-card); color: var(--t19-ink-2);
    font-size: var(--t19-fs-12); font-weight: 600; cursor: pointer; transition: all .14s;
}
.t19-chip:hover { border-color: var(--t19-accent); }
.t19-chip.is-on { background: var(--t19-accent); border-color: var(--t19-accent); color: #fff; }
:root[data-theme="dark"] .t19 .t19-chip.is-on { color: #08101c; }
.t19-tag { display: inline-block; padding: 2px 8px; border-radius: 4px; background: var(--t19-accent-soft); color: var(--t19-accent-ink); font-size: var(--t19-fs-11); font-weight: 700; }
.t19-tag--ok { background: rgba(15, 123, 82, .12); color: var(--t19-ok); }
.t19-tag--warn { background: rgba(168, 106, 9, .14); color: var(--t19-warn); }
.t19-tag--bad { background: rgba(192, 57, 47, .13); color: var(--t19-bad); }
.t19-tag--info { background: rgba(14, 116, 144, .13); color: var(--t19-info); }

/* ---------- 结果 / 数据 ---------- */
.t19-empty { padding: 24px 16px; border: 1px dashed var(--t19-line); border-radius: var(--t19-r-sm); text-align: center; color: var(--t19-ink-3); font-size: var(--t19-fs-13); }
.t19-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(136px, 1fr)); gap: 9px; }
.t19-kpi { padding: 12px 13px; border: 1px solid var(--t19-line); border-radius: var(--t19-r-sm); background: var(--t19-card-2); }
.t19-kpi-v { display: block; font-family: var(--t19-font-num); font-size: var(--t19-fs-21); font-weight: 700; color: var(--t19-ink); line-height: 1.3; }
.t19-kpi-l { display: block; font-size: var(--t19-fs-12); color: var(--t19-ink-3); }
.t19-kpi--accent .t19-kpi-v { color: var(--t19-accent-ink); }
.t19-num { font-family: var(--t19-font-num); font-variant-numeric: tabular-nums; }
.t19-tbl-wrap { overflow: auto; border: 1px solid var(--t19-line); border-radius: var(--t19-r-sm); }
.t19-tbl { width: 100%; border-collapse: collapse; font-size: var(--t19-fs-13); }
.t19-tbl th, .t19-tbl td { padding: 9px 11px; border-bottom: 1px solid var(--t19-line-2); text-align: left; white-space: nowrap; }
.t19-tbl th { position: sticky; top: 0; background: var(--t19-card-2); color: var(--t19-ink-2); font-size: var(--t19-fs-12); font-weight: 700; z-index: 1; }
.t19-tbl tr:last-child td { border-bottom: 0; }
.t19-tbl tbody tr:hover { background: var(--t19-accent-soft); }
.t19-tbl td.h19-num, .t19-tbl th.h19-num { text-align: right; }
.t19-list { margin: 0; padding: 0; list-style: none; }
.t19-list li { position: relative; padding: 7px 0 7px 19px; border-bottom: 1px dashed var(--t19-line-2); font-size: var(--t19-fs-14); }
.t19-list li:last-child { border-bottom: 0; }
.t19-list li::before { content: ""; position: absolute; left: 2px; top: 16px; width: 6px; height: 6px; border-radius: 1px; background: var(--t19-accent); }
.t19-note { padding: 11px 13px; border-left: 3px solid var(--t19-accent); border-radius: 0 var(--t19-r-sm) var(--t19-r-sm) 0; background: var(--t19-accent-soft); color: var(--t19-ink-2); font-size: var(--t19-fs-13); line-height: 1.78; }
.t19-note--warn { border-left-color: var(--t19-warn); background: rgba(168, 106, 9, .09); }
.t19-note--bad { border-left-color: var(--t19-bad); background: rgba(192, 57, 47, .08); }

/* ---------- FAQ / 正文 ---------- */
.t19-faq { display: grid; gap: 9px; }
.t19-faq-item { padding: 15px 17px; border: 1px solid var(--t19-line); border-radius: var(--t19-r-sm); background: var(--t19-card); }
.t19-faq-q { margin: 0 0 6px; font-size: var(--t19-fs-15); font-weight: 750; color: var(--t19-ink); }
.t19-faq-a { margin: 0; font-size: var(--t19-fs-14); line-height: 1.88; color: var(--t19-ink-2); }
.t19-faq-a strong { color: var(--t19-accent-ink); }
.t19-prose { font-size: var(--t19-fs-15); line-height: 1.95; color: var(--t19-ink-2); }
.t19-prose p { margin-bottom: 14px; }
.t19-foot { margin-top: 32px; padding-top: 17px; border-top: 1px solid var(--t19-line); color: var(--t19-ink-3); font-size: var(--t19-fs-12); line-height: 1.85; }

/* ---------- 弹窗：只允许在用户完成一次操作后打开 ---------- */
.t19-modal[hidden] { display: none !important; }
.t19-modal { position: fixed; inset: 0; z-index: 9000; display: grid; place-items: center; padding: 20px; }
.t19-modal-mask { position: absolute; inset: 0; background: rgba(12, 16, 22, .58); backdrop-filter: blur(3px); }
.t19-modal-box {
    position: relative; width: min(640px, 100%); max-height: 84vh; overflow: auto;
    padding: 24px; border-radius: var(--t19-r); border: 1px solid var(--t19-line);
    background: var(--t19-card); color: var(--t19-ink); box-shadow: 0 24px 70px rgba(0, 0, 0, .28);
}
.t19-modal-x { position: absolute; right: 12px; top: 10px; border: 0; background: transparent; color: var(--t19-ink-3); font-size: 24px; line-height: 1; cursor: pointer; }
.t19-modal-t { margin: 0 0 12px; font-size: var(--t19-fs-18); font-weight: 750; }

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

/* ---------- 窄屏防溢出 ---------- */
.t19 [class*="-desk"], .t19 .t19-row { min-width: 0; }
.t19 [class*="-desk"] > *, .t19 .t19-row > *, .t19-panel, .t19-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) {
    .t19-row--2, .t19-row--side, .t19-row--dash, .t19-row--3 { grid-template-columns: 1fr; }
    .t19-hero { padding: 24px 20px; }
}
@media (max-width: 620px) {
    .t19 { padding: 0 14px 54px; }
    .tsk-crumb-bar-in { padding: 14px 14px 0; }
    .t19-hero { margin-top: 12px; padding: 20px 16px; }
    .t19-grid2, .t19-grid3 { grid-template-columns: 1fr; }
    .t19-panel { padding: 16px; }
    .t19-h1 { font-size: 26px; }
    .t19-sub { font-size: var(--t19-fs-15); }
    .t19-quick { padding: 12px; gap: 8px; }
    .t19-quick-f { min-width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
    .t19 *, .t19 *::before, .t19 *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@media print {
    .t19-quick, .t19-btn, .t19-toast, .t19-modal, .tsk-crumb-bar { display: none !important; }
    .t19 { max-width: none; padding: 0; }
    .t19-panel { box-shadow: none; break-inside: avoid; }
}
