:root{
  --bg:#f2f5f9; --panel:#fff; --ink:#1f2a37; --sub:#6b7a8d; --line:#e5ebf2;
  --blue:#1677ff; --blue-d:#0f5fd1; --teal:#0fb5a3; --green:#18a558; --yellow:#f5a623;
  --orange:#f5780f; --red:#e5484d; --navy:#0b2b55; --cyan:#22c1d6;
  --shadow:0 2px 12px rgba(20,60,110,.08); --radius:12px;
}
*{box-sizing:border-box;margin:0;padding:0}
html,body{height:100%}
body{font-family:-apple-system,"PingFang SC","Microsoft YaHei",Segoe UI,Roboto,sans-serif;background:var(--bg);color:var(--ink);font-size:14px}
button{font-family:inherit;cursor:border}
button{cursor:pointer}
::-webkit-scrollbar{width:8px;height:8px}
::-webkit-scrollbar-thumb{background:#c9d4e0;border-radius:4px}

/* ---------- Login ---------- */
.login-wrap{position:fixed;inset:0;display:flex;align-items:center;justify-content:center}
.login-bg{position:absolute;inset:0;background:#071d3a url("login-campus.png") center/cover no-repeat}
.login-card{position:relative;width:920px;max-width:94vw;background:#fff;border-radius:20px;box-shadow:0 30px 80px rgba(0,0,0,.35);padding:42px 46px}
.login-brand{display:flex;gap:18px;align-items:center}
.logo{display:block;width:60px;height:60px;flex-shrink:0;object-fit:contain;border-radius:16px}
.logo.sm{width:38px;height:38px;border-radius:10px}
.login-brand h1{font-size:24px;color:var(--navy)}
.login-brand p{color:var(--sub);margin-top:6px}
.login-tip{margin:28px 0 14px;color:var(--sub)}
.role-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:14px}
.role-item{border:1.5px solid var(--line);border-radius:12px;padding:16px;transition:.15s;cursor:pointer;background:#fafcff}
.role-item:hover{border-color:var(--blue);box-shadow:0 6px 18px rgba(22,119,255,.15);transform:translateY(-2px)}
.role-item .ri{font-size:26px}
.role-item .rn{font-weight:700;margin:8px 0 3px}
.role-item .rd{color:var(--sub);font-size:12px}
.login-foot{margin-top:26px;text-align:center;color:#9aa8b8;font-size:12px}

/* ---------- Layout ---------- */
.app-wrap{display:flex;height:100vh;overflow:hidden}
.sidebar{width:232px;background:linear-gradient(180deg,#0b2b55,#0d3a73);display:flex;flex-direction:column;flex-shrink:0}
.side-brand{display:flex;align-items:center;gap:10px;padding:18px 18px;color:#fff}
.side-title{font-weight:700;font-size:16px}
.nav{flex:1;overflow-y:auto;padding:6px 10px}
.nav-group{margin-bottom:4px}
.nav-group-title{color:#7fa0c8;font-size:11px;padding:10px 12px 4px;letter-spacing:1px}
.nav-item{display:flex;align-items:center;gap:10px;color:#cdddf1;padding:9px 12px;border-radius:8px;cursor:pointer;margin-bottom:2px;font-size:13.5px}
.nav-item:hover{background:rgba(255,255,255,.08);color:#fff}
.nav-item.active{background:linear-gradient(90deg,#1677ff,#22c1d6);color:#fff;font-weight:600}
.nav-item .demo-tag{margin-left:auto;font-size:10px;background:#f5a623;color:#fff;border-radius:5px;padding:1px 5px}
.side-foot{padding:14px;color:#6e89ad;font-size:11px;text-align:center}
.main{flex:1;display:flex;flex-direction:column;overflow:hidden}
.topbar{height:60px;background:#fff;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 22px;flex-shrink:0}
.crumb{font-weight:700;font-size:16px}
.top-right{display:flex;align-items:center;gap:14px}
.top-search{background:#f2f5f9;border:1px solid var(--line);border-radius:18px;padding:7px 14px;color:#9aa8b8;font-size:12.5px;width:230px;cursor:pointer}
.icon-btn{position:relative;border:none;background:#f2f5f9;width:38px;height:38px;border-radius:10px;font-size:17px}
.badge{position:absolute;top:-5px;right:-5px;background:var(--red);color:#fff;font-size:10px;border-radius:10px;padding:1px 5px}
.dot-red{position:absolute;top:6px;right:7px;width:8px;height:8px;background:var(--red);border-radius:50%}
.user-chip{display:flex;align-items:center;gap:9px;cursor:pointer}
.avatar{width:36px;height:36px;border-radius:50%;background:linear-gradient(135deg,#1677ff,#0fb5a3);color:#fff;display:flex;align-items:center;justify-content:center;font-weight:700}
.user-name{font-size:13px;font-weight:600}
.user-role{font-size:11px;color:var(--sub)}
.view{flex:1;overflow-y:auto;padding:22px}

/* ---------- Generic ---------- */
.page-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:18px;flex-wrap:wrap;gap:10px}
.page-title{font-size:19px;font-weight:700}
.page-sub{color:var(--sub);font-size:12.5px;margin-top:3px}
.card{background:var(--panel);border-radius:var(--radius);box-shadow:var(--shadow);padding:18px;margin-bottom:18px}
.card-title{font-weight:700;margin-bottom:14px;display:flex;align-items:center;gap:8px}
.card-title .more{margin-left:auto;font-weight:400;font-size:12px;color:var(--blue);cursor:pointer}
.grid{display:grid;gap:16px}
.g4{grid-template-columns:repeat(4,1fr)}
.g3{grid-template-columns:repeat(3,1fr)}
.g2{grid-template-columns:repeat(2,1fr)}
.g5{grid-template-columns:repeat(5,1fr)}
.stat{background:#fff;border-radius:var(--radius);padding:16px 18px;box-shadow:var(--shadow);position:relative;overflow:hidden}
.stat .sl{color:var(--sub);font-size:12.5px}
.stat .sv{font-size:27px;font-weight:800;margin-top:7px}
.stat .st{font-size:12px;margin-top:6px}
.up{color:var(--green)}.down{color:var(--red)}
.stat .sico{position:absolute;right:14px;top:14px;font-size:26px;opacity:.85}
.btn{border:none;border-radius:8px;padding:8px 16px;font-size:13.5px;background:var(--blue);color:#fff}
.btn:hover{background:var(--blue-d)}
.btn.ghost{background:#fff;border:1px solid var(--line);color:var(--ink)}
.btn.teal{background:var(--teal)}
.btn.green{background:var(--green)}
.btn.sm{padding:5px 11px;font-size:12px}
.btn.danger{background:var(--red)}
.btn.gray{background:#eef2f7;color:var(--sub)}
.tag{display:inline-block;padding:2px 9px;border-radius:6px;font-size:12px;line-height:18px}
.t-blue{background:#e7f1ff;color:#1677ff}.t-green{background:#e4f7ee;color:#18a558}
.t-orange{background:#fef1e3;color:#f5780f}.t-red{background:#fdecec;color:#e5484d}
.t-gray{background:#eef2f7;color:#6b7a8d}.t-teal{background:#e1f6f3;color:#0a9484}
.t-purple{background:#efeafc;color:#6a4ce0}
table{width:100%;border-collapse:collapse;font-size:13px}
th{background:#f6f9fc;color:var(--sub);font-weight:600;text-align:left;padding:11px 12px;border-bottom:1px solid var(--line);white-space:nowrap}
td{padding:11px 12px;border-bottom:1px solid #f0f4f8}
tbody tr:hover{background:#f8fbff}
.table-wrap{overflow:auto}
.light{display:inline-block;width:12px;height:12px;border-radius:50%;margin-right:5px}
.l-red{background:var(--red);box-shadow:0 0 6px var(--red)}
.l-yellow{background:var(--yellow);box-shadow:0 0 6px var(--yellow)}
.l-green{background:var(--green);box-shadow:0 0 6px var(--green)}
.l-blue{background:var(--blue);box-shadow:0 0 6px var(--blue)}
.l-orange{background:var(--orange);box-shadow:0 0 6px var(--orange)}
.toolbar{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-bottom:14px}
.input,select{border:1px solid var(--line);border-radius:8px;padding:8px 12px;font-size:13px;background:#fff;font-family:inherit}
.input:focus,select:focus{outline:none;border-color:var(--blue)}
.chart{width:100%;height:300px}
.chart-lg{height:380px}.chart-sm{height:240px}

/* cockpit big screen */
.screen{background:radial-gradient(ellipse at top,#0e2f5c,#071a35 70%);border-radius:14px;padding:20px;color:#dceaff;min-height:calc(100vh - 130px)}
.screen-head{text-align:center;margin-bottom:18px}
.screen-head h2{font-size:26px;color:#fff;letter-spacing:3px;background:linear-gradient(90deg,#7fc7ff,#fff,#7fc7ff);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent}
.screen-head p{color:#7fa0c8;font-size:12px;margin-top:5px}
.screen .kpi{background:rgba(22,119,255,.12);border:1px solid rgba(80,160,255,.3);border-radius:10px;padding:14px;text-align:center}
.screen .kpi .v{font-size:28px;font-weight:800;color:#8fd0ff}
.screen .kpi .l{font-size:12px;color:#9fb9d8;margin-top:4px}
.screen .panel{background:rgba(15,45,90,.45);border:1px solid rgba(80,160,255,.25);border-radius:10px;padding:14px;margin-bottom:16px}
.screen .panel h3{font-size:14px;color:#bcd6f5;margin-bottom:10px}
.screen .sc-chart{width:100%;height:230px}

/* stepper / timeline */
.stepper{display:flex;margin:10px 0 20px}
.step{flex:1;text-align:center;position:relative}
.step::before{content:"";position:absolute;top:13px;left:-50%;width:100%;height:3px;background:var(--line);z-index:0}
.step:first-child::before{display:none}
.step .dot{width:28px;height:28px;border-radius:50%;background:#e7edf4;color:#9aa8b8;display:flex;align-items:center;justify-content:center;margin:0 auto 7px;position:relative;z-index:1;font-weight:700}
.step .lbl{font-size:12px;color:var(--sub)}
.step.done .dot{background:var(--green);color:#fff}
.step.done::before{background:var(--green)}
.step.active .dot{background:var(--blue);color:#fff;box-shadow:0 0 0 4px rgba(22,119,255,.18)}
.step.active .lbl{color:var(--blue);font-weight:700}
.timeline{position:relative;padding-left:26px}
.timeline::before{content:"";position:absolute;left:8px;top:4px;bottom:4px;width:2px;background:var(--line)}
.tl-item{position:relative;padding-bottom:18px}
.tl-item::before{content:"";position:absolute;left:-23px;top:3px;width:12px;height:12px;border-radius:50%;background:var(--blue);border:2px solid #fff;box-shadow:0 0 0 2px var(--blue)}
.tl-item.done::before{background:var(--green);box-shadow:0 0 0 2px var(--green)}
.tl-item.warn::before{background:var(--red);box-shadow:0 0 0 2px var(--red)}
.tl-time{font-size:11px;color:var(--sub)}
.tl-title{font-weight:600;margin:3px 0}
.tl-desc{font-size:12.5px;color:var(--sub)}

/* tree */
.tree{font-size:13.5px}
.tree-node{padding:7px 10px;border-radius:7px;cursor:pointer;display:flex;align-items:center;gap:7px}
.tree-node:hover{background:#f2f7ff}
.tree-node.sel{background:#e7f1ff;color:var(--blue);font-weight:600}
.tree-children{padding-left:20px}

/* drawer / modal / toast */
.drawer{position:fixed;inset:0;z-index:100;display:none}
.drawer.open{display:block}
.drawer-mask{position:absolute;inset:0;background:rgba(10,25,45,.4)}
.drawer-panel{position:absolute;right:0;top:0;bottom:0;width:420px;max-width:94vw;background:#fff;display:flex;flex-direction:column;box-shadow:-10px 0 40px rgba(0,0,0,.2)}
.drawer-head{display:flex;align-items:center;justify-content:space-between;padding:16px 18px;border-bottom:1px solid var(--line)}
.chat-body{flex:1;overflow-y:auto;padding:18px;background:#f6f9fc}
.msg{margin-bottom:14px;display:flex;gap:9px}
.msg .bubble{background:#fff;border-radius:12px;padding:10px 13px;max-width:80%;box-shadow:var(--shadow);font-size:13.5px;line-height:1.6}
.msg.ai .bubble{background:#e7f1ff}
.msg.me{flex-direction:row-reverse}
.msg.me .bubble{background:var(--blue);color:#fff}
.chat-quick{display:flex;gap:8px;padding:10px 14px;flex-wrap:wrap;border-top:1px solid var(--line)}
.chat-quick span{background:#f0f5ff;color:var(--blue);border-radius:15px;padding:5px 12px;font-size:12px;cursor:pointer}
.chat-input{display:flex;gap:8px;padding:14px;border-top:1px solid var(--line)}
.chat-input input{flex:1;border:1px solid var(--line);border-radius:20px;padding:10px 15px}
.chat-input button{border:none;background:var(--blue);color:#fff;border-radius:20px;padding:0 20px}
.modal{position:fixed;inset:0;z-index:200;display:none}
.modal.open{display:block}
.modal-mask{position:absolute;inset:0;background:rgba(10,25,45,.45)}
.modal-box{position:relative;width:680px;max-width:94vw;max-height:88vh;overflow-y:auto;margin:5vh auto;background:#fff;border-radius:14px;padding:24px}
.modal-box.lg{width:900px}
.modal-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:18px}
.modal-head h3{font-size:17px}
.form-row{margin-bottom:15px}
.form-row label{display:block;font-size:13px;margin-bottom:6px;color:var(--sub)}
.form-row input,.form-row select,.form-row textarea{width:100%;border:1px solid var(--line);border-radius:8px;padding:9px 12px;font-size:13.5px;font-family:inherit}
.form-row textarea{min-height:78px;resize:vertical}
.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.modal-foot{display:flex;justify-content:flex-end;gap:10px;margin-top:20px}
.toast{position:fixed;top:26px;left:50%;transform:translateX(-50%);z-index:400;display:flex;flex-direction:column;gap:10px;align-items:center}
.toast-item{background:#1f2a37;color:#fff;padding:11px 20px;border-radius:10px;font-size:13.5px;box-shadow:0 8px 30px rgba(0,0,0,.3);animation:tin .25s}
.toast-item.ok{background:var(--green)}.toast-item.warn{background:var(--orange)}.toast-item.err{background:var(--red)}
@keyframes tin{from{transform:translateY(-14px);opacity:0}to{transform:none;opacity:1}}

/* upload */
.upload-zone{border:1.6px dashed #b9c9db;border-radius:10px;padding:22px;text-align:center;color:var(--sub);background:#fafcff;cursor:pointer}
.upload-zone:hover{border-color:var(--blue);color:var(--blue)}
.file-chip{display:inline-flex;align-items:center;gap:7px;background:#eef6ff;border:1px solid #cfe3ff;border-radius:8px;padding:6px 11px;margin:5px 6px 0 0;font-size:12.5px}
.guard-box{background:#fff7f7;border:1px solid #ffd2d2;border-radius:10px;padding:13px 15px;color:#c43236;font-size:13px;display:flex;gap:10px;align-items:center;margin-bottom:14px}
.photo-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}
.photo{aspect-ratio:4/3;border-radius:8px;background:linear-gradient(135deg,#dce8f5,#eef4fb);display:flex;flex-direction:column;align-items:center;justify-content:center;color:#7d92ab;font-size:12px;position:relative;border:1px solid var(--line)}
.photo .ic{font-size:24px}
.photo .watermark{position:absolute;bottom:4px;right:6px;font-size:9px;color:#46607c}
.photo .badge-h{position:absolute;top:5px;left:5px;font-size:9px;background:rgba(229,72,77,.9);color:#fff;padding:1px 5px;border-radius:4px}
.pill-list{display:flex;flex-wrap:wrap;gap:8px}
.pill{background:#f0f4f8;border-radius:16px;padding:6px 14px;font-size:12.5px;cursor:pointer}
.pill.on{background:var(--blue);color:#fff}
.notice-bar{background:linear-gradient(90deg,#fff7e6,#fff);border:1px solid #ffe2ad;border-radius:10px;padding:11px 15px;color:#a86b08;font-size:13px;margin-bottom:16px;display:flex;gap:9px;align-items:center}
.kv{display:grid;grid-template-columns:110px 1fr;gap:10px 14px;font-size:13.5px}
.kv .k{color:var(--sub)}
.progress{height:8px;background:#eef2f7;border-radius:5px;overflow:hidden}
.progress>i{display:block;height:100%;background:linear-gradient(90deg,#1677ff,#22c1d6)}
.score-big{font-size:40px;font-weight:800;color:var(--green)}
.stars{color:#f5a623;letter-spacing:2px}
.risk-card{border-radius:10px;padding:14px;color:#fff}
.risk-card.red{background:linear-gradient(135deg,#ff6b6b,#e5484d)}
.risk-card.orange{background:linear-gradient(135deg,#ffa94d,#f5780f)}
.risk-card.yellow{background:linear-gradient(135deg,#ffd43b,#f5b90f);color:#7a5c00}
.risk-card.blue{background:linear-gradient(135deg,#4dabf7,#1677ff)}
.risk-card .rv{font-size:24px;font-weight:800}
.doc-item{display:flex;align-items:center;gap:10px;padding:10px;border:1px solid var(--line);border-radius:9px;margin-bottom:9px}
.doc-item .di{font-size:20px}.doc-item .dn{flex:1;font-size:13px}.doc-item .ds{font-size:11px;color:var(--sub)}
.muted{color:var(--sub)}
.right{text-align:right}.center{text-align:center}
.mt10{margin-top:10px}.mt16{margin-top:16px}.mb0{margin-bottom:0}
.flex{display:flex;gap:10px;align-items:center}.flex-between{display:flex;justify-content:space-between;align-items:center}
.divider{height:1px;background:var(--line);margin:14px 0}
.weekly{background:#fff;border:1px solid var(--line);border-radius:10px;padding:22px}
.weekly h2{text-align:center;margin-bottom:4px}
.weekly .ws{text-align:center;color:var(--sub);font-size:12px;margin-bottom:18px}
.weekly h4{margin:16px 0 8px;color:var(--navy)}
@media(max-width:1200px){.g4,.g5{grid-template-columns:repeat(2,1fr)}.g3{grid-template-columns:1fr 1fr}}
