/* ============================================================
   cost-engineer-plan · 造价工程师备考规划
   尺规工程量清单风（ce-）：黄铜 + 工程制图米白 + 图纸网格底纹，
   三角板 clip-path / 圆规 border 弧线装饰，清单表格双线表头+编号列+合计行
   与蓝图(95) / 钢灰(96) / 消防红(97) 区分：暖黄铜 + 图纸米白
   ============================================================ */
.ce-page {
    --ce-bg: #f6f2e4;
    --ce-panel: #fffdf4;
    --ce-panel-2: #efe8d2;
    --ce-ink: #2b2717;
    --ce-sub: #7a7358;
    --ce-line: #ddd3b6;
    --ce-line-strong: #c3b78c;
    --ce-accent: #b08d3e;
    --ce-accent-deep: #7d611f;
    --ce-accent-soft: rgba(176, 141, 62, 0.14);
    --ce-accent2: #5b4a2a;
    --ce-ok: #4e7a44;
    --ce-ok-soft: rgba(78, 122, 68, 0.14);
    --ce-warn: #a35a2a;
    --ce-warn-soft: rgba(163, 90, 42, 0.13);
    --ce-grid: rgba(176, 141, 62, 0.08);
    --ce-shadow: 0 6px 20px rgba(91, 74, 42, 0.12);

    color: var(--ce-ink);
    font-size: 15px;
    line-height: 1.8;
}

[data-theme="dark"] .ce-page {
    --ce-bg: #211d12;
    --ce-panel: #2a2517;
    --ce-panel-2: #332d1c;
    --ce-ink: #ece5cd;
    --ce-sub: #a89f81;
    --ce-line: #4a4329;
    --ce-line-strong: #635a3a;
    --ce-accent: #d3ad55;
    --ce-accent-deep: #e6c47a;
    --ce-accent-soft: rgba(211, 173, 85, 0.16);
    --ce-accent2: #cbb98f;
    --ce-ok: #86b578;
    --ce-ok-soft: rgba(134, 181, 120, 0.16);
    --ce-warn: #d99260;
    --ce-warn-soft: rgba(217, 146, 96, 0.16);
    --ce-grid: rgba(211, 173, 85, 0.07);
    --ce-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
}

.ce-page h1, .ce-page h2, .ce-page h3 { line-height: 1.4; }
.ce-page b, .ce-page strong { color: var(--ce-accent-deep); }

/* ---------- 首屏 ---------- */
.ce-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(170px, 0.6fr) minmax(240px, 0.85fr);
    gap: 22px 26px;
    align-items: center;
    padding: 30px 32px 26px;
    margin-bottom: 24px;
    border-radius: 16px;
    border: 1px solid var(--ce-line-strong);
    background:
        radial-gradient(circle at 92% 8%, var(--ce-accent-soft) 0, transparent 38%),
        linear-gradient(180deg, var(--ce-bg) 0%, var(--ce-panel) 100%);
    box-shadow: var(--ce-shadow);
    overflow: hidden;
}
/* 工程制图米白网格底纹 */
.ce-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(0deg, var(--ce-grid) 0 1px, transparent 1px 26px),
        repeating-linear-gradient(90deg, var(--ce-grid) 0 1px, transparent 1px 26px);
    pointer-events: none;
}
/* 图框四角（制图角标） */
.ce-hero::after {
    content: "";
    position: absolute;
    inset: 10px;
    border: 1.5px solid var(--ce-line-strong);
    border-radius: 10px;
    opacity: 0.45;
    pointer-events: none;
}
.ce-hero > * { position: relative; z-index: 1; }

