/* ==========================================================================
   住院押金与自费项目预估计算器 /tool/hospital-deposit-calc
   视觉主题：病区结算单 —— 洁净瓷白 + 医疗青 + 医保蓝 + 缺口珊瑚
   深浅双主题：深色跟随导航 #themeToggle（:root[data-theme="dark"]），页内不再设开关
   字体层级：衬线大标题 / 无衬线正文 / 等宽数字（金额与天数）
   ========================================================================== */

.hdp-page {
    /* ---- 浅色（默认） ---- */
    --hdp-bg: #eef4f6;
    --hdp-bg-2: #e3eef0;
    --hdp-surface: #ffffff;
    --hdp-surface-2: #f5fafb;
    --hdp-ink: #142a2e;
    --hdp-ink-2: #4b6569;
    --hdp-ink-3: #7f989c;
    --hdp-line: #d2e3e6;
    --hdp-line-2: #e4f0f1;
    --hdp-teal: #0d6d73;
    --hdp-teal-2: #128a90;
    --hdp-teal-soft: #e0f1f2;
    --hdp-blue: #2a5d8f;
    --hdp-blue-soft: #e5eef7;
    --hdp-coral: #bb4f36;
    --hdp-coral-soft: #fbe8e3;
    --hdp-amber: #a97718;
    --hdp-amber-soft: #fbf0d8;
    --hdp-green: #2c7a58;
    --hdp-green-soft: #e2f2ea;
    --hdp-shadow: 0 20px 44px rgba(13, 109, 115, .1);
    --hdp-shadow-sm: 0 6px 18px rgba(13, 109, 115, .07);
    --hdp-radius: 16px;
    --hdp-sans: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    --hdp-serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", Georgia, serif;
    --hdp-mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

:root[data-theme="dark"] .hdp-page {
    --hdp-bg: #0b1416;
    --hdp-bg-2: #0e1a1d;
    --hdp-surface: #122023;
    --hdp-surface-2: #17282b;
    --hdp-ink: #e6f2f3;
    --hdp-ink-2: #a3bcc0;
    --hdp-ink-3: #779097;
    --hdp-line: #234044;
    --hdp-line-2: #1b3236;
    --hdp-teal: #59c3c4;
    --hdp-teal-2: #7fd7d7;
    --hdp-teal-soft: #123336;
    --hdp-blue: #86b8e2;
    --hdp-blue-soft: #16293c;
    --hdp-coral: #ec8e75;
    --hdp-coral-soft: #3a201a;
    --hdp-amber: #d9ae5e;
    --hdp-amber-soft: #33280f;
    --hdp-green: #6fc79b;
    --hdp-green-soft: #15302a;
    --hdp-shadow: 0 22px 48px rgba(0, 0, 0, .55);
    --hdp-shadow-sm: 0 6px 18px rgba(0, 0, 0, .4);
}

.hdp-page {
    position: relative;
    color: var(--hdp-ink);
    font-family: var(--hdp-sans);
    font-size: 15px;
    line-height: 1.85;
    margin-top: 22px;
    padding: 4px;
    overflow-x: clip;
}

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

.hdp-page h1,
.hdp-page h2,
.hdp-page h3 {
    margin: 0;
    line-height: 1.35;
    font-style: normal;
}

.hdp-page p { margin: 0; }

.hdp-page a { color: var(--hdp-teal); text-decoration: none; }

.hdp-mono {
    font-family: var(--hdp-mono);
    font-variant-numeric: tabular-nums;
    letter-spacing: -.2px;
}

/* ============================ 首屏 ============================ */
.hdp-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(300px, .9fr);
    gap: 22px;
    align-items: stretch;
    margin-bottom: 18px;
}

.hdp-hero-main {
    position: relative;
    padding: 30px 30px 26px;
    border: 1px solid var(--hdp-line);
    border-radius: var(--hdp-radius);
    background:
        radial-gradient(circle at 91% 8%, rgba(13, 109, 115, .1) 0 44px, transparent 58px),
        linear-gradient(135deg, var(--hdp-surface), var(--hdp-surface-2));
    box-shadow: var(--hdp-shadow-sm);
    overflow: hidden;
}

