/* ============================================================
   住房与城市更新系列 · 全新 UI（hc- 前缀）
   风格：青绿「蓝图」+ 大圆角 + 三栏数据条，与 ats- 风格区分
   ============================================================ */
.hc-calc {
    --hc-bg: #f5faf8;
    --hc-card: #ffffff;
    --hc-border: #e0e9e5;
    --hc-text: #12211b;
    --hc-muted: #66786f;
    --hc-primary: #0e766e;
    --hc-primary-2: #0a5c56;
    --hc-primary-soft: #e2f4f0;
    --hc-accent: #d97706;
    --hc-accent-soft: #fdf3e2;
    --hc-green: #15803d;
    --hc-red: #b91c1c;
    --hc-shadow: 0 16px 40px rgba(11, 70, 58, .10);
    margin: 18px 0 0;
}

[data-theme="dark"] .hc-calc {
    --hc-bg: #0a1310;
    --hc-card: #101c18;
    --hc-border: #223630;
    --hc-text: #e7f1ed;
    --hc-muted: #93a8a0;
    --hc-primary: #3bb9aa;
    --hc-primary-2: #5cc9ba;
    --hc-primary-soft: #12312b;
    --hc-accent: #f0b45f;
    --hc-accent-soft: #2c2314;
    --hc-green: #4ade80;
    --hc-red: #f87171;
    --hc-shadow: 0 18px 44px rgba(0, 0, 0, .5);
}

/* ---------- 顶部蓝图横幅 ---------- */
.hc-hero {
    position: relative;
    overflow: hidden;
    border-radius: 22px;
    border: 1px solid var(--hc-border);
    padding: 22px 24px;
    margin-bottom: 16px;
    background:
        radial-gradient(900px 180px at 92% -30%, var(--hc-primary-soft), transparent 62%),
        linear-gradient(135deg, var(--hc-primary-soft), transparent 72%);
}

.hc-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--hc-border) 1px, transparent 1px),
        linear-gradient(90deg, var(--hc-border) 1px, transparent 1px);
    background-size: 22px 22px;
    opacity: .16;
    pointer-events: none;
}

.hc-hero-badge {
    position: relative;
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    color: var(--hc-primary);
    background: var(--hc-card);
    border: 1px solid var(--hc-border);
    padding: 4px 11px;
    border-radius: 999px;
    margin-bottom: 9px;
}

.hc-hero h2 {
    position: relative;
    margin: 0 0 6px;
    font-size: 22px;
    line-height: 1.35;
    color: var(--hc-text);
}

.hc-hero p {
    position: relative;
    margin: 0;
    font-size: 14px;
    line-height: 1.75;
    color: var(--hc-muted);
}

/* ---------- 主体两栏 ---------- */
.hc-main {
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    gap: 16px;
    align-items: start;
}

.hc-panel {
    background: var(--hc-card);
    border: 1px solid var(--hc-border);
    border-radius: 20px;
    box-shadow: var(--hc-shadow);
    padding: 20px;
    min-width: 0;
}

.hc-panel-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.hc-panel-head h3 {
    margin: 0;
    font-size: 16px;
    color: var(--hc-text);
}

.hc-ico {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: var(--hc-primary-soft);
    font-size: 17px;
}

/* ---------- 表单 ---------- */
.hc-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 13px 14px;
}

.hc-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.hc-field--full { grid-column: 1 / -1; }

.hc-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--hc-text);
}

.hc-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.hc-input,
.hc-select {
    width: 100%;
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
    border: 1.5px solid var(--hc-border);
    background: var(--hc-bg);
    color: var(--hc-text);
    border-radius: 12px;
    padding: 11px 13px;
    font-size: 15px;
    line-height: 1.2;
    outline: none;
    transition: border-color .18s, box-shadow .18s;
}

.hc-input:focus,
.hc-select:focus {
    border-color: var(--hc-primary);
    box-shadow: 0 0 0 3px var(--hc-primary-soft);
}

.hc-select {
    padding-right: 34px;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--hc-muted) 50%),
        linear-gradient(135deg, var(--hc-muted) 50%, transparent 50%);
    background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}

.hc-unit {
    position: absolute;
    right: 12px;
    font-size: 13px;
    color: var(--hc-muted);
    pointer-events: none;
}

.hc-unit--pre { left: 12px; right: auto; }

.hc-input--pre { padding-left: 32px; }

.hc-help {
    margin: 0;
    font-size: 12px;
    line-height: 1.6;
    color: var(--hc-muted);
}

/* ---------- 按钮 ---------- */
.hc-btn {
    width: 100%;
    margin-top: 16px;
    border: none;
    cursor: pointer;
    border-radius: 13px;
    padding: 13px 16px;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, var(--hc-primary), var(--hc-primary-2));
    box-shadow: 0 8px 20px rgba(14, 118, 110, .28);
    transition: transform .18s, box-shadow .18s;
}

