/* ==========================================================
   家庭记账 · 样式
   ========================================================== */
:root{
  --bg:#f4f5f9;
  --card:#ffffff;
  --line:#eaecf2;
  --line-strong:#dfe3ec;
  --text:#111827;
  --muted:#6b7280;
  --muted-2:#9ca3af;
  --brand:#4f46e5;
  --brand-2:#7c3aed;
  --pos:#059669;
  --neg:#e11d48;
  /* 股票页涨跌色（红涨绿跌，见文件末尾的股票配色段） */
  --stock-up:#dc2626;
  --stock-down:#16a34a;
  --radius:16px;
  --radius-lg:20px;
  --shadow:0 1px 2px rgba(16,24,40,.04), 0 10px 28px -16px rgba(16,24,40,.22);
  --sidebar-w:236px;
  --font:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Hiragino Sans GB","Microsoft YaHei",sans-serif;
}

*{box-sizing:border-box}
[hidden]{display:none !important}
html,body{margin:0;padding:0}
body{
  font-family:var(--font);
  background:var(--bg);
  color:var(--text);
  font-size:14px;
  line-height:1.6;
  -webkit-font-smoothing:antialiased;
}
h1,h2,h3{margin:0;font-weight:600;letter-spacing:.01em}
a{color:inherit;text-decoration:none}
button{font-family:inherit}
.muted{color:var(--muted)}
.small{font-size:12px}
.nowrap{white-space:nowrap}
.ta-r{text-align:right}
.mt{margin-top:20px}
.money{font-variant-numeric:tabular-nums;font-weight:600;letter-spacing:.01em}
.money.pos,.pos{color:var(--pos)}
.money.neg,.neg{color:var(--neg)}

