:root{
  --p:#2563eb; --p2:#1d4ed8; --bg:#f1f5f9; --card:#fff; --line:#e2e8f0;
  --text:#1e293b; --muted:#64748b; --ok:#16a34a; --warn:#f59e0b; --err:#dc2626;
}
*{box-sizing:border-box;margin:0;padding:0}
body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Microsoft YaHei",sans-serif;background:var(--bg);color:var(--text);font-size:14px}
a{color:var(--p);text-decoration:none}
button{cursor:pointer;font-size:14px;border:none;border-radius:6px;padding:8px 14px;background:var(--p);color:#fff;transition:.15s}
button:hover{background:var(--p2)}
button.ghost{background:#fff;color:var(--p);border:1px solid var(--p)}
button.danger{background:var(--err)}
button.danger:hover{background:#b91c1c}
button.sm{padding:4px 10px;font-size:12px}
input,select,textarea{padding:8px 10px;border:1px solid var(--line);border-radius:6px;width:100%;font-size:14px;background:#fff;color:var(--text)}
label{display:block;margin:10px 0 4px;color:var(--muted);font-size:13px}
.row{display:flex;gap:12px;flex-wrap:wrap}
.row>*{flex:1;min-width:160px}
.card{background:var(--card);border:1px solid var(--line);border-radius:12px;padding:18px;margin-bottom:16px;box-shadow:0 1px 3px rgba(15,23,42,.05)}
.card h3{font-size:15px;margin-bottom:14px}
.card h4{font-size:14px;color:var(--text)}
button.ghost:hover{background:#eff6ff}

/* 布局 */
.layout{display:flex;height:100vh;overflow:hidden}
.sidebar{width:252px;height:100vh;overflow:hidden;background:linear-gradient(180deg,#0b1424 0%,#0f1c31 45%,#0c1626 100%);color:#cbd5e1;flex-shrink:0;display:flex;flex-direction:column;border-right:1px solid rgba(148,163,184,.08);box-shadow:2px 0 26px rgba(2,6,23,.22)}
.sidebar .brand{display:flex;align-items:center;gap:12px;padding:20px 18px;border-bottom:1px solid rgba(148,163,184,.12)}
.sidebar .brand .logo{width:50px;height:50px;border-radius:15px;background:#fff;overflow:hidden;flex-shrink:0;display:flex;align-items:center;justify-content:center;box-shadow:0 8px 20px rgba(2,6,23,.5),0 0 0 1px rgba(255,255,255,.08)}
.sidebar .brand .logo img{width:100%;height:100%;object-fit:contain;padding:4px;display:block}
.sidebar .brand .bname{display:flex;flex-direction:column;line-height:1.2;letter-spacing:.02em;min-width:0}
.sidebar .brand .bname b{font-size:18px;font-weight:700;color:#fff;white-space:nowrap}
.sidebar .brand .usub{display:flex;align-items:center;gap:6px;margin-top:5px;min-width:0}
.sidebar .brand .usub .uname{font-size:12px;color:#8ea4bf;letter-spacing:.04em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:122px}
.sidebar .brand .usub .u-out{flex:none;display:inline-flex;align-items:center;justify-content:center;width:21px;height:21px;border-radius:6px;color:#7c8ba1;cursor:pointer;transition:.15s}
.sidebar .brand .usub .u-out:hover{color:#fca5a5;background:rgba(248,113,113,.18)}
.sidebar .brand .usub .u-out .ic{width:14px;height:14px}
.sidebar .nav{flex:1;overflow:auto;padding:8px 12px 12px}
.sidebar .nav::-webkit-scrollbar{width:6px}
.sidebar .nav::-webkit-scrollbar-thumb{background:rgba(148,163,184,.25);border-radius:3px}
.sidebar .nav-group{padding:18px 10px 8px;font-size:11px;letter-spacing:.16em;color:#5f7089;font-weight:700}
.sidebar a{display:flex;align-items:center;gap:12px;padding:11px 12px;margin:2px 0;color:#c3cfdd;border-radius:10px;font-size:14px;font-weight:500;transition:.16s}
.sidebar a .ni{width:24px;height:20px;display:inline-flex;align-items:center;justify-content:center;font-size:16px;line-height:1;flex:none}
.sidebar a:hover{background:rgba(148,163,184,.13);color:#fff}
.sidebar a.active{background:linear-gradient(90deg,rgba(37,99,235,.95),rgba(37,99,235,.32));color:#fff;font-weight:600;box-shadow:inset 3px 0 0 0 #7dd3fc,0 8px 20px rgba(37,99,235,.35)}
.main{flex:1;display:flex;flex-direction:column;min-width:0;height:100vh;padding:18px 26px 30px;overflow:hidden}
#pageMain{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden}
.empty-main{flex:1;min-height:0;overflow-y:auto}
.tabbar{display:flex;gap:4px;align-items:flex-end;margin-bottom:16px;flex-wrap:wrap;border-bottom:1px solid var(--line)}
.tabbar .tab{display:flex;align-items:center;gap:8px;padding:8px 14px;background:#eef2f7;color:var(--muted);border-radius:8px 8px 0 0;font-size:13px;cursor:pointer;user-select:none;border:1px solid transparent;border-bottom:none;max-width:220px;margin-bottom:-1px}
.tabbar .tab .t{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tabbar .tab:hover{background:#e2e8f0}
.tabbar .tab.active{background:#fff;color:var(--p);border-color:var(--line);box-shadow:inset 0 -2px 0 var(--p);font-weight:600}
.tabbar .tab .x{padding:0 2px;font-size:14px;line-height:1;opacity:.45}
.tabbar .tab .x:hover{opacity:1;color:var(--err)}
.tab-pane{display:none}
.tab-pane.active{display:block}

/* 无标签页时的欢迎页 */
.empty-main{padding:2px}
/* 字典管理：左右结构 */
.dict-layout{display:flex;gap:18px;align-items:flex-start}
.dict-types{width:240px;flex-shrink:0;background:#fff;border:1px solid #e7ebf0;border-radius:12px;padding:10px;box-shadow:0 1px 3px rgba(15,23,42,.04)}
.dict-types-head{display:flex;align-items:center;justify-content:space-between;font-weight:600;color:#1e3a5f;padding:4px 6px 10px}
.dict-type{position:relative;padding:10px 10px;border-radius:9px;cursor:pointer;margin-bottom:6px;background:#f8fafc;border:1px solid transparent}
.dict-type:hover{background:#eef2f7}
.dict-type.active{background:#eaf2ff;border-color:#9cc2ff;box-shadow:inset 0 0 0 1px #9cc2ff}
.dict-type .dt-name{font-weight:600;color:#0f172a}
.dict-type .dt-key{font-size:12px;margin-top:2px}
.dict-type .dt-ops{position:absolute;top:8px;right:8px;display:none;gap:8px;font-size:12px}
.dict-type:hover .dt-ops{display:flex}
.dict-type .dt-ops span{color:#2563eb;cursor:pointer}
.dict-type .dt-ops span.danger{color:#dc2626}
.dict-items{flex:1;min-width:0;background:#fff;border:1px solid #e7ebf0;border-radius:12px;padding:14px 16px;box-shadow:0 1px 3px rgba(15,23,42,.04)}
/* 拖拽排序视觉提示 */
.dict-type[draggable="true"]{cursor:move}
.dict-type.dragging{opacity:.4}
tr[draggable="true"]{cursor:move}
tr.dragging{opacity:.4;background:#eaf2ff}
/* 必填标记 */
.req{color:#dc2626;margin-left:2px;font-weight:600}
/* 表格空数据占位：居中、灰色 */
td.empty{text-align:center;color:#9aa3af;padding:26px 12px}
/* 权限配置分区标题（后台 / 小程序端） */
.perm-head{display:flex;align-items:center;justify-content:space-between;margin:16px 0 8px;border-top:1px solid #eef1f5;padding-top:12px}
.perm-head:first-of-type{border-top:0;padding-top:0;margin-top:4px}
.perm-head h4{margin:0}
.perm-head a{font-size:12px;color:#2563eb;margin-left:10px}
.empty-hero{position:relative;overflow:hidden;border-radius:16px;padding:34px 32px;margin-bottom:22px;color:#fff;background:linear-gradient(135deg,#1e3a8a 0%,#2563eb 55%,#38bdf8 100%);box-shadow:0 18px 44px rgba(37,99,235,.3)}
.empty-hero::after{content:"";position:absolute;right:-60px;top:-60px;width:220px;height:220px;border-radius:50%;background:rgba(255,255,255,.12)}
.empty-hero::before{content:"";position:absolute;right:30px;bottom:-90px;width:180px;height:180px;border-radius:50%;background:rgba(255,255,255,.08)}
.empty-hero .hero-mark{width:54px;height:54px;border-radius:15px;background:rgba(255,255,255,.14);display:flex;align-items:center;justify-content:center;font-size:24px;font-weight:700;margin-bottom:14px;position:relative;z-index:1;overflow:hidden;backdrop-filter:blur(2px)}
.empty-hero .hero-mark img{width:100%;height:100%;object-fit:contain;padding:9px;display:block}
.empty-hero h1{font-size:22px;margin-bottom:8px;position:relative;z-index:1}
.empty-hero h1 span{color:#bfdbfe}
.empty-hero p{color:#dbeafe;font-size:13px;position:relative;z-index:1}
.tiles{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:14px}
.tile{display:flex;gap:12px;align-items:flex-start;background:#fff;border:1px solid var(--line);border-radius:12px;padding:16px 18px;cursor:pointer;transition:.16s}
.tile:hover{transform:translateY(-2px);box-shadow:0 12px 26px rgba(15,23,42,.1);border-color:#cbd5e1}
.tile .ico{width:38px;height:38px;border-radius:10px;background:#eff6ff;display:flex;align-items:center;justify-content:center;font-size:18px;flex-shrink:0}
.tile .tt{font-weight:600;margin-bottom:3px;color:var(--text)}
.tile .dd{font-size:12px;color:var(--muted);line-height:1.5}

/* 表格 */
table{width:100%;border-collapse:separate;border-spacing:0;background:#fff;font-size:13px;border:1px solid var(--line);border-radius:12px;overflow:hidden;box-shadow:0 1px 3px rgba(15,23,42,.05)}
th,td{padding:11px 14px;text-align:left;border-bottom:1px solid var(--line)}
th{background:#f8fafc;color:var(--muted);font-weight:600;white-space:nowrap}
tbody tr:last-child td{border-bottom:none}
tbody tr:hover{background:#f8fafc}
.muted{color:var(--muted)}
.tag{display:inline-block;padding:2px 8px;border-radius:10px;background:#e0f2fe;color:#0369a1;font-size:12px}
.tag.green{background:#dcfce7;color:#15803d}
.tag.gray{background:#e2e8f0;color:#475569}
.tag.red{background:#fee2e2;color:#b91c1c}
/* 分段选择（支出类别等） */
.seg{display:inline-flex;background:#eef2f7;border-radius:10px;padding:3px;gap:2px}
.seg .seg-btn{border:0;background:transparent;color:#475569;font-size:13px;font-weight:500;line-height:1;padding:8px 14px;border-radius:8px;cursor:pointer;transition:.15s;white-space:nowrap}
.seg .seg-btn:hover{color:#0f172a}
.seg .seg-btn.active{background:#fff;color:#0f172a;font-weight:600;box-shadow:0 1px 3px rgba(15,23,42,.14)}

/* 可搜索选择（工地等数量多的下拉） */
.picker{position:relative}
.picker input[type=text]{width:100%}
.picker-pop{position:absolute;left:0;right:0;top:calc(100% + 4px);z-index:70;background:#fff;border:1px solid var(--line);border-radius:10px;box-shadow:0 10px 30px rgba(15,23,42,.18);max-height:240px;overflow:auto;display:none}
.picker-pop.show{display:block}
.picker-item{padding:8px 12px;font-size:13px;cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.picker-item:hover{background:#f1f5f9}
.picker-item .sub{color:var(--muted);font-size:12px;margin-left:6px}
.picker-empty{padding:10px 12px;font-size:13px;color:var(--muted)}
/* 附件列表 */
.atts{display:flex;flex-wrap:wrap;gap:8px;margin:6px 0}
.att{display:inline-flex;align-items:center;gap:6px;background:#f1f5f9;border-radius:8px;padding:4px 8px;font-size:12px}
.att a{color:#0369a1;text-decoration:none;max-width:180px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.att .att-x{cursor:pointer;color:#b91c1c;font-weight:700}

/* 横向施工进度条 */
.steps{display:flex;align-items:flex-start;margin:16px 0 6px;overflow-x:auto;padding-bottom:6px}
.step{flex:1 0 auto;min-width:96px;text-align:center;position:relative}
.step .line{position:absolute;top:15px;left:50%;right:-50%;height:2px;background:#e2e8f0}
.step:last-child .line{display:none}
.step .dot{width:30px;height:30px;line-height:26px;border-radius:50%;margin:0 auto;background:#fff;color:#94a3b8;font-size:13px;font-weight:600;border:2px solid #e2e8f0;position:relative;z-index:1;box-sizing:border-box}
.step.done .dot{background:#16a34a;border-color:#16a34a;color:#fff}
.step.done .line{background:#16a34a}
.step.doing .dot{background:#0369a1;border-color:#0369a1;color:#fff;box-shadow:0 0 0 4px rgba(3,105,161,.12)}
.step .name{margin-top:8px;font-size:13px;color:#334155;white-space:nowrap}
.step.done .name{color:#15803d;font-weight:600}
.step.doing .name{color:#0369a1;font-weight:600}
.step .desc{margin-top:2px;font-size:12px;color:#94a3b8;white-space:nowrap}
.pager{display:flex;justify-content:flex-end;align-items:center;gap:10px;margin-top:12px}
.toolbar{display:flex;gap:10px;align-items:center;margin-bottom:14px;flex-wrap:wrap}
.toolbar>input,.toolbar>select,.toolbar>textarea{width:auto;max-width:220px}
.toolbar>input[type=date],.toolbar>select{min-width:130px}
.toolbar>input.daterange{max-width:260px}
.daterange{cursor:pointer;min-width:200px}
.range-pop{position:absolute;z-index:60;background:#fff;border:1px solid var(--line);border-radius:10px;box-shadow:0 10px 30px rgba(15,23,42,.18);padding:14px;min-width:240px}
.range-pop .rp-title{font-size:13px;color:var(--muted);margin-bottom:10px}
.range-pop .rp-row{display:flex;align-items:center;gap:8px;margin-bottom:10px}
.range-pop .rp-row span{flex:0 0 32px;color:var(--muted);font-size:13px}
.range-pop .rp-row input{width:100%}
.range-pop .rp-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:2px}

/* 弹窗 */
.modal-mask{position:fixed;inset:0;background:rgba(15,23,42,.45);display:none;align-items:flex-start;justify-content:center;padding-top:40px;z-index:50}
.modal-mask.show{display:flex}
.modal{background:#fff;border-radius:10px;width:720px;max-width:94vw;max-height:calc(100vh - 80px);overflow:auto;padding:18px 22px}
.modal h3{margin-bottom:12px}
.modal label{margin-top:8px}
.modal .actions{display:flex;justify-content:flex-end;gap:10px;margin-top:16px}
.money{font-variant-numeric:tabular-nums}
.kpis{display:flex;gap:14px;flex-wrap:wrap;margin-bottom:16px}
.kpi{flex:1;min-width:160px;background:#fff;border:1px solid var(--line);border-radius:10px;padding:16px}
.kpi .v{font-size:24px;font-weight:700}
.kpi .l{color:var(--muted);margin-top:4px}
.toast{position:fixed;top:20px;left:50%;transform:translateX(-50%);background:#0f172a;color:#fff;padding:10px 18px;border-radius:8px;z-index:99;opacity:0;transition:.2s}
.toast.show{opacity:1}
/* 图标 */
.ic{width:1.05em;height:1.05em;vertical-align:-0.15em;flex:none}
button .ic{margin-right:5px}
.brand .ic{margin-right:0}
/* 利润分析条形图 */
.bars{display:flex;flex-direction:column;gap:9px;margin-top:6px}
.bar-row{display:flex;align-items:center;gap:10px}
.bl{flex:0 0 96px;color:var(--muted);font-size:13px}
.bb{height:12px;border-radius:7px;background:linear-gradient(90deg,#2563eb,#38bdf8);box-shadow:0 1px 2px rgba(37,99,235,.25);min-width:2px}
.bb.b2{background:linear-gradient(90deg,#16a34a,#4ade80);box-shadow:0 1px 2px rgba(22,163,74,.25)}
.bv{flex:0 0 auto;font-weight:600;font-variant-numeric:tabular-nums;min-width:84px;text-align:right}

/* 登录页 */
.login-page{min-height:100vh;margin:0}
.login-wrap{display:flex;min-height:100vh;background:#fff}
/* 左：品牌展示区 */
.login-hero{position:relative;flex:1 1 auto;min-width:0;padding:64px 60px;display:flex;flex-direction:column;justify-content:space-between;color:#eaf2ff;overflow:hidden;background:linear-gradient(150deg,#0a1a30 0%,#123a6b 46%,#1d5fa8 100%)}
.login-hero .hero-glow{position:absolute;border-radius:50%;pointer-events:none}
.login-hero .hero-glow.g1{width:460px;height:460px;right:-140px;top:-150px;background:radial-gradient(circle,rgba(56,189,248,.5),transparent 66%)}
.login-hero .hero-glow.g2{width:400px;height:400px;left:-130px;bottom:-140px;background:radial-gradient(circle,rgba(37,99,235,.55),transparent 68%)}
.login-hero .hero-inner{position:relative;z-index:1;max-width:580px;margin:auto 0}
.login-hero h1{font-size:54px;line-height:1.15;font-weight:800;margin:28px 0 20px;letter-spacing:.03em;color:#fff}
.login-hero h1{background:linear-gradient(120deg,#ffffff 20%,#bcdcff 80%);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent}
.hero-sub{font-size:15.5px;line-height:1.9;color:#c9ddf6;max-width:470px}
.hero-points{list-style:none;margin:32px 0 0;display:flex;flex-direction:column;gap:13px}
.hero-points li{position:relative;padding-left:28px;font-size:14px;color:#d7e6fa;line-height:1.5}
.hero-points li::before{content:"";position:absolute;left:0;top:5px;width:14px;height:14px;border-radius:50%;background:linear-gradient(135deg,#38bdf8,#2563eb);box-shadow:0 0 0 3px rgba(56,189,248,.22)}
.hero-foot{position:relative;z-index:1;font-size:12.5px;color:rgba(214,231,251,.55);letter-spacing:.16em}
/* 右：登录表单区 */
.login-panel{flex:0 0 480px;display:flex;align-items:center;justify-content:center;padding:44px 34px;background:#fff}
.login-box{width:100%;max-width:392px;text-align:center}
.login-logo{width:auto;max-width:220px;max-height:120px;height:auto;display:block;margin:0 auto 12px}
.login-box h1{font-size:22px;font-weight:800;letter-spacing:.04em;color:#0f172a;margin-bottom:7px}
.login-box .sub{color:var(--muted);font-size:13px;margin-bottom:26px;letter-spacing:.08em}
.login-box .tabs{display:flex;background:#f1f5f9;border-radius:10px;padding:4px;margin-bottom:20px}
.login-box .tabs button{flex:1;background:transparent;color:var(--muted);padding:9px 0;border-radius:7px;font-weight:500}
.login-box .tabs button:hover{background:transparent;color:var(--p)}
.login-box .tabs button.active{background:#fff;color:var(--p);box-shadow:0 1px 3px rgba(0,0,0,.12)}
.login-box label{text-align:left}
.login-box input{padding:11px 12px}
.login-box input:focus{outline:none;border-color:var(--p);box-shadow:0 0 0 3px rgba(37,99,235,.15)}
.login-box .btn-block{margin-top:22px;width:100%;padding:12px;font-size:15px;font-weight:600;border-radius:9px;background:linear-gradient(135deg,#2563eb,#1d4ed8);box-shadow:0 10px 22px rgba(37,99,235,.32)}
.login-box .btn-block:hover{background:linear-gradient(135deg,#1d4ed8,#1e40af)}
.login-box .row{align-items:flex-end;gap:10px}
.login-box .row>input{flex:1}
.login-box .btn-code{flex:0 0 116px;padding:11px 0}
.login-box .tip{margin-top:18px;font-size:12px;color:var(--muted);text-align:center}
@media(max-width:900px){.login-hero{display:none}.login-panel{flex:1 1 auto}}
.hidden{display:none!important}
.chip{display:inline-block;padding:2px 8px;border-radius:6px;background:#f1f5f9;margin:2px;font-size:12px}
