/* ======================================================================
 * H3 · 房屋交付与装修节点（21–30）共享设计系统
 * ----------------------------------------------------------------------
 * 与旧工具站蓝色系彻底区隔：暖纸底 + 墨绿/陶土主色 + 编辑式字体层级。
 * 只提供骨架与基础件；10 个工具各自的 CSS 定义专属布局、组件与副色。
 * 深浅主题跟随站点导航的 #themeToggle（localStorage.theme），
 * 由 :root[data-theme="dark"] 覆盖，本文件不新增任何主题按钮。
 * ====================================================================== */

.h3 {
    /* 新中性色板 */
    --h3-bg: #f5f2ea;
    --h3-bg-2: #ece6da;
    --h3-card: #fffdf8;
    --h3-card-2: #f3efe5;
    --h3-ink: #1e2621;
    --h3-sub: #58645a;
    --h3-faint: #8b948a;
    --h3-line: #ded7c7;
    --h3-line-2: #eae4d7;
    --h3-accent: #2f6b52;
    --h3-accent-2: #b5653a;
    --h3-ok: #2d7a55;
    --h3-warn: #a9741a;
    --h3-bad: #b04338;
    --h3-ok-soft: #e4f1e8;
    --h3-warn-soft: #f8eed8;
    --h3-bad-soft: #f9e5e1;
    --h3-shadow: 0 2px 8px rgba(38, 44, 34, .05), 0 16px 44px rgba(38, 44, 34, .07);
    --h3-shadow-sm: 0 1px 3px rgba(38, 44, 34, .06), 0 6px 18px rgba(38, 44, 34, .05);
    --h3-r: 14px;
    --h3-r-sm: 9px;
    --h3-font: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
    --h3-num: "Bahnschrift", "Segoe UI Variable Text", ui-monospace, SFMono-Regular, Consolas, monospace;
    --h3-display: Georgia, "Times New Roman", "Songti SC", serif;

    /* 公共面包屑 partials/tool-station/crumb.blade.php 依赖的变量，在此统一注入 */
    --tsk-card: #fffdf8;
    --tsk-card-2: #f3efe5;
    --tsk-ink: #1e2621;
    --tsk-sub: #58645a;
    --tsk-faint: #8b948a;
    --tsk-line: #ded7c7;
    --tsk-brand-ink: var(--h3-accent);
    --tsk-brand: var(--h3-accent);
    --tsk-font: var(--h3-font);
    --tsk-r: var(--h3-r);
    --tsk-r-sm: var(--h3-r-sm);
    --tsk-r-pill: 999px;
    --tsk-shadow-sm: var(--h3-shadow-sm);

    display: block;
    min-height: 60vh;
    background: var(--h3-bg);
    color: var(--h3-ink);
    font-family: var(--h3-font);
    font-size: 15px;
    line-height: 1.9;
    -webkit-font-smoothing: antialiased;
    overflow-x: clip;
}

