/* 青云惠家 · 四系统原型 共享样式 */
:root{
  --ink:#1a1d21; --muted:#6b7280; --line:#e5e7eb; --line2:#f1f2f4;
  --bg:#f4f5f7; --card:#ffffff;
  --primary:#b6462c; --primary-soft:#fdf1ed; --primary-dark:#8f3520;
  --gold:#b8860b; --gold-soft:#fdf8e8;
  --ok:#15803d; --ok-soft:#eefaf1;
  --warn:#b45309; --warn-soft:#fff7ed;
  --danger:#b91c1c; --danger-soft:#fef2f2;
  --blue:#1d4ed8; --blue-soft:#eef2ff;
  --navy:#0f2942; --navy2:#173f5f;
  --radius:10px;
}
*{box-sizing:border-box; -webkit-tap-highlight-color:transparent;}
html,body{margin:0; padding:0;}
body{
  background:var(--bg); color:var(--ink);
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Hiragino Sans GB","Microsoft YaHei",sans-serif;
  font-size:14px; line-height:1.7;
}
a{color:var(--primary); text-decoration:none;}
button{font-family:inherit;}
small{font-size:12px;}

/* ---------- 布局 ---------- */
.layout{display:flex; min-height:100vh;}
.side{
  width:216px; flex:0 0 216px; background:linear-gradient(180deg,var(--navy) 0%,var(--navy2) 100%);
  color:#fff; padding:18px 0 30px; position:sticky; top:0; height:100vh; overflow-y:auto;
}
.side .brand{padding:0 18px 16px; border-bottom:1px solid rgba(255,255,255,.14); margin-bottom:12px;}
.side .brand b{display:block; font-size:15px;}
.side .brand span{font-size:11.5px; opacity:.7; letter-spacing:.08em;}
.side .grp{padding:14px 18px 6px; font-size:11px; letter-spacing:.12em; opacity:.55;}
.side a.item{
  display:flex; align-items:center; gap:8px; padding:9px 18px; color:rgba(255,255,255,.85);
  font-size:13.5px; border-left:3px solid transparent; cursor:pointer;
}
.side a.item:hover{background:rgba(255,255,255,.08); color:#fff;}
.side a.item.on{background:rgba(255,255,255,.13); color:#fff; border-left-color:#e0a04a; font-weight:600;}
.side a.item .dot{width:6px; height:6px; border-radius:50%; background:#e0a04a; opacity:0; }
.side a.item.on .dot{opacity:1;}

.main{flex:1; min-width:0; display:flex; flex-direction:column;}
.topbar{
  background:#fff; border-bottom:1px solid var(--line); padding:13px 24px;
  display:flex; align-items:center; justify-content:space-between; gap:16px;
  position:sticky; top:0; z-index:30;
}
.topbar h1{margin:0; font-size:17px; font-weight:700;}
.topbar .sub{font-size:12.5px; color:var(--muted); margin-top:2px;}
.topbar .right{display:flex; align-items:center; gap:10px; font-size:13px; color:var(--muted);}
.content{padding:20px 24px 60px; max-width:1280px; width:100%;}
.avatar{width:30px; height:30px; border-radius:50%; background:var(--primary-soft); color:var(--primary);
  display:flex; align-items:center; justify-content:center; font-weight:700; font-size:12.5px;}

/* ---------- 卡片 / 栅格 ---------- */
.grid{display:grid; gap:14px;}
.g2{grid-template-columns:repeat(2,minmax(0,1fr));}
.g3{grid-template-columns:repeat(3,minmax(0,1fr));}
.g4{grid-template-columns:repeat(4,minmax(0,1fr));}
.g5{grid-template-columns:repeat(5,minmax(0,1fr));}
.g23{grid-template-columns:2fr 1fr;}
.g32{grid-template-columns:1fr 2fr;}
@media(max-width:1080px){ .g4,.g5{grid-template-columns:repeat(2,minmax(0,1fr));} .g23,.g32{grid-template-columns:1fr;} }
@media(max-width:760px){ .grid{grid-template-columns:1fr!important;} .side{display:none;} }

.card{background:var(--card); border:1px solid var(--line); border-radius:var(--radius); padding:16px 18px;}
.card.tight{padding:12px 14px;}
.card h3{margin:0 0 12px; font-size:14.5px; display:flex; align-items:center; justify-content:space-between; gap:10px;}
.card h3 .r{font-size:12px; color:var(--muted); font-weight:400;}
.hd{display:flex; align-items:center; justify-content:space-between; gap:12px; margin:22px 0 12px;}
.hd h2{margin:0; font-size:16px;}
.hd .r{font-size:12.5px; color:var(--muted);}
.mt{margin-top:16px;} .mt-s{margin-top:8px;}

/* KPI */
.kpi{background:#fff; border:1px solid var(--line); border-radius:var(--radius); padding:14px 16px;}
.kpi .lab{font-size:12.5px; color:var(--muted); display:flex; align-items:center; gap:6px;}
.kpi .val{font-size:24px; font-weight:700; letter-spacing:-.02em; margin-top:4px; font-variant-numeric:tabular-nums;}
.kpi .val small{font-size:12px; font-weight:400; color:var(--muted); margin-left:3px;}
.kpi .foot{font-size:12px; color:var(--muted); margin-top:3px;}
.kpi.acc .val{color:var(--primary);} .kpi.ok .val{color:var(--ok);}
.kpi.warn .val{color:var(--warn);} .kpi.blu .val{color:var(--blue);}
.kpi.dan .val{color:var(--danger);}

/* ---------- 按钮 / 徽标 ---------- */
.btn{display:inline-flex; align-items:center; justify-content:center; gap:6px;
  border:1px solid var(--line); background:#fff; color:var(--ink); padding:7px 13px;
  border-radius:8px; font-size:13px; cursor:pointer; transition:.15s; white-space:nowrap;}
.btn:hover{border-color:#c9ccd2; background:#fafafa;}
.btn.pri{background:var(--primary); border-color:var(--primary); color:#fff;}
.btn.pri:hover{background:var(--primary-dark); border-color:var(--primary-dark);}
.btn.dark{background:var(--navy); border-color:var(--navy); color:#fff;}
.btn.ghost{border-color:transparent; background:#f3f4f6;}
.btn.sm{padding:4px 9px; font-size:12px; border-radius:6px;}
.btn.block{width:100%;}
.btn.danger{color:var(--danger); border-color:#f3c9c9; background:#fff;}
.btn:disabled{opacity:.45; cursor:not-allowed;}
.badge{display:inline-flex; align-items:center; gap:4px; padding:2px 8px; border-radius:999px;
  font-size:11.5px; border:1px solid; line-height:1.6; white-space:nowrap;}
.b-ok{background:var(--ok-soft); border-color:#bfe6cb; color:var(--ok);}
.b-warn{background:var(--warn-soft); border-color:#fcd9b0; color:var(--warn);}
.b-dan{background:var(--danger-soft); border-color:#fbc9c9; color:var(--danger);}
.b-info{background:var(--blue-soft); border-color:#c7d2fe; color:var(--blue);}
.b-mute{background:#f3f4f6; border-color:var(--line); color:var(--muted);}
.b-gold{background:var(--gold-soft); border-color:#f0dfa8; color:var(--gold);}

/* ---------- 表格 ---------- */
table{width:100%; border-collapse:collapse; font-size:13px;}
th,td{padding:9px 10px; text-align:left; border-bottom:1px solid var(--line2);}
thead th{background:#fafbfc; color:#4b5563; font-weight:600; font-size:12.5px; white-space:nowrap;}
tbody tr:hover{background:#fcfcfd;}
td.num,th.num{text-align:right; font-variant-numeric:tabular-nums;}
tfoot td{background:#fafbfc; font-weight:600;}
.tbox{overflow-x:auto;}
.mono{font-variant-numeric:tabular-nums; font-family:ui-monospace,SFMono-Regular,Menlo,monospace; font-size:12px;}

/* ---------- 表单 ---------- */
label.f{display:block; margin-bottom:12px;}
label.f span{display:block; font-size:12.5px; color:var(--muted); margin-bottom:5px;}
input,select,textarea{width:100%; border:1px solid var(--line); border-radius:8px; padding:8px 10px;
  font-size:13.5px; font-family:inherit; background:#fff; color:var(--ink);}
input:focus,select:focus,textarea:focus{outline:none; border-color:var(--primary); box-shadow:0 0 0 3px var(--primary-soft);}
.hint{font-size:12px; color:var(--muted); margin-top:-6px; margin-bottom:12px;}
.switch{display:flex; align-items:center; gap:8px; font-size:13.5px;}
.switch input{width:auto;}

/* ---------- 进度 / 条 ---------- */
.bar{height:8px; border-radius:999px; background:#eef0f3; overflow:hidden;}
/* 最小可见宽度：抵扣进度常常只有 2~3%（抵扣金相对全年物业费），
   纯粹按百分比渲染是一条几乎看不见的细线，看起来像组件坏了。 */
.bar i{display:block; height:100%; background:var(--primary); border-radius:999px; min-width:7px;}
.bar i.ok{background:var(--ok);} .bar i.blu{background:var(--blue);} .bar i.gold{background:var(--gold);}

/* ---------- 提示块 ---------- */
.note{border-radius:9px; border:1px solid; padding:11px 13px; font-size:13px; margin:12px 0;}
.note b{display:block; margin-bottom:3px;}
.note.ok{background:var(--ok-soft); border-color:#bfe6cb; color:#14532d;}
.note.warn{background:var(--warn-soft); border-color:#fcd9b0; color:#7c2d12;}
.note.dan{background:var(--danger-soft); border-color:#fbc9c9; color:#7f1d1d;}
.note.info{background:var(--blue-soft); border-color:#c7d2fe; color:#1e3a8a;}
.note.mute{background:#f9fafb; border-color:var(--line); color:#374151;}

/* ---------- 弹层 / toast ---------- */
.mask{position:fixed; inset:0; background:rgba(15,25,40,.45); display:none; align-items:center; justify-content:center;
  z-index:200; padding:20px;}
.mask.on{display:flex;}
.modal{background:#fff; border-radius:12px; width:100%; max-width:520px; max-height:86vh; overflow-y:auto; padding:20px 22px;}
.modal h3{margin:0 0 14px; font-size:16px;}
.modal .acts{display:flex; justify-content:flex-end; gap:10px; margin-top:20px;}
#toast{position:fixed; left:50%; bottom:38px; transform:translateX(-50%) translateY(20px); opacity:0;
  background:#1f2937; color:#fff; padding:10px 18px; border-radius:8px; font-size:13.5px; z-index:300;
  transition:.25s; pointer-events:none; max-width:80vw;}
#toast.on{opacity:1; transform:translateX(-50%) translateY(0);}

/* ---------- 手机壳 ---------- */
.phone-wrap{min-height:100vh; background:linear-gradient(135deg,#0f2942,#2b6b8f 70%,#3f7fa3);
  display:flex; align-items:flex-start; justify-content:center; gap:26px; padding:26px 18px 40px; flex-wrap:wrap;}
.phone{width:390px; height:780px; background:#fff; border-radius:34px; box-shadow:0 22px 60px rgba(0,0,0,.35);
  overflow:hidden; display:flex; flex-direction:column; position:relative; border:8px solid #10161f;}
.p-status{height:38px; flex:0 0 38px; display:flex; align-items:center; justify-content:space-between;
  padding:0 20px; font-size:12px; color:#111; background:#fff;}
.p-nav{flex:0 0 auto; padding:8px 18px 12px; font-size:16px; font-weight:700; background:#fff; border-bottom:1px solid var(--line2);}
.p-body{flex:1; overflow-y:auto; background:#f5f6f8; padding:14px 16px 90px;}
.p-tab{position:absolute; bottom:0; left:0; right:0; height:62px; background:#fff; border-top:1px solid var(--line);
  display:flex; align-items:center;}
.p-tab a{flex:1; text-align:center; font-size:11px; color:var(--muted); cursor:pointer;}
.p-tab a i{display:block; font-size:17px; font-style:normal; margin-bottom:1px; line-height:1.1;}
.p-tab a.on{color:var(--primary); font-weight:600;}
.side-note{width:330px; color:#fff; font-size:13.5px; line-height:1.8; padding-top:10px;}
.side-note h2{font-size:18px; margin:0 0 8px;}
.side-note .box{background:rgba(255,255,255,.1); border:1px solid rgba(255,255,255,.2); border-radius:10px;
  padding:12px 14px; margin-top:12px;}
.side-note .box b{color:#ffd9a0; display:block; margin-bottom:4px;}
.side-note a{color:#ffd9a0;}

/* ---------- 产品模式：手机端全屏外壳 ----------
   原型模式下 .phone-wrap 是「手机壳 + 右侧说明栏」，那是给评审看的。
   真正给用户用的页面在 body 上加 .app-mode：全屏、无边框、无假状态栏、无说明栏，
   并处理刘海与底部手势条的安全区（页面已声明 viewport-fit=cover）。 */
body.app-mode{background:#f5f6f8;}
body.app-mode .phone-wrap{height:100vh; height:100dvh; min-height:0; background:#f5f6f8;
  display:block; padding:0; gap:0; overflow:hidden;}
body.app-mode .phone{width:100%; max-width:100%; height:100vh; height:100dvh;
  border:0; border-radius:0; box-shadow:none; background:#f5f6f8;}
body.app-mode .p-status,body.app-mode .side-note,body.app-mode .side-note-legacy{display:none;}
body.app-mode .p-nav{padding-top:calc(12px + env(safe-area-inset-top)); background:#fff;}
body.app-mode .p-body{padding-bottom:calc(92px + env(safe-area-inset-bottom)); -webkit-overflow-scrolling:touch;}
body.app-mode .p-tab{height:calc(62px + env(safe-area-inset-bottom)); padding-bottom:env(safe-area-inset-bottom);}
/* 桌面上不拉伸：居中一列 390px，像真实的手机页面 */
@media (min-width:760px){
  body.app-mode .phone-wrap{display:flex; justify-content:center; background:#eef1f5;}
  body.app-mode .phone{width:390px; max-width:390px; border-left:1px solid var(--line); border-right:1px solid var(--line);}
}

/* 手机内小卡 */
.mcard{background:#fff; border-radius:12px; padding:14px 15px; margin-bottom:12px; box-shadow:0 1px 3px rgba(16,24,40,.05);}
.mcard.hero{background:linear-gradient(135deg,#b6462c,#d4754f); color:#fff;}
.mcard.hero .lab{opacity:.85; font-size:12.5px;}
.mcard.hero .big{font-size:33px; font-weight:700; line-height:1.25; letter-spacing:-.02em;}
.mrow{display:flex; align-items:center; justify-content:space-between; gap:10px; padding:11px 0; border-bottom:1px solid var(--line2);}
.mrow:last-child{border-bottom:none;}
.mrow .l{flex:1; min-width:0;}
.mrow .l b{display:block; font-size:14px; font-weight:600;}
.mrow .l span{font-size:12px; color:var(--muted);}
.mlist{background:#fff; border-radius:12px; overflow:hidden; margin-bottom:12px;}
.mlist .h{padding:11px 15px; font-size:13px; font-weight:600; border-bottom:1px solid var(--line2); display:flex; justify-content:space-between;}
.mgrid{display:grid; grid-template-columns:repeat(4,1fr); gap:4px; background:#fff; border-radius:12px; padding:14px 8px; margin-bottom:12px; text-align:center;}
.mgrid a{font-size:11.5px; color:#374151; cursor:pointer;}
.mgrid a i{display:flex; width:42px; height:42px; margin:0 auto 5px; border-radius:12px; background:var(--primary-soft);
  color:var(--primary); align-items:center; justify-content:center; font-size:19px; font-style:normal;}
.mgrid a i.g{background:var(--gold-soft); color:var(--gold);}
.mgrid a i.b{background:var(--blue-soft); color:var(--blue);}
.mgrid a i.k{background:var(--ok-soft); color:var(--ok);}

/* 微工具 */
.flex{display:flex; align-items:center; gap:8px;}
.flex.wrap{flex-wrap:wrap;}
.between{justify-content:space-between;}
.right{text-align:right;}
.mut{color:var(--muted);}
.pos{color:var(--ok);} .neg{color:var(--danger);} .acc{color:var(--primary);}
.small{font-size:12px;}
.nowrap{white-space:nowrap;}
.sep{height:1px; background:var(--line2); margin:14px 0;}
.chip{display:inline-block; padding:4px 11px; border-radius:999px; border:1px solid var(--line);
  background:#fff; font-size:12.5px; cursor:pointer; color:#4b5563;}
.chip.on{background:var(--primary); border-color:var(--primary); color:#fff; font-weight:600;}
.tabs{display:flex; gap:6px; border-bottom:1px solid var(--line); margin-bottom:14px; overflow-x:auto;}
.tabs div{padding:9px 12px; font-size:13.5px; color:var(--muted); cursor:pointer; border-bottom:2px solid transparent; white-space:nowrap;}
.tabs div.on{color:var(--primary); border-bottom-color:var(--primary); font-weight:600;}
.empty{padding:34px 10px; text-align:center; color:var(--muted); font-size:13px;}
.list-clean{list-style:none; margin:0; padding:0;}
.list-clean li{padding:9px 0; border-bottom:1px solid var(--line2); font-size:13.5px; display:flex; gap:10px;}
.list-clean li:last-child{border-bottom:none;}
.list-clean li .n{flex:0 0 auto; width:20px; height:20px; border-radius:50%; background:var(--primary-soft); color:var(--primary);
  font-size:11.5px; display:flex; align-items:center; justify-content:center; font-weight:700; margin-top:3px;}
.step{display:flex; gap:10px; margin-bottom:10px; font-size:13px;}
.step .n{flex:0 0 auto; width:22px; height:22px; border-radius:6px; background:var(--navy); color:#fff; font-size:12px;
  display:flex; align-items:center; justify-content:center; font-weight:600;}
.devtip{background:#fffbeb; border:1px dashed #f0d9a0; border-radius:8px; padding:9px 12px; font-size:12.5px; color:#8a6414;}

/* 窄屏（手机）访问后台时的提示条：后台按电脑布局设计 */
.mobonly{display:none;}
@media (max-width:900px){
  .mobonly{display:block; background:#fffbeb; border:1px dashed #f0d9a0; border-radius:8px;
    padding:9px 12px; margin:12px 14px 0; font-size:12.5px; line-height:1.7; color:#8a6414;}
  .mobonly b{color:#7a5410;}
}