.hdp-hero-main::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(to right, rgba(13, 109, 115, .055) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(13, 109, 115, .055) 1px, transparent 1px);
    background-size: 26px 26px;
    mask-image: radial-gradient(circle at 8% 100%, #000 0, transparent 70%);
    -webkit-mask-image: radial-gradient(circle at 8% 100%, #000 0, transparent 70%);
    pointer-events: none;
}

.hdp-hero-main > * { position: relative; }

.hdp-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    margin-bottom: 14px;
    border-radius: 999px;
    background: var(--hdp-teal-soft);
    color: var(--hdp-teal);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .6px;
}

.hdp-kicker::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--hdp-teal);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--hdp-teal) 18%, transparent);
}

.hdp-page h1 {
    font-family: var(--hdp-serif);
    font-size: 33px;
    font-weight: 800;
    letter-spacing: .5px;
    color: var(--hdp-ink);
    margin-bottom: 12px;
}

.hdp-lead {
    max-width: 46em;
    color: var(--hdp-ink-2);
    font-size: 15px;
    line-height: 1.95;
    margin-bottom: 18px;
}

.hdp-lead b {
    color: var(--hdp-teal);
    font-weight: 700;
    background: linear-gradient(transparent 62%, color-mix(in srgb, var(--hdp-teal) 16%, transparent) 62%);
}

/* 首屏即操作入口 */
.hdp-quick {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
    gap: 10px;
    align-items: end;
    padding: 12px;
    border: 1px dashed color-mix(in srgb, var(--hdp-teal) 38%, var(--hdp-line));
    border-radius: 12px;
    background: color-mix(in srgb, var(--hdp-teal) 4%, var(--hdp-surface));
}

.hdp-quick-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }

.hdp-quick-field > span {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--hdp-ink-3);
    letter-spacing: .4px;
}

.hdp-quick-go {
    height: 38px;
    white-space: nowrap;
}

.hdp-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    margin: 18px 0 0;
    padding: 0;
}

.hdp-tags li {
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid var(--hdp-line);
    background: var(--hdp-surface);
    color: var(--hdp-ink-2);
    font-size: 12px;
    line-height: 1.6;
}

/* 结算小票 */
.hdp-slip {
    position: relative;
    align-self: start;
    padding: 24px 22px 20px;
    border: 1px solid var(--hdp-line);
    border-radius: 14px 14px 4px 4px;
    background:
        radial-gradient(circle at 0 100%, var(--hdp-bg) 0 9px, transparent 10px),
        radial-gradient(circle at 100% 100%, var(--hdp-bg) 0 9px, transparent 10px),
        var(--hdp-surface);
    box-shadow: var(--hdp-shadow);
    overflow: hidden;
}

.hdp-slip::after {
    content: "";
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 8px;
    height: 1px;
    background: repeating-linear-gradient(90deg, var(--hdp-line) 0 6px, transparent 6px 11px);
}

.hdp-slip-stamp {
    position: absolute;
    top: 16px;
    right: 16px;
    padding: 3px 9px;
    border: 1.5px solid color-mix(in srgb, var(--hdp-coral) 60%, transparent);
    border-radius: 4px;
    color: var(--hdp-coral);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 3px;
    transform: rotate(-8deg);
    opacity: .85;
}

.hdp-slip-head { display: flex; flex-direction: column; gap: 3px; margin-bottom: 12px; }

.hdp-slip-title {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--hdp-ink);
}

.hdp-slip-sub { font-size: 11.5px; color: var(--hdp-ink-3); }

.hdp-slip-main {
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
    padding-bottom: 4px;
}

.hdp-slip-label {
    width: 100%;
    font-size: 12px;
    color: var(--hdp-ink-3);
    font-weight: 700;
}

.hdp-slip-num {
    font-family: var(--hdp-mono);
    font-size: 40px;
    font-weight: 700;
    line-height: 1.1;
    color: var(--hdp-teal);
    letter-spacing: -1px;
}

.hdp-slip-unit { font-size: 13px; color: var(--hdp-ink-3); font-weight: 700; }

.hdp-slip-cut {
    margin: 14px 0 10px;
    height: 0;
    border-top: 1px dashed var(--hdp-line);
}

.hdp-slip-rows { margin: 0; padding: 0; display: grid; gap: 7px; }

.hdp-slip-rows > div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    font-size: 13px;
}

.hdp-slip-rows dt { color: var(--hdp-ink-2); }
.hdp-slip-rows dd { margin: 0; font-family: var(--hdp-mono); font-weight: 700; color: var(--hdp-ink); }

