/* ============================================================
 * usable-area-rate.css —— 得房率计算器专属「都会置业」风格
 * 青碧 + 琥珀配色，轻圆角卡片；亮色 / 黑夜双主题
 * 独立于 arc.css / contraction-timer.css
 * ============================================================ */

:root {
    --uar-bg: #eef3f1;
    --uar-card: #ffffff;
    --uar-ink: #15312b;
    --uar-ink-2: #6d8781;
    --uar-line: #d8e4e0;
    --uar-teal: #0e7a66;
    --uar-teal-deep: #0a5c4e;
    --uar-teal-soft: #dff0ec;
    --uar-amber: #e8a13a;
    --uar-amber-soft: #fbeed3;
    --uar-ok: #1c8a5b;
    --uar-warn: #b97c14;
    --uar-low: #c0492f;
    --uar-shadow: 0 10px 28px rgba(14, 122, 102, .09);
    --uar-radius: 16px;
    --arc-danger: #c0492f; /* bindAi 错误文案用 */
}

:root[data-theme="dark"] {
    --uar-bg: #131f1c;
    --uar-card: #1b2a26;
    --uar-ink: #dcebe6;
    --uar-ink-2: #8ba8a0;
    --uar-line: #2f443e;
    --uar-teal: #3db39a;
    --uar-teal-deep: #2e9c85;
    --uar-teal-soft: #22443b;
    --uar-amber: #f0b45e;
    --uar-amber-soft: #413521;
    --uar-ok: #4cc793;
    --uar-warn: #e8b45a;
    --uar-low: #f08064;
    --uar-shadow: 0 10px 28px rgba(0, 0, 0, .4);
    --arc-danger: #f08064;
}

/* ---------------- 容器 ---------------- */
.uar {
    background: var(--uar-bg);
    border-radius: 22px;
    padding: 26px 26px 34px;
    color: var(--uar-ink);
    font-size: 15px;
    line-height: 1.75;
    transition: background .25s, color .25s;
}
.uar b { color: var(--uar-ink); }

/* ---------------- 面包屑 ---------------- */
.uar-crumb { font-size: 13px; color: var(--uar-ink-2); margin-bottom: 18px; }
.uar-crumb a { color: var(--uar-ink-2); text-decoration: none; }
.uar-crumb a:hover { color: var(--uar-teal); }
.uar-crumb .sep { margin: 0 7px; opacity: .5; }

/* ---------------- Hero ---------------- */
.uar-hero { position: relative; margin-bottom: 20px; }
.uar-theme {
    position: absolute; top: 0; right: 0;
    border: 1px solid var(--uar-line); background: var(--uar-card); color: var(--uar-ink-2);
    border-radius: 8px; padding: 7px 14px; font-size: 12px; font-weight: 700;
    letter-spacing: .08em; cursor: pointer; transition: .2s;
}
.uar-theme:hover { border-color: var(--uar-teal); color: var(--uar-teal); }
.uar-hero-badge {
    width: 60px; height: 60px; border-radius: 14px;
    background: linear-gradient(135deg, var(--uar-teal) 0%, var(--uar-teal-deep) 100%);
    display: flex; align-items: center; justify-content: center;
    font-size: 30px; box-shadow: var(--uar-shadow); margin-bottom: 16px;
}
.uar-hero h1 { margin: 0 0 4px; font-size: 29px; font-weight: 800; }
.uar-hero h1 .reg {
    display: inline-block; margin-left: 12px; vertical-align: middle;
    font-size: 12px; font-weight: 700; color: var(--uar-teal-deep);
    background: var(--uar-teal-soft); border-radius: 6px; padding: 4px 12px;
    letter-spacing: .06em;
}
:root[data-theme="dark"] .uar-hero h1 .reg { color: var(--uar-teal); }
.uar-hero p { margin: 10px 0 14px; color: var(--uar-ink-2); max-width: 780px; }
.uar-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.uar-tag {
    font-size: 12px; font-weight: 700; color: var(--uar-ink-2);
    background: var(--uar-card); border: 1px solid var(--uar-line);
    border-radius: 6px; padding: 4px 12px;
}

