/* =====================================================================
 * N14 · NOVA —— 全新设计语言公共基座（14 个工具页共用骨架，各自独立皮肤）
 *
 * 与旧工具站 / S14 纸墨风完全隔离：类名一律 n14- / nx- 前缀，不改动线上任何页面。
 * 配色：冷调瓷白 + 深墨蓝字 + 每页独立双主色（--nx-a / --nx-b）
 * 字体层级：无衬线显示字重 800 + 9 级字号阶梯 + 等宽数字，行距 1.85
 * 主题：只消费公共导航 #themeToggle 写入的 <html data-theme="dark">，
 *       默认跟随系统 / 手动三态切换 / localStorage 记忆均由公共 theme-toggle.js 负责。
 * 首屏：h1 + 一句话副标题 + 操作入口同屏可见；加载阶段零弹窗、零自动请求。
 * ===================================================================== */

:root {
    /* 中性色 · 浅色 */
    --nx-bg:        #f5f7fb;
    --nx-bg-2:      #eef2f8;
    --nx-surface:   #ffffff;
    --nx-surface-2: #f2f5fa;
    --nx-surface-3: #e9eef6;
    --nx-ink:       #101828;
    --nx-ink-2:     #475467;
    --nx-ink-3:     #8792a4;
    --nx-line:      #dfe6f0;
    --nx-line-2:    #edf1f7;
    --nx-ok:        #0d8058;
    --nx-warn:      #a25c07;
    --nx-err:       #c0342b;
    --nx-sh:        0 1px 2px rgba(16, 24, 40, .04), 0 14px 38px rgba(16, 24, 40, .07);
    --nx-sh-sm:     0 1px 2px rgba(16, 24, 40, .05);
    --nx-sh-lift:   0 18px 44px rgba(16, 24, 40, .14);

    /* 每页独立覆写：主色 / 辅色 / 柔色 / 强调文字色 */
    --nx-a:    #2756d8;
    --nx-b:    #0d9488;
    --nx-tint: #e8eeff;
    --nx-deep: #1c3ea8;

    /* 字体与字号阶梯 */
    --nx-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
    --nx-mono: "SFMono-Regular", "JetBrains Mono", Consolas, "Liberation Mono", "DejaVu Sans Mono", monospace;
    --nx-display: "Segoe UI", "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", system-ui, sans-serif;
    --tx-1: 11px;  --tx-2: 12.5px; --tx-3: 14px;  --tx-4: 15.5px;
    --tx-5: 17.5px; --tx-6: 21px; --tx-7: 27px; --tx-8: 36px; --tx-9: clamp(38px, 5vw, 56px);
    --lh-1: 1.28; --lh-2: 1.6; --lh-3: 1.85;
    --r-sm: 8px; --r: 14px; --r-lg: 20px; --r-pill: 999px;

    /* 公共面包屑组件所需变量（不引入旧 tool-station.css） */
    --tsk-card: #ffffff;
    --tsk-line: #dfe6f0;
    --tsk-faint: #8792a4;
    --tsk-sub: #475467;
    --tsk-ink: #101828;
    --tsk-brand-ink: var(--nx-deep);
}

:root[data-theme="dark"] {
    --nx-bg:        #0b1018;
    --nx-bg-2:      #101823;
    --nx-surface:   #151e2b;
    --nx-surface-2: #1b2635;
    --nx-surface-3: #223045;
    --nx-ink:       #eef3fb;
    --nx-ink-2:     #afbccc;
    --nx-ink-3:     #7d8ca2;
    --nx-line:      #2b394d;
    --nx-line-2:    #222f40;
    --nx-ok:        #59c79b;
    --nx-warn:      #e5b45f;
    --nx-err:       #f0877e;
    --nx-sh:        0 1px 2px rgba(0, 0, 0, .3), 0 16px 42px rgba(0, 0, 0, .34);
    --nx-sh-sm:     0 1px 2px rgba(0, 0, 0, .3);
    --nx-sh-lift:   0 18px 44px rgba(0, 0, 0, .48);

    --tsk-card: #151e2b;
    --tsk-line: #2b394d;
    --tsk-faint: #7d8ca2;
    --tsk-sub: #afbccc;
    --tsk-ink: #eef3fb;
}

