﻿/* ==========================================================================
 * 遗嘱订立与见证公证费用计算器 /tool/will-draft-cost-calc
 * 视觉主题：信笺手书 · 钢笔蓝 + 火漆
 *
 * 设计隐喻：遗嘱是「写给最后的人的信」，公证是「火漆封缄」。
 * 因此整页按手写信笺来造：费用印鉴做成圆形火漆印章，卷宗目录做成手写折页标签，
 * 家谱用钢笔线条绘制，卷宗内页带淡蓝横线与左侧装订红线。
 *
 * 色系与站内其它工具全部错开：不用朱砂红、不用油墨青、不用翡翠金、不用靛紫。
 * 作用域限定在 .wd-page，变量前缀 --wd-；深色覆盖用 :root[data-theme="dark"] .wd-page。
 * （站内主题按钮 light 时会移除 data-theme 属性，故浅色=无属性是唯一基线）
 * ========================================================================== */

.wd-page {
    --wd-paper: #f7f3e9;
    --wd-surface: #fffdf8;
    --wd-surface-2: #faf6ec;
    --wd-ink: #1c2432;
    --wd-ink-2: #45505f;
    --wd-ink-3: #7d8794;
    --wd-line: #e5ddcc;
    --wd-line-2: #d1c6af;
    --wd-navy: #24405e;
    --wd-navy-2: #1a2f47;
    --wd-navy-3: #122336;
    --wd-navy-soft: #e6edf4;
    --wd-wax: #a83232;
    --wd-wax-2: #8a2727;
    --wd-wax-soft: #f9e7e3;
    --wd-gold: #9a7b3f;
    --wd-gold-soft: #f5eeda;
    --wd-olive: #3d6b52;
    --wd-olive-soft: #e6f0e9;
    --wd-r: 12px;
    --wd-r-sm: 8px;
    --wd-serif: "Songti SC", "STSong", "Noto Serif SC", SimSun, Georgia, serif;
    --wd-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    --wd-mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
    --wd-shadow: 0 1px 3px rgba(28, 36, 50, .05), 0 8px 24px -16px rgba(28, 36, 50, .3);
    --wd-shadow-lg: 0 2px 6px rgba(28, 36, 50, .06), 0 24px 56px -30px rgba(28, 36, 50, .48);
    --wd-rule: rgba(36, 64, 94, .09);
}

:root[data-theme="dark"] .wd-page {
    --wd-paper: #101519;
    --wd-surface: #171c22;
    --wd-surface-2: #1e242b;
    --wd-ink: #e9edf2;
    --wd-ink-2: #b3bbc5;
    --wd-ink-3: #79828e;
    --wd-line: #29313a;
    --wd-line-2: #3b4550;
    --wd-navy: #74a6d4;
    --wd-navy-2: #93bce1;
    --wd-navy-3: #b4d2ec;
    --wd-navy-soft: rgba(116, 166, 212, .13);
    --wd-wax: #e08079;
    --wd-wax-2: #ef9c96;
    --wd-wax-soft: rgba(224, 128, 121, .13);
    --wd-gold: #d3b478;
    --wd-gold-soft: rgba(211, 180, 120, .13);
    --wd-olive: #79bd95;
    --wd-olive-soft: rgba(121, 189, 149, .13);
    --wd-shadow: 0 1px 3px rgba(0, 0, 0, .4), 0 10px 28px -18px rgba(0, 0, 0, .8);
    --wd-shadow-lg: 0 2px 6px rgba(0, 0, 0, .45), 0 26px 60px -30px rgba(0, 0, 0, .9);
    --wd-rule: rgba(116, 166, 212, .1);
}

/* ============================ 基础 ============================ */
.wd-page {
    font-family: var(--wd-sans);
    color: var(--wd-ink);
    line-height: 1.8;
    font-size: 15px;
    padding-bottom: 56px;
    -webkit-font-smoothing: antialiased;
}
.wd-page * { box-sizing: border-box; }
.wd-page b { font-weight: 700; }
.wd-page h1, .wd-page h2, .wd-page h3, .wd-page h4 { text-wrap: balance; }
.wd-page p { text-wrap: pretty; }
.wd-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}
.wd-page .is-low { color: var(--wd-olive); }
.wd-page .is-mid { color: var(--wd-gold); }
.wd-page .is-high { color: var(--wd-wax); }

/* ============================ 首屏：信笺 ============================ */
.wd-hero {
    position: relative;
    margin: 16px 0 22px;
    border-radius: 18px;
    background: var(--wd-surface);
    border: 1px solid var(--wd-line);
    box-shadow: var(--wd-shadow-lg);
    overflow: hidden;
}
.wd-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: repeating-linear-gradient(180deg, transparent 0 33px, var(--wd-rule) 33px 34px);
    background-position: 0 88px;
    background-size: 100% 34px;
    background-repeat: repeat-y;
}
.wd-hero > * { position: relative; }