.hdp-slip-rows > div.is-key {
    margin-top: 4px;
    padding-top: 8px;
    border-top: 1px solid var(--hdp-line-2);
}

.hdp-slip-rows > div.is-key dt { font-weight: 800; color: var(--hdp-ink); }
.hdp-slip-rows > div.is-key dd { font-size: 18px; color: var(--hdp-coral); }

.hdp-slip-rows > div.is-ok dd { color: var(--hdp-green); }

.hdp-slip-note {
    margin-top: 14px;
    font-size: 11.5px;
    line-height: 1.7;
    color: var(--hdp-ink-3);
}

/* ============================ 校验条 ============================ */
.hdp-errbar {
    margin-bottom: 14px;
    padding: 11px 14px;
    border: 1px solid color-mix(in srgb, var(--hdp-coral) 40%, var(--hdp-line));
    border-left: 4px solid var(--hdp-coral);
    border-radius: 10px;
    background: var(--hdp-coral-soft);
    color: var(--hdp-coral);
    font-size: 13px;
}

.hdp-errbar ul { margin: 0; padding-left: 18px; }
.hdp-errbar li { line-height: 1.8; }

.hdp-errbar.is-warn {
    border-color: color-mix(in srgb, var(--hdp-amber) 40%, var(--hdp-line));
    border-left-color: var(--hdp-amber);
    background: var(--hdp-amber-soft);
    color: var(--hdp-amber);
}

/* ============================ 示例 ============================ */
.hdp-presets {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    padding: 10px 14px;
    border: 1px solid var(--hdp-line);
    border-radius: 12px;
    background: var(--hdp-surface);
}

.hdp-presets-label {
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: .6px;
    color: var(--hdp-ink-3);
    margin-right: 2px;
}

.hdp-presets button {
    padding: 6px 12px;
    border: 1px solid var(--hdp-line);
    border-radius: 999px;
    background: var(--hdp-surface-2);
    color: var(--hdp-ink-2);
    font-family: inherit;
    font-size: 12.5px;
    cursor: pointer;
    transition: all .18s ease;
}

.hdp-presets button:hover {
    border-color: var(--hdp-teal);
    color: var(--hdp-teal);
    background: var(--hdp-teal-soft);
    transform: translateY(-1px);
}

/* ============================ 面板 ============================ */
.hdp-panel {
    min-width: 0;
    margin-bottom: 16px;
    padding: 22px 24px 24px;
    border: 1px solid var(--hdp-line);
    border-radius: var(--hdp-radius);
    background: var(--hdp-surface);
    box-shadow: var(--hdp-shadow-sm);
}

.hdp-panel-head {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding-bottom: 14px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--hdp-line-2);
}

.hdp-step {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--hdp-teal-soft);
    color: var(--hdp-teal);
    font-family: var(--hdp-mono);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .5px;
}

.hdp-panel-head > div { min-width: 0; }

.hdp-panel h2 {
    font-size: 19px;
    font-weight: 800;
    color: var(--hdp-ink);
    margin-bottom: 5px;
}

.hdp-panel-head p {
    font-size: 13px;
    line-height: 1.8;
    color: var(--hdp-ink-2);
}

.hdp-grid { display: grid; gap: 14px; }
.hdp-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.hdp-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.hdp-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.hdp-field--wide { grid-column: span 2; }

.hdp-label {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--hdp-ink-2);
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
}

.hdp-unit { font-size: 11px; font-weight: 500; color: var(--hdp-ink-3); }

.hdp-input,
.hdp-select,
.hdp-textarea {
    width: 100%;
    min-width: 0;
    padding: 9px 11px;
    border: 1px solid var(--hdp-line);
    border-radius: 9px;
    background: var(--hdp-surface-2);
    color: var(--hdp-ink);
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.hdp-input.hdp-mono { font-size: 14px; font-weight: 600; }

.hdp-input:focus,
.hdp-select:focus,
.hdp-textarea:focus {
    outline: none;
    border-color: var(--hdp-teal);
    background: var(--hdp-surface);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--hdp-teal) 16%, transparent);
}

.hdp-textarea { resize: vertical; line-height: 1.7; font-family: var(--hdp-mono); font-size: 13px; }

.hdp-hint {
    margin-top: 12px;
    font-size: 12.5px;
    color: var(--hdp-ink-3);
    padding-left: 12px;
    border-left: 2px solid var(--hdp-line);
}