:root[data-theme="dark"] .h3 {
    --h3-bg: #0f1412;
    --h3-bg-2: #151c18;
    --h3-card: #18211d;
    --h3-card-2: #1e2923;
    --h3-ink: #e8f0e9;
    --h3-sub: #a9b8ac;
    --h3-faint: #7e8f83;
    --h3-line: #2c3931;
    --h3-line-2: #243029;
    --h3-accent: var(--h3-accent-d, #8cc6a5);
    --h3-accent-2: var(--h3-accent-2-d, #e0a278);
    --h3-ok: #74c69a;
    --h3-warn: #e0b263;
    --h3-bad: #e88d81;
    --h3-ok-soft: rgba(116, 198, 154, .14);
    --h3-warn-soft: rgba(224, 178, 99, .15);
    --h3-bad-soft: rgba(232, 141, 129, .15);
    --h3-shadow: 0 2px 10px rgba(0, 0, 0, .38), 0 18px 48px rgba(0, 0, 0, .34);
    --h3-shadow-sm: 0 1px 4px rgba(0, 0, 0, .34);
    --tsk-card: #18211d;
    --tsk-card-2: #1e2923;
    --tsk-ink: #e8f0e9;
    --tsk-sub: #a9b8ac;
    --tsk-faint: #7e8f83;
    --tsk-line: #2c3931;
}

.h3 *, .h3 *::before, .h3 *::after { box-sizing: border-box; }
.h3 a { color: var(--h3-accent); text-decoration: none; }
.h3 a:hover { text-decoration: underline; }
.h3 [hidden] { display: none !important; }
.h3 ::selection { background: color-mix(in srgb, var(--h3-accent) 28%, transparent); }

/* ---------- 容器与网格 ---------- */
.h3-wrap { max-width: 1180px; margin: 0 auto; padding: 0 26px 64px; }
.h3-grid { display: grid; gap: 20px; }
.h3-grid--2 { grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); }
.h3-grid--half { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.h3-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* ---------- 字体层级（新：编辑式大标题 + 宽松正文） ---------- */
.h3-kicker {
    display: inline-flex; align-items: center; gap: 8px;
    font-family: var(--h3-num);
    font-size: 11.5px; font-weight: 700; letter-spacing: .18em;
    text-transform: uppercase; color: var(--h3-accent);
    margin: 0 0 14px;
}
.h3-kicker::before {
    content: ""; width: 22px; height: 2px;
    background: var(--h3-accent); border-radius: 2px;
}
.h3-title {
    margin: 0;
    font-size: clamp(30px, 4.2vw, 46px);
    line-height: 1.2; letter-spacing: -.025em; font-weight: 800;
    color: var(--h3-ink);
}
.h3-title em { font-style: normal; color: var(--h3-accent); }
.h3-lead {
    margin: 14px 0 0; max-width: 68ch;
    font-size: 16px; line-height: 1.9; color: var(--h3-sub);
}
.h3-lead strong, .h3-prose strong { color: var(--h3-ink); font-weight: 700; }
.h3-meta {
    display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 0; padding: 0; list-style: none;
}
.h3-meta li {
    font-size: 12.5px; line-height: 1.5; padding: 5px 12px;
    border: 1px solid var(--h3-line); border-radius: 999px;
    background: var(--h3-card); color: var(--h3-sub);
}
.h3-sec-title {
    margin: 46px 0 18px; font-size: 21px; line-height: 1.4;
    font-weight: 750; letter-spacing: -.01em; color: var(--h3-ink);
}
.h3-sec-title span {
    font-family: var(--h3-num); font-size: 12px; letter-spacing: .16em;
    color: var(--h3-faint); margin-right: 12px; font-weight: 600;
}

/* ---------- 卡片 / 面板 ---------- */
.h3-card {
    background: var(--h3-card); border: 1px solid var(--h3-line);
    border-radius: var(--h3-r); box-shadow: var(--h3-shadow);
    padding: 24px;
}
.h3-card--flat { box-shadow: var(--h3-shadow-sm); }
.h3-card-h {
    margin: 0 0 18px; font-size: 17px; line-height: 1.5;
    font-weight: 750; color: var(--h3-ink);
    display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
}
.h3-card-h small { font-size: 12.5px; font-weight: 500; color: var(--h3-faint); }
.h3-card-h .h3-idx {
    font-family: var(--h3-num); font-size: 12px; letter-spacing: .1em;
    color: var(--h3-accent); font-weight: 700;
}

/* ---------- 表单 ---------- */
.h3-fields { display: grid; gap: 15px; }
.h3-fields--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.h3-fields--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.h3-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.h3-label {
    font-size: 13px; font-weight: 700; color: var(--h3-ink); line-height: 1.5;
}
.h3-label i {
    font-style: normal; font-weight: 500; font-size: 11.5px; color: var(--h3-faint); margin-left: 6px;
}
.h3-label .h3-req { color: var(--h3-bad); margin-left: 3px; }
.h3-input, .h3-select, .h3-textarea {
    width: 100%; min-width: 0; padding: 10px 12px;
    border: 1px solid var(--h3-line); border-radius: var(--h3-r-sm);
    background: var(--h3-card-2); color: var(--h3-ink);
    font-family: var(--h3-font); font-size: 14.5px; line-height: 1.6;
    outline: none; transition: border-color .16s, box-shadow .16s;
}
:root[data-theme="dark"] .h3 .h3-input,
:root[data-theme="dark"] .h3 .h3-select,
:root[data-theme="dark"] .h3 .h3-textarea { background: #131b17; }
.h3-input:focus, .h3-select:focus, .h3-textarea:focus {
    border-color: var(--h3-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--h3-accent) 16%, transparent);
}
.h3-textarea { resize: vertical; min-height: 120px; }
.h3-select { cursor: pointer; }
.h3-hint { margin: 0; font-size: 12px; line-height: 1.65; color: var(--h3-faint); }
.h3-err { margin: 0; min-height: 0; font-size: 12.5px; line-height: 1.6; color: var(--h3-bad); }
.h3-err:empty { display: none; }
.h3-check { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--h3-sub); cursor: pointer; }
.h3-check input { accent-color: var(--h3-accent); width: 16px; height: 16px; }

/* ---------- 按钮 ---------- */
.h3-btns { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.h3-btn {
    appearance: none; border: 1px solid var(--h3-accent);
    background: var(--h3-accent); color: #fff;
    font-family: var(--h3-font); font-size: 14px; font-weight: 700;
    padding: 11px 20px; border-radius: var(--h3-r-sm); cursor: pointer;
    transition: transform .14s, filter .14s, box-shadow .14s;
}
:root[data-theme="dark"] .h3 .h3-btn { color: #101713; }
.h3-btn:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: var(--h3-shadow-sm); }
.h3-btn:active { transform: translateY(0); }
.h3-btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.h3-btn--ghost { background: transparent; color: var(--h3-accent); border-color: var(--h3-line); }
:root[data-theme="dark"] .h3 .h3-btn--ghost { color: var(--h3-accent); }
.h3-btn--ghost:hover { border-color: var(--h3-accent); background: color-mix(in srgb, var(--h3-accent) 8%, transparent); }
.h3-btn--sm { font-size: 12.5px; padding: 8px 14px; }
.h3-btn--wide { width: 100%; justify-content: center; text-align: center; }

/* ---------- 表格 ---------- */
.h3-table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--h3-line); border-radius: var(--h3-r-sm); }
.h3-table { width: 100%; border-collapse: collapse; font-size: 13.5px; line-height: 1.7; }
.h3-table th, .h3-table td {
    padding: 10px 13px; text-align: left; vertical-align: top;
    border-bottom: 1px solid var(--h3-line-2);
}
.h3-table th {
    background: var(--h3-card-2); color: var(--h3-sub);
    font-size: 12.5px; font-weight: 700; white-space: nowrap;
}
.h3-table tbody tr:last-child td { border-bottom: 0; }
.h3-table tbody tr:hover { background: color-mix(in srgb, var(--h3-accent) 4%, transparent); }
.h3-table .h3-num { font-family: var(--h3-num); white-space: nowrap; }