.wd-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 350px);
    align-items: stretch;
}
.wd-hero-left { padding: 32px 32px 26px; min-width: 0; }
.wd-hero-copy { min-width: 0; }

.wd-kicker {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--wd-wax);
    padding: 5px 12px;
    border: 1px solid var(--wd-wax-soft);
    background: var(--wd-wax-soft);
    border-radius: 4px;
}
.wd-kicker::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--wd-wax);
}
.wd-hero h1 {
    font-family: var(--wd-serif);
    font-size: clamp(28px, 3.4vw, 40px);
    font-weight: 700;
    line-height: 1.26;
    letter-spacing: .01em;
    margin: 15px 0 12px;
    color: var(--wd-ink);
}
.wd-lead {
    font-size: 16.5px;
    line-height: 1.85;
    color: var(--wd-ink-2);
    max-width: 34em;
    margin: 0 0 18px;
}
.wd-lead b { color: var(--wd-navy); font-weight: 700; }
:root[data-theme="dark"] .wd-page .wd-lead b { color: var(--wd-navy-2); }
.wd-seals {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 7px 8px;
    margin: 0 0 4px;
    padding: 0;
}
.wd-seals li {
    font-size: 12.5px;
    color: var(--wd-ink-2);
    padding: 5px 12px;
    border-radius: 4px;
    background: var(--wd-surface-2);
    border: 1px solid var(--wd-line);
    white-space: nowrap;
}
.wd-seals li::before {
    content: "·";
    display: inline-block;
    margin-right: 7px;
    color: var(--wd-wax);
    font-weight: 800;
}

/* ============================ 首屏操作入口 ============================ */
.wd-entry {
    margin-top: 22px;
    padding: 20px 20px 18px;
    border-radius: 12px;
    background: var(--wd-surface-2);
    border: 1px solid var(--wd-line);
}
.wd-entry-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
    margin-bottom: 13px;
}
.wd-entry-head > b {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14.5px;
    font-weight: 800;
    color: var(--wd-ink);
}
.wd-entry-head > b::before {
    content: "①";
    font-family: var(--wd-mono);
    font-size: 11px;
    color: #fff;
    background: var(--wd-navy);
    width: 19px;
    height: 19px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.wd-entry-title {
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--wd-ink-3);
}
.wd-entry-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(116px, 1fr));
    gap: 12px;
    margin-top: 14px;
}
.wd-field--wide { grid-column: 1 / -1; }

/* ============================ 卷宗目录：手写折页标签 ============================ */
.wd-dossier-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(162px, 1fr));
    gap: 9px;
}
.wd-dossier {
    position: relative;
    display: grid;
    gap: 2px;
    text-align: left;
    padding: 11px 13px 12px 15px;
    border-radius: 4px 10px 10px 4px;
    cursor: pointer;
    font-family: inherit;
    color: var(--wd-ink);
    background: var(--wd-surface);
    border: 1px solid var(--wd-line);
    border-left: 4px solid var(--wd-line-2);
    box-shadow: 0 2px 0 0 var(--wd-line);
    transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.wd-dossier:hover { transform: translateX(2px); border-color: var(--wd-navy); }
.wd-dossier.is-on {
    background: var(--wd-navy-soft);
    border-color: var(--wd-navy);
    border-left-color: var(--wd-navy);
    box-shadow: 0 2px 0 0 var(--wd-navy);
}
.wd-dossier-tab {
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--wd-gold);
}
.wd-dossier-name { font-family: var(--wd-serif); font-size: 16px; font-weight: 700; }
.wd-dossier-cost { font-size: 12px; font-family: var(--wd-mono); color: var(--wd-ink-2); }
.wd-dossier-risk {
    position: absolute;
    top: 9px;
    right: 10px;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--wd-surface-2);
    border: 1px solid var(--wd-line-2);
}
.wd-dossier-risk.is-low { color: var(--wd-olive); border-color: var(--wd-olive); }
.wd-dossier-risk.is-mid { color: var(--wd-gold); border-color: var(--wd-gold); }
.wd-dossier-risk.is-high { color: var(--wd-wax); border-color: var(--wd-wax); }

