/* 成本分析站点 · 共享样式（light theme / slate-500/600 灰阶 / 偏大字号） */
:root{
  --bg:#f5f7fa; --card:#ffffff; --ink:#0f172a; --ink2:#334155; --muted:#64748b;
  --line:#e2e8f0; --brand:#4f46e5; --brand2:#4338ca;
  --house:#4f46e5; --admin:#0d9488; --car:#d97706;
  --shadow:0 1px 2px rgba(15,23,42,.05),0 10px 30px rgba(15,23,42,.05);
  --nav-h:64px; --sidebar-w:216px; --maxw:1400px;
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{margin:0;background:var(--bg);color:var(--ink);
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;
  font-size:15.5px;line-height:1.65;-webkit-font-smoothing:antialiased}
a{color:inherit;text-decoration:none}

/* ---------- Header ---------- */
.site-header{position:sticky;top:0;z-index:50;height:var(--nav-h);background:#fff;
  border-bottom:1px solid var(--line);display:flex;align-items:center;padding:0 26px;gap:18px}
.brand{display:flex;align-items:center;gap:11px;font-weight:760;font-size:18px;letter-spacing:-.3px;white-space:nowrap}
.brand .mark{width:34px;height:34px;border-radius:9px;background:linear-gradient(135deg,var(--brand),#7c3aed);
  display:flex;align-items:center;justify-content:center;color:#fff;font-size:19px}
.brand .sep{color:#cbd5e1;font-weight:400}
.brand .sub{color:var(--muted);font-size:15px;font-weight:600}
.header-right{margin-left:auto;display:flex;align-items:center;gap:14px;color:var(--muted);font-size:13.5px}
.header-right .dot{width:8px;height:8px;border-radius:50%;background:#22c55e;display:inline-block;margin-right:6px}
.menu-btn{display:none;background:none;border:1px solid var(--line);border-radius:8px;padding:6px 10px;cursor:pointer;color:var(--ink2)}

/* ---------- Layout ---------- */
.layout{display:flex;max-width:var(--maxw);margin:0 auto;align-items:flex-start}
.sidebar{width:var(--sidebar-w);flex:0 0 var(--sidebar-w);position:sticky;top:var(--nav-h);
  height:calc(100vh - var(--nav-h));overflow-y:auto;padding:22px 14px 30px;border-right:1px solid var(--line);background:#fff}
.nav-group{margin-bottom:22px}
.nav-title{font-size:12px;font-weight:700;color:#94a3b8;letter-spacing:.08em;padding:0 12px;margin-bottom:8px}
.nav-item{display:flex;align-items:center;gap:10px;padding:9px 12px;border-radius:9px;color:var(--ink2);
  font-size:14.5px;font-weight:600;margin-bottom:3px;transition:.15s}
.nav-item:hover{background:#f1f5f9;color:var(--brand)}
.nav-item.active{background:#eef2ff;color:var(--brand2)}
.nav-item .ico{width:18px;text-align:center;font-size:15px}
.nav-item .tag{margin-left:auto;font-size:11px;color:#94a3b8;font-weight:600}
.main{flex:1;min-width:0;padding:26px 30px 60px}
/* 统一首页嵌入模式：去掉独立页的 Header / Sidebar / Footer */
body.embed{background:var(--bg);padding:20px 26px 40px;max-width:1400px;margin:0 auto}
body.embed .page-head{margin-bottom:16px}
body.embed .page-head h1{font-size:24px}
body.embed .crumb{display:none}
body.embed .card{box-shadow:none}

/* ---------- Page header ---------- */
.page-head{margin-bottom:22px}
.page-head h1{font-size:28px;line-height:1.25;margin:0 0 6px;font-weight:760;letter-spacing:-.5px}
.page-head .desc{color:var(--muted);font-size:15px}
.crumb{color:#94a3b8;font-size:13px;margin-bottom:8px}
.crumb b{color:var(--muted);font-weight:600}

/* ---------- Cards ---------- */
.card{background:var(--card);border:1px solid var(--line);border-radius:14px;padding:22px 24px;
  box-shadow:var(--shadow);margin-bottom:20px}
.card h2{font-size:19px;margin:0 0 4px;font-weight:720}
.card h3{font-size:16px;margin:0 0 14px;font-weight:680;color:var(--ink2)}
.note{color:var(--muted);font-size:13.5px;margin:2px 0 16px}
.grid2{display:grid;grid-template-columns:1fr 1fr;gap:20px}
.grid3{display:grid;grid-template-columns:repeat(3,1fr);gap:20px}
.grid4{display:grid;grid-template-columns:repeat(4,1fr);gap:16px}
@media(max-width:1180px){.grid3,.grid4{grid-template-columns:repeat(2,1fr)}}
@media(max-width:920px){.grid2,.grid3,.grid4{grid-template-columns:1fr}}

/* ---------- KPI ---------- */
.kpi{background:var(--card);border:1px solid var(--line);border-radius:14px;padding:19px 21px;box-shadow:var(--shadow)}
.kpi .lbl{color:var(--muted);font-size:13.5px;font-weight:600}
.kpi .val{font-size:29px;font-weight:760;letter-spacing:-.5px;margin-top:5px;line-height:1.15}
.kpi .sub2{color:var(--muted);font-size:12.5px;margin-top:4px}

/* ---------- Table ---------- */
table{width:100%;border-collapse:collapse;font-size:14px}
th,td{padding:9px 10px;text-align:left;border-bottom:1px solid var(--line)}
th{color:var(--muted);font-weight:650;font-size:13px;background:#f8fafc;position:sticky;top:0;z-index:1}
td.num,th.num{text-align:right;font-variant-numeric:tabular-nums}
tr:last-child td{border-bottom:none}
tbody tr:hover{background:#f8fafc}
.table-wrap{max-height:460px;overflow:auto;border:1px solid var(--line);border-radius:10px}

/* ---------- Bar list ---------- */
.bar-row{display:grid;grid-template-columns:180px 1fr 92px;gap:12px;align-items:center;margin-bottom:9px;font-size:14px}
.bar-track{height:15px;background:#f1f5f9;border-radius:8px;overflow:hidden}
.bar-fill{height:100%;border-radius:8px;transition:width .6s ease}
.bar-val{text-align:right;font-variant-numeric:tabular-nums;color:var(--ink2);font-weight:600}
.bar-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--ink2)}

/* ---------- Misc ---------- */
.legend{display:flex;gap:18px;flex-wrap:wrap;margin:6px 0 14px;font-size:13.5px;color:var(--ink2)}
.legend i{display:inline-block;width:10px;height:10px;border-radius:3px;margin-right:6px}
.pill{display:inline-block;padding:2px 9px;border-radius:6px;font-size:12px;font-weight:650}
.pill.h{background:#eef2ff;color:#4338ca}.pill.a{background:#f0fdfa;color:#0f766e}.pill.c{background:#fffbeb;color:#b45309}
.tag{font-size:12px;padding:2px 8px;border-radius:6px;background:#f1f5f9;color:var(--muted);font-weight:600}
.alert{background:#fffbeb;border-color:#fde68a}
.alert h2,.alert h3{color:#92400e}
.insight{background:linear-gradient(180deg,#f8fafc,#fff);border-left:4px solid var(--brand)}
.insight ul{margin:10px 0 0;padding-left:20px}
.insight li{margin-bottom:9px;color:var(--ink2)}
.insight b{color:var(--ink)}
.chart{width:100%;overflow-x:auto}
svg text{font-family:inherit}

/* ---------- Footer ---------- */
.site-footer{border-top:1px solid var(--line);background:#fff;margin-top:40px;padding:22px 30px;color:var(--muted);font-size:13px}
.footer-inner{max-width:var(--maxw);margin:0 auto;display:flex;justify-content:space-between;gap:20px;flex-wrap:wrap}
.footer-inner b{color:var(--ink2)}

/* ---------- Mobile ---------- */
@media(max-width:820px){
  .site-header{padding:0 14px;gap:10px}
  .menu-btn{display:inline-block}
  .sidebar{position:fixed;left:-260px;top:var(--nav-h);z-index:45;width:250px;transition:.2s;box-shadow:8px 0 24px rgba(0,0,0,.08)}
  .sidebar.open{left:0}
  .main{padding:18px 12px 50px}
  .brand{font-size:16px;gap:8px}
  .brand .mark{width:28px;height:28px;border-radius:8px;font-size:15px}
  .brand .sub{display:none}
  .header-right{font-size:12px;gap:8px}
  .page-head h1{font-size:21px;letter-spacing:-.3px}
  .page-head .desc{font-size:13.5px}
  body.embed{padding:14px 12px 30px}
  body.embed .page-head h1{font-size:21px}
  .card{padding:15px 13px;border-radius:12px}
  .kpi{padding:13px 14px}
  .kpi .val{font-size:22px}
  .bar-row{grid-template-columns:118px 1fr 78px;gap:8px}
  .bar-name{font-size:13px}
  table{font-size:13px}
  th,td{padding:7px 8px}
  .table-wrap,.chart,.bscroll{-webkit-overflow-scrolling:touch}
  .site-footer{padding:16px 14px}
}
@media(max-width:420px){
  .header-right .dot{margin-right:4px}
  .legend{gap:12px;font-size:12.5px}
}