/* ---------------- 布局 ---------------- */
.app{display:flex;min-height:100vh}
.sidebar{
  width:var(--sidebar-w);
  flex:0 0 var(--sidebar-w);
  background:linear-gradient(170deg,#1e1b4b 0%,#312e81 55%,#3b0764 100%);
  color:#c7d2fe;
  display:flex;flex-direction:column;
  padding:22px 14px;
  position:sticky;top:0;height:100vh;
}
.brand{display:flex;align-items:center;gap:11px;padding:4px 8px 22px}
.brand-mark{
  width:38px;height:38px;border-radius:12px;
  background:linear-gradient(135deg,#818cf8,#c084fc);
  color:#fff;font-weight:700;font-size:17px;
  display:grid;place-items:center;
  box-shadow:0 6px 18px -6px rgba(129,140,248,.9);
}
.brand-text{display:flex;flex-direction:column;line-height:1.25}
.brand-text strong{color:#fff;font-size:15px}
.brand-text span{font-size:11px;color:#a5b4fc;letter-spacing:.06em}
.nav{display:flex;flex-direction:column;gap:3px;flex:1}
.nav-item{
  display:flex;align-items:center;gap:11px;
  padding:10px 12px;border-radius:11px;
  font-size:14px;color:#c7d2fe;
  transition:background .16s,color .16s;
}
.nav-item:hover{background:rgba(255,255,255,.08);color:#fff}
.nav-item.is-on{background:rgba(255,255,255,.14);color:#fff;box-shadow:inset 0 0 0 1px rgba(255,255,255,.12)}
.sidebar-foot{border-top:1px solid rgba(255,255,255,.12);padding-top:12px;margin-top:12px}
.me{display:flex;align-items:center;gap:10px;padding:6px 8px 12px}
.avatar{
  width:32px;height:32px;border-radius:50%;
  background:rgba(255,255,255,.16);color:#fff;
  display:grid;place-items:center;font-size:13px;font-weight:600;flex:0 0 32px;
}
.me-text{display:flex;flex-direction:column;line-height:1.25;overflow:hidden}
.me-text strong{color:#fff;font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.me-text span{font-size:11px;color:#a5b4fc}

.main{flex:1;min-width:0;display:flex;flex-direction:column}
.topbar{
  display:flex;align-items:center;gap:14px;
  padding:18px 28px;background:rgba(244,245,249,.86);
  backdrop-filter:saturate(1.4) blur(8px);
  position:sticky;top:0;z-index:20;
  border-bottom:1px solid var(--line);
}
.page-title{font-size:19px;flex:1}
.topbar-actions{display:flex;gap:10px}
.content{padding:22px 28px 60px;display:flex;flex-direction:column;gap:18px}

/* ---------------- 卡片 ---------------- */
.card{
  background:var(--card);border:1px solid var(--line);
  border-radius:var(--radius);padding:20px;
  box-shadow:var(--shadow);
}
.card-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px}
.card-title{font-size:15px}
.link{color:var(--brand);font-size:13px;display:inline-flex;align-items:center;gap:4px}
.empty{color:var(--muted);font-size:13px;padding:18px 0;text-align:center}

/* ---------------- 总览 hero ---------------- */
.hero{
  display:flex;gap:20px;flex-wrap:wrap;
  background:linear-gradient(125deg,#4338ca 0%,#6d28d9 48%,#a21caf 100%);
  color:#fff;border-radius:var(--radius-lg);padding:26px 28px;
  box-shadow:0 22px 46px -24px rgba(76,29,149,.75);
}
.hero-main{flex:1 1 300px;min-width:260px}
.hero-label{font-size:12.5px;color:#ddd6fe;letter-spacing:.04em}
.hero-value{display:block;font-size:34px;line-height:1.25;margin:6px 0 16px;font-variant-numeric:tabular-nums}
.hero-split{display:flex;gap:28px}
.hero-split div{display:flex;flex-direction:column}
.hero-split span{font-size:12px;color:#ddd6fe}
.hero-split b{font-size:16px;font-variant-numeric:tabular-nums}
/* 「不含房贷」视角：hero 里单独一块，避免大额房贷把真实财务状况盖住 */
.hero-exmort{
  display:flex;flex-direction:column;gap:3px;margin-top:16px;padding:11px 14px;
  border-radius:12px;background:rgba(255,255,255,.15);
  border:1px solid rgba(255,255,255,.26);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.18);
}
.hero-exmort-main{display:flex;align-items:baseline;gap:12px;flex-wrap:wrap}
.hero-exmort-main span{font-size:12.5px;color:#ede9fe;letter-spacing:.03em}
.hero-exmort-main b{font-size:23px;font-variant-numeric:tabular-nums;letter-spacing:-.01em}
.hero-exmort-note{font-size:11.5px;color:#ddd6fe;font-variant-numeric:tabular-nums}
.hero-side{
  flex:0 1 220px;min-width:180px;
  background:rgba(255,255,255,.12);border-radius:14px;padding:14px 16px;
  display:flex;flex-direction:column;gap:8px;
  backdrop-filter:blur(4px);
}
.hero-cur{display:flex;justify-content:space-between;align-items:baseline;font-size:13px}
.hero-cur span{color:#ddd6fe}
.hero-cur b{font-variant-numeric:tabular-nums}
.warn-note{font-size:11.5px;color:#fde68a;margin:2px 0 0}

/* ---------------- 统计 ---------------- */
.grid{display:grid;gap:14px}
.grid-3{grid-template-columns:repeat(3,minmax(0,1fr))}
.grid-4{grid-template-columns:repeat(4,minmax(0,1fr))}
.grid-auto{grid-template-columns:repeat(auto-fill,minmax(196px,1fr))}
.stat{display:flex;flex-direction:column;gap:3px;padding:16px 18px}
.stat.card{padding:16px 18px}
.stat-label{font-size:12.5px;color:var(--muted)}
.stat-value{font-size:21px;font-variant-numeric:tabular-nums;font-weight:650}
.stat-sub{font-size:11.5px;color:var(--muted-2)}
/* 关键指标卡（净资产 · 不含房贷） */
.stat-key{position:relative;border-color:#e4e2fb;background:linear-gradient(180deg,#faf9ff 0%,#fff 72%)}
.stat-key::before{
  content:"";position:absolute;left:0;top:14px;bottom:14px;width:3px;border-radius:0 3px 3px 0;
  background:linear-gradient(180deg,#818cf8,#c084fc);
}
.two-col{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}

/* ---------------- 按钮 ---------------- */
.btn{
  display:inline-flex;align-items:center;gap:6px;justify-content:center;
  padding:9px 15px;border-radius:11px;border:1px solid transparent;
  font-size:13.5px;font-weight:550;cursor:pointer;
  transition:transform .12s,box-shadow .16s,background .16s;
  white-space:nowrap;
}
.btn:active{transform:translateY(1px)}
.btn-primary{
  background:linear-gradient(135deg,var(--brand),var(--brand-2));color:#fff;
  box-shadow:0 8px 20px -10px rgba(79,70,229,.95);
}
.btn-primary:hover{box-shadow:0 10px 24px -10px rgba(79,70,229,1)}
.btn-ghost{background:#fff;border-color:var(--line-strong);color:var(--muted)}
.btn-ghost:hover{border-color:#c7cbd8;color:var(--text)}
.btn-danger{background:#fff1f2;color:var(--neg);border-color:#fecdd3}
.btn-sm{padding:6px 11px;font-size:12.5px}
.btn-block{width:100%}
.icon-btn{
  display:inline-grid;place-items:center;width:32px;height:32px;
  border-radius:9px;border:1px solid transparent;background:transparent;
  color:var(--muted);cursor:pointer;
}
.icon-btn:hover{background:#f3f4f7;color:var(--text)}
.icon-btn.danger:hover{background:#fff1f2;color:var(--neg)}

/* ---------------- 表格 ---------------- */
.table{width:100%;border-collapse:collapse;font-size:13.5px}
.table th{
  text-align:left;font-weight:500;color:var(--muted);font-size:12px;
  padding:8px 10px;border-bottom:1px solid var(--line);
}
.table td{padding:10px;border-bottom:1px solid #f3f4f7;vertical-align:middle}
.table tbody tr:last-child td{border-bottom:none}
.table-compact td{padding:7px 10px}
.table .ta-r{text-align:right}

/* ---------------- 流水列表 ---------------- */
.tx-list{list-style:none;margin:0;padding:0}
.tx-item{display:flex;align-items:center;gap:13px;padding:11px 2px;border-bottom:1px solid #f3f4f7}
.tx-item:last-child{border-bottom:none}
.tx-icon{
  width:38px;height:38px;border-radius:12px;flex:0 0 38px;
  background:linear-gradient(135deg,#eef2ff,#f5f3ff);
  display:grid;place-items:center;font-size:17px;
}
.tx-main{flex:1;min-width:0;display:flex;flex-direction:column;line-height:1.45}
.tx-main strong{font-size:13.5px;font-weight:600}
.tx-main span{font-size:12px}
.tx-amt{font-size:14px;white-space:nowrap}

/* ---------------- 账户 ---------------- */
.page-actions{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap}
.kind-block{display:flex;flex-direction:column;gap:12px}
.kind-title{font-size:14px;color:var(--muted);letter-spacing:.08em;padding-left:2px}
.type-block{display:flex;flex-direction:column;gap:9px}
.type-head{display:flex;align-items:center;gap:8px;font-size:13px;padding-left:2px}
.type-icon{font-size:14px}
.type-name{font-weight:600}
.type-count{font-size:11.5px;color:var(--muted-2);background:#f3f4f7;border-radius:20px;padding:1px 8px}
.acct-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(268px,1fr));gap:14px}
.acct-card{
  background:#fff;border:1px solid var(--line);border-radius:var(--radius);
  padding:16px 18px;box-shadow:var(--shadow);cursor:pointer;
  transition:transform .14s,box-shadow .2s,border-color .2s;
  display:flex;flex-direction:column;gap:12px;
}
.acct-card:hover{transform:translateY(-2px);border-color:#dcd9fb;box-shadow:0 16px 34px -18px rgba(79,70,229,.42)}
.acct-card header{display:flex;gap:11px;align-items:flex-start}
.acct-ico{
  width:36px;height:36px;border-radius:11px;flex:0 0 36px;
  background:linear-gradient(135deg,#eef2ff,#ede9fe);display:grid;place-items:center;font-size:16px;
}
.acct-name{display:flex;flex-direction:column;gap:5px;min-width:0}
.acct-name strong{font-size:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.acct-tags{display:flex;gap:5px;flex-wrap:wrap}
.acct-bal{display:flex;flex-direction:column;gap:2px}
.acct-bal .muted{font-size:11.5px}
.acct-bal strong{font-size:19px}
.acct-note{font-size:12px;margin:0}
.badge{
  font-size:11px;padding:2px 8px;border-radius:20px;
  background:#f3f4f7;color:var(--muted);white-space:nowrap;
}
.badge-domestic{background:#ecfdf5;color:#047857}
.badge-overseas{background:#eff6ff;color:#1d4ed8}
.badge-cur{background:#f5f3ff;color:#6d28d9}
.badge-share{background:#fff7ed;color:#c2410c}
.badge-admin{background:#eef2ff;color:#4338ca}

/* ---------------- 筛选 ---------------- */
.filter-bar{display:flex;gap:14px;align-items:flex-end;flex-wrap:wrap}
.filter-bar .field{flex:1 1 148px;min-width:130px}
.filter-actions{display:flex;gap:8px;padding-bottom:1px}
.inline-form{margin:0}
.inline-form select{padding:7px 10px}

/* ---------------- 表单 ---------------- */
.form{display:flex;flex-direction:column;gap:14px}
.field{display:flex;flex-direction:column;gap:6px;min-width:0}
.field-row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.field label{font-size:12.5px;color:var(--muted);font-weight:500}
.field input,.field select,.inline-form select{
  width:100%;padding:10px 12px;border-radius:11px;
  border:1px solid var(--line-strong);background:#fff;color:var(--text);
  font-size:14px;font-family:inherit;transition:border-color .16s,box-shadow .16s;
}
.field input:focus,.field select:focus{
  outline:none;border-color:#a5b4fc;box-shadow:0 0 0 3px rgba(165,180,252,.32);
}
.field input:disabled{background:#f7f8fa;color:var(--muted)}
.form-err,.form-msg{
  font-size:12.5px;padding:9px 12px;border-radius:10px;
}
.form-err{background:#fff1f2;color:#be123c}
.form-msg{background:#ecfdf5;color:#047857}
.chip-wrap{display:flex;flex-wrap:wrap;gap:8px}
.chip{
  display:inline-flex;align-items:center;gap:5px;
  font-size:12.5px;padding:5px 10px;border-radius:20px;background:#f3f4f7;
}
.chip-pos{background:#ecfdf5;color:#047857}
.chip-neg{background:#fff1f2;color:#be123c}
.chip-x{border:none;background:transparent;color:inherit;opacity:.55;cursor:pointer;font-size:14px;line-height:1;padding:0}
.chip-x:hover{opacity:1}

/* ---------------- 报表 ---------------- */
.bs-summary{display:flex;gap:34px;flex-wrap:wrap;padding:4px 0 18px;border-bottom:1px solid var(--line);margin-bottom:6px}
.bs-summary div{display:flex;flex-direction:column;gap:2px}
.bs-summary strong{font-size:20px}
.bs-h3{font-size:13px;color:var(--muted);margin:18px 0 6px;letter-spacing:.04em}

/* ---------------- 弹窗 ---------------- */
.modal{position:fixed;inset:0;z-index:60;display:grid;place-items:center;padding:18px}
.modal-bg{position:absolute;inset:0;background:rgba(17,24,39,.46);backdrop-filter:blur(3px)}
.modal-card{
  position:relative;width:100%;max-width:460px;max-height:88vh;overflow-y:auto;
  background:#fff;border-radius:var(--radius-lg);padding:22px 24px;
  box-shadow:0 34px 70px -26px rgba(15,23,42,.55);
  animation:pop .17s ease-out;
}
@keyframes pop{from{opacity:0;transform:translateY(8px) scale(.985)}to{opacity:1;transform:none}}
.modal-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:16px}
.modal-head h3{font-size:16px}
.modal-foot{display:flex;justify-content:flex-end;gap:10px;margin-top:6px}

/* 分段控件 */
.seg{display:flex;flex-wrap:wrap;gap:4px;background:#f3f4f7;border-radius:12px;padding:4px;margin-bottom:16px}
.seg-btn{
  flex:1;padding:8px;border:none;background:transparent;border-radius:9px;
  font-size:13.5px;color:var(--muted);cursor:pointer;transition:background .16s,color .16s;
}
.seg-btn.is-on{background:#fff;color:var(--text);font-weight:600;box-shadow:0 1px 3px rgba(16,24,40,.12)}

/* ---------------- 登录 ---------------- */
.login-body{
  min-height:100vh;display:grid;place-items:center;
  background:
    radial-gradient(900px 500px at 12% -8%,rgba(129,140,248,.42),transparent 60%),
    radial-gradient(800px 520px at 96% 12%,rgba(192,132,252,.36),transparent 62%),
    linear-gradient(160deg,#1e1b4b,#312e81 55%,#4c1d95);
  padding:24px;
}
.login-wrap{width:100%;max-width:390px}
.login-card{
  background:rgba(255,255,255,.985);border-radius:22px;padding:34px 30px;
  box-shadow:0 40px 80px -30px rgba(15,23,42,.7);
}
.login-mark{
  width:46px;height:46px;border-radius:14px;margin-bottom:16px;
  background:linear-gradient(135deg,var(--brand),var(--brand-2));color:#fff;
  display:grid;place-items:center;font-size:19px;font-weight:700;
  box-shadow:0 10px 22px -10px rgba(79,70,229,1);
}
.login-card h1{font-size:21px;margin-bottom:4px}
.login-card>p{margin:0 0 22px;font-size:13px}

/* ---------------- 轻提示 ---------------- */
.toast{
  position:fixed;left:50%;bottom:38px;transform:translate(-50%,16px);
  background:#111827;color:#fff;font-size:13.5px;
  padding:10px 18px;border-radius:12px;
  box-shadow:0 18px 40px -16px rgba(15,23,42,.7);
  opacity:0;pointer-events:none;transition:opacity .2s,transform .2s;z-index:90;
  max-width:82vw;text-align:center;
}
.toast.show{opacity:1;transform:translate(-50%,0)}
.toast.err{background:#9f1239}

/* ---------------- 活动基金 / 共享 ---------------- */
.hero-fund{background:linear-gradient(125deg,#0f766e 0%,#0891b2 48%,#4f46e5 100%);
  box-shadow:0 22px 46px -24px rgba(8,145,178,.7)}
.badge-fund{background:#ecfeff;color:#0e7490;font-size:10.5px;padding:1px 7px;vertical-align:middle}
.acct-share{font-size:11.5px;color:#c2410c;margin:0}
.share-list{display:flex;flex-direction:column;gap:8px}
.share-row{display:flex;align-items:center;justify-content:space-between;gap:12px;
  background:#f8f9fc;border:1px solid var(--line);border-radius:11px;padding:8px 12px}
.share-name{flex:1 1 auto;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
  font-size:13px;display:flex;align-items:center;gap:6px}
.share-name em{font-style:normal;font-size:11.5px;flex:0 0 auto}
/* 选择器要压过 .field select{width:100%}，否则会把成员名字挤成竖排 */
.share-row .share-sel{flex:0 0 auto;width:auto;min-width:104px;padding:6px 10px;border-radius:9px;
  border:1px solid var(--line-strong);background:#fff;font-size:13px;font-family:inherit}
.hint{font-size:11.5px;color:var(--muted-2);margin:0;line-height:1.6}
/* 首期与非整月计息的说明条：放在还款表上方，别被表格压住 */
.hint-first{display:block;margin:0 0 12px;padding:9px 12px;background:#f7f7ff;
  border:1px solid #e4e2fb;border-left:3px solid #7c3aed;border-radius:10px;
  color:var(--muted);font-size:12px}
.hint-first .badge{margin-right:6px;vertical-align:1px}
label.check{display:flex;align-items:center;gap:8px;font-size:13.5px;color:var(--text);cursor:pointer}
label.check input{width:16px;height:16px;accent-color:var(--brand);flex:0 0 16px}

/* ---------------- 房贷 ---------------- */
.hero-loan{background:linear-gradient(125deg,#7c2d12 0%,#b45309 48%,#0f766e 100%);
  box-shadow:0 22px 46px -24px rgba(180,83,9,.6)}
.loan-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(330px,1fr));gap:14px}
.loan-card{display:flex;flex-direction:column;gap:10px;background:#fff;border:1px solid var(--line);
  border-radius:var(--radius);padding:18px;box-shadow:var(--shadow);
  transition:transform .14s,box-shadow .2s,border-color .2s}
.loan-card:hover{transform:translateY(-2px);border-color:#fcd9b6;box-shadow:0 18px 36px -20px rgba(180,83,9,.4)}
.loan-card header{display:flex;gap:11px;align-items:flex-start}
.loan-head{display:flex;flex-direction:column;gap:5px;min-width:0}
.loan-bal{display:flex;flex-direction:column;gap:2px}
.loan-bal strong{font-size:21px}
.loan-meta{display:flex;justify-content:space-between;gap:10px;font-size:12px;color:var(--muted)}
.progress{height:8px;border-radius:20px;background:#f1f2f6;overflow:hidden;margin:2px 0}
.progress-bar{height:100%;border-radius:20px;background:linear-gradient(90deg,#4f46e5,#7c3aed);transition:width .3s}
.row-actions{display:flex;gap:8px}
.more-details{margin-top:14px}
.more-details summary{cursor:pointer;font-size:13px;color:var(--brand);padding:6px 0;outline:none}
.table-scroll{max-height:430px;overflow-y:auto;border:1px solid var(--line);border-radius:12px}
.sim-box{background:#f8f9fc;border:1px solid var(--line);border-radius:12px;padding:12px 14px;
  display:flex;flex-direction:column;gap:7px}
.sim-row{display:flex;justify-content:space-between;gap:12px;font-size:13px}
.sim-row b{font-variant-numeric:tabular-nums;white-space:nowrap}
.sim-big{border-top:1px dashed var(--line-strong);margin-top:2px;padding-top:9px;font-size:14px}
.sim-big b{color:var(--pos);font-size:17px}
.sub-fieldset{border:1px solid var(--line);border-radius:12px;padding:12px 14px 4px;margin:0}
.sub-fieldset legend{font-size:12.5px;color:var(--muted);padding:0 6px}

/* ---------------- 导出 ---------------- */
.export-grid{display:flex;flex-wrap:wrap;gap:10px}
.table tfoot td{border-top:1px solid var(--line);font-weight:600;padding-top:11px}

/* ---------------- 响应式 ---------------- */
.only-mobile{display:none}
@media (max-width:1080px){
  .grid-4{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width:900px){
  .sidebar{
    position:fixed;left:0;top:0;z-index:70;
    transform:translateX(-100%);transition:transform .22s ease;
    box-shadow:0 0 60px rgba(15,23,42,.4);
  }
  .sidebar.is-open{transform:none}
  .only-mobile{display:inline-grid}
  .topbar{padding:14px 18px}
  .content{padding:18px 18px 70px}
  .hero{padding:22px 20px}
  .grid-3,.grid-4,.two-col{grid-template-columns:minmax(0,1fr)}
  .hero-value{font-size:29px}
}
@media (max-width:560px){
  .field-row{grid-template-columns:minmax(0,1fr)}
  .bs-summary{gap:22px}
  .table{font-size:12.5px}
  .table th,.table td{padding:8px 6px}
  .topbar-actions .btn span{display:none}
  .topbar-actions .btn{padding:9px 11px}
}

/* ---------------- 分页 ---------------- */
.pager{display:flex;align-items:center;justify-content:center;gap:14px;padding:4px 0}
.pager-info{font-size:13px;color:var(--muted)}

/* ---------------- 图表 ---------------- */
.chart{width:100%}
.chart svg{display:block;max-width:100%}
.chart-legend{display:flex;align-items:center;gap:14px;font-size:12px;color:var(--muted)}
.lg{display:inline-block;width:10px;height:10px;border-radius:3px}
.lg-inc{background:#059669}
.lg-exp{background:#e11d48}
.chart-pie-wrap{display:flex;gap:24px;align-items:center;flex-wrap:wrap}
.chart-pie-wrap .chart{flex:0 0 auto}
.pie-legend{list-style:none;margin:0;padding:0;flex:1 1 220px;min-width:180px;display:flex;flex-direction:column;gap:6px}
.pie-legend li{display:flex;align-items:center;gap:8px;font-size:12.5px}
.pie-legend li b{margin-left:auto;font-variant-numeric:tabular-nums}
.lg-dot{display:inline-block;width:10px;height:10px;border-radius:50%;flex:0 0 10px}

/* ---------------- 分类管理 ---------------- */
.cat-mgmt{display:flex;flex-direction:column;gap:2px}
.cat-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:7px 8px;border-radius:9px}
.cat-row:hover{background:#f8f9fc}
.cat-sub{padding-left:26px}
.cat-name{font-size:13.5px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:flex;align-items:center;gap:6px}
.cat-actions{display:flex;gap:2px;flex:0 0 auto}

/* ---------------- 分段控件禁用 ---------------- */
.seg-btn:disabled{opacity:.4;cursor:not-allowed}

/* ---------------- 总览：资产负债构成 ---------------- */
.hero-side-title{font-size:11.5px;color:#c7d2fe;letter-spacing:.04em;margin-bottom:2px}
.row-sub td{background:#fafbfd}
/* 资产构成：现金要扣掉其他负债（信用卡 / 短期借款 / 押金），房贷不参与扣减 */
.row-deduct td{border-top:1px dashed var(--line-strong);color:var(--neg);font-size:13px}
.row-deduct td:first-child{color:var(--muted);font-weight:500}
.row-net td{border-top:1px solid var(--line-strong);font-weight:650}
.row-net td:first-child{color:var(--text)}
.row-net td:last-child{font-size:15px}
.row-net .muted{font-weight:400}
.row-mortgage td{background:#fff7ed}
.row-mortgage td:first-child{color:#c2410c;font-weight:600}

/* ---------------- 房贷：全周期重演（独立统计，不写流水） ---------------- */
.callout{display:flex;flex-direction:column;gap:3px;background:#f5f6fb;border:1px solid var(--line);
  border-left:3px solid var(--brand);border-radius:12px;padding:12px 14px;margin:0 0 14px}
.callout strong{font-size:13.5px}
.callout span{font-size:12.5px;color:var(--muted);line-height:1.65}
.callout-warn{background:#fffbeb;border-color:#fde68a;border-left-color:#f59e0b}
.callout-warn strong{color:#b45309}
/* 中国工作日历提示条里的小动作行（按钮 + 国务院通知链接） */
.callout-act{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:8px}
.callout-act .btn{flex:0 0 auto}

.row-prepay td{background:#fff7ed}
.row-prepay td:first-child{color:#c2410c;font-weight:600}
.row-past td{opacity:.6}

.legend{display:flex;flex-wrap:wrap;gap:14px;padding:0 2px 10px;font-size:11.5px;color:var(--muted)}
.legend span{display:inline-flex;align-items:center;gap:6px}
.dot{width:9px;height:9px;border-radius:50%;display:inline-block;flex:0 0 9px}
.dot-past{background:#a7f3d0}
.dot-prepay{background:#fdba74}
.dot-future{background:#e5e7eb}

.table-tall{max-height:520px;overflow-y:auto}
.table-tall thead th{position:sticky;top:0;z-index:1;background:var(--card)}

/* ---------------- 归档账户：流水查看 / 合并到其它账户 ---------------- */
.link-btn{background:none;border:0;padding:0;color:var(--brand);font:inherit;font-size:13px;
  cursor:pointer;text-decoration:underline;text-underline-offset:2px}
.link-btn:hover{color:var(--brand-2);text-decoration-thickness:2px}

.modal-card.modal-wide{max-width:780px}
.modal-card.modal-wide .table-tall{max-height:46vh}

.at-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;
  padding:0 2px 10px;border-bottom:1px solid var(--line);margin-bottom:8px}
.at-check{display:inline-flex;align-items:center;gap:7px;font-size:13px;color:var(--muted);cursor:pointer}
.at-check input{width:15px;height:15px;cursor:pointer;margin:0}
.at-pick{width:15px;height:15px;cursor:pointer;margin:0;vertical-align:middle}

.at-merge{display:flex;align-items:flex-end;gap:12px;margin-top:14px;padding-top:14px;
  border-top:1px solid var(--line)}
.at-merge .field{flex:1 1 auto;margin:0;min-width:0}
.at-merge .btn{flex:0 0 auto}

/* ---------------- 股票（独立模块） ---------------- */
.page-actions-btns{display:flex;align-items:center;gap:8px;flex-wrap:wrap}

.stock-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin-bottom:18px}
.stat-card{display:flex;flex-direction:column;gap:4px;padding:16px 18px}
.stat-card .stat-value{font-size:20px}
.stat-card-hl{border-color:#e4e2fb;background:linear-gradient(180deg,#faf9ff 0%,#fff 72%)}

.card-warn{border-color:#fde68a;background:#fffbeb}
.stock-errors{margin:0;padding-left:18px;font-size:13px;line-height:1.9;color:#92400e}
.stock-errors li{word-break:break-all}

.stock-name{font-weight:600}
.stock-name:hover{color:var(--brand)}
.spark{display:block;margin:2px 0 10px}

.search-results{margin-top:8px;padding:6px;border:1px solid var(--line);border-radius:12px;background:#fafbfd;
  max-height:190px;overflow:auto}
.search-item{display:block;width:100%;text-align:left;background:#fff;border:1px solid var(--line);border-radius:10px;
  padding:7px 10px;margin-bottom:5px;font:inherit;font-size:13px;cursor:pointer}
.search-item:last-child{margin-bottom:0}
.search-item:hover{border-color:var(--brand);color:var(--brand)}

/* 顶部通知 */
.notice-btn{position:relative}
.notice-badge{position:absolute;top:-3px;right:-3px;min-width:16px;height:16px;padding:0 4px;border-radius:9px;
  background:var(--neg);color:#fff;font-size:10.5px;line-height:16px;text-align:center;font-weight:600}
.notice-panel{position:fixed;top:62px;right:18px;z-index:70;width:min(380px,calc(100vw - 28px));
  background:var(--card);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);
  overflow:hidden}
.notice-head{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:12px 14px;
  border-bottom:1px solid var(--line)}
.notice-head>div{display:flex;gap:6px;align-items:center}
.notice-list{max-height:58vh;overflow:auto;padding:6px}
.notice-item{padding:9px 10px;border-radius:10px;border-bottom:1px solid #f3f4f7}
.notice-item:last-child{border-bottom:none}
.notice-item.is-new{background:#f7f7ff}
.notice-title{font-size:13.5px;font-weight:600}
.notice-body{margin-top:2px;word-break:break-all}
.notice-time{margin-top:3px}

@media (max-width:1080px){
  .stock-summary{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width:560px){
  .stock-summary{grid-template-columns:1fr}
  .notice-panel{top:56px;right:10px}
}

/* ---------------- 股票：涨跌配色「红涨绿跌」（A股 / 港股口径） ----------------
   改动初衷：国内看盘习惯是涨红跌绿，而记账里「收入绿 / 支出红」是另一套语义，
   所以只覆盖股票页的内容区（含弹窗），记账各页与顶栏通知面板不受影响。 */
body[data-page="stocks"] .content .money.pos,
body[data-page="stocks"] .content .pos,
body[data-page="stocks"] .content .stat-value.pos{color:var(--stock-up)}
body[data-page="stocks"] .content .money.neg,
body[data-page="stocks"] .content .neg,
body[data-page="stocks"] .content .stat-value.neg{color:var(--stock-down)}
/* 「还没抓过」这类提醒文字不再借用 .neg（否则会变成绿色） */
.text-warn{color:#b45309;font-weight:600}

/* ---------------- 股票持仓：状态 / 市场 筛选 + 分组 ---------------- */
.stock-filters{display:flex;gap:10px;flex-wrap:wrap;align-items:center;margin:2px 0 14px}
.seg.seg-sm{margin-bottom:0;padding:3px;background:#f3f4f7}
.seg.seg-sm .seg-btn{flex:0 0 auto;padding:6px 12px;font-size:13px}
.seg.seg-sm .seg-btn b{font-variant-numeric:tabular-nums;font-weight:600;opacity:.75}
.stock-group-row td{
  background:#fafbfd;border-top:1px solid var(--line);
  font-size:12.5px;color:var(--muted);padding-top:7px;padding-bottom:7px;
}
.stock-group-row .badge{margin-right:6px}
.stock-group-row b{color:var(--text);font-weight:600}
tr[data-state="cleared"] td:first-child .stock-name{color:var(--muted)}
body[data-page="stocks"] .content .stock-group-row .pos{color:var(--pos)}
body[data-page="stocks"] .content .stock-group-row .neg{color:var(--neg)}

/* ---------------- 股票回报报表 ---------------- */
.table-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch}
.table-wrap .table{min-width:900px}
.rp-chart{display:block;max-width:100%;height:auto;margin:4px 0 6px}
.rp-chart text{font-variant-numeric:tabular-nums}

/* 首页「收益走势」卡：图表改成前端按容器宽度自绘（.srt 一套，与回报报表页共用）。
   .stk-trend-chart 现在只留给关掉 JS 时的 <noscript> 兜底 —— 定宽 SVG，窄了就让它横向滚。 */
.stk-trend .srt{margin:2px 0 4px}
.stk-trend .srt-canvas{min-height:190px}
.stk-trend .stk-trend-chart{display:block;max-width:100%;overflow-x:auto}

/* 待入账的分红：到账日（派息日）。
   数据源（东财 A股 / Yahoo）都不给派息日，只能在这里人工补 ——
   它决定这笔分红算哪一期收益，以及哪天自动转「已到账」。 */
.plan-paydate{
  font:inherit;font-size:13px;color:inherit;background:var(--card);
  border:1px solid var(--line);border-radius:8px;padding:4px 7px;max-width:148px;
}
.plan-paydate:hover{border-color:var(--muted-2)}
.plan-paydate:focus{outline:none;border-color:var(--brand);box-shadow:0 0 0 3px rgba(79,70,229,.12)}
.plan-paydate:disabled{opacity:.55}
@media (max-width:760px){
  .plan-paydate{font-size:16px;max-width:none;width:100%}   /* 16px：iPhone 聚焦不放大整页 */
}

/* ==========================================================
   移动端：股票页「表格 → 卡片」+ 触屏交互优化
   ----------------------------------------------------------
   设计要点（列表页 / 个股页共用）：
     · 表格 DOM 不变，只用 CSS 在窄屏改成卡片 —— 行情轮询用的
       [data-row] / [data-cell] 选择器、筛选用的 tr.hidden 全部照旧生效；
     · 每张卡片的信息层级：标题 → 关键数值（市值/收益）→ 明细 → 大按钮操作；
     · 每个单元格的标签来自 PHP 里的 data-label，不用重复写两套结构。
   ========================================================== */

/* 汇总卡里「总收益率」那张：左侧加一道强调色条（桌面也生效） */
.stock-summary .stat-card-hl{position:relative;overflow:hidden}
.stock-summary .stat-card-hl::before{
  content:"";position:absolute;left:0;top:14px;bottom:14px;width:3px;border-radius:0 3px 3px 0;
  background:linear-gradient(180deg,#818cf8,#c084fc);
}
.stock-summary .stat-card{padding-left:20px}

/* 窄屏放不下的表格：变成可横向滑动的容器，不撑破整页 */
.table-x{overflow-x:auto;-webkit-overflow-scrolling:touch}
/* 还能往哪边滑：只在真的能滑的那一侧显示一道淡阴影（纯 CSS，无 JS） */
@media (max-width:1280px){
  .table-x{
    background:
      linear-gradient(to right,#fff 30%,rgba(255,255,255,0)) 0 0,
      linear-gradient(to right,rgba(255,255,255,0),#fff 70%) 100% 0,
      radial-gradient(farthest-side at 0 50%,rgba(15,23,42,.16),transparent) 0 0,
      radial-gradient(farthest-side at 100% 50%,rgba(15,23,42,.16),transparent) 100% 0;
    background-repeat:no-repeat;
    background-size:44px 100%,44px 100%,15px 100%,15px 100%;
    background-attachment:local,local,scroll,scroll;
  }
}

/* 页头那句口径说明（移动端弱化） */
.page-note{margin:0;max-width:76ch;font-size:12.5px;line-height:1.7}

@keyframes sheet-up{from{transform:translateY(26px);opacity:.6}to{transform:none;opacity:1}}

@media (max-width:1280px){
  /* ---------- 4. 表格 → 卡片 ----------
     触发宽度取 1280px：持仓表要「放得下 + 不挤成一团」，
     >900px 时侧栏 236px + 内容区内边距 56px，1280 − 292 = 988px 才够
     （1150 时虽然不溢出，但「股票」列会被压到逐字换行，很难看）。
     再窄（平板 768/810/820、横屏手机、窄窗口）一律走卡片。 */
  .table-cards{display:block;font-size:13.5px}
  .table-cards thead{display:none}
  .table-cards tbody{display:block}
  .table-cards tbody tr{
    display:grid;grid-template-columns:repeat(2,minmax(0,1fr));
    gap:9px 12px;margin:0 0 12px;padding:14px;
    background:#fbfcfe;border:1px solid var(--line);border-radius:14px;
  }
  .table-cards tbody tr:last-child{margin-bottom:0}
  .table-cards tbody tr>td{
    display:flex;flex-direction:column;gap:2px;min-width:0;
    padding:0;border:0;text-align:left;
  }
  .table-cards tbody tr>td::before{
    content:attr(data-label);font-size:11px;font-weight:500;
    color:var(--muted-2);letter-spacing:.02em;
  }
  .table-cards tbody tr>td:not([data-label])::before{display:none}
  .table-cards tbody tr>td.cell-main,
  .table-cards tbody tr>td.cell-span,
  .table-cards tbody tr>td.cell-total,
  .table-cards tbody tr>td.cell-actions{grid-column:1/-1}
  .table-cards tbody tr>td.cell-main::before,
  .table-cards tbody tr>td.cell-actions::before{display:none}
  .table-cards .stock-name{font-size:15.5px;line-height:1.35}
  .table-cards tbody tr>td>.small{font-size:11px}
  .table-cards tbody tr>td.cell-total{font-size:15px;font-weight:650}
  .table-cards tbody tr>td.cell-span{flex-direction:row;align-items:center;justify-content:space-between;gap:10px}
  /* 分组小标题（A股 / 港股 / 美股 · 持有 N 只）保持整行，别被当卡片 */
  .table-cards tbody tr.stock-group-row{
    display:block;margin:0;padding:12px 2px 8px;
    background:transparent;border:0;border-radius:0;
  }
  .table-cards tbody tr.stock-group-row>td{display:block;padding:0;border:0;background:transparent;line-height:1.55}
  .table-cards tbody tr.stock-group-row>td>b{display:block}
  /* 卡片底部操作条：等分大按钮 + 文字标签（触屏友好） */
  .table-cards tbody tr>td.cell-actions{
    flex-direction:row;gap:8px;margin-top:3px;padding-top:12px;
    border-top:1px solid var(--line);
  }
  .table-cards tbody tr>td.cell-actions .icon-btn{
    flex:1 1 0;display:flex;align-items:center;justify-content:center;gap:5px;
    width:auto;height:40px;border:1px solid var(--line-strong);background:#fff;
    border-radius:11px;color:var(--muted);font-size:12.5px;
  }
  .table-cards tbody tr>td.cell-actions .icon-btn::after{content:attr(data-mlabel)}
  .table-cards tbody tr>td.cell-actions .btn{flex:1 1 auto;min-height:40px}
  .table-cards tbody tr>td.cell-actions .icon-btn.danger{color:var(--neg);border-color:#fecdd3;background:#fff1f2}
  .table-cards tbody tr>td.cell-actions .icon-btn:active{background:#f3f4f7}
  .table-x .table{min-width:540px}
}

@media (max-width:900px){
  /* ---------- 2. 汇总 KPI：主卡整行 + 次级两列（省一半竖向空间） ---------- */
  .page-note{font-size:12px;line-height:1.65}
  .stock-summary{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-bottom:14px}
  .stock-summary .stat-card{padding:13px 15px;gap:2px}
  .stock-summary .stat-card:first-child,
  .stock-summary .stat-card-hl{grid-column:1/-1}
  .stock-summary .stat-card .stat-value{font-size:18px}
  .stock-summary .stat-card:first-child .stat-value,
  .stock-summary .stat-card-hl .stat-value{font-size:25px}
  .stock-summary .stat-card .small{font-size:11.5px}

  /* ---------- 3. 持仓筛选：两组各占一整行，按钮不再被挤到屏幕外 ---------- */
  .stock-filters{flex-wrap:wrap;gap:8px;margin:0 0 12px}
  .stock-filters .seg{flex:1 1 100%;margin:0}
  .stock-filters .seg-btn{padding:8px 12px;min-height:36px}

  /* ---------- 6. 容器与触屏细节 ---------- */
  .card{padding:16px}
  .card-head{flex-wrap:wrap;gap:6px 12px;margin-bottom:10px}
  .two-col{gap:12px}
  .icon-btn{width:36px;height:36px}
}

@media (max-width:720px){
  /* ---------- 1. 页头动作：主按钮整行 + 次级两列 ---------- */
  .page-actions{flex-direction:column-reverse;align-items:stretch;gap:10px}
  .page-actions-btns{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;width:100%}
  .page-actions-btns>*{width:100%;min-width:0}
  .page-actions-btns .btn{min-height:44px;padding:9px 6px;font-size:12.5px;
    white-space:normal;line-height:1.35;text-align:center}
  .page-actions-btns .btn-primary{grid-column:1/-1;order:-1;min-height:48px;font-size:14px}
  .page-actions-btns .check{border:1px solid var(--line-strong);border-radius:11px;background:#fff;
    min-height:44px;padding:0 10px;justify-content:center;font-size:12.5px;color:var(--muted)}

  /* ---------- 5. 弹窗 → 底部抽屉（大按钮 + 防 iOS 聚焦缩放） ---------- */
  .modal{padding:0;align-items:flex-end}
  .modal-card{max-width:none;width:100%;max-height:92vh;border-radius:20px 20px 0 0;
    padding:16px 18px calc(14px + env(safe-area-inset-bottom));
    animation:sheet-up .22s ease-out}
  .modal-card::before{content:"";display:block;width:38px;height:4px;border-radius:3px;
    background:#e2e5ee;margin:0 auto 12px}
  .modal-head{margin-bottom:12px}
  .modal-head h3{font-size:17px}
  .modal-foot{position:sticky;bottom:0;z-index:2;gap:8px;padding:10px 0 2px;margin-top:8px;
    background:linear-gradient(180deg,rgba(255,255,255,.72),#fff 45%)}
  .modal-foot .btn{flex:1 1 0;min-height:46px;font-size:14px}
  .field input,.field select{padding:11px 12px;font-size:16px}   /* ≥16px：iOS 不再放大页面 */
  .field-row{grid-template-columns:minmax(0,1fr);gap:12px}
  .seg-btn{min-height:42px}
  .search-item{padding:10px 12px;font-size:13.5px}
  .grid-3 .stat{padding:9px 2px}
}

/* ---------------- 回报统计（独立模块） ---------------- */
/* 「按规则预计」提示条：跟实际数字视觉上分开（浅紫底 + 左侧色条） */
.callout-est{background:#f8f9ff;border-color:#e4e2fb;border-left-color:#818cf8}
.callout-est strong{color:#4338ca}
.callout-est .badge{background:#eef2ff;color:#4338ca;margin-left:4px}
.ret-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:14px}
.ret-card{display:flex;flex-direction:column;gap:10px}
.ret-card header{display:flex;gap:11px;align-items:flex-start}
.ret-ico{width:36px;height:36px;border-radius:11px;flex:0 0 36px;
  background:linear-gradient(135deg,#eef2ff,#ede9fe);display:grid;place-items:center;font-size:15px;text-align:center}
.ret-name{display:flex;flex-direction:column;gap:5px;min-width:0;flex:1 1 auto}
.ret-name strong{font-size:14px;line-height:1.35;overflow-wrap:anywhere}
.ret-big{display:flex;flex-direction:column;gap:2px}
.ret-big strong{font-size:24px;font-variant-numeric:tabular-nums;letter-spacing:-.01em}
.ret-rows{display:flex;flex-direction:column;gap:3px}
.ret-rows .sim-row{font-size:12.5px}
.ret-actions{display:flex;gap:8px;margin-top:auto;padding-top:2px}
.ret-actions .btn{flex:1 1 auto}
@media (max-width:720px){
  .ret-actions .btn{min-height:42px}
  .ret-big strong{font-size:26px}
}

/* 手机：整张卡片可以横滑 —— 给「流水 / 周期记账」这类不属于股票模块的宽表兜底
   （它们的最小宽度约 454px，视口再窄就会整页横着跑） */
@media (max-width:560px){
  .card{overflow-x:auto}
}

/* ==========================================================
   股票回报报表 · 收益走势图（2026-09-24 重做）
   ----------------------------------------------------------
   数字不再堆在一起的几个关键点：
     · 图上给 Y 轴刻度 + 0 轴，数值大小不用靠眼睛量；
     · 明细表默认「简洁」（期次/分红/总回报 + 量级横条），
       要细节再切「完整」；数字列一律 nowrap，绝不把
       「+¥2,725.70」断成两行（老版在 1400px 下就会断）；
     · 窄屏走 .table-cards 卡片模式，不再横向挤成一团。
   ========================================================== */
.srt-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-bottom:14px}
.srt-kpi{
  display:flex;flex-direction:column;gap:2px;
  padding:11px 13px;border:1px solid var(--line);border-radius:12px;background:#fbfcfe;
}
.srt-kpi-label{font-size:11.5px;color:var(--muted-2);letter-spacing:.02em}
.srt-kpi-value{font-size:16px;font-variant-numeric:tabular-nums;letter-spacing:-.01em}
.srt-kpi-sub{font-size:11.5px;color:var(--muted);font-style:normal}

.srt{position:relative}
.srt:focus-visible{outline:2px solid var(--brand);outline-offset:3px;border-radius:12px}
.srt-canvas{position:relative;touch-action:pan-y}
.srt-svg{display:block;width:100%;height:auto}
.srt-svg text{font-variant-numeric:tabular-nums}
.srt-g rect{transition:opacity .12s}
.srt-g.is-sel>rect:first-child{opacity:.72;stroke:#fff;stroke-width:1.4}
.srt-g.is-sel>rect:last-child{fill:rgba(79,70,229,.06)!important}

/* 跟随提示条 */
.srt-tip{
  position:absolute;z-index:5;min-width:196px;max-width:min(280px,92%);
  padding:10px 12px;border:1px solid var(--line-strong);border-radius:12px;
  background:rgba(255,255,255,.98);box-shadow:0 14px 34px -14px rgba(16,24,40,.35);
  font-size:12px;line-height:1.5;pointer-events:none;
}
.srt-tip-head{display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin-bottom:6px}
.srt-tip-head b{font-size:13px}
.srt-tip-head em{font-size:10.5px;color:var(--muted-2);font-style:normal}
.srt-tip-row{display:flex;align-items:baseline;gap:8px;justify-content:space-between}
.srt-tip-row span{color:var(--muted);flex:0 0 auto}
.srt-tip-row b{font-variant-numeric:tabular-nums;font-weight:600;text-align:right;margin-left:auto}
.srt-tip-row em{font-style:normal;color:var(--muted);font-variant-numeric:tabular-nums}
.srt-tip-row.sub span,.srt-tip-row.sub b{font-size:11px;font-weight:500;color:var(--muted)}
.srt-tip-row:first-of-type b{font-size:13px}
.srt-tip-warn{margin-top:6px;padding-top:6px;border-top:1px dashed var(--line-strong);font-size:10.5px;color:#b45309}
.srt-tip-foot{margin-top:6px;font-size:10.5px;color:var(--muted-2)}

.srt-legend{display:flex;flex-wrap:wrap;align-items:center;gap:6px 14px;margin-top:8px;font-size:11.5px;color:var(--muted)}
.srt-lg{display:inline-flex;align-items:center;gap:5px}
.srt-dot{width:9px;height:9px;border-radius:3px;flex:0 0 9px}
.srt-dot.up{background:var(--stock-up,#dc2626)}
.srt-dot.dn{background:var(--stock-down,#16a34a)}
.srt-dot.cum{background:var(--brand);border-radius:50%}
.srt:not(.is-cum) .srt-lg-cum{display:none}

/* 「量级」小横条：不读数字也能看出哪期赚得最多 */
.srt-th-bar{width:88px}
.srt-mini{display:block;height:5px;border-radius:3px;background:#f1f2f7;overflow:hidden;min-width:44px}
.srt-mini i{display:block;height:100%;border-radius:3px}
.srt-mini i.up{background:var(--stock-up,#dc2626)}
.srt-mini i.dn{background:var(--stock-down,#16a34a)}

/* 数字列不换行：老版「+¥2,725.70」会被断成「+」+「¥2,725.70」两行 */
.srt-table td.num,.srt-table th{white-space:nowrap}
.srt-table td.num{font-variant-numeric:tabular-nums}
.srt-warn{color:#b45309;cursor:help;font-size:12px;margin-left:4px}
.srt-flash>td{background:#fff7ed!important;transition:background .3s}
.srt-total-row>td{background:#fafbfd;border-top:1px solid var(--line-strong);font-weight:600}
.srt-total-row .muted,.srt-total-row b{font-weight:600}

@media (max-width:900px){
  .srt-kpis{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .srt-kpi-value{font-size:15px}
}
@media (max-width:720px){
  .srt-tip{position:absolute;left:0!important;right:0;max-width:none;min-width:0}
  .srt-legend{font-size:11px;gap:4px 10px}
}
@media (max-width:1280px){
  /* 卡片模式：别再被 .table-wrap 的 min-width:900px 撑出一屏横向滚动，
     也要把「数字一律右对齐」改回左对齐 —— 否则窄屏上数字会被推到卡片外面看不见 */
  .srt-wrap{overflow:visible}
  .srt-wrap .table-cards{min-width:0}
  .table-cards.srt-table tbody tr>td.ta-r{text-align:left}
  .table-cards.srt-table tbody tr>td.cell-total{text-align:left}

  /* 卡片模式下的量级条与聚合单元格 */
  .table-cards.srt-table tbody tr>td.srt-td-bar{grid-column:1/-1;flex-direction:row;align-items:center;gap:10px}
  .table-cards.srt-table tbody tr>td.srt-td-bar::before{flex:0 0 auto}
  .table-cards.srt-table tbody tr>td.srt-td-bar .srt-mini{flex:1 1 auto;min-width:0}
  .table-cards.srt-table tbody tr.srt-total-row{
    display:block;margin:0;padding:13px 14px;background:#f8f9ff;border-color:#e4e2fb;
  }
  .table-cards.srt-table tbody tr.srt-total-row>td{display:block}
  .table-cards.srt-table tbody tr.srt-total-row>td.cell-total,
  .table-cards.srt-table tbody tr.srt-total-row>td[colspan]{padding:2px 0}
}

/* ===== 小眼睛（隐私模式）：房贷 / 股票 / 回报统计 三个模块 ===== */
.privacy-btn{position:relative}
.privacy-btn .pv-show,.privacy-btn .pv-hide{display:inline-flex;align-items:center}
.privacy-btn .pv-hide{display:none}
html.bk-privacy .privacy-btn .pv-show{display:none}
html.bk-privacy .privacy-btn .pv-hide{display:inline-flex}
html.bk-privacy .privacy-btn{color:var(--brand);background:#eef2ff;border-color:#c7d2fe}
html.bk-privacy .privacy-btn:hover{background:#e4e9ff;color:var(--brand)}
/* 打码后的数字用等宽感一致的圆点，行高不跳 */
html.bk-privacy .money,html.bk-privacy .stat-value{letter-spacing:.5px}

/* ==========================================================
   提醒清单（reminders）
   ----------------------------------------------------------
   层次：快速添加 → 概览小卡（可点筛选）→ 分组列表 →（右下角）到点弹窗。
   配色沿用既有变量（--brand / --neg / --muted / --line），不引入新色系。
   ========================================================== */

/* 侧栏「提醒清单」后面的小红数字（逾期 + 今天） */
.nav-count{
  margin-left:auto;flex:0 0 auto;min-width:18px;height:18px;padding:0 5px;border-radius:9px;
  background:var(--neg);color:#fff;font-size:11px;line-height:18px;text-align:center;font-weight:600;
}

/* 通知面板：提醒来的那几条挂「提醒」标签，整条可点进提醒页 */
.notice-tag{
  display:inline-block;margin-right:6px;padding:0 6px;border-radius:6px;
  background:#eef2ff;color:#4338ca;font-size:10.5px;font-weight:600;line-height:17px;vertical-align:1px;
}
.notice-item[data-goto]{cursor:pointer}
.notice-item[data-goto]:hover{background:#f5f5ff}

/* ---------- 快速添加 ---------- */
.rem-top{display:flex;flex-direction:column;gap:12px}
.rem-quick{display:grid;grid-template-columns:minmax(0,1fr) 150px 124px auto;gap:10px;align-items:center}
.rem-quick input{
  width:100%;min-width:0;padding:11px 13px;border:1px solid var(--line-strong);border-radius:12px;
  font:inherit;font-size:14px;background:#fff;color:var(--text);
}
.rem-quick input:focus{outline:none;border-color:var(--brand);box-shadow:0 0 0 3px rgba(79,70,229,.12)}
.rem-quick input[type=date],.rem-quick input[type=time]{font-size:13.5px;color:var(--muted);padding:10px 11px}
.rem-quick #remQuickTitle{font-size:14.5px}
.rem-more{border-top:1px dashed var(--line);padding-top:12px}
.rem-foot{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap}
/* 快捷日期（今天 / 明天 / 下周）：按钮而不是文字链，手指点得中 */
.rem-shortcuts{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.rem-chip{
  font:inherit;font-size:12.5px;font-weight:600;line-height:1.2;
  padding:5px 13px;border-radius:20px;cursor:pointer;
  border:1px solid var(--line-strong);background:#fff;color:var(--brand);
  transition:background .15s,border-color .15s,color .15s;
}
.rem-chip:hover{border-color:var(--brand);background:#f7f7ff}
.rem-chip.is-on{background:var(--brand);border-color:var(--brand);color:#fff}
.rem-date-jump{color:var(--brand);font-weight:600}

/* ---------- 概览小卡（点一下 = 筛选） ---------- */
.rem-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}
.rem-stat{
  display:flex;flex-direction:column;gap:3px;padding:16px 18px;
  text-align:left;font:inherit;color:inherit;cursor:pointer;background:var(--card);
  transition:transform .14s,border-color .2s,box-shadow .2s;
}
.rem-stat:hover{transform:translateY(-2px);border-color:#dcd9fb}
.rem-stat .stat-value{font-size:23px}
.rem-stat.is-on{border-color:var(--brand);box-shadow:0 0 0 2px rgba(79,70,229,.14)}
.rem-stat-overdue .stat-value{color:var(--neg)}

/* ---------- 视图 / 搜索 ---------- */
.rem-bar{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.rem-bar .seg{margin-bottom:0;flex:0 0 auto;width:auto}
.rem-search{
  flex:1 1 220px;min-width:170px;max-width:340px;padding:9px 13px;border:1px solid var(--line-strong);
  border-radius:11px;font:inherit;font-size:13.5px;background:#fff;color:var(--text);
}
.rem-search:focus{outline:none;border-color:var(--brand)}
#remFilterHint{margin-left:auto}

/* ---------- 分组列表 ---------- */
.rem-list{display:flex;flex-direction:column;gap:14px}
.rem-group{padding:6px 8px 8px}
.rem-group-head{display:flex;align-items:center;gap:10px;padding:6px 8px 8px}
.rem-group-head b{font-size:12.5px;letter-spacing:.08em;color:var(--muted)}
.rem-group-late{border-color:#fecdd3}
.rem-group-late .rem-group-head b{color:var(--neg)}
.rem-item{display:flex;align-items:center;gap:12px;padding:11px 8px;border-radius:12px;transition:background .15s}
.rem-item + .rem-item{border-top:1px solid #f4f5f9}
.rem-item:hover{background:#fafbff}
.rem-item.is-done{background:#fcfcfd}
.rem-check{
  flex:0 0 22px;width:22px;height:22px;padding:0;border-radius:50%;
  border:1.6px solid var(--line-strong);background:#fff;color:transparent;
  display:grid;place-items:center;cursor:pointer;
  transition:border-color .15s,background .15s,color .15s;
}
.rem-check:hover{border-color:var(--brand);color:rgba(79,70,229,.35)}
.rem-item.is-done .rem-check{background:var(--pos);border-color:var(--pos);color:#fff}
.rem-item.is-overdue .rem-check{border-color:#fda4af}
.rem-main{flex:1 1 auto;min-width:0}
/* 标题最多两行：长标题（一百多字那种）不再把整行撑到三四行高，超出打省略号 —— 
   列表的「节奏」靠这个守住；桌面上几乎不会触发，手机上是最关键的一条 */
.rem-title{
  font-size:14px;font-weight:600;line-height:1.5;word-break:break-word;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;
}
.rem-item.is-done .rem-title{text-decoration:line-through;color:var(--muted);font-weight:500}
.rem-sub{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin-top:4px;font-size:12px}
.rem-tag{
  display:inline-flex;align-items:center;gap:3px;padding:0 7px;border-radius:7px;
  background:#f3f4f7;color:var(--muted);font-size:11px;line-height:18px;white-space:nowrap;
}
.rem-tag-imp{background:#fff7ed;color:#c2410c}
.rem-tag-rep{background:#eef2ff;color:#4338ca}
.rem-note{color:var(--muted);max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.rem-note::before{content:"· ";color:var(--muted-2)}
.rem-when{flex:0 0 auto;min-width:86px;text-align:right;line-height:1.35}
.rem-when b{display:block;font-size:12.5px;font-weight:600;color:var(--muted)}
.rem-when span{font-size:12px;color:var(--muted-2);font-variant-numeric:tabular-nums}
.rem-when.is-late b{color:var(--neg)}
.rem-acts{flex:0 0 auto;display:flex;gap:2px;opacity:.5;transition:opacity .15s}
.rem-item:hover .rem-acts{opacity:1}
.rem-del{margin-right:auto}

/* ---------- 到点弹窗卡片（右下角，所有页面通用） ---------- */
.rem-pop-wrap{
  position:fixed;right:22px;bottom:22px;z-index:88;
  display:flex;flex-direction:column;gap:10px;
  max-width:min(360px,calc(100vw - 32px));
}
.rem-pop{
  background:var(--card);border:1px solid var(--line);border-left:4px solid var(--brand);
  border-radius:14px;padding:13px 15px;
  box-shadow:0 20px 46px -20px rgba(15,23,42,.5);
  animation:remPop .22s ease-out;
}
@keyframes remPop{from{opacity:0;transform:translateY(10px) scale(.98)}to{opacity:1;transform:none}}
.rem-pop-head{display:flex;align-items:center;gap:8px}
.rem-pop-head b{flex:1 1 auto;min-width:0;font-size:14px;word-break:break-word}
.rem-pop-ico{font-size:15px}
.rem-pop-x{border:none;background:transparent;color:var(--muted-2);font-size:18px;line-height:1;cursor:pointer;padding:0 2px}
.rem-pop-x:hover{color:var(--text)}
.rem-pop-body{margin:6px 0 10px}
.rem-pop-foot{display:flex;gap:8px;flex-wrap:wrap}

@media (max-width:1080px){
  .rem-stats{grid-template-columns:repeat(2,minmax(0,1fr))}
}
/* ---------- 手机端（≤760px）：重新排一遍，重点是「少占竖向空间 + 手指点得中」 ---------- */
@media (max-width:760px){
  /* 快速添加：标题整行 → 日期/时间两栏 → 添加按钮整行 */
  .rem-quick{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
  .rem-quick #remQuickTitle{grid-column:1/-1}
  .rem-quick #remQuickAdd{grid-column:1/-1;justify-content:center;padding:12px}
  /* 输入框字号必须 ≥16px，否则 iPhone 聚焦时会自动放大整个页面（原来的 13.5px 就是这毛病） */
  .rem-quick input,.rem-quick input[type=date],.rem-quick input[type=time],.rem-search,
  #remModal input,#remModal select{font-size:16px}
  .rem-shortcuts{gap:8px}
  .rem-chip{padding:7px 15px;font-size:13.5px}

  /* 概览小卡 → 一行紧凑胶囊（可横滑）：省下的竖向空间全给列表 */
  .rem-stats{display:flex;gap:8px;overflow-x:auto;-webkit-overflow-scrolling:touch;padding:1px 0 3px}
  .rem-stats .rem-stat{
    flex:0 0 auto;flex-direction:row;align-items:baseline;gap:7px;
    padding:10px 15px;border-radius:13px;transform:none;
  }
  .rem-stats .rem-stat:hover{transform:none;border-color:var(--line)}
  .rem-stats .rem-stat .stat-label{font-size:12.5px}
  .rem-stats .rem-stat .stat-value{font-size:18px}
  .rem-stats .rem-stat .stat-sub{display:none}                 /* 副标题在手机上纯占地方 */
  .rem-stats .rem-stat[data-filter="done"]{display:none}        /* 已完成用上面的段选切换，不重复占位 */

  /* 列表行：第一行 圆圈 + 标题 + 操作，第二行 时间；操作按钮放大到点得中 */
  .rem-list{gap:12px}
  .rem-group{padding:4px 6px 6px}
  .rem-group-head{padding:8px 8px 6px}
  /* 待办行在手机上压成「两行」，行高不再被长标题/长备注撑开（以前一条能高到另一条的 2.2 倍）：
       第 1 行   [勾选] 标题（最多 2 行，超出省略）              [✎][🗑]
       第 2 行   ★重要 ↻每天 · 备注（一行省略）          今天 10:00
     这里必须用 grid 把两行「定死」：flex 换行是按「内容的自然宽度」判定的，长标题（上千 px）
     会先把勾选圈/图标挤走；标题 flex-basis 设 0 又会让它和副信息挤在同一行、被压成竖排 —— 都不行。 */
  .rem-item{
    display:grid;align-items:start;
    grid-template-columns:26px minmax(0,1fr) auto;
    column-gap:10px;row-gap:2px;padding:12px 8px;
  }
  .rem-main{display:contents}          /* 让标题/副信息成为 grid 的直接子级，手机才能这样重排 */
  .rem-check{grid-area:1/1;width:26px;height:26px;margin-top:1px}
  .rem-title{grid-area:1/2;min-width:0;font-size:15px;line-height:1.45}
  .rem-acts{grid-area:1/3;justify-self:end;margin-top:-4px;opacity:1;gap:2px}
  .rem-acts .icon-btn{width:38px;height:38px;border-radius:11px}
  .rem-sub{grid-area:2/2;min-width:0;margin-top:2px}
  .rem-note{flex:1 1 0;min-width:0}
  .rem-when{grid-area:2/3;justify-self:end;min-width:0;margin-top:2px;text-align:right}
  .rem-when b,.rem-when span{display:inline;font-size:12.5px}
  .rem-when span{margin-left:5px}
  .rem-bar{gap:10px}
  #remFilterHint{margin-left:0;width:100%}

  /* 到点弹窗：铺满底部，三个按钮均分好点 */
  .rem-pop-wrap{right:12px;left:12px;bottom:12px;max-width:none}
  .rem-pop-foot .btn{flex:1 1 auto;justify-content:center;padding:9px 10px}
}

/* ============================================================
   自动更新提示条
   ------------------------------------------------------------
   部署完新版本后，页面自己会去问 /?action=build：
     · 没在填东西 → 直接自动刷新（用户什么都不用做）
     · 正在填表 / 开着弹窗 → 只显示这一条，点「立即更新」才刷新
   ============================================================ */
.update-bar{
  position:fixed;left:50%;top:12px;transform:translateX(-50%);
  z-index:140;display:flex;align-items:center;gap:10px;
  padding:9px 12px 9px 16px;border-radius:999px;
  background:var(--brand);color:#fff;font-size:13.5px;font-weight:600;
  box-shadow:0 12px 28px rgba(79,70,229,.32);
  animation:update-bar-in .22s ease-out;
}
.update-bar[hidden]{display:none}
.update-bar .btn{
  background:rgba(255,255,255,.2);border:1px solid rgba(255,255,255,.55);
  color:#fff;font-weight:600;padding:5px 14px;font-size:13px;
}
.update-bar .btn:hover{background:rgba(255,255,255,.32);border-color:#fff;color:#fff}
.update-bar .update-x{
  background:none;border:0;color:rgba(255,255,255,.82);
  font:inherit;font-size:17px;line-height:1;cursor:pointer;
  padding:2px 6px;border-radius:8px;
}
.update-bar .update-x:hover{color:#fff;background:rgba(255,255,255,.16)}
@keyframes update-bar-in{
  from{opacity:0;transform:translate(-50%,-8px)}
  to{opacity:1;transform:translate(-50%,0)}
}

@media (max-width:560px){
  /* 手机上贴底部：拇指够得着，也不会盖住顶栏的通知铃铛和「记一笔」 */
  .update-bar{
    top:auto;bottom:12px;left:12px;right:12px;transform:none;
    justify-content:center;padding:12px 14px;
    animation:update-bar-in-m .22s ease-out;
  }
}
@keyframes update-bar-in-m{
  from{opacity:0;transform:translateY(8px)}
  to{opacity:1;transform:translateY(0)}
}