/* ---------------- 卡片 ---------------- */
.uar-card {
    background: var(--uar-card); border: 1px solid var(--uar-line);
    border-radius: var(--uar-radius); padding: 22px;
    margin-top: 18px; box-shadow: var(--uar-shadow);
}
.uar-card-title {
    margin: 0 0 16px; font-size: 17px; font-weight: 800;
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.uar-card-title .fi {
    width: 32px; height: 32px; border-radius: 9px; background: var(--uar-teal-soft);
    display: inline-flex; align-items: center; justify-content: center; font-size: 16px;
}
.uar-card-title .sub { font-size: 12.5px; font-weight: 600; color: var(--uar-ink-2); }
.uar-card-title .no {
    margin-left: auto; font-size: 11px; font-weight: 800; color: var(--uar-ink-2);
    letter-spacing: .14em;
}

/* ---------------- 表单 ---------------- */
.uar-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.uar-field { margin-bottom: 16px; min-width: 0; }
.uar-label { display: block; font-size: 13.5px; font-weight: 700; margin-bottom: 8px; }
.uar-label .hint { display: block; font-size: 12px; font-weight: 500; color: var(--uar-ink-2); margin-top: 2px; }
.uar-input {
    width: 100%; box-sizing: border-box;
    border: 1.5px solid var(--uar-line); border-radius: 10px;
    background: var(--uar-bg); color: var(--uar-ink);
    padding: 11px 13px; font-size: 15px; font-family: inherit;
    font-variant-numeric: tabular-nums;
}
.uar-input:focus { outline: none; border-color: var(--uar-teal); }
.uar-addon { position: relative; display: flex; align-items: stretch; }
.uar-addon .uar-input { flex: 1; border-radius: 10px 0 0 10px; border-right: none; }
.uar-addon .suf {
    display: flex; align-items: center; padding: 0 14px;
    border: 1.5px solid var(--uar-line); border-radius: 0 10px 10px 0;
    background: var(--uar-teal-soft); color: var(--uar-teal-deep);
    font-size: 13px; font-weight: 800; white-space: nowrap;
}
:root[data-theme="dark"] .uar-addon .suf { color: var(--uar-teal); }
.uar-seg { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.uar-seg button {
    border: 1.5px solid var(--uar-line); background: var(--uar-bg);
    color: var(--uar-ink-2); border-radius: 9px; padding: 9px 16px;
    font-size: 13px; font-weight: 700; cursor: pointer; transition: .15s;
}
.uar-seg button:hover { border-color: var(--uar-teal); color: var(--uar-teal); }
.uar-seg button.active {
    background: var(--uar-teal); border-color: var(--uar-teal); color: #fff;
}
.uar-status {
    display: none; margin-top: 4px; padding: 11px 14px; border-radius: 10px;
    background: var(--uar-amber-soft); color: var(--uar-warn);
    font-size: 13px; font-weight: 700;
}

/* ---------------- KPI ---------------- */
.uar-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.uar-kpi {
    background: var(--uar-bg); border: 1px solid var(--uar-line);
    border-radius: 12px; padding: 14px 15px;
}
.uar-kpi .k { font-size: 12px; font-weight: 700; color: var(--uar-ink-2); letter-spacing: .05em; }
.uar-kpi .v { font-size: 20px; font-weight: 800; margin: 3px 0 2px; font-variant-numeric: tabular-nums; }
.uar-kpi .n { font-size: 11.5px; color: var(--uar-ink-2); line-height: 1.5; }
.uar-kpi.is-big {
    background: linear-gradient(135deg, var(--uar-teal) 0%, var(--uar-teal-deep) 100%);
    border-color: transparent;
}
.uar-kpi.is-big .k, .uar-kpi.is-big .n { color: rgba(255, 255, 255, .82); }
.uar-kpi.is-big .v { color: #fff; font-size: 30px; }

/* ---------------- 比例条 ---------------- */
.uar-bar-wrap { margin-top: 18px; }
.uar-bar {
    display: flex; height: 34px; border-radius: 9px; overflow: hidden;
    font-size: 12.5px; font-weight: 800; color: #fff;
}
.uar-bar .in {
    background: linear-gradient(90deg, var(--uar-teal) 0%, var(--uar-teal-deep) 100%);
    display: flex; align-items: center; padding-left: 12px;
    transition: width .4s; white-space: nowrap; overflow: hidden;
}
.uar-bar .sh {
    background: linear-gradient(90deg, var(--uar-amber) 0%, #d18a24 100%);
    display: flex; align-items: center; justify-content: flex-end; padding-right: 12px;
    transition: width .4s; white-space: nowrap; overflow: hidden;
}

/* ---------------- 区间标尺 ---------------- */
.uar-scale-wrap { margin-top: 22px; }
.uar-scale {
    position: relative; height: 10px; border-radius: 6px;
    background: var(--uar-line); margin-top: 30px;
}
.uar-scale-band {
    position: absolute; top: -4px; height: 18px; border-radius: 6px;
    background: var(--uar-teal-soft); border: 1.5px dashed var(--uar-teal);
}
.uar-scale-band .cap {
    position: absolute; top: 22px; left: 50%; transform: translateX(-50%);
    font-size: 11px; font-weight: 700; color: var(--uar-ink-2); white-space: nowrap;
}
.uar-scale-mark {
    position: absolute; top: -8px; width: 4px; height: 26px; border-radius: 2px;
    background: var(--uar-amber); transform: translateX(-50%);
    transition: left .4s;
}
.uar-scale-mark .cap {
    position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%);
    font-size: 12px; font-weight: 800; color: var(--uar-amber); white-space: nowrap;
}
.uar-scale-min, .uar-scale-max {
    position: absolute; top: 14px; font-size: 11px; color: var(--uar-ink-2); font-weight: 700;
}
.uar-scale-min { left: 0; }
.uar-scale-max { right: 0; }

/* ---------------- 评价 ---------------- */
.uar-verdict {
    margin-top: 18px; border-radius: 12px; padding: 14px 17px;
    font-size: 14px;
}
.uar-verdict b { display: block; margin-bottom: 3px; font-size: 14.5px; }
.uar-verdict p { margin: 0; line-height: 1.7; }
.uar-verdict.in { background: var(--uar-teal-soft); }
.uar-verdict.in b, .uar-verdict.in p { color: var(--uar-ok); }
:root[data-theme="dark"] .uar-verdict.in p { color: var(--uar-teal); }
.uar-verdict.high { background: var(--uar-amber-soft); }
.uar-verdict.high b, .uar-verdict.high p { color: var(--uar-warn); }
.uar-verdict.low { background: rgba(192, 73, 47, .10); }
.uar-verdict.low b, .uar-verdict.low p { color: var(--uar-low); }

/* ---------------- 明细表 ---------------- */
.uar-table { margin-top: 16px; border: 1px solid var(--uar-line); border-radius: 12px; overflow: hidden; }
.uar-table table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.uar-table th, .uar-table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--uar-line); }
.uar-table th { background: var(--uar-bg); font-size: 12px; letter-spacing: .06em; color: var(--uar-ink-2); }
.uar-table tr:last-child td { border-bottom: none; }
.uar-table td.num { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.uar-table td.dim { color: var(--uar-ink-2); font-size: 12.5px; }

/* ---------------- 备注条 ---------------- */
.uar-note {
    margin-top: 16px; display: flex; gap: 10px; align-items: flex-start;
    font-size: 13px; color: var(--uar-ink-2); line-height: 1.75;
    background: var(--uar-bg); border: 1px dashed var(--uar-line);
    border-radius: 12px; padding: 13px 15px;
}
.uar-note .ni { flex: none; font-size: 15px; }

/* ---------------- AI ---------------- */
.uar-textarea {
    width: 100%; box-sizing: border-box; resize: vertical;
    border: 1.5px solid var(--uar-line); border-radius: 10px;
    background: var(--uar-bg); color: var(--uar-ink);
    padding: 12px 14px; font-size: 14px; font-family: inherit; line-height: 1.6;
}
.uar-textarea:focus { outline: none; border-color: var(--uar-teal); }
.uar-btn {
    border: none; cursor: pointer;
    background: linear-gradient(135deg, var(--uar-teal) 0%, var(--uar-teal-deep) 100%);
    color: #fff; font-size: 14px; font-weight: 800; letter-spacing: .04em;
    border-radius: 10px; padding: 12px 26px; margin-top: 14px;
    box-shadow: 0 8px 20px rgba(14, 122, 102, .28); transition: .15s;
}
.uar-btn:hover { transform: translateY(-2px); }
.uar-btn:disabled { opacity: .6; cursor: default; transform: none; }
.uar-ai {
    margin-top: 16px; border-radius: 12px; padding: 16px 18px;
    background: var(--uar-bg); border: 1px solid var(--uar-line);
    font-size: 14px; line-height: 1.85; white-space: pre-wrap; word-break: break-word;
}
.uar-ai.empty { color: var(--uar-ink-2); }
.arc-dots::after { content: ''; animation: uarDots 1.2s steps(4) infinite; }
@keyframes uarDots { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; } }

/* ---------------- toast（Arc.toast 用） ---------------- */
.arc-toast {
    position: fixed; left: 50%; bottom: 36px;
    transform: translateX(-50%) translateY(16px);
    background: var(--uar-ink, #15312b); color: var(--uar-card, #fff);
    padding: 11px 20px; border-radius: 10px;
    font-size: 13.5px; font-weight: 600; z-index: 9999;
    opacity: 0; pointer-events: none; transition: .25s;
    box-shadow: 0 10px 26px rgba(0, 0, 0, .2);
}
.arc-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------------- Tabs / Panels ---------------- */
.uar-tabs {
    display: flex; flex-wrap: wrap; gap: 0; margin-top: 26px;
    border-bottom: 2px solid var(--uar-line);
}
.uar-tab {
    border: none; background: transparent;
    color: var(--uar-ink-2); padding: 11px 18px;
    font-size: 13.5px; font-weight: 700; cursor: pointer;
    border-bottom: 2.5px solid transparent; margin-bottom: -2px;
    transition: .15s;
}
.uar-tab:hover { color: var(--uar-teal); }
.uar-tab.active { color: var(--uar-teal); border-bottom-color: var(--uar-teal); }
.uar-panel { display: none; padding: 20px 6px 4px; }
.uar-panel.active { display: block; }
.uar-panel h2 { font-size: 17px; font-weight: 800; margin: 18px 0 8px; }
.uar-panel h2:first-child { margin-top: 4px; }
.uar-panel p { margin: 8px 0; }
.uar-panel ul { margin: 8px 0; padding-left: 22px; }
.uar-panel li { margin: 6px 0; }
.uar-faq details {
    border: 1px solid var(--uar-line); border-radius: 10px;
    background: var(--uar-card); margin: 10px 0; overflow: hidden;
}
.uar-faq summary {
    cursor: pointer; padding: 13px 17px; font-weight: 700; font-size: 14px;
    list-style: none;
}
.uar-faq summary::-webkit-details-marker { display: none; }
.uar-faq summary::before { content: '▸'; color: var(--uar-teal); margin-right: 9px; }
.uar-faq details[open] summary::before { content: '▾'; }
.uar-faq .a { padding: 0 17px 15px; font-size: 13.5px; color: var(--uar-ink-2); line-height: 1.8; }
.uar-timeline { list-style: none; padding: 0 !important; }
.uar-timeline li {
    display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap;
    padding: 10px 0; border-bottom: 1px dashed var(--uar-line);
}
.uar-timeline .ver {
    font-size: 11.5px; font-weight: 800; color: #fff; background: var(--uar-teal);
    border-radius: 6px; padding: 2px 10px;
}
.uar-timeline .date { font-size: 12.5px; color: var(--uar-ink-2); font-weight: 700; }
.uar-timeline .txt { flex: 1 1 100%; font-size: 13.5px; }

/* ---------------- 相关工具 ---------------- */
.uar-rel-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.uar-rel {
    display: flex; gap: 11px; align-items: center; text-decoration: none;
    border: 1px solid var(--uar-line); border-radius: 12px;
    background: var(--uar-bg); padding: 13px 14px; transition: .15s;
}
.uar-rel:hover { border-color: var(--uar-teal); transform: translateY(-2px); }
.uar-rel .ri {
    width: 38px; height: 38px; border-radius: 10px; background: var(--uar-teal-soft);
    display: flex; align-items: center; justify-content: center; font-size: 19px; flex: none;
}
.uar-rel b { display: block; font-size: 13.5px; color: var(--uar-ink); }
.uar-rel small { font-size: 11.5px; color: var(--uar-ink-2); }

/* ---------------- 响应式 ---------------- */
@media (max-width: 860px) {
    .uar-kpis { grid-template-columns: repeat(2, 1fr); }
    .uar-rel-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
    .uar { padding: 18px 14px 26px; border-radius: 16px; }
    .uar-hero h1 { font-size: 22px; }
    .uar-hero h1 .reg { display: block; margin: 8px 0 0; width: fit-content; }
    .uar-grid2 { grid-template-columns: 1fr; }
    .uar-rel-grid { grid-template-columns: 1fr; }
    .uar-theme { position: static; margin-bottom: 12px; }
    .uar-table td.dim { display: none; }
}