.hdp-hint b { color: var(--hdp-ink-2); }

/* ============================ 表格 ============================ */
.hdp-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    border: 1px solid var(--hdp-line);
    border-radius: 11px;
    background: var(--hdp-surface-2);
    -webkit-overflow-scrolling: touch;
}

.hdp-table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
    font-size: 13px;
}

.hdp-table th {
    padding: 9px 10px;
    text-align: left;
    white-space: nowrap;
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: .3px;
    color: var(--hdp-ink-3);
    background: color-mix(in srgb, var(--hdp-teal) 6%, var(--hdp-surface));
    border-bottom: 1px solid var(--hdp-line);
}

.hdp-table td {
    padding: 7px 10px;
    border-bottom: 1px solid var(--hdp-line-2);
    color: var(--hdp-ink);
    vertical-align: middle;
}

.hdp-table tbody tr:last-child td { border-bottom: none; }
.hdp-table tbody tr:hover { background: color-mix(in srgb, var(--hdp-teal) 4%, transparent); }

.hdp-table .hdp-input,
.hdp-table .hdp-select { padding: 6px 8px; font-size: 13px; border-radius: 7px; }

.hdp-table .cell-name { min-width: 150px; }
.hdp-table .cell-num { min-width: 82px; }

.hdp-table .hdp-op { width: 52px; text-align: center; }

.hdp-table td.is-calc {
    font-family: var(--hdp-mono);
    font-weight: 600;
    white-space: nowrap;
    color: var(--hdp-ink-2);
}

.hdp-table td.is-self {
    font-family: var(--hdp-mono);
    font-weight: 700;
    white-space: nowrap;
    color: var(--hdp-coral);
}

.hdp-table td.is-hero {
    font-family: var(--hdp-mono);
    font-weight: 800;
    white-space: nowrap;
    color: var(--hdp-teal);
}

.hdp-table--sm { min-width: 520px; }
.hdp-table--sm td,
.hdp-table--sm th { font-size: 12.5px; padding: 8px 9px; }
.hdp-table--sm td.hdp-num { font-family: var(--hdp-mono); font-weight: 700; white-space: nowrap; }
.hdp-table tr.is-current { background: color-mix(in srgb, var(--hdp-teal) 7%, transparent); }
.hdp-table tr.is-current td:first-child { box-shadow: inset 3px 0 0 var(--hdp-teal); }

.hdp-del {
    width: 26px;
    height: 26px;
    border: 1px solid var(--hdp-line);
    border-radius: 7px;
    background: var(--hdp-surface);
    color: var(--hdp-ink-3);
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    transition: all .16s ease;
}

.hdp-del:hover {
    border-color: var(--hdp-coral);
    color: var(--hdp-coral);
    background: var(--hdp-coral-soft);
}

.hdp-item-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.hdp-item-sum { font-size: 12.5px; color: var(--hdp-ink-3); }
.hdp-item-sum b { font-family: var(--hdp-mono); color: var(--hdp-teal); }

.hdp-mini-btn {
    padding: 7px 13px;
    border: 1px dashed color-mix(in srgb, var(--hdp-teal) 45%, var(--hdp-line));
    border-radius: 9px;
    background: color-mix(in srgb, var(--hdp-teal) 5%, var(--hdp-surface));
    color: var(--hdp-teal);
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all .16s ease;
}

.hdp-mini-btn:hover { background: var(--hdp-teal-soft); }

/* 批量导入 */
.hdp-import {
    margin-top: 16px;
    padding: 13px 14px;
    border: 1px solid var(--hdp-line);
    border-radius: 11px;
    background: var(--hdp-surface-2);
}

.hdp-import-label {
    display: block;
    margin-bottom: 7px;
    font-size: 12px;
    font-weight: 700;
    color: var(--hdp-ink-2);
}

.hdp-import-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 9px;
}

.hdp-import-note { font-size: 11.5px; color: var(--hdp-ink-3); flex: 1 1 220px; }

.hdp-import-msg {
    margin-top: 9px;
    padding: 8px 11px;
    border-radius: 8px;
    background: var(--hdp-green-soft);
    color: var(--hdp-green);
    font-size: 12.5px;
}

.hdp-import-msg.is-bad { background: var(--hdp-coral-soft); color: var(--hdp-coral); }

