/* =====================================================================
   NF60 · ATLAS 经纬台 · 精品工具设计系统基座
   ---------------------------------------------------------------------
   · 命名空间 .nf60，全部样式严格限定在工具容器内，绝不影响线上已有页面；
   · 每个工具在自己的 {slug}.css 里覆盖 --x-* 色板变量、--x-mono/font-display
     与专属视觉母题，做到一工具一色板、一版式、一母题；
   · 主题由公共导航 #themeToggle 控制（localStorage.theme: auto/light/dark），
     本文件只做变量翻转，auto 跟随系统由 layout 内联脚本完成；
   · 全部图形用 CSS 渐变 / inline SVG 绘制，零图片依赖；静态资源走 cdn_asset()。
   ===================================================================== */

.nf60 {
    /* 默认色板（各工具页覆盖） */
    --x-bg:       #eef1f6;
    --x-bg2:      #e4e9f1;
    --x-surface:  #ffffff;
    --x-surface2: #f5f7fb;
    --x-ink:      #16202e;
    --x-sub:      #435066;
    --x-muted:    #7b8798;
    --x-line:     #dde3ec;
    --x-line2:    #c3cddb;
    --x-ac:       #2f5fe0;
    --x-ac2:      #8a3ffc;
    --x-tint:     #e3ebff;
    --x-on:       #ffffff;
    --x-ok:       #12865c;
    --x-okt:      #d9f2e7;
    --x-warn:     #9a6506;
    --x-warnt:    #fbefd4;
    --x-bad:      #c4382b;
    --x-badt:     #fae6e3;
    --x-grid:     rgba(47, 95, 224, .055);
    --x-glow:     rgba(47, 95, 224, .18);

    --x-font: "PingFang SC", "Source Han Sans SC", "Noto Sans CJK SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
    --x-font-display: "PingFang SC", "Source Han Sans SC", "Microsoft YaHei", system-ui, sans-serif;
    --x-mono: "SFMono-Regular", "JetBrains Mono", "Consolas", "Liberation Mono", monospace;
    --x-xs: 12px; --x-sm: 13.5px; --x-base: 16px; --x-md: 18px;
    --x-lg: 23px; --x-xl: 30px; --x-hero: clamp(31px, 5vw, 52px);
    --x-lh: 1.8; --x-lht: 1.22;
    --x-r: 18px; --x-rs: 11px;
    --x-sh: 0 1px 2px rgba(22,32,46,.05), 0 14px 34px rgba(22,32,46,.07);
    --x-shl: 0 22px 54px rgba(22,32,46,.16);
    --x-max: 1180px;
    --x-gap: 18px;

    box-sizing: border-box; width: 100%; margin: 0 auto; padding: 0 24px 76px;
    background:
        linear-gradient(var(--x-grid) 1px, transparent 1px) 0 0 / 100% 30px,
        linear-gradient(90deg, var(--x-grid) 1px, transparent 1px) 0 0 / 30px 100%,
        radial-gradient(780px 340px at 92% -140px, var(--x-tint), transparent 70%),
        radial-gradient(560px 300px at -10% 8%, var(--x-glow), transparent 70%),
        var(--x-bg);
    color: var(--x-ink); font-family: var(--x-font); font-size: var(--x-base);
    line-height: var(--x-lh); -webkit-font-smoothing: antialiased;
    font-variant-numeric: tabular-nums lining-nums; overflow-x: clip;
}
.nf60 *, .nf60 *::before, .nf60 *::after { box-sizing: border-box; }
.nf60 p { margin: 0 0 14px; line-height: var(--x-lh); }
.nf60 p:last-child { margin-bottom: 0; }
.nf60 b, .nf60 strong { font-weight: 760; color: var(--x-ink); }
.nf60 a { color: var(--x-ac); text-decoration: none; border-bottom: 1px solid currentColor; }
.nf60 a:hover { opacity: .78; }
.nf60 h1, .nf60 h2, .nf60 h3, .nf60 h4 { margin: 0; font-weight: 820; line-height: var(--x-lht); letter-spacing: -.02em; }
.nf60 h1, .nf60 h2, .nf60 h3 { font-family: var(--x-font-display); }
.nf60 h2 { font-size: var(--x-lg); } .nf60 h3 { font-size: var(--x-md); } .nf60 h4 { font-size: var(--x-base); }
.nf60 small { font-size: var(--x-xs); }
.nf60 ul, .nf60 ol { margin: 0 0 14px; padding-left: 22px; }
.nf60 li { margin-bottom: 6px; } .nf60 li::marker { color: var(--x-ac); font-weight: 800; }
.nf60 :focus-visible { outline: 3px solid var(--x-ac); outline-offset: 3px; border-radius: 5px; }
.nf60 [hidden] { display: none !important; }