/* ---------- 1. 页面骨架与排版层级 ---------- */
.n14-page {
    display: block;
    min-height: 62vh;
    padding-bottom: 80px;
    background: var(--nx-bg);
    color: var(--nx-ink-2);
    font-family: var(--nx-sans);
    font-size: var(--tx-4);
    line-height: var(--lh-3);
    letter-spacing: .1px;
    -webkit-font-smoothing: antialiased;
}
.n14-page *, .n14-page *::before, .n14-page *::after { box-sizing: border-box; }
.n14-page .n14-wrap { width: min(1180px, calc(100% - 44px)); margin: 0 auto; }
.n14-page .n14-wrap--wide { width: min(1340px, calc(100% - 44px)); margin: 0 auto; }
.n14-page .n14-wrap--narrow { width: min(920px, calc(100% - 44px)); margin: 0 auto; }
.n14-page h1, .n14-page h2, .n14-page h3, .n14-page h4 {
    font-family: var(--nx-display); color: var(--nx-ink); font-weight: 800;
    line-height: var(--lh-1); letter-spacing: -.035em; margin: 0;
    text-wrap: balance;
}
.n14-page h1 { font-size: var(--tx-9); letter-spacing: -.05em; }
.n14-page h2 { font-size: var(--tx-8); }
.n14-page h3 { font-size: var(--tx-6); letter-spacing: -.02em; }
.n14-page h4 { font-size: var(--tx-5); letter-spacing: -.01em; line-height: var(--lh-2); }
.n14-page p { margin: 0 0 .9em; }
.n14-page p:last-child { margin-bottom: 0; }
.n14-page strong, .n14-page b { color: var(--nx-ink); font-weight: 750; }
.n14-page a { color: var(--nx-deep); text-decoration: none; border-bottom: 1px solid var(--nx-tint); }
.n14-page a:hover { border-bottom-color: var(--nx-a); }
.n14-page code, .n14-page .n14-mono, .n14-page .num {
    font-family: var(--nx-mono); font-variant-numeric: tabular-nums;
}
.n14-page code {
    background: var(--nx-surface-2); color: var(--nx-ink);
    padding: 2px 6px; border-radius: 5px; font-size: .9em;
}
.n14-page :focus-visible { outline: 2px solid var(--nx-a); outline-offset: 3px; }
.n14-page .n14-kw {
    font-weight: 750; color: var(--nx-deep);
    box-shadow: inset 0 -.38em 0 var(--nx-tint);
}
:root[data-theme="dark"] .n14-page .n14-kw { color: var(--nx-ink); }
.n14-page .n14-lead { font-size: var(--tx-5); line-height: var(--lh-2); max-width: 62ch; }
.n14-page .n14-small { font-size: var(--tx-3); line-height: var(--lh-2); color: var(--nx-ink-3); }
.n14-page .n14-mute { color: var(--nx-ink-3); }
.n14-page [hidden] { display: none !important; }

/* ---------- 2. 公共面包屑重绘（partials.tool-station.crumb） ---------- */
.n14-page .tsk-crumb-bar {
    background: var(--nx-surface); border-bottom: 1px solid var(--nx-line);
    backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: none;
}
.n14-page .tsk-crumb-bar-in { max-width: 1180px; padding: 11px 0; }
.n14-page .tsk-crumb { font-size: var(--tx-2); gap: 8px; line-height: 1.5; }
.n14-page .tsk-crumb a { color: var(--nx-ink-3); border-bottom: 0; }
.n14-page .tsk-crumb a:hover { color: var(--nx-a); }
.n14-page .tsk-crumb-sep { color: var(--nx-ink-3); opacity: .65; }
.n14-page .tsk-crumb-cur {
    color: var(--nx-deep); background: var(--nx-tint); font-weight: 750;
    padding: 3px 11px; border-radius: var(--r-pill);
}
:root[data-theme="dark"] .n14-page .tsk-crumb-cur { color: var(--nx-ink); }

