/* desk2 设计系统：墨色文字 + 单一强调色 + 等宽数字；默认浅色，dark 变量整体切换 */

:root {
    --x2-bg: #fbfaf7;
    --x2-surface: #ffffff;
    --x2-surface-2: #f5f3ee;
    --x2-ink: #14161a;
    --x2-ink-2: #3d434c;
    --x2-muted: #6b7280;
    --x2-line: #e5e1d8;
    --x2-line-strong: #cfc9bc;
    --x2-accent: #e8590c;
    --x2-accent-soft: #fff1e8;
    --x2-accent-line: #f3c5a6;
    --x2-ok: #15803d;
    --x2-err: #b91c1c;
    --x2-ok-soft: #eaf7ef;
    --x2-err-soft: #fdeceb;
    --x2-swim: #0284c7;
    --x2-bike: #b45309;
    --x2-run: #dc2626;
    --x2-r: 16px;
    --x2-r-sm: 10px;
    --x2-font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    --x2-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    --x2-shadow: 0 1px 2px rgba(20, 22, 26, .04), 0 10px 30px -18px rgba(20, 22, 26, .28);
}

:root[data-theme="dark"] {
    --x2-bg: #0e1013;
    --x2-surface: #16191e;
    --x2-surface-2: #1c2027;
    --x2-ink: #f2f3f5;
    --x2-ink-2: #c8ccd3;
    --x2-muted: #98a0ab;
    --x2-line: #262b33;
    --x2-line-strong: #3a414c;
    --x2-accent: #ff8a4c;
    --x2-accent-soft: rgba(255, 138, 76, .13);
    --x2-accent-line: rgba(255, 138, 76, .36);
    --x2-ok: #4ade80;
    --x2-err: #f87171;
    --x2-ok-soft: rgba(74, 222, 128, .12);
    --x2-err-soft: rgba(248, 113, 113, .12);
    --x2-swim: #38bdf8;
    --x2-bike: #fbbf24;
    --x2-run: #f87171;
    --x2-shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 16px 40px -24px rgba(0, 0, 0, .8);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--x2-bg);
    color: var(--x2-ink);
    font-family: var(--x2-font);
    font-size: 16px;
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
    transition: background-color .18s ease, color .18s ease;
}

h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 700; letter-spacing: -.01em; }
p { margin: 0; }
a { color: var(--x2-accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button { font-family: inherit; }
table { border-collapse: collapse; }

.x2-skip {
    position: absolute; left: -999px; top: 8px; z-index: 60;
    padding: 8px 14px; border-radius: 8px; background: var(--x2-ink); color: var(--x2-bg);
}
.x2-skip:focus { left: 12px; }

.x2-wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 24px; }

/* ---------- 顶栏 ---------- */
.x2-head {
    position: sticky; top: 0; z-index: 40;
    background: color-mix(in srgb, var(--x2-bg) 86%, transparent);
    backdrop-filter: saturate(1.2) blur(12px);
    border-bottom: 1px solid var(--x2-line);
}
.x2-head-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 60px; }
.x2-brand { display: inline-flex; align-items: center; gap: 9px; color: var(--x2-ink); font-weight: 700; font-size: 15px; letter-spacing: -.01em; }
.x2-brand:hover { text-decoration: none; }
.x2-brand-mark {
    width: 18px; height: 18px; border-radius: 5px;
    background: var(--x2-accent);
    box-shadow: inset -5px -5px 0 0 rgba(0, 0, 0, .18);
}
.x2-nav { display: flex; align-items: center; gap: 20px; }
.x2-nav a { color: var(--x2-ink-2); font-size: 14px; }
.x2-nav a:hover { color: var(--x2-accent); text-decoration: none; }

.x2-theme {
    display: inline-grid; place-items: center;
    width: 34px; height: 34px; padding: 0;
    border: 1px solid var(--x2-line-strong); border-radius: 9px;
    background: var(--x2-surface); color: var(--x2-ink-2);
    cursor: pointer; transition: color .15s, border-color .15s;
}
.x2-theme:hover { color: var(--x2-accent); border-color: var(--x2-accent-line); }
.x2-theme:focus-visible { outline: 2px solid var(--x2-accent); outline-offset: 2px; }
.x2-theme svg { width: 17px; height: 17px; }
.x2-theme .i-sun { display: none; }
:root[data-theme="dark"] .x2-theme .i-sun { display: block; }
:root[data-theme="dark"] .x2-theme .i-moon { display: none; }