/* ---------- 状态标签 ---------- */
.h3-tag {
    display: inline-block; padding: 2px 9px; border-radius: 999px;
    font-size: 11.5px; font-weight: 700; line-height: 1.7; white-space: nowrap;
    background: var(--h3-card-2); color: var(--h3-sub); border: 1px solid var(--h3-line);
}
.h3-tag--ok { background: var(--h3-ok-soft); color: var(--h3-ok); border-color: transparent; }
.h3-tag--warn { background: var(--h3-warn-soft); color: var(--h3-warn); border-color: transparent; }
.h3-tag--bad { background: var(--h3-bad-soft); color: var(--h3-bad); border-color: transparent; }
.h3-tag--accent { background: color-mix(in srgb, var(--h3-accent) 14%, transparent); color: var(--h3-accent); border-color: transparent; }

/* ---------- 提示条 / 空态 / 说明 ---------- */
.h3-note {
    display: flex; gap: 12px; align-items: flex-start;
    padding: 15px 18px; border: 1px solid var(--h3-line);
    border-left: 3px solid var(--h3-accent);
    border-radius: var(--h3-r-sm); background: var(--h3-card-2);
    font-size: 13.5px; line-height: 1.85; color: var(--h3-sub);
}
.h3-note b { color: var(--h3-ink); }
.h3-note .h3-ic { font-size: 17px; line-height: 1.3; }
.h3-empty {
    padding: 34px 18px; text-align: center; color: var(--h3-faint);
    font-size: 13.5px; line-height: 1.9; border: 1px dashed var(--h3-line);
    border-radius: var(--h3-r-sm); background: var(--h3-card-2);
}
.h3-empty b { display: block; font-size: 26px; margin-bottom: 8px; font-weight: 400; }
.h3-prose { font-size: 14.5px; line-height: 2.02; color: var(--h3-sub); }
.h3-prose h3 { margin: 22px 0 8px; font-size: 16px; line-height: 1.5; color: var(--h3-ink); font-weight: 750; }
.h3-prose h3:first-child { margin-top: 0; }
.h3-prose p { margin: 0 0 12px; }
.h3-prose ul { margin: 0 0 12px; padding-left: 20px; }
.h3-prose li { margin-bottom: 6px; }
.h3-kw { color: var(--h3-ink); font-weight: 700; }
.h3-faq { display: grid; gap: 12px; }
.h3-faq details {
    border: 1px solid var(--h3-line); border-radius: var(--h3-r-sm);
    background: var(--h3-card); padding: 12px 16px;
}
.h3-faq summary { cursor: pointer; font-size: 14.5px; font-weight: 700; color: var(--h3-ink); }
.h3-faq details p { margin: 10px 0 0; font-size: 13.5px; line-height: 1.9; color: var(--h3-sub); }
.h3-foot {
    margin-top: 44px; padding-top: 20px; border-top: 1px solid var(--h3-line);
    font-size: 12.5px; line-height: 1.85; color: var(--h3-faint);
}