.ce-kicker {
    display: inline-block;
    padding: 5px 14px;
    margin-bottom: 12px;
    border-radius: 4px;
    background: var(--ce-accent);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.18em;
}
[data-theme="dark"] .ce-kicker { color: #211d12; }
.ce-hero h1 { margin: 0 0 10px; font-size: clamp(25px, 3.2vw, 36px); font-weight: 900; }
.ce-hero-sub { margin: 0 0 14px; max-width: 56ch; color: var(--ce-sub); font-size: 15px; }
.ce-hero-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.ce-hero-chips li {
    padding: 5px 13px;
    border-radius: 999px;
    border: 1px solid var(--ce-line-strong);
    background: var(--ce-panel);
    color: var(--ce-sub);
    font-size: 12px;
    font-weight: 700;
}

/* hero 装饰：三角板 + 圆规 */
.ce-hero-deco {
    position: relative;
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 12px;
    min-height: 170px;
}
.ce-triangle {
    position: relative;
    width: 148px;
    height: 128px;
    clip-path: polygon(0 0, 0 100%, 100% 100%);
    background: linear-gradient(160deg, var(--ce-accent) 0%, var(--ce-accent-deep) 100%);
    filter: drop-shadow(0 8px 14px rgba(91, 74, 42, 0.3));
}
.ce-triangle-cut {
    position: absolute;
    left: 14px;
    bottom: 14px;
    width: 82px;
    height: 72px;
    clip-path: polygon(0 0, 0 100%, 100% 100%);
    background: var(--ce-bg);
}
.ce-triangle-tick {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 10px;
    background:
        repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.85) 0 1.5px, transparent 1.5px 12px);
    opacity: 0.75;
}
.ce-compass {
    position: absolute;
    right: 6px;
    top: 4px;
    width: 118px;
    height: 118px;
}
.ce-compass::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid var(--ce-accent2);
    border-bottom-color: transparent;
    border-left-color: transparent;
    transform: rotate(-38deg);
    opacity: 0.85;
}
.ce-compass-leg {
    position: absolute;
    top: 6px;
    left: 50%;
    width: 3px;
    height: 74px;
    border-radius: 2px;
    background: var(--ce-accent2);
    transform-origin: top center;
}
.ce-leg-a { transform: translateX(-50%) rotate(26deg); }
.ce-leg-b { transform: translateX(-50%) rotate(-26deg); }
.ce-leg-b::after {
    content: "";
    position: absolute;
    bottom: -5px;
    left: -1px;
    width: 5px;
    height: 9px;
    border-radius: 1px;
    background: var(--ce-accent);
}
.ce-compass-pivot {
    position: absolute;
    top: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--ce-accent);
    box-shadow: 0 0 0 3px var(--ce-panel);
}
.ce-deco-tag {
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%) rotate(-4deg);
    padding: 3px 10px;
    border-radius: 4px;
    border: 2px solid var(--ce-accent);
    background: var(--ce-panel);
    color: var(--ce-accent-deep);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.12em;
    white-space: nowrap;
}

/* hero 读数 */
.ce-hero-readout, .ce-result-hero {
    padding: 18px 20px;
    border-radius: 12px;
    border: 1px solid var(--ce-line-strong);
    background: var(--ce-panel);
    display: grid;
    gap: 4px;
    justify-items: start;
    box-shadow: var(--ce-shadow);
}
.ce-hero-readout { position: relative; z-index: 1; }
.ce-readout-label, .ce-rh-label {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.18em;
    color: var(--ce-sub);
}
.ce-readout-num, .ce-rh-num {
    font-size: 23px;
    font-weight: 900;
    color: var(--ce-accent-deep);
    font-variant-numeric: tabular-nums;
    line-height: 1.3;
}
.ce-readout-meta, .ce-rh-sub { font-size: 13px; font-weight: 700; color: var(--ce-accent2); }
.ce-readout-tip, .ce-rh-tip { margin-top: 4px; font-size: 12px; color: var(--ce-sub); opacity: 0.9; }

/* ---------- 测算两栏 ---------- */
.ce-calc {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(290px, 1fr);
    gap: 20px;
    align-items: start;
    margin-bottom: 28px;
}
.ce-input-col { display: grid; gap: 16px; min-width: 0; }