/* 顶部色条 / 主容器 */
.x-top { height: 5px; border-radius: 0 0 6px 6px; max-width: var(--x-max); margin: 0 auto;
    background: linear-gradient(90deg, var(--x-ac), var(--x-ac2), var(--x-ac));
    box-shadow: 0 2px 14px var(--x-glow); }
.x-inner { max-width: var(--x-max); margin: 0 auto; }

/* 首屏 Hero */
.x-hero { padding: 44px 0 24px; display: grid; gap: 24px; align-items: center;
    grid-template-columns: minmax(0, 1fr) auto; }
.x-eyebrow { display: inline-flex; align-items: center; gap: 9px; margin-bottom: 15px;
    font-family: var(--x-mono); font-size: var(--x-xs); font-weight: 700; letter-spacing: .14em;
    color: var(--x-ac); text-transform: uppercase; }
.x-eyebrow::before { content: ""; width: 28px; height: 3px; background: linear-gradient(90deg, var(--x-ac), var(--x-ac2)); border-radius: 2px; }
.x-hero h1 { font-size: var(--x-hero); letter-spacing: -.05em; margin-bottom: 13px; }
.x-hero h1 em { font-style: normal; color: var(--x-ac); position: relative; white-space: nowrap; }
.x-hero h1 em::after { content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 8px;
    background: var(--x-tint); border-radius: 4px; z-index: -1; }
.x-lead { font-size: var(--x-md); line-height: 1.72; color: var(--x-sub); max-width: 800px; }
.x-lead b { color: var(--x-ink); background: linear-gradient(transparent 62%, var(--x-tint) 62%); font-weight: 760; }
.x-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.x-chip { display: inline-flex; align-items: center; gap: 6px; font-size: var(--x-sm); font-weight: 600;
    color: var(--x-sub); background: var(--x-surface); border: 1px solid var(--x-line);
    border-radius: 999px; padding: 5px 13px; box-shadow: var(--x-sh); }
.x-chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--x-ac); }
.x-hero-art { justify-self: end; }

/* 区块 */
.x-sec { margin-top: 42px; }
.x-sec-h { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap;
    padding-bottom: 12px; margin-bottom: 20px; border-bottom: 1px solid var(--x-line2); }
.x-sec-h .idx { font-family: var(--x-mono); font-size: var(--x-xs); font-weight: 700;
    color: var(--x-ac); letter-spacing: .1em; white-space: nowrap; }
.x-sec-h h2 { flex: 1 1 auto; } .x-sec-h .note { font-size: var(--x-sm); color: var(--x-muted); }
.x-sec-lead { font-size: var(--x-base); color: var(--x-sub); max-width: 880px; margin: -6px 0 20px; }

/* 面板 / 工作台 */
.x-card { background: var(--x-surface); border: 1px solid var(--x-line); border-radius: var(--x-r);
    box-shadow: var(--x-sh); padding: 24px; margin-bottom: var(--x-gap); position: relative; }