/* ---------- 首屏操作条：工具入口直接置于首屏 ---------- */
.h3-quick {
    margin-top: 24px; padding: 18px;
    background: var(--h3-card); border: 1px solid var(--h3-line);
    border-radius: var(--h3-r); box-shadow: var(--h3-shadow);
}
.h3-quick-h {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    margin: 0 0 14px; font-size: 13px; font-weight: 750; color: var(--h3-ink);
}
.h3-quick-h span {
    font-family: var(--h3-num); font-size: 11px; letter-spacing: .1em;
    color: var(--h3-accent); border: 1px solid var(--h3-line);
    padding: 2px 8px; border-radius: 999px;
}

/* ---------- Toast（仅操作后触发） ---------- */
.h3-toast {
    position: fixed; left: 50%; bottom: 30px; transform: translate(-50%, 14px);
    z-index: 100001; max-width: min(86vw, 520px);
    padding: 11px 20px; border-radius: 999px;
    background: #202a23; color: #fff; font-size: 13.5px; line-height: 1.6;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .26);
    opacity: 0; pointer-events: none; transition: opacity .22s, transform .22s;
}
.h3-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
:root[data-theme="dark"] .h3-toast { background: #d9e7dc; color: #14201a; }

/* ---------- 结果弹窗：只在用户完成一次操作后由 JS 打开 ---------- */
.h3-modal[hidden] { display: none !important; }
.h3-modal { position: fixed; inset: 0; z-index: 100000; }
.h3-modal-mask { position: absolute; inset: 0; background: rgba(16, 22, 18, .58); backdrop-filter: blur(3px); }
.h3-modal-box {
    position: relative; width: min(92vw, 720px); max-height: 84vh; overflow: auto;
    margin: 8vh auto 0; background: var(--h3-card); color: var(--h3-ink);
    border: 1px solid var(--h3-line); border-radius: var(--h3-r);
    box-shadow: 0 30px 90px rgba(0, 0, 0, .35); padding: 22px 26px 26px;
}
.h3-modal-h { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.h3-modal-h h3 { margin: 0; font-size: 18px; font-weight: 750; }
.h3-modal-x {
    border: 1px solid var(--h3-line); background: transparent; color: var(--h3-sub);
    width: 32px; height: 32px; border-radius: 8px; font-size: 20px; line-height: 1; cursor: pointer;
}
.h3-modal-body { font-size: 14px; line-height: 1.95; color: var(--h3-sub); }
.h3-modal-body pre {
    white-space: pre-wrap; word-break: break-word; font-family: var(--h3-num);
    background: var(--h3-card-2); border: 1px solid var(--h3-line-2);
    padding: 14px; border-radius: var(--h3-r-sm); font-size: 13px;
}

/* ---------- 响应式 ---------- */
@media (max-width: 960px) {
    .h3-grid--2, .h3-grid--3, .h3-grid--half { grid-template-columns: 1fr; }
    .h3-fields--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
    .h3-wrap { padding: 0 16px 48px; }
    .h3-card { padding: 18px; }
    .h3-fields--2, .h3-fields--3 { grid-template-columns: 1fr; }
    .h3-lead { font-size: 15px; }
    .tsk-crumb-bar-in { padding-left: 16px; padding-right: 16px; }
}

/* ---------- 打印：只留结果区 ---------- */
@media print {
    .h3 .h3-no-print, .h3 .h3-toast, .h3 .h3-modal,
    .h3 .h3-quick, .h3 .h3-hero-deco { display: none !important; }
    .h3 { background: #fff; color: #000; }
    .h3 .h3-card { box-shadow: none; border-color: #bbb; }
    .h3 .h3-print-area { display: block !important; }
}
