/* ==========================================================================
   外派补贴与两地生活成本计算器
   设计语言：登机牌 / 行程单（航空蓝 + 珊瑚橙）
   作用域：.ex-page（变量 ex- 前缀）
   ========================================================================== */

.ex-page {
    --ex-bg: #eef4f9;
    --ex-card: #ffffff;
    --ex-ink: #12222f;
    --ex-ink-2: #4a5f70;
    --ex-ink-3: #8298a8;
    --ex-line: #d8e4ee;
    --ex-line-2: #eaf2f8;
    --ex-blue: #0b4f8a;
    --ex-blue-2: #1d6fb8;
    --ex-blue-soft: #e4f0fa;
    --ex-coral: #e2593c;
    --ex-coral-2: #ff7b57;
    --ex-coral-soft: #fdeee9;
    --ex-mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;

    background:
        radial-gradient(620px 320px at 4% -8%, rgba(11, 79, 138, .12), transparent 62%),
        radial-gradient(520px 280px at 98% 2%, rgba(226, 89, 60, .09), transparent 60%),
        var(--ex-bg);
    color: var(--ex-ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    line-height: 1.76;
    -webkit-font-smoothing: antialiased;
}

:root[data-theme="dark"] .ex-page {
    --ex-bg: #0a1017;
    --ex-card: #111a23;
    --ex-ink: #e8f0f7;
    --ex-ink-2: #a3b5c4;
    --ex-ink-3: #6d8294;
    --ex-line: #1f2c38;
    --ex-line-2: #18232d;
    --ex-blue: #5fa6e0;
    --ex-blue-2: #8ac2ee;
    --ex-blue-soft: #102433;
    --ex-coral: #f0836a;
    --ex-coral-2: #ffa58f;
    --ex-coral-soft: #2c1a15;
    background:
        radial-gradient(620px 320px at 4% -8%, rgba(95, 166, 224, .08), transparent 62%),
        radial-gradient(520px 280px at 98% 2%, rgba(240, 131, 106, .06), transparent 60%),
        var(--ex-bg);
}

.ex-page *, .ex-page *::before, .ex-page *::after { box-sizing: border-box; }
.ex-wrap { width: min(1150px, calc(100% - 40px)); margin: 0 auto; }
.ex-page a { color: inherit; text-decoration: none; }

/* ---------- 首屏 ---------- */
.ex-hero {
    position: relative;
    overflow: hidden;
    padding: 26px 0 52px;
    background: linear-gradient(180deg, #e9f3fb 0%, #f3f8fc 70%, transparent 100%);
    border-bottom: 1px solid var(--ex-line);
}

.ex-hero::before {
    content: "";
    position: absolute;
    left: 0; right: 0; top: 96px;
    height: 1px;
    background: repeating-linear-gradient(90deg, rgba(11, 79, 138, .18) 0 6px, transparent 6px 14px);
    pointer-events: none;
}

:root[data-theme="dark"] .ex-hero { background: linear-gradient(180deg, #0e1922 0%, #0a1017 74%, transparent 100%); }

.ex-hero > .ex-wrap { position: relative; z-index: 1; }

.ex-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 28px; }
.ex-crumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ex-ink-3); }
.ex-crumb i { font-style: normal; opacity: .5; }
.ex-crumb b { color: var(--ex-ink); font-weight: 600; }
.ex-crumb a:hover { color: var(--ex-blue); }

.ex-modes { display: inline-flex; padding: 3px; border: 1px solid var(--ex-line); border-radius: 999px; background: var(--ex-card); }
.ex-modes button { border: 0; background: transparent; color: var(--ex-ink-2); font: inherit; font-size: 12.5px; padding: 6px 12px; border-radius: 999px; cursor: pointer; }
.ex-modes button.is-on { background: var(--ex-blue); color: #fff; font-weight: 600; }

.ex-hero-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 40px; align-items: start; }

.ex-kicker { margin: 0 0 12px; font-family: var(--ex-mono); font-size: 11px; letter-spacing: .2em; color: var(--ex-coral); font-weight: 700; }
.ex-intro h1 { margin: 0 0 14px; font-size: clamp(30px, 3.7vw, 46px); line-height: 1.2; font-weight: 800; letter-spacing: -.02em; }
.ex-intro h1 em { font-style: normal; color: var(--ex-blue); }
.ex-lede { margin: 0 0 18px; max-width: 32em; font-size: 14.5px; line-height: 1.95; color: var(--ex-ink-2); }
.ex-lede strong { color: var(--ex-ink); }

.ex-chips { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 8px; }
.ex-chips li { display: flex; gap: 10px; align-items: baseline; font-size: 13px; color: var(--ex-ink-2); }
.ex-chips b { flex: none; min-width: 34px; text-align: center; padding: 1px 6px; border-radius: 3px; background: var(--ex-blue-soft); color: var(--ex-blue); font-size: 11.5px; }

.ex-presets { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ex-presets > span { font-size: 12.5px; color: var(--ex-ink-3); }
.ex-presets button { font: inherit; font-size: 12.5px; padding: 7px 12px; border: 1px solid var(--ex-line); border-radius: 6px; background: var(--ex-card); color: var(--ex-ink-2); cursor: pointer; }
.ex-presets button:hover { border-color: var(--ex-blue); color: var(--ex-blue); }
.ex-presets button.is-on { border-color: var(--ex-blue); background: var(--ex-blue-soft); color: var(--ex-blue); font-weight: 600; }

/* ---------- 登机牌 ---------- */
.ex-pass {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 96px;
    border-radius: 14px;
    overflow: hidden;
    background: var(--ex-card);
    box-shadow: 0 30px 60px -46px rgba(18, 34, 47, .55);
    position: relative;
}

.ex-pass::before,
.ex-pass::after {
    content: "";
    position: absolute;
    right: 96px;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: var(--ex-bg);
    transform: translateX(50%);
    z-index: 2;
}
.ex-pass::before { top: -9px; }
.ex-pass::after { bottom: -9px; }

.ex-pass-main { padding: 18px 20px 16px; min-width: 0; }

.ex-pass-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--ex-line); }
.ex-airline { display: block; font-family: var(--ex-mono); font-size: 9px; letter-spacing: .18em; color: var(--ex-coral); }
.ex-pass-head h2 { margin: 3px 0 0; font-size: 16px; font-weight: 800; }
.ex-route { display: flex; align-items: center; gap: 6px; font-family: var(--ex-mono); font-size: 13px; color: var(--ex-ink); }
.ex-route i { font-style: normal; color: var(--ex-coral); }

