:root { --top-speed: 20s; --top-color-speed: 12s; --card-speed: 6s; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; overflow: hidden; height: 100%; }
body { font-family: -apple-system, "Microsoft YaHei", sans-serif; background: #f0f2f5; color: #222; font-size: 14px; }

.top-marquee { background: linear-gradient(90deg,#1a73e8,#7b1fa2,#e91e63,#e37400,#1e8e3e,#1a73e8); background-size: 300% 100%; animation: gradientMove var(--top-color-speed,12s) ease infinite; height: 42px; display: flex; align-items: center; justify-content: center; overflow: hidden; position: sticky; top: 0; z-index: 50; }
@keyframes gradientMove { 0%{background-position:0% 50%} 50%{background-position:100% 50%} 100%{background-position:0% 50%} }
.top-marquee > span#marqueeText { color: #fff; font-size: 14px; font-weight: 700; letter-spacing: 1px; text-shadow: 0 1px 3px rgba(0,0,0,.25); white-space: nowrap; padding-left: 100%; animation: marquee var(--top-speed,20s) linear infinite; display: inline-block; }
@keyframes marquee { 0%{transform:translateX(0)} 100%{transform:translateX(-100%)} }

/* ============ 红绿灯（独立定位） ============ */
.status-ring {
  position: fixed !important;
  left: 12px !important;
  top: 13px !important;
  transform: none !important;
  width: 16px !important; height: 16px !important;
  min-width: 16px !important; min-height: 16px !important;
  max-width: 16px !important; max-height: 16px !important;
  padding: 0 !important; margin: 0 !important;
  border-radius: 50% !important;
  border: 2px solid rgba(255,255,255,.9) !important;
  background: transparent !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  z-index: 9999 !important;
  pointer-events: none !important;
  animation: none !important;
}
.status-ring .status-dot {
  width: 6px !important; height: 6px !important;
  min-width: 6px !important; min-height: 6px !important;
  padding: 0 !important; margin: 0 !important;
  border-radius: 50% !important;
  background: #1e8e3e !important;
  display: block !important;
  animation: none !important;
}
body.err-mode .status-ring .status-dot,
.status-ring.err .status-dot { background: #d93025 !important; }

.page { display: none; padding: 14px; max-width: 600px; margin: 0 auto; min-height: calc(100vh - 42px); padding-bottom: 40px; }
.page.active { display: block; }
.page:not(.fixed-layout).active { height: calc(100vh - 42px); overflow-y: auto; -webkit-overflow-scrolling: touch; box-sizing: border-box; padding-bottom: 40px; }
.page.fixed-layout { padding: 0; height: calc(100vh - 42px); display: none; flex-direction: column; overflow: hidden; }
.page.fixed-layout.active { display: flex; }
.page.fixed-layout .fixed-top { flex: 0 0 auto; padding: 12px 14px 8px; background: #f0f2f5; }
.page.fixed-layout .scroll-area { flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 0 14px 20px; }
.page.fixed-layout .fixed-bottom { flex: 0 0 auto; padding: 10px 14px; padding-bottom: calc(10px + env(safe-area-inset-bottom)); background: #f0f2f5; border-top: 1px solid #e6e9ef; }

#pageHome.active { min-height: 100vh; overflow-y: auto; display: flex; flex-direction: column; padding: min(3vw, 16px) min(3vw, 16px) min(12vw, 60px) min(3vw, 16px); gap: min(3vw, 14px); box-sizing: border-box; max-width: 500px; margin: 0 auto; width: 100%; background: #f0f2f5; }
.home-wrap { display: flex; flex-direction: column; gap: min(3vw, 14px); flex: none; width: 100%; }
.home-card { position: relative; border-radius: min(4vw, 16px); padding: min(3vw, 14px) min(4vw, 18px); color: #fff; cursor: pointer; box-shadow: 0 min(2vw, 8px) min(4vw, 20px) min(-2vw, -10px) rgba(0,0,0,.34); overflow: hidden; display: flex; align-items: center; gap: min(3vw, 14px); flex: none; width: 100%; height: min(26vw, 145px); box-sizing: border-box; }
.home-card:active { transform: scale(0.98); }
.home-card .hc-icon { font-size: min(8vw, 36px); line-height: 1; flex-shrink: 0; }
.home-card .hc-text { flex: 1; }
.home-card .hc-title { font-size: min(5vw, 22px); font-weight: 800; letter-spacing: min(.2vw, 1px); margin: 0 0 min(1vw, 4px); }
.home-card .hc-sub { font-size: min(3vw, 13px); opacity: .88; line-height: 1.4; }
.home-card .hc-arrow { font-size: min(5vw, 22px); opacity: .65; flex-shrink: 0; }
.home-card.personal { background: linear-gradient(90deg,#1a73e8,#4a9eff,#7b1fa2,#1a73e8); background-size: 300% 100%; animation: cardBgShift var(--card-speed,6s) linear infinite; }
.home-card.biz { background: linear-gradient(90deg,#1e8e3e,#4caf50,#00c853,#1e8e3e); background-size: 300% 100%; animation: cardBgShift var(--card-speed,6s) linear infinite; }
.home-card.credit { background: linear-gradient(90deg,#d93025,#f4511e,#ff8a65,#d93025); background-size: 300% 100%; animation: cardBgShift var(--card-speed,6s) linear infinite; }
.home-card.center { background: linear-gradient(90deg,#7b1fa2,#9c27b0,#e91e63,#7b1fa2); background-size: 300% 100%; animation: cardBgShift var(--card-speed,6s) linear infinite; }
.home-card.calc { background: linear-gradient(90deg,#e37400,#f7a541,#ffcc80,#e37400); background-size: 300% 100%; animation: cardBgShift var(--card-speed,6s) linear infinite; }
@keyframes cardBgShift { 0%{background-position:0% 50%} 100%{background-position:300% 50%} }
.home-row { display: grid !important; grid-template-columns: 3fr 2fr !important; gap: min(3vw, 14px) !important; flex: none; width: 100%; }
.home-row .home-card { padding: min(2.5vw, 12px) min(2vw, 10px); gap: min(2vw, 8px); height: min(20vw, 110px); }
.home-row .home-card .hc-icon { font-size: min(7vw, 30px); }
.home-row .home-card .hc-title { font-size: min(4.5vw, 18px); margin: 0; }
.home-row .home-card .hc-sub { font-size: min(2.8vw, 12px); }
.home-row .home-card.center { justify-content: center; text-align: center; padding: min(2.5vw, 12px) min(1vw, 4px); }
.home-row .home-card.center .hc-text { flex: 1; display: flex; align-items: center; justify-content: center; }
.home-rule-note { background: #f0f7ff; border-left: min(1vw, 5px) solid #1a73e8; border-radius: min(2.5vw, 12px); padding: min(2.5vw, 12px) min(3vw, 16px); flex: none; width: 100%; box-sizing: border-box; }
.home-rule-note h4 { margin: 0 0 min(1.5vw, 6px); font-size: min(3.2vw, 15px); color: #1a73e8; font-weight: 700; }
.home-rule-note p { margin: min(1vw, 4px) 0; font-size: min(2.8vw, 13px); color: #555; line-height: 1.55; }
.home-rule-note p b { color: #1a73e8; }
#pageHome .footer-note { position: fixed; bottom: 0; left: 0; right: 0; padding: min(2vw, 10px) 0; background: rgba(240,242,245,.97); border-top: 1px solid #e6e9ef; font-size: min(2.8vw, 12px); color: #aab; text-align: center; z-index: 30; max-width: 500px; margin: 0 auto; box-sizing: border-box; }

h2 { font-size: 15px; margin: 12px 0 8px; color: #333; }
.card { background: #fff; border-radius: 16px; padding: 16px; margin-bottom: 12px; box-shadow: 0 1px 5px rgba(0,0,0,.05); }
.row { display: flex; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.row label { flex: 0 0 auto; width: calc(50% - 5px); font-size: 12px; color: #555; }
input, select, textarea { padding: 10px; border: 1px solid #dcdfe6; border-radius: 10px; font-size: 15px; width: 100%; background: #fff; height: 44px; box-sizing: border-box; line-height: 22px; min-width: 0; max-width: 100%; }
textarea { height: auto; min-height: 120px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: #1a73e8; box-shadow: 0 0 0 3px rgba(26,115,232,.1); }
.module-title { font-size: 13px; font-weight: 700; color: #1a73e8; margin: 4px 0 10px; padding-left: 10px; border-left: 4px solid #1a73e8; }
.module-title.biz { color: #1e8e3e; border-left-color: #1e8e3e; }
.module-title.calc { color: #e37400; border-left-color: #e37400; }
.module-title.credit { color: #d93025; border-left-color: #d93025; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.two-col .col { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.two-col .col label { font-size: 12px; color: #555; display: flex; flex-direction: column; gap: 4px; }
.two-col .col input, .two-col .col select { padding: 8px 10px; font-size: 13px; }
.pl-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pl-two-col .pl-col { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.pl-two-col .pl-col label { font-size: 12px; color: #555; display: flex; flex-direction: column; gap: 4px; }
.pl-two-col .pl-col input, .pl-two-col .pl-col select { padding: 8px 10px; font-size: 13px; }

.btn { padding: 10px 16px; border: none; border-radius: 10px; background: #1a73e8; color: #fff; font-size: 14px; font-weight: 600; cursor: pointer; }
.btn:active { opacity: .8; }
.btn.gray { background: #eef1f5; color: #333; }
.btn.small { padding: 6px 12px; font-size: 12px; border-radius: 8px; }
.btn.red { background: #fce8e6; color: #d93025; }
.btn.green { background: #e6f4ea; color: #1e8e3e; }
.btn.biz { background: #1e8e3e; }
.btn.credit { background: #d93025; }
.btn.calc { background: #e37400; }
.btn.big { padding: 15px 20px; font-size: 16px; width: 100%; border-radius: 14px; }
.bank-wrap { display: flex; gap: 6px; min-width: 0; }
.bank-wrap select { flex: 1; min-width: 0; }

.result-box { background: #fff; border-radius: 16px; padding: 16px; margin-bottom: 12px; box-shadow: 0 1px 5px rgba(0,0,0,.05); }
.score-box { background: linear-gradient(135deg,#f0f7ff,#fff); border: 1.5px solid #d6e6ff; }
.score-box.biz { background: linear-gradient(135deg,#e8f5ec,#fff); border-color: #b7dfc4; }
.score-title { font-size: 14px; font-weight: 700; color: #1a73e8; margin: 0 0 8px; }
.score-box.biz .score-title { color: #1e8e3e; }
.score-line { display: flex; align-items: baseline; gap: 8px; margin: 6px 0 12px; }
.score-num { font-size: 42px; font-weight: 800; line-height: 1; }
.score-level { font-size: 16px; font-weight: 700; }
.score-divider { border: none; border-top: 1px dashed #d0dceb; margin: 12px 0; }
.calc-inline { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; margin-top: 4px; }
.calc-inline p { margin: 2px 0; font-size: 12px; color: #555; line-height: 1.6; }
.calc-inline b { color: #1a73e8; }
.calc-inline .hl-warn { color: #e37400; font-weight: 700; }
.calc-inline .hl-danger { color: #d93025; font-weight: 700; }
.calc-inline .hl-ok { color: #1e8e3e; font-weight: 700; }
.calc-inline .full { grid-column: 1 / -1; }
.safe { color: #1e8e3e; } .warn { color: #e37400; } .danger { color: #d93025; }
.product-item { border: 1px solid #e6e9ef; border-radius: 12px; padding: 12px; margin-bottom: 10px; background: #fafbfc; }
.product-item h3 { margin: 0 0 8px; font-size: 13px; color: #1a73e8; line-height: 1.5; }
.product-item.biz h3 { color: #1e8e3e; }
.product-item p { margin: 4px 0; font-size: 12px; color: #555; line-height: 1.6; }
.product-item.rejected { opacity: .7; }
.rate-tag { background: #fff3e0; color: #e37400; font-weight: 700; padding: 2px 8px; border-radius: 6px; font-size: 11px; }
.empty { text-align: center; color: #999; padding: 30px 0; font-size: 13px; }
.warn-list { background: #fff8e1; border-radius: 10px; padding: 10px 12px; margin-top: 4px; }
.warn-list p { font-size: 12px; color: #e37400; margin: 3px 0; }

/* 结果页三块折叠 */
.fold-block h2 { cursor: pointer; user-select: none; transition: color .2s; margin-top: 0; }
.fold-block h2:hover { color: #1a73e8; }
.fold-block.expanded h2 { color: #1a73e8; }
.fold-content { margin-top: 8px; }

/* 同类型客户 */
.similar-item:hover { background: #eef1f5 !important; }
.similar-customers-box { font-size: 13px; }
#similarDetailBox table tr:hover { background: #f8f9fc; }

.back-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.back-bar button { background: #fff; border: 1px solid #dcdfe6; border-radius: 10px; padding: 8px 14px; font-size: 14px; cursor: pointer; color: #333; }
.back-bar .bb-title { font-size: 18px; font-weight: 800; color: #222; }
.back-bar .bb-title.biz { color: #1e8e3e; }
.back-bar .bb-title.calc { color: #e37400; }
.back-bar .bb-title.credit { color: #d93025; }

.sub-tab { display: flex; gap: 6px; margin-bottom: 12px; background: #fff; padding: 6px; border-radius: 14px; box-shadow: 0 1px 5px rgba(0,0,0,.05); flex-wrap: wrap; }
.sub-tab button { flex: 1; padding: 10px 4px; border: none; background: none; border-radius: 10px; font-size: 12.5px; color: #666; cursor: pointer; font-weight: 600; min-width: 60px; }
.sub-tab button.active { background: #1a73e8; color: #fff; }
.sub-page { display: none; } .sub-page.active { display: block; }

.custom-modal { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.55); z-index: 9998; display: none; align-items: center; justify-content: center; padding: 20px; }
.custom-modal.show { display: flex; }
.custom-modal-card { background: #fff; border-radius: 20px; padding: 24px; width: 100%; max-width: 400px; display: flex; flex-direction: column; max-height: 84vh; }
.custom-modal-card.wide { max-width: 620px; }
.custom-modal-title { margin: 0 0 16px; font-size: 17px; color: #222; text-align: center; font-weight: 700; }
.custom-modal-body { flex: 1; overflow-y: auto; }
.custom-modal-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.custom-modal-actions .btn { flex: 1; min-width: 80px; }

.calc-display { background: #1c2333; color: #fff; border-radius: 16px; padding: 18px 16px; text-align: right; margin-bottom: 12px; min-height: 96px; display: flex; flex-direction: column; justify-content: flex-end; }
.calc-display .cd-expr { font-size: 13px; color: #8899bb; min-height: 18px; }
.calc-display .cd-val { font-size: 36px; font-weight: 700; line-height: 1.2; }
.calc-keys { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; }
.calc-keys button { padding: 18px 4px; border: none; border-radius: 14px; font-size: 20px; font-weight: 700; cursor: pointer; background: #e8eaed; color: #222; }
.calc-keys button:active { opacity: .55; }
.calc-keys button.op { background: #d2e3fc; color: #1a73e8; }
.calc-keys button.eq { background: #1a73e8; color: #fff; }
.calc-keys button.fn { background: #ffe0b2; color: #e37400; font-size: 17px; }
.calc-keys button.danger { background: #fce8e6; color: #d93025; font-size: 17px; }
.conv-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.conv-row span { flex: 0 0 100px; font-size: 12px; color: #666; }
.conv-row input { flex: 1; padding: 8px 10px; font-size: 14px; min-width: 0; }
.conv-row em { font-size: 12px; color: #999; font-style: normal; flex: 0 0 30px; }

.plan-table { width: 100%; border-collapse: collapse; font-size: 12px; table-layout: auto; }
.plan-table th, .plan-table td { border: 1px solid #e6e9ef; padding: 6px 4px; text-align: center; white-space: nowrap; }
.plan-table th { background: #f5f7fa; font-weight: 600; color: #555; white-space: nowrap; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -16px; padding: 0 16px; }
.cp-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.cp-table th, .cp-table td { border: 1px solid #e6e9ef; padding: 4px 2px; text-align: center; font-size: 11px; overflow: hidden; }
.cp-table th { background: #f5f7fa; font-weight: 600; color: #555; }
.cp-table input, .cp-table select { padding: 5px 3px; font-size: 11px; border-radius: 6px; width: 100%; box-sizing: border-box; height: 32px; }
.cp-table .cp-del button { border: none; background: none; color: #d93025; font-size: 18px; cursor: pointer; padding: 0; }
.product-scroll { max-height: 62vh; overflow-y: auto; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.product-scroll .plan-table { border-collapse: separate; border-spacing: 0; }
.product-scroll .plan-table thead th { position: sticky; top: 0; z-index: 2; background: #f5f7fa; }
.product-scroll .plan-table thead th:first-child, .product-scroll .plan-table tbody td:first-child { position: sticky; left: 0; z-index: 5; background: #e8f0fe; text-align: center; padding: 8px 4px; min-width: 44px; width: 44px; }
.product-scroll .plan-table tbody td:first-child { color: #1a73e8; font-weight: 700; font-size: 13px; }

.calc-summary { background: #fff6ec; border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; }
.calc-summary p { margin: 4px 0; font-size: 13px; }
.calc-summary .big { font-size: 26px; font-weight: 800; color: #e37400; }

.biz-summary-card, .pl-summary-card { background: #f8f9fc; border-radius: 12px; padding: 12px 14px; cursor: pointer; border: 1px solid #e6e9ef; }
.biz-summary-card:active, .pl-summary-card:active { background: #eef1f5; }
.biz-summary-card .bsc-title, .pl-summary-card .bsc-title { font-size: 13px; font-weight: 600; color: #333; margin-bottom: 6px; display: flex; justify-content: space-between; align-items: center; }
.biz-summary-card .bsc-line, .pl-summary-card .bsc-line { font-size: 12px; color: #555; line-height: 1.6; margin: 2px 0; }
.biz-summary-card .bsc-line b { color: #1e8e3e; }
.pl-summary-card .bsc-line b { color: #1a73e8; }
.bsc-warn { color: #e37400; font-weight: 700; }
.bsc-danger { color: #d93025; font-weight: 700; }
.bsc-empty { color: #999; }
.bsc-arrow { font-size: 16px; color: #888; }

.biz-debt-block, .pl-debt-block, .pl-asset-block { margin-bottom: 14px; padding: 10px 12px; background: #fafbfc; border-radius: 10px; border: 1px solid #eef1f5; }
.biz-debt-block .bdb-title { font-size: 12.5px; font-weight: 700; color: #1e8e3e; margin: 0 0 8px; padding-left: 8px; border-left: 3px solid #1e8e3e; }
.pl-debt-block .bdb-title, .pl-asset-block .bdb-title { font-size: 12.5px; font-weight: 700; color: #1a73e8; margin: 0 0 8px; padding-left: 8px; border-left: 3px solid #1a73e8; }
.biz-debt-row, .pl-debt-row, .pl-asset-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.biz-debt-row.two, .pl-debt-row.two, .pl-asset-row.two { grid-template-columns: 1fr 1fr; }
.biz-debt-row.one, .pl-debt-row.one, .pl-asset-row.one { grid-template-columns: 1fr; }
.biz-debt-row label, .pl-debt-row label, .pl-asset-row label { font-size: 11px; color: #555; display: flex; flex-direction: column; gap: 3px; min-height: 52px; justify-content: flex-start; line-height: 1.35; min-width: 0; }
.biz-debt-row label span, .pl-debt-row label span, .pl-asset-row label span { display: block; min-height: 30px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.biz-debt-row input, .pl-debt-row input, .pl-asset-row input { margin-top: auto; padding: 7px 8px; font-size: 13px; border-radius: 8px; }

.bank-check-toggle { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; background: #f8f9fc; border-radius: 12px; cursor: pointer; }
.bank-check-toggle .bct-label { font-size: 13px; font-weight: 600; color: #333; }
.bank-check-toggle .bct-label b { color: #1a73e8; }
.bank-check-toggle .bct-arrow { font-size: 16px; color: #888; }
.bank-mini-toggle { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; background: #fff; border-radius: 10px; border: 1px solid #e6e9ef; cursor: pointer; }
.bank-mini-toggle .bmt-label { font-size: 12.5px; font-weight: 600; color: #333; }
.bank-mini-toggle .bmt-label b { color: #1e8e3e; }
.bank-mini-toggle .bmt-arrow { font-size: 14px; color: #888; }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 3px; background: #e8f0fe; padding: 0; min-height: 0; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: #1a73e8; cursor: pointer; }

#bankModalGrid, #bizBanksCorpGrid, #bizBanksPerGrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; padding-bottom: 8px; }
#bankModalGrid label, #bizBanksCorpGrid label, #bizBanksPerGrid label { display: flex; flex-direction: row; align-items: center; gap: 8px; font-size: 13px; padding: 8px 10px; background: #fff; border: 1px solid #e6e9ef; border-radius: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; cursor: pointer; min-height: 40px; box-sizing: border-box; }
#bankModalGrid label.checked, #bizBanksCorpGrid label.checked, #bizBanksPerGrid label.checked { background: #e8f0fe; border-color: #1a73e8; }
input[type="checkbox"], input[type="radio"] { width: 18px !important; height: 18px !important; min-width: 18px !important; padding: 0 !important; margin: 0 !important; flex-shrink: 0; accent-color: #1a73e8; cursor: pointer; }

.credit-upload { border: 2px dashed #cbd5e1; border-radius: 12px; padding: 26px 16px; text-align: center; cursor: pointer; background: #fff; display: block; }
.credit-upload.drag { border-color: #d93025; background: #fef2f2; }
.credit-upload .big { font-size: 15px; font-weight: 700; margin-bottom: 4px; color: #d93025; }
.credit-upload .sm { font-size: 12px; color: #888; }
.credit-page-item { background: #f8fafc; border-radius: 8px; padding: 8px 10px; margin-bottom: 6px; font-size: 12px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.credit-page-item .cpi-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.credit-page-item.ok { border-left: 3px solid #1e8e3e; }
.credit-page-item.err { border-left: 3px solid #d93025; background: #fef2f2; }
.credit-page-item.busy { border-left: 3px solid #1a73e8; }
.cpi-status { font-size: 11px; color: #888; flex-shrink: 0; }
.cpi-status.ok { color: #1e8e3e; font-weight: 700; }
.cpi-status.err { color: #d93025; font-weight: 700; }
.credit-kv { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; margin-top: 6px; }
.credit-kv p { margin: 2px 0; font-size: 12px; color: #555; }
.credit-kv p b { color: #1a73e8; }
.credit-kv .full { grid-column: 1 / -1; }
.mask-badge { display: inline-block; background: #e8f0fe; color: #1a73e8; font-size: 10px; padding: 1px 6px; border-radius: 6px; margin-left: 6px; }

/* 相机弹窗 */
.credit-cam-modal { position: fixed; inset: 0; background: #000; z-index: 9999; display: none; flex-direction: column; touch-action: none; }
.credit-cam-modal.show { display: flex; }
.credit-cam-modal video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.credit-cam-overlay { position: relative; flex: 1; display: flex; flex-direction: column; justify-content: space-between; padding: 16px; padding-top: calc(16px + env(safe-area-inset-top)); padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
.credit-cam-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; z-index: 10; }
.credit-cam-top button { background: rgba(0,0,0,.55); color: #fff; border: none; border-radius: 50%; width: 42px; height: 42px; font-size: 20px; cursor: pointer; padding: 0; flex-shrink: 0; }
.credit-cam-hint { flex: 1; text-align: center; font-size: 12px; color: #fff; background: rgba(0,0,0,.55); padding: 6px 12px; border-radius: 14px; margin: 0 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; letter-spacing: .5px; }
.credit-cam-frame { position: absolute; left: 5%; right: 5%; top: 15%; height: 30vh; min-height: 160px; max-height: 240px; border: 2px dashed rgba(0,255,150,.85); border-radius: 12px; pointer-events: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,.72); background: rgba(0,255,150,.05); z-index: 5; }
.credit-cam-frame::after { content: "只拍一个账户的表头"; position: absolute; left: 50%; bottom: -36px; transform: translateX(-50%); color: #00ff96; font-size: 12px; font-weight: 700; white-space: nowrap; background: rgba(0,0,0,.75); padding: 4px 12px; border-radius: 10px; letter-spacing: .5px; }
.credit-cam-bottom { display: flex; justify-content: center; align-items: center; position: relative; z-index: 10; }
.credit-shoot-btn { width: 72px; height: 72px; border-radius: 50%; background: #fff; border: 4px solid rgba(255,255,255,.4); box-shadow: 0 0 0 3px rgba(0,0,0,.4); cursor: pointer; padding: 0; }
.credit-shoot-btn:active { transform: scale(.92); }
.credit-shoot-btn:disabled { opacity: .5; }
.credit-cam-tip { position: absolute; bottom: -26px; left: 50%; transform: translateX(-50%); color: #fff; font-size: 12px; opacity: .85; white-space: nowrap; }

.credit-load-tabs { display: flex; gap: 6px; margin-bottom: 12px; background: #f5f7fa; padding: 4px; border-radius: 10px; }
.credit-load-tabs button { flex: 1; padding: 10px 8px; border: none; background: none; border-radius: 8px; font-size: 13px; font-weight: 600; color: #666; cursor: pointer; }
.credit-load-tabs button.active { background: #1a73e8; color: #fff; }
.credit-load-tabs button.active.biz { background: #1e8e3e; }
.credit-load-toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; padding: 8px 10px; background: #f8fafc; border-radius: 8px; }
.credit-load-toolbar .btn { padding: 5px 12px; font-size: 12px; min-height: 30px; border-radius: 6px; }
.credit-load-toolbar .credit-sel-count { margin-left: auto; font-size: 12px; color: #888; }
.credit-load-toolbar .credit-sel-count b { color: #1a73e8; font-size: 14px; }
.credit-field-group { margin-bottom: 14px; }
.credit-field-group-title { font-size: 12px; font-weight: 700; color: #1a73e8; padding: 4px 8px; background: #f0f6ff; border-radius: 6px; margin-bottom: 6px; }
.credit-field-group-title.biz { color: #1e8e3e; background: #e8f5ec; }
.credit-field-item { display: flex !important; flex-direction: row !important; align-items: center !important; gap: 10px !important; padding: 8px 10px !important; background: #fafbfc !important; border: 1px solid #eef1f5 !important; border-radius: 8px !important; margin-bottom: 5px !important; cursor: pointer; width: 100% !important; }
.credit-field-item.checked { background: #e8f0fe !important; border-color: #1a73e8 !important; }
.credit-field-item .cfi-name { flex: 1; font-size: 13px; color: #333; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.credit-field-item .cfi-val { font-size: 13px; font-weight: 700; color: #1a73e8; flex-shrink: 0; }
.credit-field-item .cfi-val.empty { color: #ccc; font-weight: 400; }

.footer-note { text-align: center; font-size: 11px; color: #aab; padding: 16px 0 8px; }

/* ============ 登录界面 ============ */
.login-page { position: fixed; inset: 0; z-index: 99998; background: linear-gradient(135deg, #1a73e8 0%, #7b1fa2 100%); display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { background: #fff; border-radius: 20px; padding: 32px 24px 20px; width: 100%; max-width: 360px; box-shadow: 0 20px 60px -20px rgba(0,0,0,.5); }
.login-logo { text-align: center; font-size: 48px; line-height: 1; margin-bottom: 8px; }
.login-title { text-align: center; font-size: 20px; font-weight: 800; color: #1a73e8; margin: 0 0 4px; }
.login-sub { text-align: center; font-size: 12px; color: #888; margin: 0 0 20px; }
.login-card input[type="text"], .login-card input[type="password"] { margin-bottom: 10px; font-size: 14px; }
.login-remember { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #666; margin: 4px 0 14px; cursor: pointer; }
.login-remember input { width: auto !important; height: auto !important; min-width: 0 !important; }
.login-tip { text-align: center; font-size: 12px; min-height: 18px; margin-top: 10px; color: #d93025; }
.login-footer { text-align: center; font-size: 11px; color: #aab; margin-top: 16px; }

/* ============ 账户管理 ============ */
.acc-item { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; background: #f8f9fc; border-radius: 8px; margin-bottom: 6px; font-size: 13px; gap: 8px; }
.acc-item .acc-name { font-weight: 600; color: #333; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-item .acc-role { font-size: 11px; padding: 2px 8px; border-radius: 6px; background: #e8f0fe; color: #1a73e8; }
.acc-item .acc-role.admin { background: #fce8e6; color: #d93025; }
.acc-item .acc-actions { display: flex; gap: 4px; flex-shrink: 0; }
.acc-item button { padding: 4px 10px; border: none; border-radius: 6px; font-size: 11px; cursor: pointer; background: #eef1f5; color: #333; }
.acc-item button.danger { background: #fce8e6; color: #d93025; }

/* ============ 日志条目 ============ */
.log-item { padding: 8px 10px; background: #f8f9fc; border-radius: 6px; margin-bottom: 5px; font-size: 12px; line-height: 1.6; }
.log-item .log-time { color: #888; font-size: 11px; }
.log-item .log-type { display: inline-block; padding: 1px 6px; border-radius: 4px; background: #e8f0fe; color: #1a73e8; font-size: 10px; margin-right: 6px; }

/* ============ 新增贷款独立页 ============ */
#newLoanTable select, #newLoanTable input { width: 100%; font-size: 11px; padding: 4px 2px; height: 28px; border-radius: 6px; }
#newLoanTable th, #newLoanTable td { padding: 4px 2px; font-size: 11px; }

/* ============ 录入页折叠头 ============ */
.form-fold-header { transition: background .2s; }
.form-fold-header:active { background: #f0f7ff !important; }

/* ============ 大额分期行对齐 ============ */
div[style*="flex-wrap:nowrap"][style*="color:#888"][style*="margin-left:-2px"] { margin-left: -16px !important; }

@media (max-width: 560px) {
  .page { padding: 12px; }
  .custom-modal { padding: 10px; }
  .custom-modal-card { padding: 18px; max-height: 90vh; }
  .custom-modal-card.wide { max-width: 100%; }
  .custom-modal-actions { flex-direction: row !important; gap: 8px !important; }
  .custom-modal-actions .btn { flex: 1 !important; min-height: 44px !important; }
  #bankModalGrid, #bizBanksCorpGrid, #bizBanksPerGrid { grid-template-columns: 1fr 1fr !important; gap: 6px !important; }
  .calc-display .cd-val { font-size: 30px; }
  .calc-keys button { padding: 15px 4px; font-size: 18px; }
  .score-num { font-size: 36px; }
  .back-bar { gap: 6px; }
  .back-bar button { padding: 7px 12px; font-size: 13px; }
  .back-bar .bb-title { font-size: 16px; }
  .sub-tab button { font-size: 12px; padding: 8px 4px; min-width: 0; }
}
/* ============ 合同存档模块 ============ */
.contract-drop { border:2px dashed #cbd5e1; border-radius:10px; padding:24px; text-align:center; color:#888; cursor:pointer; background:#fff; }
.contract-drop.drag { border-color:#1a73e8; background:#f0f7ff; }
.contract-preview { display:grid; grid-template-columns:repeat(auto-fill,minmax(80px,1fr)); gap:6px; margin-top:8px; }
.contract-preview img { width:100%; border-radius:6px; border:1px solid #ddd; }
.contract-field-grid { display:grid; grid-template-columns:120px 1fr; gap:6px 10px; padding:10px; background:#f0f7ff; border-radius:8px; font-size:12px; }
.contract-field-grid .k { color:#555; }
.contract-field-grid input { width:100%; padding:4px 6px; font-size:12px; margin:0; }
.contract-list-item { display:flex; justify-content:space-between; align-items:center; padding:10px 12px; background:#f8f9fc; border-radius:8px; margin-bottom:6px; font-size:13px; gap:8px; }
.contract-list-item .cli-title { font-weight:600; color:#333; flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.contract-list-item .cli-meta { font-size:11px; color:#888; flex-shrink:0; }
.contract-view-img { width:100%; border-radius:8px; border:1px solid #ddd; margin-bottom:8px; cursor:pointer; }

/* ============ 弹窗层级修复 ============ */
#confirmModal,
#pwdModal,
#saveModal,
#diagModal {
  z-index: 100000 !important;
}
#logsModal,
#fixHistoryModal,
#autoCalcModal,
#planDetailModal {
  z-index: 9998 !important;
}
#cloudUpdateModal,
#contractUploadModal,
#contractListModal,
#contractViewModal,
#newAccountModal {
  z-index: 99990 !important;
}
#imageCategoryModal,
#creditCamModal {
  z-index: 100000 !important;
}