/* ---------- 3. 首屏：3 秒讲清价值，操作入口同屏 ---------- */
.n14-hero { padding: clamp(30px, 4.4vw, 58px) 0 clamp(26px, 3.4vw, 44px); }
.n14-hero__grid {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .96fr);
    gap: clamp(22px, 3.6vw, 52px); align-items: start;
}
.n14-hero__grid--wide { grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr); }
.n14-hero__grid--single { grid-template-columns: 1fr; }
.n14-kicker {
    display: inline-flex; align-items: center; gap: 9px; margin: 0 0 16px;
    font-family: var(--nx-mono); font-size: var(--tx-1); font-weight: 700;
    letter-spacing: .19em; text-transform: uppercase; color: var(--nx-deep);
}
.n14-kicker::before {
    content: ""; width: 22px; height: 2px; border-radius: 2px; background: var(--nx-a);
}
.n14-hero h1 { margin: 0 0 14px; }
.n14-hero h1 em { font-style: normal; color: var(--nx-a); }
.n14-subtitle { font-size: var(--tx-5); line-height: var(--lh-2); color: var(--nx-ink-2); max-width: 58ch; margin: 0 0 18px; }
.n14-chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0 0 18px; }
.n14-chips li {
    display: inline-flex; align-items: center; gap: 6px; font-size: var(--tx-2);
    padding: 5px 12px; border-radius: var(--r-pill);
    background: var(--nx-surface); border: 1px solid var(--nx-line); color: var(--nx-ink-2);
}
.n14-chips li::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--nx-b); }
.n14-facts { display: flex; flex-wrap: wrap; gap: 22px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--nx-line); }
.n14-facts div { min-width: 108px; }
.n14-facts b { display: block; font-family: var(--nx-mono); font-size: var(--tx-6); color: var(--nx-ink); line-height: 1.3; }
.n14-facts span { font-size: var(--tx-2); color: var(--nx-ink-3); }

/* ---------- 4. 卡片 / 面板 / 表单 / 按钮 ---------- */
.n14-panel, .n14-card {
    background: var(--nx-surface); border: 1px solid var(--nx-line);
    border-radius: var(--r-lg); box-shadow: var(--nx-sh); padding: clamp(18px, 2.2vw, 28px);
}
.n14-card--flat { box-shadow: none; background: var(--nx-surface-2); }
.n14-card__head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding-bottom: 14px; margin-bottom: 16px; border-bottom: 1px solid var(--nx-line-2);
}
.n14-card__title { font-family: var(--nx-display); font-size: var(--tx-6); font-weight: 800; color: var(--nx-ink); margin: 0; }
.n14-card__hint { font-size: var(--tx-2); color: var(--nx-ink-3); }
.n14-panel__cap {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    font-size: var(--tx-1); font-family: var(--nx-mono); letter-spacing: .13em;
    text-transform: uppercase; color: var(--nx-ink-3); margin-bottom: 16px;
}
.n14-panel__cap b { color: var(--nx-deep); font-weight: 700; letter-spacing: 0; text-transform: none; font-family: var(--nx-sans); font-size: var(--tx-2); }
.n14-field { margin-bottom: 15px; }
.n14-field:last-child { margin-bottom: 0; }
.n14-label {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: 7px;
    font-size: var(--tx-2); font-weight: 750; color: var(--nx-ink); margin-bottom: 7px;
}
.n14-label small { font-weight: 400; color: var(--nx-ink-3); font-size: var(--tx-1); }
.n14-input, .n14-select, .n14-textarea {
    display: block; width: 100%; font-family: var(--nx-sans); font-size: var(--tx-4);
    color: var(--nx-ink); background: var(--nx-surface-2); border: 1px solid var(--nx-line);
    border-radius: var(--r-sm); padding: 10px 13px; line-height: 1.6;
    transition: border-color .15s, box-shadow .15s;
}
.n14-textarea { min-height: 108px; resize: vertical; font-family: var(--nx-mono); font-size: var(--tx-3); line-height: 1.7; }
.n14-input:focus, .n14-select:focus, .n14-textarea:focus {
    outline: none; border-color: var(--nx-a); box-shadow: 0 0 0 3px var(--nx-tint);
}
.n14-input::placeholder, .n14-textarea::placeholder { color: var(--nx-ink-3); opacity: .85; }
.n14-select {
    appearance: none; padding-right: 34px;
    background-image: linear-gradient(45deg, transparent 50%, var(--nx-ink-3) 50%), linear-gradient(135deg, var(--nx-ink-3) 50%, transparent 50%);
    background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
    background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}