/* ============================ 首屏右栏：火漆印鉴 ============================ */
.wd-seal-wrap {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 16px;
    padding: 28px 26px 24px;
    background: var(--wd-surface-2);
    border-left: 1px solid var(--wd-line);
    min-width: 0;
}
.wd-seal {
    position: relative;
    width: 100%;
    max-width: 236px;
    aspect-ratio: 1 / 1;
    margin: 0 auto;
    padding: 20px 18px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: radial-gradient(circle at 34% 28%, var(--wd-wax-2), var(--wd-wax) 62%, #7e2222);
    color: #fff;
    box-shadow: 0 10px 26px -14px rgba(168, 50, 50, .95), inset 0 -3px 12px rgba(0, 0, 0, .25);
}
.wd-seal::before {
    content: "";
    position: absolute;
    inset: -6px;
    border-radius: 46% 54% 48% 52% / 52% 46% 54% 48%;
    background: var(--wd-wax);
    z-index: -1;
    opacity: .92;
}
.wd-seal::after {
    content: "";
    position: absolute;
    inset: 14px;
    border-radius: 50%;
    border: 1.5px dashed rgba(255, 255, 255, .5);
    pointer-events: none;
}
/* 深色下仍是"红蜡"质感，而不是粉色圆盘 */
:root[data-theme="dark"] .wd-page .wd-seal {
    background: radial-gradient(circle at 34% 28%, #e28b81, #c25a51 62%, #8e3730);
}
:root[data-theme="dark"] .wd-page .wd-seal::before { background: #b44b43; }
.wd-seal-label {
    display: block;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .2em;
    opacity: .84;
}
.wd-seal strong {
    display: block;
    font-family: var(--wd-mono);
    font-size: clamp(22px, 2.7vw, 31px);
    font-weight: 800;
    line-height: 1.22;
    margin: 3px 0;
    word-break: break-all;
}
.wd-seal-range {
    display: block;
    font-size: 11.5px;
    font-family: var(--wd-mono);
    opacity: .88;
}
.wd-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.wd-metric {
    padding: 10px 12px;
    border-radius: var(--wd-r-sm);
    background: var(--wd-surface);
    border: 1px solid var(--wd-line);
    text-align: center;
}
.wd-metric > span { display: block; font-size: 11.5px; color: var(--wd-ink-3); }
.wd-metric > b { font-family: var(--wd-mono); font-size: 16px; font-weight: 700; color: var(--wd-ink); }
.wd-risk-badge {
    display: inline-block;
    padding: 2px 12px;
    border-radius: 999px;
    font-size: 13.5px;
    font-family: var(--wd-serif);
    font-weight: 700;
    background: var(--wd-surface-2);
    border: 1px solid var(--wd-line-2);
    color: var(--wd-ink-2);
}
.wd-risk-badge.is-low { background: var(--wd-olive-soft); border-color: var(--wd-olive); color: var(--wd-olive); }
.wd-risk-badge.is-mid { background: var(--wd-gold-soft); border-color: var(--wd-gold); color: var(--wd-gold); }
.wd-risk-badge.is-high { background: var(--wd-wax-soft); border-color: var(--wd-wax); color: var(--wd-wax); }

/* ============================ 预置案例 ============================ */
.wd-presets {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    background: var(--wd-surface);
    border-top: 1px solid var(--wd-line);
}
.wd-presets-label {
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--wd-ink-3);
}
.wd-presets button {
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--wd-ink-2);
    padding: 6px 14px;
    border-radius: 4px;
    background: var(--wd-surface-2);
    border: 1px solid var(--wd-line);
    cursor: pointer;
    transition: all .15s ease;
}
.wd-presets button:hover {
    color: #fff;
    background: var(--wd-navy);
    border-color: var(--wd-navy);
}
:root[data-theme="dark"] .wd-page .wd-presets button:hover { color: #0f1418; }

/* ============================ 错误条 ============================ */
.wd-errbar {
    margin: 0 0 20px;
    padding: 15px 20px;
    border-radius: var(--wd-r);
    background: var(--wd-wax-soft);
    border: 1px solid var(--wd-wax);
    border-left-width: 4px;
    color: var(--wd-wax);
    font-size: 14px;
    line-height: 1.75;
}
:root[data-theme="dark"] .wd-page .wd-errbar { color: var(--wd-wax-2); }
.wd-errbar b { display: block; margin-bottom: 3px; font-size: 14.5px; }
.wd-errbar ul { margin: 4px 0 0; padding-left: 20px; }
.wd-errbar li { margin: 2px 0; }
.wd-result.is-blocked .wd-ledger { opacity: .55; filter: grayscale(.4); }

/* ============================ 卷宗布局 ============================ */
.wd-layout {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 22px;
    align-items: start;
}
.wd-rail { display: flex; flex-direction: column; gap: 15px; min-width: 0; }
.wd-ledger { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

/* ============================ 侧栏卡片 ============================ */
.wd-rail-card {
    position: relative;
    padding: 17px 16px 15px;
    border-radius: var(--wd-r);
    background: var(--wd-surface);
    border: 1px solid var(--wd-line);
    box-shadow: var(--wd-shadow);
}
.wd-rail-head { margin-bottom: 12px; }
.wd-rail-no {
    display: inline-block;
    font-size: 10.5px;
    letter-spacing: .2em;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--wd-gold);
    border-bottom: 1px solid var(--wd-gold);
    padding-bottom: 2px;
}
.wd-rail-head h2 {
    font-family: var(--wd-serif);
    font-size: 17.5px;
    font-weight: 700;
    margin: 7px 0 0;
    color: var(--wd-ink);
}
.wd-rail-note {
    margin: 12px 0 0;
    font-size: 12px;
    line-height: 1.75;
    color: var(--wd-ink-3);
}

/* ============================ 表单 ============================ */
.wd-fields { display: flex; flex-direction: column; gap: 12px; }
.wd-field { display: block; min-width: 0; }
.wd-field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(78px, 1fr)); gap: 9px; }
.wd-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--wd-ink-2);
    margin-bottom: 5px;
}
.wd-unit { font-weight: 500; color: var(--wd-ink-3); }
.wd-input, .wd-select {
    width: 100%;
    padding: 8px 11px;
    border-radius: var(--wd-r-sm);
    border: 1px solid var(--wd-line-2);
    background: var(--wd-surface-2);
    color: var(--wd-ink);
    font-family: inherit;
    font-size: 14px;
    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.wd-input:focus, .wd-select:focus {
    outline: none;
    border-color: var(--wd-navy);
    background: var(--wd-surface);
    box-shadow: 0 0 0 3px var(--wd-navy-soft);
}
.wd-hint { display: block; margin-top: 4px; font-size: 11.5px; line-height: 1.65; color: var(--wd-ink-3); }
.wd-err-tip { display: block; margin-top: 3px; font-size: 11.5px; line-height: 1.6; color: var(--wd-wax); font-weight: 600; }
.wd-err-tip:empty { display: none; }
.wd-err-tip.is-on { display: block; }

.wd-check, .wd-extra {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    line-height: 1.7;
    color: var(--wd-ink-2);
    cursor: pointer;
}
.wd-check input, .wd-extra input {
    margin: 3px 0 0;
    width: 15px;
    height: 15px;
    accent-color: var(--wd-navy);
    flex: none;
}
.wd-check b { color: var(--wd-navy); }
:root[data-theme="dark"] .wd-page .wd-check b { color: var(--wd-navy-2); }

.wd-subgroup {
    padding: 11px 12px;
    border-radius: 10px;
    background: var(--wd-surface-2);
    border: 1px dashed var(--wd-line-2);
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.wd-subgroup-title {
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: .06em;
    color: var(--wd-gold);
}
.wd-extras { display: flex; flex-direction: column; gap: 9px; }
.wd-extra {
    align-items: center;
    padding: 8px 10px;
    border-radius: 8px;
    background: var(--wd-surface-2);
    border: 1px solid var(--wd-line);
}
.wd-extra span { display: flex; flex-direction: column; }
.wd-extra em {
    font-style: normal;
    font-size: 11.5px;
    font-family: var(--wd-mono);
    color: var(--wd-ink-3);
}

/* ============================ 按钮 ============================ */
.wd-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    padding: 13px 14px;
    border-radius: var(--wd-r);
    background: var(--wd-navy-3);
    border: 1px solid var(--wd-navy-3);
}
.wd-btn {
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 700;
    padding: 9px 17px;
    border-radius: var(--wd-r-sm);
    border: 1px solid var(--wd-gold);
    background: transparent;
    color: #f6f1e4;
    cursor: pointer;
    transition: all .15s ease;
}
.wd-btn:hover { background: var(--wd-gold); color: #1a1408; }
.wd-btn.is-primary { background: var(--wd-gold); color: #1a1408; border-color: var(--wd-gold); }
.wd-btn.is-primary:hover { background: #b39456; border-color: #b39456; color: #1a1408; }
.wd-btn.is-ghost { border-color: rgba(246, 241, 228, .4); }
.wd-mini {
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    margin-right: 5px;
    border-radius: 5px;
    border: 1px solid var(--wd-line-2);
    background: var(--wd-surface-2);
    color: var(--wd-ink-2);
    cursor: pointer;
}
.wd-mini:hover { border-color: var(--wd-navy); color: var(--wd-navy); }
.wd-mini.is-del:hover { border-color: var(--wd-wax); color: var(--wd-wax); }
.wd-mini-flag {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    padding: 0 6px;
    border-radius: 3px;
    background: var(--wd-olive-soft);
    color: var(--wd-olive);
    border: 1px solid var(--wd-olive);
}

/* ============================ 内页面板 ============================ */
.wd-panel {
    position: relative;
    margin: 0 0 18px;
    padding: 24px 26px 22px;
    border-radius: var(--wd-r);
    background: var(--wd-surface);
    border: 1px solid var(--wd-line);
    box-shadow: var(--wd-shadow);
}
.wd-panel::after {
    content: "";
    position: absolute;
    left: 0;
    top: 14px;
    bottom: 14px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: linear-gradient(180deg, var(--wd-wax), var(--wd-gold));
}
.wd-panel-head { margin-bottom: 16px; }
.wd-panel-kicker {
    display: inline-block;
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--wd-wax);
}
.wd-panel-head h2 {
    font-family: var(--wd-serif);
    font-size: 20.5px;
    font-weight: 700;
    line-height: 1.42;
    margin: 7px 0 0;
    color: var(--wd-ink);
}
.wd-panel-head p {
    margin: 8px 0 0;
    font-size: 14px;
    line-height: 1.85;
    color: var(--wd-ink-2);
    max-width: 62em;
}
.wd-panel-head p b { color: var(--wd-navy); }
:root[data-theme="dark"] .wd-page .wd-panel-head p b { color: var(--wd-navy-2); }

/* ============================ 卷宗首部 ============================ */
.wd-charter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 12px;
}
.wd-charter-item {
    padding: 13px 15px;
    border-radius: 10px;
    background: var(--wd-surface-2);
    border: 1px solid var(--wd-line);
    border-left: 3px solid var(--wd-gold);
}
.wd-charter-k {
    display: block;
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--wd-gold);
    margin-bottom: 5px;
}
.wd-charter-item p { margin: 0; font-size: 13.5px; line-height: 1.85; color: var(--wd-ink-2); }
.wd-estate-note {
    margin: 13px 0 0;
    padding: 11px 15px;
    border-radius: 10px;
    background: var(--wd-navy-soft);
    border: 1px dashed var(--wd-navy);
    font-size: 13px;
    line-height: 1.8;
    color: var(--wd-ink-2);
}

/* ============================ 份额列表 ============================ */
.wd-share-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.wd-share-row {
    display: grid;
    grid-template-columns: minmax(78px, 140px) minmax(60px, 1fr) 58px minmax(92px, auto);
    align-items: center;
    gap: 12px;
    padding: 9px 13px;
    border-radius: 9px;
    background: var(--wd-surface-2);
    border: 1px solid var(--wd-line);
}
.wd-share-name { font-size: 13.5px; font-weight: 700; color: var(--wd-ink); }
.wd-share-bar {
    position: relative;
    display: block;
    height: 8px;
    border-radius: 999px;
    background: var(--wd-line);
    overflow: hidden;
}
.wd-share-bar i {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--wd-navy), var(--wd-gold));
}
.wd-share-ratio { font-family: var(--wd-mono); font-size: 13.5px; font-weight: 700; color: var(--wd-navy); text-align: right; }
.wd-share-amt { font-family: var(--wd-mono); font-size: 13px; color: var(--wd-ink-2); text-align: right; }
.wd-empty { margin: 0; padding: 16px 2px; font-size: 13.5px; color: var(--wd-ink-3); }