/* ---------- 首屏 ---------- */
.x2-hero { padding: 40px 0 34px; }
.x2-hero-in { display: grid; grid-template-columns: minmax(0, 1.02fr) minmax(0, .98fr); gap: 44px; align-items: start; }

.x2-crumb { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-bottom: 18px; font-size: 12.5px; color: var(--x2-muted); }
.x2-crumb a { color: var(--x2-muted); }
.x2-crumb a:hover { color: var(--x2-accent); text-decoration: none; }
.x2-crumb i { font-style: normal; opacity: .55; }

.x2-eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    margin-bottom: 14px;
    font-family: var(--x2-mono); font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase;
    color: var(--x2-accent);
}
.x2-eyebrow::before { content: ""; width: 22px; height: 2px; background: var(--x2-accent); }

.x2-h1 { font-size: clamp(29px, 3.6vw, 44px); letter-spacing: -.025em; }
.x2-h1 em { font-style: normal; color: var(--x2-accent); }
.x2-lede { margin-top: 14px; max-width: 34em; font-size: 16px; line-height: 1.85; color: var(--x2-ink-2); }
.x2-lede strong { color: var(--x2-ink); font-weight: 600; }

.x2-points { display: grid; gap: 9px; margin: 22px 0 0; padding: 0; list-style: none; }
.x2-points li { position: relative; padding-left: 20px; font-size: 14px; line-height: 1.75; color: var(--x2-ink-2); }
.x2-points li::before {
    content: ""; position: absolute; left: 4px; top: 10px;
    width: 6px; height: 6px; border-radius: 50%; background: var(--x2-accent-line);
}
.x2-points b { color: var(--x2-ink); font-weight: 600; }