/* ============================ 按钮 ============================ */
.hdp-btn {
    padding: 9px 16px;
    border: 1px solid var(--hdp-line);
    border-radius: 9px;
    background: var(--hdp-surface);
    color: var(--hdp-ink);
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, background .16s ease;
}

.hdp-btn:hover { transform: translateY(-1px); box-shadow: var(--hdp-shadow-sm); }

.hdp-btn--primary {
    border-color: transparent;
    background: linear-gradient(135deg, var(--hdp-teal), var(--hdp-teal-2));
    color: #fff;
}

.hdp-btn--ghost { background: transparent; color: var(--hdp-ink-2); }

.hdp-btn--ai {
    border-color: color-mix(in srgb, var(--hdp-blue) 45%, var(--hdp-line));
    background: var(--hdp-blue-soft);
    color: var(--hdp-blue);
}

.hdp-btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }

/* ============================ 结果 ============================ */
.hdp-panel--result { background: linear-gradient(180deg, color-mix(in srgb, var(--hdp-teal) 4%, var(--hdp-surface)), var(--hdp-surface)); }

.hdp-modes {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 6px;
    margin: 18px 0 0;
    border: 1px solid var(--hdp-line);
    border-radius: 11px;
    background: var(--hdp-surface-2);
}

.hdp-modes button {
    padding: 7px 14px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--hdp-ink-2);
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all .16s ease;
}

.hdp-modes button:hover { color: var(--hdp-teal); }

.hdp-modes button.on {
    border-color: color-mix(in srgb, var(--hdp-teal) 40%, var(--hdp-line));
    background: var(--hdp-surface);
    color: var(--hdp-teal);
    box-shadow: var(--hdp-shadow-sm);
}

.hdp-modes-hint {
    margin-left: auto;
    padding-right: 8px;
    font-size: 11.5px;
    color: var(--hdp-ink-3);
}

.hdp-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin: 18px 0 16px;
}

.hdp-kpi {
    min-width: 0;
    padding: 14px 15px;
    border: 1px solid var(--hdp-line);
    border-radius: 12px;
    background: var(--hdp-surface);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.hdp-kpi.is-main {
    border-color: color-mix(in srgb, var(--hdp-teal) 40%, var(--hdp-line));
    background: linear-gradient(160deg, var(--hdp-teal-soft), var(--hdp-surface));
}

.hdp-kpi.is-warn {
    border-color: color-mix(in srgb, var(--hdp-coral) 32%, var(--hdp-line));
    background: linear-gradient(160deg, var(--hdp-coral-soft), var(--hdp-surface));
}

.hdp-kpi-label { font-size: 11.5px; font-weight: 700; color: var(--hdp-ink-3); letter-spacing: .3px; }

.hdp-kpi-val {
    font-family: var(--hdp-mono);
    font-size: 25px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--hdp-ink);
    letter-spacing: -.6px;
    word-break: break-all;
}

.hdp-kpi.is-main .hdp-kpi-val { color: var(--hdp-teal); }
.hdp-kpi.is-warn .hdp-kpi-val { color: var(--hdp-coral); }
.hdp-kpi-unit { font-size: 11px; color: var(--hdp-ink-3); }

.hdp-facts { display: grid; gap: 9px; margin-bottom: 18px; }

.hdp-fact {
    position: relative;
    padding: 11px 14px 11px 34px;
    border: 1px solid var(--hdp-line);
    border-radius: 10px;
    background: var(--hdp-surface);
    font-size: 13px;
    line-height: 1.85;
    color: var(--hdp-ink-2);
}

.hdp-fact::before {
    content: "";
    position: absolute;
    left: 14px;
    top: 17px;
    width: 7px;
    height: 7px;
    border-radius: 2px;
    background: var(--hdp-teal);
}

.hdp-fact b { color: var(--hdp-ink); font-family: var(--hdp-mono); font-size: 13.5px; }

.hdp-fact.is-warn { border-color: color-mix(in srgb, var(--hdp-coral) 32%, var(--hdp-line)); background: var(--hdp-coral-soft); }
.hdp-fact.is-warn::before { background: var(--hdp-coral); }
.hdp-fact.is-warn b { color: var(--hdp-coral); }

.hdp-fact.is-ok { border-color: color-mix(in srgb, var(--hdp-green) 32%, var(--hdp-line)); background: var(--hdp-green-soft); }
.hdp-fact.is-ok::before { background: var(--hdp-green); }
.hdp-fact.is-ok b { color: var(--hdp-green); }