/* ============================ 家族树（钢笔线条） ============================ */
.wd-tree {
    margin-top: 16px;
    padding: 16px 10px;
    border-radius: var(--wd-r);
    background:
        repeating-linear-gradient(90deg, transparent 0 27px, var(--wd-rule) 27px 28px),
        var(--wd-surface-2);
    border: 1px solid var(--wd-line);
    overflow-x: auto;
}
.wd-tree-svg { display: block; width: 100%; min-width: 540px; height: auto; }
.wd-tree-trunk { stroke: var(--wd-gold); stroke-width: 2; fill: none; }
.wd-tree-branch { stroke: var(--wd-navy); stroke-width: 1.5; fill: none; opacity: .6; }
.wd-tree-root { fill: var(--wd-navy-3); stroke: var(--wd-gold); stroke-width: 1.6; }
.wd-tree-root-text { fill: #f6f1e4; font-size: 17px; text-anchor: middle; font-family: var(--wd-serif); }
.wd-tree-dot { fill: var(--wd-wax); }
.wd-tree-label { fill: var(--wd-ink); font-size: 13px; text-anchor: middle; }
.wd-tree-pct { fill: var(--wd-navy); font-size: 12px; font-weight: 700; text-anchor: middle; }
:root[data-theme="dark"] .wd-page .wd-tree-root-text { fill: #e9edf2; }
:root[data-theme="dark"] .wd-page .wd-tree-branch { stroke: var(--wd-navy); }

/* ============================ 要件核验器 ============================ */
.wd-req-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.wd-req {
    position: relative;
    padding: 12px 15px 11px;
    border-radius: 10px;
    background: var(--wd-surface-2);
    border: 1px solid var(--wd-line);
    border-left: 4px solid var(--wd-line-2);
}
.wd-req.is-ok { border-left-color: var(--wd-olive); background: var(--wd-olive-soft); }
.wd-req.is-miss { border-left-color: var(--wd-wax); }
.wd-req-check { display: flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 700; color: var(--wd-ink); cursor: pointer; }
.wd-req-check input { width: 16px; height: 16px; accent-color: var(--wd-olive); flex: none; }
.wd-req.is-ok .wd-req-check { color: var(--wd-olive); }
.wd-req-risk {
    display: inline-block;
    margin-top: 6px;
    font-size: 11.5px;
    padding: 1px 9px;
    border-radius: 999px;
    background: var(--wd-surface);
    border: 1px solid var(--wd-line-2);
}
.wd-req-risk.is-low { color: var(--wd-olive); border-color: var(--wd-olive); }
.wd-req-risk.is-mid { color: var(--wd-gold); border-color: var(--wd-gold); }
.wd-req-risk.is-high { color: var(--wd-wax); border-color: var(--wd-wax); }
.wd-req-tip { margin: 6px 0 0; font-size: 12.5px; line-height: 1.75; color: var(--wd-ink-3); }

/* ============================ 费用明细 ============================ */
.wd-cost-detail table { width: 100%; border-collapse: collapse; font-size: 14px; }
.wd-cost-detail td {
    padding: 10px 12px;
    border-bottom: 1px dashed var(--wd-line);
    color: var(--wd-ink-2);
}
.wd-cost-detail td em {
    display: block;
    font-style: normal;
    font-size: 11.5px;
    font-family: var(--wd-mono);
    color: var(--wd-ink-3);
}
.wd-cost-detail .wd-num { font-family: var(--wd-mono); text-align: right; color: var(--wd-ink); white-space: nowrap; }
.wd-cost-detail .wd-total-row td {
    border-bottom: none;
    border-top: 3px double var(--wd-navy);
    font-family: var(--wd-serif);
    font-size: 16px;
    font-weight: 700;
    color: var(--wd-ink);
    padding-top: 12px;
}
.wd-cost-detail .wd-total-row .wd-num { color: var(--wd-navy); font-size: 19px; }
:root[data-theme="dark"] .wd-page .wd-cost-detail .wd-total-row .wd-num { color: var(--wd-navy-2); }

/* ============================ 四方式对比 ============================ */
.wd-compare-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(235px, 1fr)); gap: 13px; }
.wd-cmp {
    position: relative;
    padding: 16px 16px 14px;
    border-radius: 10px;
    background: var(--wd-surface-2);
    border: 1px solid var(--wd-line);
}
.wd-cmp.is-best { border-color: var(--wd-olive); box-shadow: 0 10px 26px -18px rgba(61, 107, 82, .9); }
.wd-cmp.is-err { border-color: var(--wd-wax); background: var(--wd-wax-soft); }
.wd-cmp h4 { font-family: var(--wd-serif); font-size: 16.5px; font-weight: 700; margin: 0 0 8px; color: var(--wd-ink); }
.wd-cmp.is-err p { margin: 0; font-size: 13px; color: var(--wd-wax); }
.wd-cmp-flag {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
    padding: 1px 9px;
    border-radius: 999px;
    background: var(--wd-olive);
    color: #fff;
}
:root[data-theme="dark"] .wd-page .wd-cmp-flag { color: #0f1418; }
.wd-cmp-cost {
    font-family: var(--wd-mono);
    font-size: 23px;
    font-weight: 700;
    color: var(--wd-ink);
    line-height: 1.3;
    margin-bottom: 8px;
}
.wd-cmp-cost span { font-size: 11.5px; color: var(--wd-ink-3); margin-left: 6px; font-family: var(--wd-sans); }
.wd-cmp-list { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.wd-cmp-list li { font-size: 12.5px; color: var(--wd-ink-3); }
.wd-cmp-list b { color: var(--wd-ink); font-family: var(--wd-mono); font-weight: 700; }
.wd-cmp-note { margin: 0; font-size: 12px; line-height: 1.75; color: var(--wd-ink-3); }

/* ============================ 批量表 ============================ */
.wd-batch-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 13px; margin-bottom: 14px; }
.wd-batch-bar .wd-btn { background: var(--wd-navy); border-color: var(--wd-navy); color: #fff; }
:root[data-theme="dark"] .wd-page .wd-batch-bar .wd-btn { color: #0f1418; }
.wd-batch-bar .wd-btn:hover { background: var(--wd-navy-2); border-color: var(--wd-navy-2); color: #fff; }
.wd-batch-best { margin: 0; font-size: 13.5px; color: var(--wd-ink-2); }
.wd-batch-best b { color: var(--wd-navy); }
.wd-table-wrap { overflow-x: auto; border-radius: var(--wd-r-sm); border: 1px solid var(--wd-line); }
.wd-table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 620px; }
.wd-table th, .wd-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--wd-line);
    color: var(--wd-ink-2);
}
.wd-table th {
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: .05em;
    color: var(--wd-ink);
    background: var(--wd-surface-2);
    border-bottom: 1px solid var(--wd-line-2);
    white-space: nowrap;
}
.wd-table tbody tr:last-child td { border-bottom: none; }
.wd-table tbody tr:hover { background: var(--wd-surface-2); }
.wd-table tbody tr.is-best { background: var(--wd-olive-soft); }
.wd-table .wd-num { font-family: var(--wd-mono); text-align: right; white-space: nowrap; }

/* ============================ CSV ============================ */
.wd-pre {
    margin: 0;
    padding: 16px 18px;
    border-radius: var(--wd-r-sm);
    background: var(--wd-surface-2);
    border: 1px solid var(--wd-line);
    font-family: var(--wd-mono);
    font-size: 12.5px;
    line-height: 1.85;
    color: var(--wd-ink-2);
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 420px;
    overflow: auto;
}

/* ============================ FAQ ============================ */
.wd-faq { display: flex; flex-direction: column; gap: 8px; }
.wd-faq-item {
    border-radius: var(--wd-r-sm);
    border: 1px solid var(--wd-line);
    background: var(--wd-surface-2);
    overflow: hidden;
}
.wd-faq-item summary {
    cursor: pointer;
    list-style: none;
    padding: 13px 44px 13px 16px;
    font-size: 14.5px;
    font-weight: 700;
    color: var(--wd-ink);
    position: relative;
}
.wd-faq-item summary::-webkit-details-marker { display: none; }
.wd-faq-item summary::after {
    content: "+";
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-family: var(--wd-mono);
    font-size: 19px;
    font-weight: 700;
    color: var(--wd-navy);
}
.wd-faq-item[open] summary::after { content: "−"; }
.wd-faq-a {
    padding: 13px 16px 15px;
    font-size: 13.5px;
    line-height: 1.95;
    color: var(--wd-ink-2);
    border-top: 1px solid var(--wd-line);
}
.wd-faq-a b { color: var(--wd-ink); font-weight: 700; }

/* ============================ 留言板 ============================ */
.wd-comments {
    padding: 24px 26px;
    border-radius: var(--wd-r);
    background: var(--wd-surface);
    border: 1px solid var(--wd-line);
    box-shadow: var(--wd-shadow);
}
.wd-comments .cm-head-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding-bottom: 13px;
    border-bottom: 1px solid var(--wd-line);
}
.wd-comments .cm-title {
    display: inline-flex;
    align-items: center;
    font-size: 17px;
    font-weight: 800;
    margin: 0;
    color: var(--wd-ink);
}
.wd-comments .cm-title::before {
    content: "";
    width: 4px;
    height: 17px;
    border-radius: 2px;
    margin-right: 9px;
    background: linear-gradient(135deg, var(--wd-navy), var(--wd-wax));
}
.wd-comments .cm-count {
    font-size: 12.5px;
    color: #fff;
    background: var(--wd-navy);
    border-radius: 999px;
    padding: 1px 9px;
    margin-left: 8px;
}
:root[data-theme="dark"] .wd-page .wd-comments .cm-count { color: #0f1418; }
.wd-comments .cm-note {
    font-size: 12px;
    color: var(--wd-ink-3);
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--wd-surface-2);
    border: 1px solid var(--wd-line);
}
.wd-comments .cm-item {
    padding: 14px 16px;
    border-radius: var(--wd-r-sm);
    border: 1px solid var(--wd-line);
    background: var(--wd-surface-2);
    transition: transform .18s ease, box-shadow .18s ease;
}
.wd-comments .cm-item:hover { transform: translateY(-2px); box-shadow: var(--wd-shadow); }
.wd-comments .cm-avatar {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--wd-navy-soft);
    color: var(--wd-navy);
    font-size: 16px;
}
.wd-comments .cm-content { font-size: 14px; line-height: 1.85; color: var(--wd-ink-2); }
.wd-comments .cm-form {
    padding: 20px;
    border-radius: var(--wd-r-sm);
    border: 1px solid var(--wd-line);
    background: var(--wd-surface-2);
    display: flex;
    flex-direction: column;
    gap: 13px;
}
.wd-comments .cm-form-title { font-size: 15px; font-weight: 800; color: var(--wd-ink); }
.wd-comments .cm-input, .wd-comments .cm-textarea {
    border-radius: var(--wd-r-sm);
    border: 1px solid var(--wd-line-2);
    background: var(--wd-surface);
    color: var(--wd-ink);
    padding: 9px 12px;
    font-family: inherit;
    font-size: 14px;
}
.wd-comments .cm-input:focus, .wd-comments .cm-textarea:focus {
    outline: none;
    border-color: var(--wd-navy);
    box-shadow: 0 0 0 3px var(--wd-navy-soft);
}
.wd-comments .cm-submit {
    align-self: flex-start;
    border-radius: var(--wd-r-sm);
    padding: 11px 24px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    border: none;
    background: var(--wd-navy);
    color: #fff;
    cursor: pointer;
}
:root[data-theme="dark"] .wd-page .wd-comments .cm-submit { color: #0f1418; }
.wd-comments .cm-submit:hover { background: var(--wd-navy-2); }
.wd-comments .cm-success {
    padding: 26px;
    border-radius: var(--wd-r-sm);
    background: var(--wd-olive-soft);
    border: 1px dashed var(--wd-olive);
    text-align: center;
}

/* ============================ Toast ============================ */
.wd-toast {
    position: fixed;
    left: 50%;
    bottom: 36px;
    transform: translate(-50%, 16px);
    z-index: 9999;
    max-width: min(90vw, 480px);
    padding: 12px 22px;
    border-radius: 6px;
    background: var(--wd-navy-3);
    color: #f6f1e4;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 16px 40px -16px rgba(0, 0, 0, .65);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
}
.wd-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.wd-toast.is-err { background: var(--wd-wax); color: #fff; }

/* ============================ A4 打印单 ============================ */
.wd-sheet { display: none; }
@media print {
    @page { size: A4; margin: 14mm 12mm; }
    body { background: #fff !important; }
    .wd-hero, .wd-presets, .wd-errbar, .wd-layout, .wd-toast,
    .detail-breadcrumb, .nav-header, .footer, .back-to-top {
        display: none !important;
    }
    .wd-sheet { display: block !important; }
    .wd-sheet .wd-sheet-head h3 {
        font-family: var(--wd-serif);
        font-size: 22px;
        font-weight: 700;
        margin: 0 0 4px;
        color: #1c2432;
    }
    .wd-sheet .wd-sheet-head span { font-size: 13px; color: #7d8794; }
    .wd-sheet .wd-sheet-table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 13px; }
    .wd-sheet .wd-sheet-table th, .wd-sheet .wd-sheet-table td {
        border: 1px solid #d1c6af;
        padding: 7px 10px;
        text-align: left;
    }
    .wd-sheet .wd-sheet-table th { background: #f7f3e9; color: #45505f; font-weight: 700; }
    .wd-sheet .wd-sheet-note { font-size: 11.5px; color: #7d8794; line-height: 1.75; margin-top: 14px; }
}

/* ============================ 响应式 ============================ */
@media (max-width: 1180px) {
    .wd-layout { grid-template-columns: 272px minmax(0, 1fr); }
}
@media (max-width: 1000px) {
    .wd-hero-grid { grid-template-columns: minmax(0, 1fr); }
    .wd-seal-wrap { border-left: none; border-top: 1px solid var(--wd-line); }
    .wd-layout { grid-template-columns: minmax(0, 1fr); }
    .wd-rail { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); align-items: start; }
    .wd-actions { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
    .wd-page { font-size: 14.5px; }
    .wd-hero-left { padding: 24px 16px 20px; }
    .wd-presets { padding: 12px 16px; }
    .wd-seal-wrap { padding: 22px 16px 20px; }
    .wd-panel { padding: 20px 16px 18px; }
    .wd-comments { padding: 18px 16px; }
    .wd-entry { padding: 16px 14px 14px; }
    .wd-metrics { grid-template-columns: minmax(0, 1fr); }
    .wd-rail { grid-template-columns: minmax(0, 1fr); }
    .wd-share-row { grid-template-columns: minmax(0, 1fr) 58px; row-gap: 6px; }
    .wd-share-bar { grid-column: 1 / -1; }
    .wd-share-amt { text-align: right; }
    .wd-actions .wd-btn { flex: 1 1 auto; }
    .wd-field-row { grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); }
}