.ce-panel {
    padding: 20px 22px;
    border: 1px solid var(--ce-line);
    border-radius: 14px;
    background: var(--ce-panel);
    box-shadow: var(--ce-shadow);
}
.ce-panel--flat { box-shadow: none; }
.ce-panel-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.ce-panel-head h2 { margin: 0; font-size: 18px; font-weight: 800; }
.ce-panel-head p { margin: 2px 0 0; font-size: 13px; color: var(--ce-sub); }
.ce-step {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: var(--ce-accent);
    color: #fff;
    font-size: 15px;
    font-weight: 900;
}
[data-theme="dark"] .ce-step { color: #211d12; }

/* 级别切换 */
.ce-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border: 1.5px solid var(--ce-line-strong);
    border-radius: 10px;
    overflow: hidden;
    height: 44px;
    margin-bottom: 14px;
}
.ce-toggle-btn {
    border: none;
    background: var(--ce-panel-2);
    color: var(--ce-sub);
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.14s;
}
.ce-toggle-btn + .ce-toggle-btn { border-left: 1.5px solid var(--ce-line-strong); }
.ce-toggle-btn.is-active {
    background: var(--ce-accent);
    color: #fff;
}
[data-theme="dark"] .ce-toggle-btn.is-active { color: #211d12; }

/* 字段 */
.ce-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ce-field { display: grid; gap: 6px; }
.ce-field--year { margin-top: 12px; }
.ce-label { font-size: 13px; font-weight: 700; }
.ce-select-wrap { position: relative; display: block; }
.ce-select-wrap::after {
    content: "▾";
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ce-sub);
    pointer-events: none;
    font-size: 12px;
}
.ce-input {
    width: 100%;
    height: 44px;
    padding: 0 30px 0 12px;
    border: 1.5px solid var(--ce-line-strong);
    border-radius: 10px;
    background: var(--ce-panel-2);
    color: var(--ce-ink);
    font-size: 14px;
    font-weight: 700;
    outline: none;
    appearance: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
}
.ce-input:focus { border-color: var(--ce-accent); box-shadow: 0 0 0 3px var(--ce-accent-soft); }
.ce-hint { margin: 12px 0 0; font-size: 12.5px; color: var(--ce-sub); }

/* 免考提示 */
.ce-exempt {
    margin-top: 12px;
    padding: 11px 14px;
    border-radius: 10px;
    border: 1px dashed var(--ce-line-strong);
    background: var(--ce-accent-soft);
}
.ce-exempt b { display: block; font-size: 13.5px; margin-bottom: 2px; }
.ce-exempt p { margin: 0; font-size: 12.5px; color: var(--ce-sub); }

/* 错误盒 / 按钮 */
.ce-error {
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid rgba(163, 90, 42, 0.45);
    background: var(--ce-warn-soft);
    color: var(--ce-warn);
    font-size: 13px;
}
.ce-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.ce-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 44px;
    padding: 0 20px;
    border: 1.5px solid var(--ce-line-strong);
    border-radius: 10px;
    background: var(--ce-panel-2);
    color: var(--ce-ink);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.12s, box-shadow 0.12s;
}
.ce-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(91, 74, 42, 0.18); }
.ce-btn--primary {
    border-color: var(--ce-accent-deep);
    background: linear-gradient(170deg, var(--ce-accent) 0%, var(--ce-accent-deep) 100%);
    color: #fff;
}
[data-theme="dark"] .ce-btn--primary { color: #211d12; }

/* 结果列 */
.ce-result-col { display: grid; gap: 14px; position: sticky; top: 16px; }
.ce-result-hero.is-ok .ce-rh-num { color: var(--ce-ok); }
.ce-result-hero.is-warn .ce-rh-num { color: var(--ce-warn); }
.ce-rh-tip { color: var(--ce-warn); opacity: 1; }

.ce-kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.ce-kpi {
    padding: 12px 14px;
    border: 1px solid var(--ce-line);
    border-radius: 12px;
    background: var(--ce-panel);
    display: grid;
    gap: 2px;
}
.ce-kpi span { font-size: 12px; color: var(--ce-sub); font-weight: 700; }
.ce-kpi b { font-size: 18px; font-weight: 900; color: var(--ce-ink); line-height: 1.25; font-variant-numeric: tabular-nums; }
.ce-kpi small { font-size: 11px; color: var(--ce-sub); }

.ce-mini-card {
    padding: 16px 18px;
    border: 1px solid var(--ce-line);
    border-radius: 12px;
    background: var(--ce-panel);
}
.ce-mini-card h3 { margin: 0 0 10px; font-size: 15px; font-weight: 800; color: var(--ce-accent-deep); }

/* 工程量清单表：双线表头 + 编号列 + 合计行 */
.ce-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.ce-table th {
    padding: 8px 10px;
    text-align: left;
    font-size: 12px;
    font-weight: 800;
    color: var(--ce-accent2);
    letter-spacing: 0.06em;
    white-space: nowrap;
    border-top: 3px double var(--ce-line-strong);
    border-bottom: 1.5px solid var(--ce-line-strong);
    background: var(--ce-panel-2);
}
.ce-table td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px dashed var(--ce-line);
    font-variant-numeric: tabular-nums;
    vertical-align: top;
}
.ce-no { width: 44px; font-weight: 900; color: var(--ce-accent-deep); }
.ce-table tr.ce-total td {
    border-top: 3px double var(--ce-line-strong);
    border-bottom: none;
    font-weight: 900;
    color: var(--ce-accent-deep);
    background: var(--ce-accent-soft);
}
.ce-table--wide th, .ce-table--wide td { padding: 10px 12px; }
.ce-table-note { margin: 10px 0 0; font-size: 12px; color: var(--ce-sub); }