.ex-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; padding: 11px 0; }

.ex-field { display: grid; gap: 2px; min-width: 0; }
.ex-field > span { font-size: 10.5px; color: var(--ex-ink-3); }
.ex-field .ex-input { display: flex; align-items: center; gap: 4px; padding: 0 8px; border: 1px solid var(--ex-line); border-radius: 5px; background: var(--ex-bg); }
.ex-field .ex-input:focus-within { border-color: var(--ex-blue); box-shadow: 0 0 0 3px rgba(29, 111, 184, .13); }
.ex-field input { width: 100%; min-width: 0; border: 0; outline: none; background: transparent; color: #12222f; font: inherit; font-family: var(--ex-mono); font-size: 13px; padding: 6px 0; font-variant-numeric: tabular-nums; }
.ex-page .ex-field input { background: transparent; color: #12222f; -webkit-text-fill-color: #12222f; }
:root[data-theme="dark"] .ex-field input { color: #e8f0f7; -webkit-text-fill-color: #e8f0f7; }
.ex-field em { flex: none; font-style: normal; font-size: 9.5px; color: var(--ex-ink-3); }

.ex-pass-result { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding-top: 11px; border-top: 1px dashed var(--ex-line); }
.ex-pass-result > div > span { display: block; font-size: 11px; color: var(--ex-ink-3); }
.ex-pass-result b { display: flex; align-items: baseline; gap: 2px; font-size: clamp(28px, 3.4vw, 38px); font-weight: 800; line-height: 1.1; color: var(--ex-blue); font-variant-numeric: tabular-nums; }
.ex-pass-result b small { font-size: 14px; }
.ex-pass-side { display: grid; gap: 4px; text-align: right; font-size: 10.5px; color: var(--ex-ink-3); }
.ex-pass-side b { display: block; font-family: var(--ex-mono); font-size: 13px; color: var(--ex-ink); }
.ex-pass-side b span { font: inherit; color: inherit; }

.ex-note { margin: 9px 0 0; font-size: 11px; line-height: 1.6; color: var(--ex-ink-3); }

.ex-stub {
    border-left: 1px dashed var(--ex-line);
    background: linear-gradient(180deg, var(--ex-blue-soft), transparent);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
}
.ex-stub-code { font-family: var(--ex-mono); font-size: 8.5px; line-height: 1.5; letter-spacing: .1em; color: var(--ex-ink-3); text-align: center; }
.ex-stub-code b { font-size: 14px; color: var(--ex-ink); }
.ex-barcode {
    width: 44px; height: 108px;
    background-image: repeating-linear-gradient(180deg, var(--ex-ink) 0 2px, transparent 2px 5px, var(--ex-ink) 5px 6px, transparent 6px 9px);
    opacity: .72;
}

/* ---------- 正文 ---------- */
.ex-body { display: grid; grid-template-columns: minmax(0, 1fr) 286px; gap: 28px; padding: 34px 0 30px; align-items: start; }
.ex-main { display: grid; gap: 18px; min-width: 0; }
.ex-main > * { min-width: 0; }
.ex-card { background: var(--ex-card); border: 1px solid var(--ex-line); border-radius: 12px; padding: 22px 24px; }
.ex-card-head { margin-bottom: 12px; }
.ex-card-head h2 { margin: 0; font-size: 17.5px; font-weight: 800; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ex-card-head h2 i { display: inline-grid; place-items: center; width: 26px; height: 24px; border-radius: 4px; background: var(--ex-coral-soft); color: var(--ex-coral); font-style: normal; font-family: var(--ex-mono); font-size: 11px; font-weight: 700; }
.ex-card-head p { margin: 6px 0 0; font-size: 12.5px; color: var(--ex-ink-3); }

.ex-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .85fr); gap: 22px; margin-top: 12px; }
.ex-ledger { border: 1px solid var(--ex-line); border-radius: 8px; padding: 10px 12px 12px; }
.ex-ledger-head { margin: 8px 0 2px; font-size: 10px; letter-spacing: .12em; color: var(--ex-ink-3); text-transform: uppercase; }
.ex-ledger-head:first-child { margin-top: 0; }
.ex-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--ex-line-2); font-size: 12.5px; color: var(--ex-ink-2); }
.ex-row b { font-family: var(--ex-mono); color: var(--ex-ink); }
.ex-row.is-total { border-bottom: 0; font-weight: 600; }
.ex-net { display: flex; justify-content: space-between; align-items: baseline; margin-top: 8px; padding: 10px 12px; border-radius: 6px; background: var(--ex-blue); color: #fff; font-size: 12.5px; }
.ex-net b { font-family: var(--ex-mono); font-size: 19px; }

.ex-kpi { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.ex-kpi > div { border: 1px solid var(--ex-line); border-radius: 7px; padding: 8px 9px; }
.ex-kpi span { display: block; font-size: 10px; color: var(--ex-ink-3); }
.ex-kpi b { display: block; margin-top: 2px; font-family: var(--ex-mono); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.ex-kpi b span { display: inline; font: inherit; color: inherit; }

.ex-bar { display: flex; height: 14px; margin-top: 11px; border-radius: 4px; overflow: hidden; background: var(--ex-line-2); }
.ex-seg { height: 100%; width: 0; transition: width .4s ease; }
.ex-seg.seg-keep { background: linear-gradient(90deg, var(--ex-blue-2), var(--ex-blue)); }
.ex-seg.seg-cost { background: var(--ex-coral); }
.ex-legend { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 11px; color: var(--ex-ink-3); }
.ex-legend li { display: flex; align-items: center; gap: 5px; }
.ex-legend i { width: 8px; height: 8px; border-radius: 2px; }
.ex-legend .seg-keep { background: var(--ex-blue); }
.ex-legend .seg-cost { background: var(--ex-coral); }
.ex-legend b { font-family: var(--ex-mono); color: var(--ex-ink); }
.ex-tip { margin: 9px 0 0; font-size: 11.5px; line-height: 1.7; color: var(--ex-ink-3); }

.ex-year { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.ex-year > div { border: 1px solid var(--ex-line); border-radius: 8px; padding: 10px 12px; }
.ex-year span { display: block; font-size: 10.5px; color: var(--ex-ink-3); }
.ex-year b { display: block; margin-top: 2px; font-family: var(--ex-mono); font-size: 16px; font-variant-numeric: tabular-nums; }
.ex-year > div.is-key { background: var(--ex-coral-soft); border-color: var(--ex-coral); }
.ex-year > div.is-key b { color: var(--ex-coral); font-size: 18px; }

.ex-table-wrap { margin-top: 12px; overflow-x: auto; border: 1px solid var(--ex-line); border-radius: 8px; }
.ex-table { width: 100%; min-width: 540px; border-collapse: collapse; font-size: 12.5px; }
.ex-table th, .ex-table td { padding: 9px 11px; text-align: right; border-bottom: 1px solid var(--ex-line-2); white-space: nowrap; }
.ex-table th { background: var(--ex-bg); color: var(--ex-ink-2); font-size: 11.5px; font-weight: 600; }
.ex-table th:first-child, .ex-table td:first-child { text-align: left; }
.ex-table td { font-family: var(--ex-mono); font-variant-numeric: tabular-nums; }
.ex-table tbody tr:last-child td { border-bottom: 0; }
.ex-table tr.is-on { background: var(--ex-blue-soft); }
.ex-table tr.is-on td { color: var(--ex-blue); font-weight: 700; }
.ex-table-soft { min-width: 620px; }
.ex-table-soft td { font-family: inherit; color: var(--ex-ink-2); white-space: normal; text-align: left; font-size: 12px; line-height: 1.65; }
.ex-table-soft th { text-align: left; }

.ex-formula { margin-top: 12px; padding: 12px 14px; border: 1px dashed var(--ex-line); border-radius: 8px; background: var(--ex-bg); font-family: var(--ex-mono); font-size: 11.5px; line-height: 1.95; color: var(--ex-ink-2); overflow-x: auto; }
.ex-notes { display: grid; gap: 9px; margin-top: 12px; }
.ex-notes > div { padding: 11px 13px; border-radius: 7px; background: var(--ex-bg); border-left: 3px solid var(--ex-blue); font-size: 12.5px; color: var(--ex-ink-2); }
.ex-notes b { color: var(--ex-ink); }

.ex-faq details { border-bottom: 1px solid var(--ex-line-2); }
.ex-faq details:last-child { border-bottom: 0; }
.ex-faq summary { position: relative; list-style: none; cursor: pointer; padding: 11px 28px 11px 0; font-size: 14px; font-weight: 600; }
.ex-faq summary::-webkit-details-marker { display: none; }
.ex-faq summary::after { content: "+"; position: absolute; right: 4px; top: 50%; transform: translateY(-50%); font-family: var(--ex-mono); font-size: 17px; color: var(--ex-blue); transition: transform .2s ease; }
.ex-faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.ex-faq p { margin: 0; padding: 0 8px 12px 0; font-size: 13px; line-height: 1.92; color: var(--ex-ink-2); }

/* ---------- 侧栏 ---------- */
.ex-rail { position: sticky; top: 24px; display: grid; gap: 12px; }
.ex-rail-card { background: var(--ex-card); border: 1px solid var(--ex-line); border-radius: 10px; padding: 16px; }
.ex-rail-card h3 { margin: 0 0 9px; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--ex-ink-3); font-weight: 700; }
.ex-rail-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ex-rail-list li { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--ex-ink-2); }
.ex-rail-list b { font-family: var(--ex-mono); color: var(--ex-ink); }
.ex-links { display: grid; gap: 7px; }
.ex-links a { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--ex-line); border-radius: 6px; font-size: 12.5px; color: var(--ex-ink-2); }
.ex-links a:hover { border-color: var(--ex-blue); color: var(--ex-blue); background: var(--ex-blue-soft); }
.ex-links a::after { content: "→"; font-family: var(--ex-mono); opacity: .5; }
.ex-rail-note { margin: 0; font-size: 11.5px; line-height: 1.8; color: var(--ex-ink-3); }

@media (max-width: 1020px) {
    .ex-hero-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }
    .ex-body { grid-template-columns: minmax(0, 1fr); }
    .ex-rail { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ex-split { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 700px) {
    .ex-wrap { width: calc(100% - 28px); }
    .ex-intro h1 { font-size: 28px; }
    .ex-pass { grid-template-columns: minmax(0, 1fr) 64px; }
    .ex-pass::before, .ex-pass::after { right: 64px; }
    .ex-pass-main { padding: 14px 12px 14px; }
    .ex-grid { grid-template-columns: 1fr 1fr; gap: 7px 8px; }
    .ex-barcode { width: 30px; height: 80px; }
    .ex-card { padding: 18px 14px; }
    .ex-kpi { grid-template-columns: 1fr; }
    .ex-year { grid-template-columns: 1fr 1fr; }
    .ex-rail { grid-template-columns: minmax(0, 1fr); }
    .ex-pass-result { flex-wrap: wrap; }
    .ex-pass-side { text-align: left; }
}