.hdp-fact.is-tip { background: var(--hdp-surface-2); }
.hdp-fact.is-tip::before { background: var(--hdp-ink-3); }

.hdp-split {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.hdp-sub { min-width: 0; }

.hdp-sub h3 {
    font-size: 13.5px;
    font-weight: 800;
    color: var(--hdp-ink);
    margin-bottom: 9px;
    padding-left: 9px;
    border-left: 3px solid var(--hdp-teal);
    line-height: 1.4;
}

.hdp-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    padding-top: 16px;
    border-top: 1px solid var(--hdp-line-2);
}

/* AI 区块 */
.hdp-ai {
    margin-top: 16px;
    padding: 16px 18px;
    border: 1px solid color-mix(in srgb, var(--hdp-blue) 26%, var(--hdp-line));
    border-radius: 12px;
    background: color-mix(in srgb, var(--hdp-blue) 4%, var(--hdp-surface));
}

.hdp-ai-head h3 { font-size: 14.5px; font-weight: 800; color: var(--hdp-blue); margin-bottom: 5px; }
.hdp-ai-head p { font-size: 12.5px; color: var(--hdp-ink-2); margin-bottom: 12px; line-height: 1.8; }

.hdp-pre {
    margin: 0;
    padding: 14px 16px;
    max-height: 300px;
    overflow: auto;
    border: 1px solid var(--hdp-line);
    border-radius: 10px;
    background: var(--hdp-surface-2);
    color: var(--hdp-ink-2);
    font-family: var(--hdp-mono);
    font-size: 12px;
    line-height: 1.75;
    white-space: pre-wrap;
    word-break: break-word;
}

.hdp-pre--ai {
    margin-top: 12px;
    max-height: 420px;
    font-family: var(--hdp-sans);
    font-size: 13px;
    line-height: 1.9;
    color: var(--hdp-ink);
    background: var(--hdp-surface);
}

/* ============================ 介绍 / FAQ / 相关 ============================ */
.hdp-intro,
.hdp-faq-sec,
.hdp-related,
.hdp-comments {
    margin-bottom: 16px;
    padding: 24px 26px;
    border: 1px solid var(--hdp-line);
    border-radius: var(--hdp-radius);
    background: var(--hdp-surface);
}

.hdp-intro h2,
.hdp-faq-sec h2,
.hdp-related h2 {
    font-size: 19px;
    font-weight: 800;
    color: var(--hdp-ink);
    margin-bottom: 12px;
}

.hdp-intro h3 {
    font-size: 15px;
    font-weight: 800;
    color: var(--hdp-teal);
    margin: 18px 0 7px;
    padding-left: 10px;
    border-left: 3px solid var(--hdp-teal);
}

.hdp-intro p {
    font-size: 14.5px;
    line-height: 2;
    color: var(--hdp-ink-2);
    margin-bottom: 9px;
}

.hdp-intro b { color: var(--hdp-ink); font-weight: 700; }

.hdp-faq { display: grid; gap: 9px; }

.hdp-faq-item {
    border: 1px solid var(--hdp-line);
    border-radius: 10px;
    background: var(--hdp-surface-2);
    overflow: hidden;
    transition: border-color .16s ease;
}

.hdp-faq-item[open] { border-color: color-mix(in srgb, var(--hdp-teal) 35%, var(--hdp-line)); }

.hdp-faq-item summary {
    padding: 12px 15px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    color: var(--hdp-ink);
    list-style: none;
    display: flex;
    align-items: center;
    gap: 9px;
}

.hdp-faq-item summary::-webkit-details-marker { display: none; }

