/* ============================================================
   style-unify.css — 单一定稿（不再叠加补丁）
   基准：Nova 8（392px）→ 根字号 14px
   规则：一类一样式，全部用 rem 等比缩放
   ============================================================ */

/* ===== 1. 根字号 ===== */
html { font-size: clamp(12px, 3.571vw, 16px); -webkit-text-size-adjust: 100%; }
*, *::before, *::after { box-sizing: border-box; }
body { font-size: 0.93rem; line-height: 1.55; margin: 0; overflow-x: hidden; }

/* ===== 2. 页面 ===== */
.page { padding: 1rem; max-width: 1080px; margin: 0 auto; width: 100%; overflow-x: hidden; }
.page .scroll-area { padding: 1rem; padding-bottom: 1.5rem; }
.fixed-top, .fixed-bottom { padding-left: 1rem; padding-right: 1rem; }

/* ===== 3. 卡片 ===== */
.card, .result-box, .pv2-card, .pv2-summary, .pv2-banks,
.plan-card, .biz-summary-card, .acc-item,
.contract-list-item, .credit-page-item,
.biz-debt-block, .pl-debt-block, .pl-asset-block {
  padding: 1rem; margin-bottom: 0.86rem; border-radius: 1rem; overflow: hidden;
}

/* ===== 4. 标题 ===== */
.bb-title { font-size: 1.14rem; line-height: 1.4; font-weight: 700; }
.custom-modal-title { font-size: 1.14rem; line-height: 1.4; font-weight: 700; }
.module-title, .score-title { font-size: 1rem; line-height: 1.4; font-weight: 700; }
.pv2-section-title, .pv2-card-title, .bdb-title { font-size: 0.93rem; line-height: 1.4; font-weight: 700; }
h2 { font-size: 1rem; line-height: 1.4; font-weight: 700; margin: 0.86rem 0 0.57rem; }
h3 { font-size: 0.93rem; line-height: 1.4; font-weight: 700; }
h4 { font-size: 0.86rem; line-height: 1.4; font-weight: 700; }

/* ===== 5. 正文 ===== */
label { font-size: 0.86rem; line-height: 1.4; }
.sub, .tip, small, .hint, .empty { font-size: 0.79rem; line-height: 1.45; }

/* ===== 6. 输入框（唯一规则：页面锁 16px 防放大） ===== */
input:not([type="file"]):not([type="checkbox"]):not([type="radio"]),
select, textarea {
  font-size: max(16px, 0.93rem);
  padding: 0.57rem 0.71rem;
  border-radius: 0.57rem;
  height: 2.29rem; min-height: 2.29rem;
  line-height: 1.4;
  width: 100%; min-width: 0;
}
input[type="checkbox"], input[type="radio"] {
  width: 1.14rem; height: 1.14rem;
  min-width: 1.14rem; min-height: 1.14rem;
  padding: 0; margin: 0;
}

/* ===== 7. 按钮 ===== */
.btn { font-size: 0.93rem; padding: 0.57rem 1rem; height: 2.29rem; min-height: 2.29rem; border-radius: 0.71rem; }
.btn.small { font-size: 0.79rem; padding: 0.36rem 0.71rem; height: 1.71rem; min-height: 1.71rem; border-radius: 0.5rem; }
.btn.big { font-size: 1rem; padding: 0.71rem 1.14rem; height: 2.71rem; min-height: 2.71rem; border-radius: 0.93rem; }

/* ===== 8. 录入栅格：唯一规则 → 双排 ===== */
.pl-debt-row, .biz-debt-row, .pl-asset-row, .biz-asset-row,
.two-col, .pl-two-col,
#pagePersonal .pv2-card-body,
#bizSecBasic > div,
#bizSecOps .two-col,
#bizSecQuery .two-col,
#bizSecQuery .two-col > .col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.71rem;
}

/* 每个 label = 上标题下输入 */
.pl-debt-row > label, .biz-debt-row > label,
.pl-asset-row > label, .biz-asset-row > label,
#pagePersonal .pv2-card-body > label,
#pageBiz label {
  display: flex; flex-direction: column; gap: 0.21rem;
  margin-bottom: 0; min-width: 0;
}

/* label 里的文字：单行省略 */
.pl-debt-row > label > span, .biz-debt-row > label > span,
.pl-asset-row > label > span, .biz-asset-row > label > span,
#pagePersonal .pv2-card-body > label > span,
#pageBiz label > span {
  display: block;
  font-size: 0.79rem; line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* label 内输入框 */
.pl-debt-row > label > input, .pl-debt-row > label > select,
.biz-debt-row > label > input, .biz-debt-row > label > select,
#pagePersonal .pv2-card-body > label > input,
#pagePersonal .pv2-card-body > label > select,
#pageBiz label > input, #pageBiz label > select {
  font-size: max(14px, 0.93rem);
  height: 2.14rem; min-height: 2.14rem;
  padding: 0.36rem 0.5rem;
  text-align: right;
}

/* 含 bank-wrap 的字段占整行（收入/还款方式） */
#pagePersonal .pv2-card-body > label:has(.bank-wrap),
#pageBiz label:has(.bank-wrap) {
  grid-column: 1 / -1;
}
.bank-wrap { display: flex; gap: 0.29rem; min-width: 0; }
.bank-wrap > select, .bank-wrap > input { flex: 1 1 0; min-width: 0; }