.x-card--flat { box-shadow: none; background: var(--x-surface2); }
.x-card--tint { background: var(--x-tint); border-color: transparent; box-shadow: none; }
.x-card-t { display: flex; align-items: center; gap: 10px; font-size: var(--x-md); font-weight: 820; margin-bottom: 6px; }
.x-card-s { color: var(--x-muted); font-size: var(--x-sm); margin-bottom: 18px; }
.x-desk { display: grid; gap: var(--x-gap); grid-template-columns: minmax(0, 1.32fr) minmax(0, 1fr); align-items: start; }
.x-desk-side { min-width: 0; }
.x-tag { display: inline-block; font-family: var(--x-mono); font-size: var(--x-xs); font-weight: 700;
    letter-spacing: .09em; color: var(--x-ac); background: var(--x-tint); border-radius: 6px;
    padding: 4px 10px; margin-bottom: 11px; }

/* 表单 */
.x-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.x-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.x-field > label, .x-label { font-size: var(--x-sm); font-weight: 700; color: var(--x-sub); }
.x-hint { font-size: var(--x-xs); color: var(--x-muted); line-height: 1.6; }
.x-input, .x-select, .x-textarea { width: 100%; padding: 10px 12px; border: 1.5px solid var(--x-line2);
    border-radius: var(--x-rs); background: var(--x-surface); color: var(--x-ink);
    font-family: var(--x-font); font-size: var(--x-base); line-height: 1.6; transition: border-color .16s, box-shadow .16s; }
.x-input:focus, .x-select:focus, .x-textarea:focus { outline: none; border-color: var(--x-ac); box-shadow: 0 0 0 3px var(--x-tint); }
.x-input.is-bad { border-color: var(--x-bad); box-shadow: 0 0 0 3px var(--x-badt); }
.x-textarea { min-height: 132px; resize: vertical; font-family: var(--x-mono); font-size: var(--x-sm); line-height: 1.7; }
.x-unit { position: relative; }
.x-unit .x-ufix { position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
    font-size: var(--x-xs); color: var(--x-muted); font-family: var(--x-mono); pointer-events: none; }
.x-unit .x-input, .x-unit .x-select { padding-right: 52px; }

/* 按钮 */
.x-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.x-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    padding: 11px 19px; border: 1.5px solid var(--x-ac); border-radius: var(--x-rs);
    background: var(--x-ac); color: var(--x-on); font-family: var(--x-font);
    font-size: var(--x-sm); font-weight: 760; cursor: pointer; transition: transform .14s, filter .14s, box-shadow .14s; }
.x-btn:hover { filter: brightness(1.07); transform: translateY(-1px); box-shadow: 0 8px 18px var(--x-glow); }
.x-btn:active { transform: translateY(0); }
.x-btn--soft { background: var(--x-tint); color: var(--x-ac); border-color: transparent; }
.x-btn--ghost { background: transparent; color: var(--x-ac); }
.x-btn--sm { padding: 7px 12px; font-size: var(--x-xs); }
.x-btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.x-err { color: var(--x-bad); font-size: var(--x-sm); margin-top: 12px; min-height: 1em; font-weight: 600; }

/* 结果 / 读数 / 提示 */
.x-result { margin-top: 16px; padding: 18px; border-radius: var(--x-rs);
    background: var(--x-surface2); border: 1px solid var(--x-line); font-size: var(--x-sm); line-height: 1.85; }
.x-result b { color: var(--x-ac); }
.x-reads { display: flex; flex-wrap: wrap; gap: 12px; }
.x-read { flex: 1 1 150px; min-width: 132px; padding: 16px; border-radius: var(--x-rs);
    background: var(--x-surface2); border: 1px solid var(--x-line); position: relative; overflow: hidden; }
.x-read::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--x-ac); opacity: .65; }
.x-read .k { display: block; font-size: var(--x-xs); color: var(--x-muted); margin-bottom: 6px; letter-spacing: .04em; }
.x-read .v { display: block; font-family: var(--x-mono); font-size: var(--x-lg); font-weight: 820;
    color: var(--x-ink); line-height: 1.18; word-break: break-word; }