.x2-jump { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.x2-jump a {
    padding: 6px 12px; border: 1px solid var(--x2-line); border-radius: 99px;
    font-size: 12.5px; color: var(--x2-ink-2); background: var(--x2-surface);
    transition: color .14s, border-color .14s, background .14s;
}
.x2-jump a:hover { color: var(--x2-accent); border-color: var(--x2-accent-line); background: var(--x2-accent-soft); text-decoration: none; }

/* ---------- 工具面板 ---------- */
.x2-panel {
    position: sticky; top: 78px;
    border: 1px solid var(--x2-line); border-radius: var(--x2-r);
    background: var(--x2-surface); box-shadow: var(--x2-shadow);
    overflow: hidden;
}
.x2-panel-head {
    display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
    padding: 16px 20px; border-bottom: 1px solid var(--x2-line);
    background: linear-gradient(180deg, var(--x2-surface-2), var(--x2-surface));
}
.x2-panel-head h2 { font-size: 14.5px; letter-spacing: 0; }
.x2-panel-head span { font-family: var(--x2-mono); font-size: 11.5px; color: var(--x2-muted); }

.x2-fields { display: grid; gap: 15px; padding: 18px 20px 4px; }
.x2-field { display: grid; gap: 6px; min-width: 0; }
.x2-label { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 12.5px; font-weight: 600; color: var(--x2-ink-2); }
.x2-label i { font-style: normal; font-family: var(--x2-mono); font-size: 11px; font-weight: 400; color: var(--x2-muted); }

.x2-input {
    display: flex; align-items: center; gap: 8px;
    height: 44px; padding: 0 12px;
    border: 1px solid var(--x2-line-strong); border-radius: var(--x2-r-sm);
    background: var(--x2-surface);
    transition: border-color .15s, box-shadow .15s;
}
.x2-input:focus-within { border-color: var(--x2-accent); box-shadow: 0 0 0 3px var(--x2-accent-soft); }
.x2-input input {
    flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; outline: none;
    background: transparent; color: var(--x2-ink);
    font-family: var(--x2-mono); font-size: 15px; font-variant-numeric: tabular-nums;
}
.x2-input input::placeholder { font-family: var(--x2-font); font-size: 13px; color: var(--x2-muted); }
.x2-input span { flex: none; font-size: 11.5px; color: var(--x2-muted); white-space: nowrap; }
.x2-input.is-bad { border-color: var(--x2-err); }
.x2-input.is-bad span { color: var(--x2-err); }

.x2-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.x2-trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.x2-triolabel {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px;
    font-size: 11px; line-height: 1.4; color: var(--x2-muted);
}
.x2-triolabel span { padding-left: 2px; }

.x2-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.x2-chip {
    padding: 6px 11px; cursor: pointer;
    border: 1px solid var(--x2-line-strong); border-radius: 8px;
    background: var(--x2-surface); color: var(--x2-ink-2);
    font-size: 12.5px; line-height: 1.4;
    transition: color .14s, border-color .14s, background .14s;
}
.x2-chip:hover { color: var(--x2-accent); border-color: var(--x2-accent-line); }
.x2-chip:focus-visible { outline: 2px solid var(--x2-accent); outline-offset: 2px; }
.x2-chip[aria-pressed="true"] {
    color: var(--x2-accent); background: var(--x2-accent-soft);
    border-color: var(--x2-accent); font-weight: 600;
}

.x2-hint { margin: 0; font-size: 11.5px; line-height: 1.6; color: var(--x2-muted); }

/* 结果区 */
.x2-out {
    margin-top: 16px; padding: 18px 20px;
    border-top: 1px solid var(--x2-line);
    background: var(--x2-surface-2);
}
.x2-out-main { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; }
.x2-out-k { font-size: 11.5px; letter-spacing: .06em; color: var(--x2-muted); }
.x2-out-big {
    display: block; margin-top: 2px;
    font-family: var(--x2-mono); font-size: 34px; font-weight: 600; line-height: 1.1;
    font-variant-numeric: tabular-nums; letter-spacing: -.02em; color: var(--x2-ink);
}
.x2-out-big small { font-size: 13px; font-weight: 400; color: var(--x2-muted); margin-left: 3px; }
.x2-tag {
    flex: none; padding: 3px 9px; border-radius: 99px;
    font-size: 11px; line-height: 1.5; white-space: nowrap;
    color: var(--x2-muted); background: var(--x2-surface);
    border: 1px solid var(--x2-line-strong);
}
.x2-tag.is-ok { color: var(--x2-ok); background: var(--x2-ok-soft); border-color: color-mix(in srgb, var(--x2-ok) 30%, transparent); }
.x2-tag.is-warn { color: var(--x2-accent); background: var(--x2-accent-soft); border-color: var(--x2-accent-line); }
.x2-tag.is-err { color: var(--x2-err); background: var(--x2-err-soft); border-color: color-mix(in srgb, var(--x2-err) 30%, transparent); }

.x2-out-note { margin-top: 8px; font-size: 12.5px; line-height: 1.7; color: var(--x2-ink-2); }

.x2-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 20px 18px; }
.x2-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    height: 36px; padding: 0 14px; cursor: pointer;
    border: 1px solid var(--x2-line-strong); border-radius: 9px;
    background: var(--x2-surface); color: var(--x2-ink-2);
    font-size: 13px; font-weight: 500;
    transition: color .14s, border-color .14s, background .14s;
}
.x2-btn:hover { color: var(--x2-accent); border-color: var(--x2-accent-line); }
.x2-btn-primary { background: var(--x2-ink); border-color: var(--x2-ink); color: var(--x2-bg); }
.x2-btn-primary:hover { background: var(--x2-accent); border-color: var(--x2-accent); color: #fff; }

/* ---------- 内容区 ---------- */
.x2-sec { padding: 40px 0; border-top: 1px solid var(--x2-line); }
.x2-sec:first-of-type { border-top: 0; }
.x2-sec-head { margin-bottom: 18px; }
.x2-sec-k { font-family: var(--x2-mono); font-size: 11.5px; letter-spacing: .12em; color: var(--x2-accent); }
.x2-h2 { margin-top: 6px; font-size: clamp(20px, 2.2vw, 25px); letter-spacing: -.015em; }
.x2-sec-sub { margin-top: 8px; max-width: 62ch; font-size: 14.5px; line-height: 1.85; color: var(--x2-muted); }

.x2-prose { max-width: 68ch; }
.x2-prose p { margin: 12px 0 0; font-size: 15px; line-height: 1.95; color: var(--x2-ink-2); }
.x2-prose p:first-child { margin-top: 0; }
.x2-prose strong { color: var(--x2-ink); font-weight: 600; }
.x2-prose code {
    padding: 1px 5px; border-radius: 5px; background: var(--x2-surface-2);
    font-family: var(--x2-mono); font-size: .88em; color: var(--x2-ink);
}

.x2-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 40px; }
.x2-cols-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px 28px; }

.x2-card {
    padding: 18px 20px;
    border: 1px solid var(--x2-line); border-radius: var(--x2-r-sm);
    background: var(--x2-surface);
}
.x2-card h3 { font-size: 15px; margin-bottom: 6px; }
.x2-card p { font-size: 13.5px; line-height: 1.85; color: var(--x2-ink-2); }
.x2-card p + p { margin-top: 8px; }