.hc-btn:hover { transform: translateY(-1px); box-shadow: 0 11px 24px rgba(14, 118, 110, .34); }
.hc-btn:active { transform: translateY(0); }

.hc-ai {
    width: 100%;
    margin-top: 12px;
    cursor: pointer;
    border-radius: 12px;
    padding: 11px 14px;
    font-size: 14px;
    font-weight: 600;
    color: var(--hc-primary);
    background: var(--hc-primary-soft);
    border: 1px dashed var(--hc-primary);
    transition: background .18s;
}

.hc-ai:hover { background: var(--hc-card); }

/* ---------- 结果 ---------- */
.hc-result-hero {
    border-radius: 16px;
    padding: 18px;
    text-align: center;
    border: 1px solid var(--hc-border);
    background: linear-gradient(135deg, var(--hc-primary-soft), transparent);
}

.hc-result-hero.is-good { background: linear-gradient(135deg, rgba(21, 128, 61, .14), transparent); }
.hc-result-hero.is-warn { background: linear-gradient(135deg, var(--hc-accent-soft), transparent); }
.hc-result-hero.is-bad { background: linear-gradient(135deg, rgba(185, 28, 28, .12), transparent); }

.hc-result-label {
    font-size: 13px;
    color: var(--hc-muted);
    margin-bottom: 6px;
}

.hc-result-value {
    font-size: 34px;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -.5px;
    color: var(--hc-primary);
    word-break: break-all;
}

.hc-result-value .u {
    font-size: 15px;
    font-weight: 600;
    margin-left: 3px;
    color: var(--hc-muted);
    letter-spacing: 0;
}

.hc-result-sub {
    margin-top: 6px;
    font-size: 12px;
    color: var(--hc-muted);
    line-height: 1.6;
}

.hc-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.hc-stat {
    background: var(--hc-bg);
    border: 1px solid var(--hc-border);
    border-radius: 13px;
    padding: 11px 10px;
    text-align: center;
    min-width: 0;
}

.hc-stat-v {
    display: block;
    font-size: 17px;
    font-weight: 800;
    color: var(--hc-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hc-stat-k {
    display: block;
    margin-top: 3px;
    font-size: 11px;
    color: var(--hc-muted);
}

.hc-rows {
    list-style: none;
    margin: 14px 0 0;
    padding: 0;
    border-top: 1px dashed var(--hc-border);
}

.hc-rows li {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px dashed var(--hc-border);
    font-size: 13.5px;
}

.hc-rows li span { color: var(--hc-muted); }
.hc-rows li b { color: var(--hc-text); font-weight: 700; text-align: right; }

.hc-calc-note {
    margin-top: 14px;
    font-size: 12.5px;
    line-height: 1.75;
    color: var(--hc-muted);
    background: var(--hc-bg);
    border: 1px dashed var(--hc-border);
    border-radius: 12px;
    padding: 11px 13px;
}

.hc-calc-note b { color: var(--hc-text); }

.hc-ai-result {
    margin-top: 12px;
    font-size: 13px;
    line-height: 1.75;
    color: var(--hc-text);
    background: var(--hc-primary-soft);
    border: 1px solid var(--hc-border);
    border-radius: 12px;
    padding: 12px 14px;
    white-space: pre-wrap;
}

.hc-disclaim {
    margin: 16px 0 0;
    font-size: 12px;
    line-height: 1.8;
    color: var(--hc-muted);
    background: var(--hc-bg);
    border-left: 3px solid var(--hc-accent);
    border-radius: 8px;
    padding: 10px 14px;
}

/* ---------- 响应式 ---------- */
@media (max-width: 880px) {
    .hc-main { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
    .hc-fields { grid-template-columns: 1fr; }
    .hc-stats { grid-template-columns: 1fr 1fr; }
    .hc-hero { padding: 18px; border-radius: 18px; }
    .hc-hero h2 { font-size: 19px; }
    .hc-result-value { font-size: 28px; }
}

/* ---------- 明细表 ---------- */
.hc-table-wrap {
    margin-top: 14px;
    overflow-x: auto;
    border: 1px solid var(--hc-border);
    border-radius: 12px;
    -webkit-overflow-scrolling: touch;
}

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

.hc-table th {
    text-align: left;
    padding: 9px 11px;
    background: var(--hc-bg);
    color: var(--hc-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--hc-border);
    white-space: nowrap;
}

.hc-table td {
    padding: 9px 11px;
    border-bottom: 1px dashed var(--hc-border);
    color: var(--hc-text);
    white-space: nowrap;
}

.hc-table tr:last-child td { border-bottom: none; }
.hc-table .hc-td-k { color: var(--hc-muted); }
.hc-table .hc-tnum { text-align: right; font-variant-numeric: tabular-nums; }
.hc-table tr.is-total td { background: var(--hc-bg); font-weight: 700; }
.hc-table .is-best { color: var(--hc-green); font-weight: 700; }
.hc-table .is-bad { color: var(--hc-red); font-weight: 700; }
.hc-table .hc-table-sub { font-size: 11px; color: var(--hc-muted); display: block; margin-top: 2px; }

/* ---------- 状态标签 ---------- */
.hc-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.hc-pill {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--hc-primary-soft);
    color: var(--hc-primary);
    border: 1px solid var(--hc-border);
    white-space: nowrap;
}

.hc-pill.is-good { background: rgba(21, 128, 61, .12); color: var(--hc-green); }
.hc-pill.is-warn { background: var(--hc-accent-soft); color: var(--hc-accent); }
.hc-pill.is-bad { background: rgba(185, 28, 28, .1); color: var(--hc-red); }

/* ---------- 方案小标题 ---------- */
.hc-subhead {
    margin: 16px 0 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--hc-text);
    display: flex;
    align-items: center;
    gap: 6px;
}

.hc-subhead::before {
    content: "";
    width: 3px;
    height: 13px;
    border-radius: 2px;
    background: var(--hc-primary);
}

.hc-subhead-desc {
    margin-left: 4px;
    font-size: 11.5px;
    font-weight: 400;
    color: var(--hc-muted);
}

/* ============================================================
   结果「报告化」增强：结论卡 / 环形指标 / 对比条 / 堆叠条 / 趋势
   ============================================================ */

/* ---------- 主结果：双栏 + 环形 ---------- */
.hc-result-hero {
    position: relative;
    overflow: hidden;
    text-align: center;
    transition: box-shadow .2s;
}

.hc-result-hero::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--hc-primary);
    opacity: .85;
}