.x-read .v.ac { color: var(--x-ac); } .x-read .u { font-size: var(--x-xs); color: var(--x-muted); font-weight: 500; }
.x-read--hero { background: linear-gradient(145deg, var(--x-tint), var(--x-surface)); border-color: var(--x-ac); }
.x-read--hero .v { font-size: var(--x-xl); color: var(--x-ac); }
.x-note { padding: 11px 14px; border-radius: var(--x-rs); background: var(--x-surface2);
    border: 1px solid var(--x-line); font-size: var(--x-sm); color: var(--x-sub); margin: 11px 0; line-height: 1.75; }
.x-note--warn { background: var(--x-warnt); border-color: var(--x-warn); color: var(--x-warn); }
.x-note--ok { background: var(--x-okt); border-color: var(--x-ok); color: var(--x-ok); }
.x-note--danger { background: var(--x-badt); border-color: var(--x-bad); color: var(--x-bad); }
.x-note b { color: inherit; }

/* 选项 / 分段 / 仪表 */
.x-opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.x-opt { position: relative; display: flex; align-items: flex-start; gap: 10px; cursor: pointer; padding: 12px 13px;
    border: 1.5px solid var(--x-line2); border-radius: var(--x-rs); background: var(--x-surface);
    font-size: var(--x-sm); line-height: 1.6; transition: all .15s; }
.x-opt:hover { border-color: var(--x-ac); }
.x-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.x-opt:has(input:checked) { border-color: var(--x-ac); background: var(--x-tint); box-shadow: 0 0 0 2px var(--x-tint); }
.x-opt-txt b { display: block; } .x-opt-txt small { display: block; color: var(--x-muted); font-size: var(--x-xs); font-weight: 400; margin-top: 2px; }
.x-seg { display: inline-flex; flex-wrap: wrap; border: 1.5px solid var(--x-line2); border-radius: var(--x-rs); overflow: hidden; background: var(--x-surface); }
.x-seg button { padding: 8px 15px; border: none; background: transparent; color: var(--x-sub);
    font-family: var(--x-font); font-size: var(--x-sm); font-weight: 650; cursor: pointer; border-right: 1px solid var(--x-line); }