.x2-note {
    margin-top: 16px; padding: 12px 15px;
    border-left: 3px solid var(--x2-accent); border-radius: 0 8px 8px 0;
    background: var(--x2-accent-soft);
    font-size: 13.5px; line-height: 1.8; color: var(--x2-ink-2);
}
.x2-note b { color: var(--x2-ink); }

.x2-table-wrap { margin-top: 16px; overflow-x: auto; border: 1px solid var(--x2-line); border-radius: var(--x2-r-sm); }
.x2-table { width: 100%; font-size: 13.5px; }
.x2-table th, .x2-table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--x2-line); white-space: nowrap; }
.x2-table th { background: var(--x2-surface-2); color: var(--x2-ink-2); font-weight: 600; font-size: 12.5px; }
.x2-table td { color: var(--x2-ink-2); }
.x2-table tbody tr:last-child td { border-bottom: 0; }
.x2-table tbody tr:hover td { background: var(--x2-surface-2); }
.x2-num { font-family: var(--x2-mono); font-variant-numeric: tabular-nums; color: var(--x2-ink); }

.x2-faq { margin-top: 6px; }
.x2-faq details { border-bottom: 1px solid var(--x2-line); }
.x2-faq details:first-child { border-top: 1px solid var(--x2-line); }
.x2-faq summary {
    position: relative; padding: 14px 30px 14px 0; cursor: pointer;
    font-size: 14.5px; font-weight: 600; color: var(--x2-ink); list-style: none;
}
.x2-faq summary::-webkit-details-marker { display: none; }
.x2-faq summary::after {
    content: "+"; position: absolute; right: 4px; top: 13px;
    font-family: var(--x2-mono); font-size: 16px; color: var(--x2-muted);
}
.x2-faq details[open] summary::after { content: "−"; color: var(--x2-accent); }
.x2-faq .x2-faq-body { padding: 0 0 15px; font-size: 14px; line-height: 1.9; color: var(--x2-ink-2); }

.x2-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.x2-link {
    display: block; padding: 16px 18px;
    border: 1px solid var(--x2-line); border-radius: var(--x2-r-sm);
    background: var(--x2-surface); color: var(--x2-ink);
    transition: border-color .14s, transform .14s;
}
.x2-link:hover { border-color: var(--x2-accent-line); text-decoration: none; transform: translateY(-1px); }
.x2-link h3 { font-size: 14.5px; margin-bottom: 4px; }
.x2-link p { font-size: 12.5px; line-height: 1.7; color: var(--x2-muted); }
.x2-link span { display: block; margin-top: 8px; font-family: var(--x2-mono); font-size: 11px; color: var(--x2-accent); }

/* ---------- 页脚 ---------- */
.x2-foot { margin-top: 30px; border-top: 1px solid var(--x2-line); background: var(--x2-surface-2); }
.x2-foot-in {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
    padding: 18px 0; font-size: 12.5px; color: var(--x2-muted);
}
.x2-themeselect { display: inline-flex; gap: 4px; padding: 3px; border: 1px solid var(--x2-line); border-radius: 8px; background: var(--x2-surface); }
.x2-themeselect button {
    padding: 4px 9px; border: 0; border-radius: 6px; background: transparent;
    color: var(--x2-muted); font-size: 11.5px; cursor: pointer;
}
.x2-themeselect button:hover { color: var(--x2-ink); }
.x2-themeselect button[aria-pressed="true"] { background: var(--x2-accent-soft); color: var(--x2-accent); font-weight: 600; }

/* ---------- 响应式 ---------- */
@media (max-width: 980px) {
    .x2-hero-in { grid-template-columns: 1fr; gap: 28px; }
    .x2-panel { position: static; }
    .x2-cols, .x2-cols-3, .x2-links { grid-template-columns: 1fr; }
    .x2-sec { padding: 32px 0; }
}

@media (max-width: 640px) {
    .x2-wrap { padding: 0 16px; }
    .x2-hero { padding: 26px 0 24px; }
    .x2-nav { gap: 12px; }
    .x2-nav a { font-size: 13px; }
    .x2-out-big { font-size: 29px; }
    .x2-fields { padding: 16px 16px 2px; }
    .x2-out, .x2-actions, .x2-panel-head { padding-left: 16px; padding-right: 16px; }
    .x2-trio { grid-template-columns: 1fr 1fr; }
    .x2-triolabel { grid-template-columns: 1fr 1fr; }
    .x2-triolabel span:nth-child(3) { grid-column: 1 / -1; }
    .x2-jump { display: none; }
    .x2-foot-in { justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
}