.hdp-faq-item summary::before {
    content: "?";
    flex: 0 0 auto;
    width: 19px;
    height: 19px;
    border-radius: 50%;
    background: var(--hdp-teal-soft);
    color: var(--hdp-teal);
    font-size: 11px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.hdp-faq-a {
    padding: 0 15px 14px 43px;
    font-size: 13.5px;
    line-height: 1.95;
    color: var(--hdp-ink-2);
}

.hdp-faq-a b { color: var(--hdp-teal); }

.hdp-related .hdp-rel-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.hdp-rel-grid a {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 13px 15px;
    border: 1px solid var(--hdp-line);
    border-radius: 10px;
    background: var(--hdp-surface-2);
    color: var(--hdp-ink);
    font-size: 14px;
    font-weight: 700;
    transition: all .16s ease;
}

.hdp-rel-grid a span { font-size: 12px; font-weight: 500; color: var(--hdp-ink-3); }

.hdp-rel-grid a:hover {
    border-color: var(--hdp-teal);
    background: var(--hdp-teal-soft);
    transform: translateY(-2px);
}

.hdp-comments { padding: 20px 22px; }

/* ============================ 打印稿 ============================ */
.hdp-sheet {
    display: none;
    color: #111;
    font-family: var(--hdp-sans);
    font-size: 12px;
    line-height: 1.7;
}

.hdp-sheet h1 { font-size: 19px; text-align: center; margin-bottom: 4px; }
.hdp-sheet-meta { text-align: center; font-size: 11px; color: #555; margin-bottom: 12px; }
.hdp-sheet table { width: 100%; border-collapse: collapse; margin-bottom: 10px; }
.hdp-sheet th,
.hdp-sheet td { border: 1px solid #999; padding: 5px 7px; font-size: 11px; text-align: left; }
.hdp-sheet th { background: #f0f0f0; font-weight: 700; }
.hdp-sheet-note { font-size: 11px; color: #333; line-height: 1.8; margin-bottom: 6px; }
.hdp-sheet-total { margin-top: 8px; font-size: 12.5px; font-weight: 700; }

/* ============================ Toast ============================ */
.hdp-toast {
    position: fixed;
    left: 50%;
    bottom: 34px;
    transform: translate(-50%, 20px);
    padding: 10px 20px;
    border-radius: 999px;
    background: rgba(20, 42, 46, .94);
    color: #fff;
    font-size: 13px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .22s ease, transform .22s ease;
    z-index: 9999;
    max-width: 86vw;
    text-align: center;
}

.hdp-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ============================ 响应式 ============================ */
@media (max-width: 1080px) {
    .hdp-hero { grid-template-columns: minmax(0, 1fr); }
    .hdp-slip { max-width: 460px; }
    .hdp-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hdp-split { grid-template-columns: minmax(0, 1fr); }
    .hdp-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
    .hdp-page { padding: 0; }
    .hdp-page h1 { font-size: 27px; }
    .hdp-hero-main { padding: 22px 20px; }
    .hdp-panel { padding: 18px 16px 20px; }
    .hdp-intro, .hdp-faq-sec, .hdp-related, .hdp-comments { padding: 20px 18px; }
    .hdp-quick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hdp-quick-go { grid-column: 1 / -1; width: 100%; }
    .hdp-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hdp-related .hdp-rel-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 560px) {
    .hdp-page h1 { font-size: 23px; }
    .hdp-lead { font-size: 14px; }
    .hdp-grid--4,
    .hdp-grid--3 { grid-template-columns: minmax(0, 1fr); }
    .hdp-field--wide { grid-column: span 1; }
    .hdp-kpis { grid-template-columns: minmax(0, 1fr); }
    .hdp-slip-num { font-size: 34px; }
    .hdp-kpi-val { font-size: 22px; }
    .hdp-panel-head { gap: 10px; }
    .hdp-step { width: 28px; height: 28px; font-size: 12px; }
    .hdp-panel h2 { font-size: 17px; }
    .hdp-actions .hdp-btn { flex: 1 1 46%; }
    .hdp-faq-a { padding-left: 15px; }
}

/* ============================ 打印 ============================ */
@media print {
    .nav-header,
    .footer,
    .back-to-top,
    #evadeFab,
    .evade-fab,
    #navEvadeBtn,
    .nav-evade-btn,
    #navMask,
    .nav-mask,
    .ma-page-modal,
    #clicaptcha-container,
    .detail-breadcrumb,
    .hdp-toast,
    .hdp-hero,
    .hdp-errbar,
    .hdp-presets,
    .hdp-panel,
    .hdp-intro,
    .hdp-faq-sec,
    .hdp-related,
    .hdp-comments,
    .cm-wrap {
        display: none !important;
    }

    .detail-wrap { padding: 0 !important; }
    .container { max-width: none !important; padding: 0 !important; }
    .hdp-page { margin: 0 !important; padding: 0 !important; display: block !important; }
    .hdp-sheet { display: block !important; }
    .hdp-sheet table { page-break-inside: auto; }
    .hdp-sheet tr { page-break-inside: avoid; }
}