.n14-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.n14-row > .n14-field { flex: 1 1 160px; margin-bottom: 0; }
.n14-grid { display: grid; gap: 16px; }
.n14-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.n14-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.n14-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.n14-btn-row { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 16px; }
.n14-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    font-family: var(--nx-sans); font-size: var(--tx-3); font-weight: 750; letter-spacing: .01em;
    color: var(--nx-ink); background: var(--nx-surface-2); border: 1px solid var(--nx-line);
    border-radius: 10px; padding: 9px 16px; min-height: 40px; cursor: pointer;
    transition: transform .13s, border-color .13s, color .13s, filter .13s, background .13s;
}
.n14-btn:hover { transform: translateY(-1px); border-color: var(--nx-a); color: var(--nx-deep); }
.n14-btn:active { transform: translateY(0); }
.n14-btn--primary { color: #fff; background: var(--nx-a); border-color: var(--nx-a); }
.n14-btn--primary:hover { color: #fff; filter: brightness(1.09); }
.n14-btn--accent { color: #fff; background: var(--nx-b); border-color: var(--nx-b); }
.n14-btn--accent:hover { color: #fff; filter: brightness(1.09); }
.n14-btn--ghost { background: transparent; }
.n14-btn--sm { padding: 6px 11px; min-height: 32px; font-size: var(--tx-2); border-radius: 8px; }
.n14-btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }
.n14-seg { display: inline-flex; flex-wrap: wrap; gap: 3px; padding: 4px; background: var(--nx-surface-2); border: 1px solid var(--nx-line); border-radius: 11px; }
.n14-seg button {
    font-family: var(--nx-sans); font-size: var(--tx-3); font-weight: 650; color: var(--nx-ink-2);
    background: transparent; border: 0; border-radius: 8px; padding: 7px 13px; cursor: pointer; line-height: 1.5;
}
.n14-seg button[aria-pressed="true"] { background: var(--nx-a); color: #fff; }
.n14-check { display: inline-flex; align-items: center; gap: 7px; font-size: var(--tx-3); color: var(--nx-ink-2); cursor: pointer; }
.n14-check input { accent-color: var(--nx-a); width: 15px; height: 15px; }

/* ---------- 5. 结果 / 数据展示 ---------- */
.n14-section { margin-top: clamp(34px, 4vw, 60px); }
.n14-section__head { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.n14-section__head h2 { font-size: var(--tx-7); }
.n14-section__head p { font-size: var(--tx-3); color: var(--nx-ink-3); margin: 6px 0 0; }
.n14-out {
    background: var(--nx-surface-2); border: 1px solid var(--nx-line);
    border-radius: var(--r); padding: 16px 18px; margin-top: 16px; min-height: 64px;
}
.n14-out__cap { font-family: var(--nx-mono); font-size: var(--tx-1); letter-spacing: .14em; text-transform: uppercase; color: var(--nx-ink-3); margin-bottom: 10px; }
.n14-kpi { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); }
.n14-kpi__i { background: var(--nx-surface); border: 1px solid var(--nx-line); border-radius: var(--r); padding: 13px 15px; }
.n14-kpi__k { font-size: var(--tx-2); color: var(--nx-ink-3); }
.n14-kpi__v { font-family: var(--nx-mono); font-size: var(--tx-6); font-weight: 750; color: var(--nx-ink); line-height: 1.35; margin-top: 3px; word-break: break-word; }
.n14-kpi__u { font-size: var(--tx-2); color: var(--nx-ink-3); margin-left: 4px; font-family: var(--nx-sans); }
.n14-table-wrap { overflow-x: auto; border: 1px solid var(--nx-line); border-radius: var(--r); background: var(--nx-surface); }
.n14-table { width: 100%; border-collapse: collapse; font-size: var(--tx-3); }
.n14-table th, .n14-table td { padding: 10px 13px; text-align: left; border-bottom: 1px solid var(--nx-line-2); vertical-align: top; line-height: var(--lh-2); }
.n14-table th { background: var(--nx-surface-2); color: var(--nx-ink); font-weight: 750; white-space: nowrap; font-size: var(--tx-2); letter-spacing: .03em; }
.n14-table tr:last-child td { border-bottom: 0; }
.n14-table td.num, .n14-table th.num { font-family: var(--nx-mono); font-variant-numeric: tabular-nums; }
.n14-table tbody tr:hover td { background: var(--nx-tint); }
:root[data-theme="dark"] .n14-table tbody tr:hover td { background: var(--nx-surface-2); }
.n14-badge { display: inline-block; font-size: var(--tx-1); font-weight: 750; padding: 2px 9px; border-radius: var(--r-pill); background: var(--nx-tint); color: var(--nx-deep); white-space: nowrap; }
:root[data-theme="dark"] .n14-badge { color: var(--nx-ink); }
.n14-badge--mute { background: var(--nx-surface-3); color: var(--nx-ink-3); }
.n14-badge--ok { background: rgba(13, 128, 88, .12); color: var(--nx-ok); }
.n14-badge--warn { background: rgba(162, 92, 7, .12); color: var(--nx-warn); }
.n14-note { font-size: var(--tx-3); line-height: var(--lh-2); color: var(--nx-ink-3); }
.n14-msg { border-left: 3px solid var(--nx-a); background: var(--nx-tint); padding: 11px 14px; border-radius: 0 var(--r-sm) var(--r-sm) 0; font-size: var(--tx-3); line-height: var(--lh-2); color: var(--nx-ink-2); }
.n14-msg--ok { border-left-color: var(--nx-ok); }
.n14-msg--err { border-left-color: var(--nx-err); }
.n14-msg--warn { border-left-color: var(--nx-warn); }
.n14-empty { text-align: center; color: var(--nx-ink-3); font-size: var(--tx-3); padding: 24px 10px; }
.n14-code {
    display: block; background: var(--nx-surface); border: 1px solid var(--nx-line);
    border-radius: var(--r-sm); padding: 14px 16px; font-family: var(--nx-mono);
    font-size: var(--tx-2); line-height: 1.75; color: var(--nx-ink);
    white-space: pre-wrap; word-break: break-all; overflow-x: auto; margin: 0;
}
.n14-divider { height: 1px; background: var(--nx-line); margin: 22px 0; border: 0; }
.n14-faq { display: grid; gap: 12px; }
.n14-faq details { background: var(--nx-surface); border: 1px solid var(--nx-line); border-radius: var(--r); padding: 14px 18px; }
.n14-faq summary { cursor: pointer; font-weight: 750; color: var(--nx-ink); font-size: var(--tx-4); }
.n14-faq details p { margin: 10px 0 0; font-size: var(--tx-3); line-height: var(--lh-3); }

/* ---------- 6. 操作完成后的弹窗（加载阶段绝不触发）与轻提示 ---------- */
.n14-toast {
    position: fixed; left: 50%; bottom: 30px; transform: translate(-50%, 12px);
    z-index: 9500; max-width: 86vw; padding: 10px 18px; border-radius: 11px;
    background: var(--nx-ink); color: var(--nx-bg); font-family: var(--nx-sans);
    font-size: var(--tx-3); line-height: 1.6; box-shadow: var(--nx-sh-lift);
    opacity: 0; pointer-events: none; transition: opacity .22s, transform .22s;
}
.n14-toast[data-show="1"] { opacity: 1; transform: translate(-50%, 0); }
.n14-mask { position: fixed; inset: 0; z-index: 9400; display: grid; place-items: center; background: rgba(11, 16, 24, .6); padding: 18px; }
.n14-modal {
    width: min(560px, 100%); max-height: 84vh; overflow: auto;
    background: var(--nx-surface); color: var(--nx-ink-2); border: 1px solid var(--nx-line);
    border-radius: var(--r-lg); box-shadow: var(--nx-sh-lift); padding: 26px;
}
.n14-modal h3 { font-size: var(--tx-6); margin-bottom: 12px; }
.n14-modal__body { font-size: var(--tx-3); line-height: var(--lh-3); white-space: pre-wrap; word-break: break-word; }
.n14-modal__foot { display: flex; justify-content: flex-end; gap: 9px; margin-top: 20px; }

/* ---------- 7. 响应式 ---------- */
@media (max-width: 980px) {
    .n14-hero__grid, .n14-hero__grid--wide { grid-template-columns: 1fr; }
    .n14-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .n14-page .n14-wrap, .n14-page .n14-wrap--wide, .n14-page .n14-wrap--narrow { width: calc(100% - 28px); }
    .n14-page h1 { font-size: 32px; }
    .n14-page h2 { font-size: 25px; }
    .n14-grid--2, .n14-grid--3, .n14-grid--4 { grid-template-columns: 1fr; }
    .n14-subtitle { font-size: var(--tx-4); }
    .n14-facts { gap: 14px; }
    .n14-panel, .n14-card { padding: 16px; }
}