.hc-result-hero.is-good::before { background: var(--hc-green); }
.hc-result-hero.is-warn::before { background: var(--hc-accent); }
.hc-result-hero.is-bad::before { background: var(--hc-red); }

.hc-result-hero.has-ring {
    text-align: left;
    padding: 18px 18px 18px 20px;
}

.hc-result-hero.has-ring::after {
    content: "";
    position: absolute;
    right: -46px;
    top: -46px;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--hc-primary-soft), transparent 68%);
    pointer-events: none;
}

.hc-hero-grid {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.hc-hero-main { min-width: 0; flex: 1; }
.hc-result-hero.has-ring .hc-result-value { font-size: 30px; }

.hc-result-value { font-variant-numeric: tabular-nums; }

/* ---------- 环形指标 ---------- */
.hc-ring {
    --c: var(--hc-primary);
    --p: 0%;
    position: relative;
    flex: 0 0 108px;
    width: 108px;
    height: 108px;
    border-radius: 50%;
    background: conic-gradient(var(--c) var(--p), var(--hc-border) 0);
    display: grid;
    place-items: center;
    animation: hcRingIn .6s ease-out both;
}

.hc-ring::after {
    content: "";
    position: absolute;
    inset: 9px;
    border-radius: 50%;
    background: var(--hc-card);
    box-shadow: inset 0 0 0 1px var(--hc-border);
}

.hc-ring-in {
    position: relative;
    z-index: 1;
    text-align: center;
    line-height: 1.2;
    padding: 0 4px;
}

.hc-ring-in b {
    display: block;
    font-size: 17px;
    font-weight: 800;
    color: var(--hc-text);
    font-variant-numeric: tabular-nums;
}

.hc-ring-in span {
    display: block;
    margin-top: 2px;
    font-size: 10px;
    color: var(--hc-muted);
}

@keyframes hcRingIn {
    from { transform: scale(.82); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* ---------- 一句话结论 ---------- */
.hc-verdict {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--hc-border);
    border-left-width: 3px;
    border-left-color: var(--hc-primary);
    background: linear-gradient(135deg, var(--hc-primary-soft), transparent 70%);
    font-size: 13px;
    line-height: 1.75;
    color: var(--hc-text);
}

.hc-verdict.is-good { border-left-color: var(--hc-green); background: linear-gradient(135deg, rgba(21, 128, 61, .10), transparent 70%); }
.hc-verdict.is-warn { border-left-color: var(--hc-accent); background: linear-gradient(135deg, var(--hc-accent-soft), transparent 70%); }
.hc-verdict.is-bad { border-left-color: var(--hc-red); background: linear-gradient(135deg, rgba(185, 28, 28, .09), transparent 70%); }

.hc-verdict-ico { font-size: 17px; line-height: 1.4; }

.hc-verdict b {
    display: block;
    margin-bottom: 2px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .6px;
    color: var(--hc-primary);
}

.hc-verdict.is-good b { color: var(--hc-green); }
.hc-verdict.is-warn b { color: var(--hc-accent); }
.hc-verdict.is-bad b { color: var(--hc-red); }

.hc-verdict em {
    font-style: normal;
    font-weight: 800;
    color: var(--hc-text);
}

/* ---------- 横向对比条 ---------- */
.hc-bars {
    margin-top: 14px;
    display: grid;
    gap: 10px;
}

.hc-bar-row {
    display: grid;
    grid-template-columns: 78px 1fr auto;
    align-items: center;
    gap: 10px;
}

.hc-bar-name {
    font-size: 12px;
    color: var(--hc-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hc-bar-track {
    height: 10px;
    border-radius: 999px;
    background: var(--hc-bg);
    box-shadow: inset 0 0 0 1px var(--hc-border);
    overflow: hidden;
}

.hc-bar-track i {
    display: block;
    height: 100%;
    width: 0;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--hc-primary), var(--hc-primary-2));
    transform-origin: left center;
    animation: hcBarGrow .75s cubic-bezier(.2, .7, .2, 1) both;
}

.hc-bar-track i.is-old,
.hc-bar-track i.is-muted { background: linear-gradient(90deg, #9aa8a3, #6f8079); }
.hc-bar-track i.is-good { background: linear-gradient(90deg, #34d399, var(--hc-green)); }
.hc-bar-track i.is-warn { background: linear-gradient(90deg, #fbbf24, var(--hc-accent)); }
.hc-bar-track i.is-bad { background: linear-gradient(90deg, #f87171, var(--hc-red)); }

.hc-bar-val {
    font-size: 12.5px;
    color: var(--hc-text);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

@keyframes hcBarGrow {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

/* ---------- 100% 堆叠条 ---------- */
.hc-stack {
    display: flex;
    height: 14px;
    margin-top: 14px;
    border-radius: 999px;
    overflow: hidden;
    background: var(--hc-bg);
    box-shadow: inset 0 0 0 1px var(--hc-border);
}

.hc-stack i { display: block; height: 100%; min-width: 2px; }
.hc-stack i + i { box-shadow: -1px 0 0 var(--hc-card); }

.hc-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    margin-top: 9px;
    font-size: 11.5px;
    color: var(--hc-muted);
}

.hc-legend i {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 5px;
    border-radius: 3px;
    vertical-align: 1px;
}

/* ---------- 趋势曲线 ---------- */
.hc-spark {
    margin-top: 14px;
    padding: 10px 12px 6px;
    border: 1px solid var(--hc-border);
    border-radius: 14px;
    background: linear-gradient(180deg, var(--hc-bg), transparent);
}

.hc-spark-cap {
    margin-bottom: 4px;
    font-size: 11.5px;
    color: var(--hc-muted);
}

.hc-spark svg {
    display: block;
    width: 100%;
    height: 88px;
}

.hc-spark-x {
    display: flex;
    justify-content: space-between;
    margin-top: 2px;
    font-size: 10.5px;
    color: var(--hc-muted);
}

/* ---------- 场景预设 ---------- */
.hc-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 14px;
}

.hc-preset {
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--hc-border);
    background: var(--hc-card);
    color: var(--hc-muted);
    font-size: 12px;
    line-height: 1.4;
    transition: color .15s, border-color .15s, background .15s, transform .15s;
}

.hc-preset:hover {
    color: var(--hc-primary);
    border-color: var(--hc-primary);
    transform: translateY(-1px);
}

.hc-preset.is-active {
    background: linear-gradient(135deg, var(--hc-primary), var(--hc-primary-2));
    border-color: transparent;
    color: #fff;
    font-weight: 600;
}

/* ---------- 细节质感 ---------- */
.hc-stat {
    transition: transform .18s, box-shadow .18s;
}

.hc-stat:hover {
    transform: translateY(-2px);
    box-shadow: 0 9px 20px rgba(11, 70, 58, .12);
}

.hc-table tbody tr:nth-child(even) td { background: rgba(14, 118, 110, .025); }
[data-theme="dark"] .hc-table tbody tr:nth-child(even) td { background: rgba(255, 255, 255, .025); }

.hc-table tbody tr:hover td { background: var(--hc-primary-soft); }

@media (max-width: 560px) {
    .hc-result-hero.has-ring { padding: 16px; }
    .hc-result-hero.has-ring .hc-result-value { font-size: 25px; }
    .hc-ring { flex-basis: 88px; width: 88px; height: 88px; }
    .hc-ring-in b { font-size: 14px; }
    .hc-ring-in span { font-size: 9px; }
    .hc-bar-row { grid-template-columns: 66px 1fr auto; gap: 8px; }
    .hc-bar-val { font-size: 11.5px; }
}