/* ---------- 通用 section ---------- */
.ce-section { margin-bottom: 28px; }
.ce-sec-head { margin-bottom: 14px; }
.ce-sec-head h2 { margin: 0 0 4px; font-size: 21px; font-weight: 900; }
.ce-sec-head p { margin: 0; font-size: 13.5px; color: var(--ce-sub); }

/* 案例要点卡 */
.ce-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.ce-card {
    position: relative;
    padding: 18px 16px 15px;
    border: 1px solid var(--ce-line);
    border-radius: 14px;
    background: var(--ce-panel);
    box-shadow: var(--ce-shadow);
    overflow: hidden;
}
.ce-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: repeating-linear-gradient(90deg, var(--ce-accent) 0 12px, var(--ce-accent2) 12px 24px);
    opacity: 0.65;
}
.ce-card-no {
    position: absolute;
    top: 12px;
    right: 14px;
    font-size: 24px;
    font-weight: 900;
    color: var(--ce-line-strong);
    opacity: 0.6;
    font-variant-numeric: tabular-nums;
}
.ce-card h3 { margin: 0 0 6px; font-size: 15px; font-weight: 800; padding-right: 40px; }
.ce-card p { margin: 0; font-size: 12.5px; color: var(--ce-sub); line-height: 1.7; }

/* 风险横幅 */
.ce-risk {
    margin-top: 14px;
    padding: 14px 18px;
    border-radius: 12px;
    border: 1.5px solid var(--ce-warn);
    background: var(--ce-warn-soft);
}
.ce-risk b { display: block; font-size: 14.5px; color: var(--ce-warn); margin-bottom: 3px; }
.ce-risk p { margin: 0; font-size: 13px; color: var(--ce-sub); }

/* 薪资卡 */
.ce-salary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.ce-salary {
    padding: 16px 16px 14px;
    border: 1px solid var(--ce-line);
    border-radius: 14px;
    background: var(--ce-panel);
    box-shadow: var(--ce-shadow);
    display: grid;
    gap: 6px;
    align-content: start;
}
.ce-salary-ico { font-size: 26px; line-height: 1; }
.ce-salary h3 { margin: 0; font-size: 15px; font-weight: 800; }
.ce-salary strong { font-size: 21px; font-weight: 900; color: var(--ce-accent-deep); font-variant-numeric: tabular-nums; }
.ce-salary p { margin: 0; font-size: 12.5px; color: var(--ce-sub); line-height: 1.7; }