/* 经营贷查询/逾期：标题跨整行 */
#bizSecQuery .two-col > .col > .module-title { grid-column: 1 / -1; }

/* ===== 9. 弹窗 ===== */
.custom-modal { padding: 0.57rem; }
.custom-modal-card, .custom-modal-card.wide {
  width: 100%; max-width: min(94vw, 560px); max-height: 92vh;
  border-radius: 1.14rem; overflow: hidden;
  display: flex; flex-direction: column;
}
.custom-modal-title { padding: 0.86rem 1rem 0.71rem; font-size: 1.14rem; flex: 0 0 auto; }
.custom-modal-body { padding: 0.86rem 1rem; flex: 1 1 auto; overflow-x: hidden; overflow-y: auto; }
.custom-modal-actions { padding: 0.71rem 1rem; gap: 0.57rem; flex-wrap: wrap; flex: 0 0 auto; }

/* 弹窗内输入框：和页面统一 */
.custom-modal input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.custom-modal select, .custom-modal textarea {
  font-size: max(14px, 0.93rem);
  padding: 0.36rem 0.5rem;
  height: 2rem; min-height: 2rem;
  border-radius: 0.43rem;
  text-align: right;
}
.custom-modal .btn { font-size: 0.93rem; padding: 0.5rem 0.86rem; height: 2rem; min-height: 2rem; }
.custom-modal .btn.small { font-size: 0.79rem; padding: 0.36rem 0.71rem; height: 1.71rem; min-height: 1.71rem; }

/* 弹窗内 label 文字单行 */
.custom-modal label > span {
  display: block;
  font-size: 0.79rem; line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ===== 10. 摘要行（负债/资产详情）===== */
.bsc-line {
  font-size: 0.79rem; line-height: 1.6;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ===== 11. 表格 ===== */
table { table-layout: fixed; width: 100%; border-collapse: collapse; }
table th, table td {
  padding: 0.43rem 0.29rem;
  font-size: 0.79rem; line-height: 1.25;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  min-width: 0;
}
table th { text-align: center; font-weight: 600; }
table td { text-align: right; }
table td:first-child, table th:first-child { text-align: left; padding-left: 0.57rem; }
table input, table select {
  width: 100%; min-width: 0; max-width: 100%;
  font-size: max(12px, 0.79rem);
  padding: 0.21rem 0.29rem;
  height: 1.71rem; min-height: 1.71rem;
  text-align: right;
}

/* 房贷表 5 列按比例 */
.custom-modal .pl-debt-block > table > thead > tr > th:nth-child(1),
.custom-modal .pl-debt-block > table > tbody > tr > td:nth-child(1) { width: 24%; }
.custom-modal .pl-debt-block > table > thead > tr > th:nth-child(2),
.custom-modal .pl-debt-block > table > tbody > tr > td:nth-child(2) { width: 22%; }
.custom-modal .pl-debt-block > table > thead > tr > th:nth-child(3),
.custom-modal .pl-debt-block > table > tbody > tr > td:nth-child(3) { width: 19%; }
.custom-modal .pl-debt-block > table > thead > tr > th:nth-child(4),
.custom-modal .pl-debt-block > table > tbody > tr > td:nth-child(4) { width: 23%; }
.custom-modal .pl-debt-block > table > thead > tr > th:nth-child(5),
.custom-modal .pl-debt-block > table > tbody > tr > td:nth-child(5) { width: 12%; padding: 0; text-align: center; }

/* 宽表：允许横滚 */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -1rem; padding: 0 1rem; }
.table-scroll table { min-width: 900px; width: auto; table-layout: auto; }

/* ===== 12. 首页 ===== */
#pageHome .hv2-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.71rem; }
#pageHome .hv2-entry--p, #pageHome .hv2-entry--b, #pageHome .hv2-entry--c { grid-column: 1 / -1; }
#pageHome .hv2-entry {
  display: flex; flex-direction: row; align-items: center;
  gap: 0.71rem; padding: 0.86rem 0.93rem;
  border-radius: 1rem; overflow: hidden; min-height: 4.29rem;
}
#pageHome .hv2-entry-ico {
  width: 2.29rem; height: 2.29rem;
  min-width: 2.29rem; flex: 0 0 2.29rem;
  font-size: 1.29rem; border-radius: 0.71rem;
  display: grid; place-items: center;
}
#pageHome .hv2-entry-title { font-size: 0.93rem; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 0 0 0.14rem; }
#pageHome .hv2-entry-sub { font-size: 0.71rem; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#pageHome .hv2-entry-arrow { display: none; }

/* ===== 13. 计算器 ===== */
.calc-keys button { padding: 1rem 0.29rem; font-size: 1.43rem; border-radius: 0.93rem; }
.calc-display { padding: 1.14rem 1rem; min-height: 6rem; }
.calc-display .cd-val { font-size: 2.29rem; }

/* ===== 14. 溢出保护 ===== */
.page, .page .scroll-area,
.custom-modal, .custom-modal-card, .custom-modal-body,
.table-scroll, body { overflow-x: hidden; }

/* ===== 15. 极窄屏 ===== */
@media (max-width: 360px) { html { font-size: 12px; } }