.x-seg button:last-child { border-right: none; }
.x-seg button.active { background: var(--x-ac); color: var(--x-on); font-weight: 760; }
.x-meter { height: 11px; border-radius: 7px; background: var(--x-line); overflow: hidden; margin: 8px 0; }
.x-meter > i { display: block; height: 100%; border-radius: 7px; background: linear-gradient(90deg, var(--x-ac), var(--x-ac2)); transition: width .45s cubic-bezier(.2,.7,.3,1); }
.x-meter--ok > i { background: linear-gradient(90deg, var(--x-ok), #4dd4a0); }
.x-meter--warn > i { background: linear-gradient(90deg, var(--x-warn), #f0bc5a); }
.x-meter--bad > i { background: linear-gradient(90deg, var(--x-bad), #ff7b6b); }

/* 表格 */
.x-table-wrap { overflow-x: auto; margin: 12px 0; border: 1px solid var(--x-line); border-radius: var(--x-rs); }
.x-table { width: 100%; border-collapse: collapse; font-size: var(--x-sm); line-height: 1.65; }
.x-table th, .x-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--x-line); white-space: nowrap; }
.x-table thead th { background: var(--x-surface2); color: var(--x-sub); font-weight: 760; position: sticky; top: 0; }
.x-table tbody tr:last-child td { border-bottom: none; }
.x-table tbody tr:hover { background: var(--x-surface2); }
.x-table .is-bad td { background: var(--x-badt); color: var(--x-bad); }
.x-table .hi { color: var(--x-ac); font-weight: 800; }
.x-table td.num, .x-table th.num { text-align: right; font-family: var(--x-mono); }
.x-table-cap { font-family: var(--x-mono); font-size: var(--x-sm); font-weight: 800; color: var(--x-ac); margin-bottom: 8px; }

/* 图表容器 */
.x-chart { width: 100%; display: block; }
.x-chart-card { padding: 12px; }
.x-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: var(--x-xs); color: var(--x-sub); margin-top: 10px; }
.x-legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }

/* FAQ 折叠 */
.x-faq { display: grid; gap: 10px; }
.x-faq details { background: var(--x-surface); border: 1px solid var(--x-line); border-radius: var(--x-rs); padding: 0 16px; }
.x-faq summary { cursor: pointer; font-weight: 760; font-size: var(--x-base); padding: 14px 0; list-style: none; }
.x-faq summary::-webkit-details-marker { display: none; }
.x-faq summary::after { content: "+"; float: right; color: var(--x-ac); font-size: 20px; line-height: 1; font-weight: 500; }
.x-faq details[open] summary::after { content: "−"; }
.x-faq details p { color: var(--x-sub); padding-bottom: 14px; margin: 0; font-size: var(--x-sm); }

/* 底部说明条 / 相关工具 */
.x-disclaimer { margin-top: 14px; padding: 13px 16px; border-radius: var(--x-rs);
    background: var(--x-surface2); border: 1px dashed var(--x-line2); font-size: var(--x-xs); color: var(--x-muted); line-height: 1.75; }
.x-related { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.x-related a { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--x-line);
    border-radius: var(--x-rs); background: var(--x-surface); color: var(--x-ink); border-bottom: 1px solid var(--x-line);
    transition: transform .15s, border-color .15s; }
.x-related a:hover { transform: translateY(-2px); border-color: var(--x-ac); }
.x-related .ic { font-size: 24px; } .x-related b { display: block; font-size: var(--x-sm); }
.x-related small { color: var(--x-muted); }

/* 弹窗 / Toast */
.has-nf60-page .tskb { max-width: var(--x-max, 1180px); margin: 0 auto; }
.x-modal { position: fixed; inset: 0; z-index: 10030; display: none; align-items: center; justify-content: center;
    background: rgba(9,14,22,.58); padding: 20px; }
.x-modal.is-open { display: flex; }
.x-modal-card { width: min(580px, 100%); max-height: 86vh; overflow: auto; background: var(--x-surface);
    border-radius: var(--x-r); box-shadow: var(--x-shl); padding: 28px; border: 1px solid var(--x-line); }
.x-modal-card h3 { margin-bottom: 12px; }
.x-modal-card p { font-size: var(--x-sm); color: var(--x-sub); }
.x-modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* 主题翻转（导航 #themeToggle 写 <html data-theme>） */
:root[data-theme="dark"] .nf60 {
    --x-bg: #0b1017; --x-bg2: #101823; --x-surface: #151e2a; --x-surface2: #1b2734;
    --x-ink: #eef3f9; --x-sub: #b8c5d4; --x-muted: #8291a2;
    --x-line: #283546; --x-line2: #39495c;
    --x-ac: #5b8cff; --x-ac2: #a56bff; --x-tint: #16233f; --x-on: #060d1c;
    --x-ok: #4dd4a0; --x-okt: #10352a; --x-warn: #f0bc5a; --x-warnt: #3a2d13;
    --x-bad: #ff7b6b; --x-badt: #3a201d;
    --x-grid: rgba(91,140,255,.045); --x-glow: rgba(91,140,255,.14);
    --x-sh: 0 1px 2px rgba(0,0,0,.35), 0 14px 34px rgba(0,0,0,.4);
    --x-shl: 0 22px 54px rgba(0,0,0,.6);
}
:root[data-theme="dark"] .x-hero h1 em::after { background: rgba(91,140,255,.22); }
:root[data-theme="dark"] .x-lead b { background: linear-gradient(transparent 62%, rgba(91,140,255,.22) 62%); }

/* 响应式 */
@media (max-width: 900px) {
    .x-hero { grid-template-columns: 1fr; }
    .x-hero-art { justify-self: start; }
    .x-desk { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .nf60 { padding: 0 16px 60px; }
    .x-hero { padding: 32px 0 18px; }
    .x-card { padding: 18px; }
    .x-reads { gap: 9px; }
    .x-read { flex-basis: 100%; }
    .x-sec-h .note { flex-basis: 100%; }
}
@media (prefers-reduced-motion: reduce) {
    .nf60 * { transition: none !important; animation: none !important; }
}