/* 注册执业 */
.ce-reg-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.ce-reg-list li {
    font-size: 13px;
    color: var(--ce-sub);
    padding: 9px 12px;
    border: 1px solid var(--ce-line);
    border-radius: 10px;
    background: var(--ce-panel-2);
}
.ce-reg-list li b { color: var(--ce-ink); }
.ce-reg-list li.is-warn {
    border-color: var(--ce-warn);
    background: var(--ce-warn-soft);
}
.ce-reg-list li.is-warn b { color: var(--ce-warn); }

/* 考试节奏 */
.ce-rhythm { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.ce-rhythm-card {
    padding: 16px 16px 14px;
    border: 1px solid var(--ce-line);
    border-radius: 14px;
    background: var(--ce-panel);
    box-shadow: var(--ce-shadow);
}
.ce-rhythm-tag {
    display: inline-block;
    padding: 3px 12px;
    margin-bottom: 8px;
    border-radius: 4px;
    background: var(--ce-accent);
    color: #fff;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.1em;
}
[data-theme="dark"] .ce-rhythm-tag { color: #211d12; }
.ce-rhythm-tag--2 { background: var(--ce-accent2); }
.ce-rhythm-tag--3 { background: var(--ce-ok); }
.ce-rhythm-card h3 { margin: 0 0 6px; font-size: 15.5px; font-weight: 800; }
.ce-rhythm-card p { margin: 0; font-size: 12.5px; color: var(--ce-sub); line-height: 1.7; }

/* FAQ */
.ce-faq { display: grid; gap: 10px; }
.ce-faq .faq-item {
    border: 1px solid var(--ce-line);
    border-radius: 12px;
    background: var(--ce-panel);
    overflow: hidden;
}
.ce-faq .faq-item summary {
    padding: 13px 16px;
    font-size: 14.5px;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
    position: relative;
}
.ce-faq .faq-item summary::-webkit-details-marker { display: none; }
.ce-faq .faq-item summary::after {
    content: "+";
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ce-accent);
    font-weight: 900;
    font-size: 16px;
}
.ce-faq .faq-item[open] summary::after { content: "−"; }
.ce-faq .faq-a { padding: 0 16px 13px; font-size: 13.5px; color: var(--ce-sub); }

/* 留言 */
.ce-comments { margin-bottom: 30px; }

/* 返回顶部 */
.ce-top {
    position: fixed;
    right: 22px;
    bottom: 26px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1.5px solid var(--ce-line-strong);
    background: var(--ce-panel);
    color: var(--ce-accent-deep);
    font-size: 18px;
    font-weight: 900;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: all 0.25s;
    box-shadow: var(--ce-shadow);
    z-index: 50;
}
.ce-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.ce-top:hover { background: var(--ce-accent); color: #fff; }

/* toast */
.ce-toast {
    position: fixed;
    left: 50%;
    bottom: 90px;
    transform: translateX(-50%) translateY(10px);
    padding: 10px 20px;
    border-radius: 999px;
    background: var(--ce-accent-deep);
    color: #fff;
    font-size: 13.5px;
    font-weight: 700;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s;
    z-index: 60;
}
.ce-toast.show { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }

/* ---------- 响应式 ---------- */
@media (max-width: 1080px) {
    .ce-hero { grid-template-columns: minmax(0, 1.5fr) minmax(230px, 0.8fr); }
    .ce-hero-deco { display: none; }
    .ce-calc { grid-template-columns: 1fr; }
    .ce-result-col { position: static; }
    .ce-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ce-salary-grid, .ce-rhythm { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
    .ce-hero { grid-template-columns: 1fr; padding: 24px 20px 20px; }
    .ce-panel { padding: 16px 16px; }
    .ce-grid2, .ce-kpis, .ce-cards, .ce-salary-grid, .ce-rhythm { grid-template-columns: 1fr; }
    .ce-actions { display: grid; grid-template-columns: 1fr; }
    .ce-actions .ce-btn { width: 100%; }
    .ce-sec-head h2 { font-size: 18px; }
    .ce-table--wide { font-size: 12.5px; }
    .ce-table--wide th, .ce-table--wide td { padding: 8px 8px; }
    .ce-top { right: 14px; bottom: 18px; }
}
