:root{
  --primary:#2563eb;--primary-hover:#1d4ed8;--primary-soft:#eff6ff;
  --bg:#f5f7fa;--surface:#fff;--border:#e4e7ec;--border-strong:#d0d5dd;
  --text:#101828;--muted:#667085;--faint:#98a2b3;
  --success:#12b76a;--success-bg:#ecfdf3;
  --warning:#f79009;--warning-bg:#fffaeb;
  --danger:#d92d20;--danger-bg:#fef3f2;
  --radius:10px;--radius-lg:14px;
  --shadow:0 1px 2px rgba(16,24,40,.05),0 1px 3px rgba(16,24,40,.08);
  --font:-apple-system,BlinkMacSystemFont,"Segoe UI","Microsoft YaHei",sans-serif;
  --mono:ui-monospace,Consolas,"Courier New",monospace;
}
*{box-sizing:border-box;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}
a{color:var(--primary);text-decoration:none}
button{font-family:var(--font)}
.app{display:flex;min-height:100vh}

/* ====== 左侧固定 + 右侧滚动（#10） ====== */
.sidebar{width:224px;background:var(--surface);border-right:1px solid var(--border);display:flex;flex-direction:column;position:fixed;top:0;left:0;bottom:0;z-index:100;overflow-y:auto}
.logo{display:flex;align-items:center;gap:10px;padding:18px 20px;border-bottom:1px solid var(--border)}
.logo .mark{width:34px;height:34px;border-radius:9px;background:var(--primary);color:#fff;display:flex;align-items:center;justify-content:center;font-weight:700;font-size:15px}
.logo .t{font-size:15px;font-weight:700;line-height:1.2}
.logo .s{font-size:11px;color:var(--faint)}
.nav{flex:1;padding:14px 12px;display:flex;flex-direction:column;gap:2px;overflow-y:auto}
.nav-item{display:flex;align-items:center;gap:10px;padding:10px 12px;border-radius:8px;color:var(--muted);cursor:pointer;font-size:13.5px;transition:background .12s,color .12s}
.nav-item:hover{background:#f9fafb;color:var(--text)}
.nav-item.active{background:var(--primary-soft);color:var(--primary);font-weight:600}
.nav-item svg{width:17px;height:17px;flex-shrink:0}
.side-foot{padding:14px 20px;border-top:1px solid var(--border);font-size:12px;color:var(--faint)}

/* 右侧内容区：左侧留出 sidebar 宽度，自身可滚动 */
.main{flex:1;margin-left:224px;padding:26px 32px;min-width:0;width:calc(100vw - 224px);max-width:none;min-height:100vh;overflow-y:auto;overflow-x:hidden}

/* 表头吸顶 */
.table-wrap{overflow-x:auto;position:relative;max-height:60vh;overflow-y:auto}
.table-wrap thead{position:sticky;top:0;z-index:5}
.table-wrap thead th{background:var(--surface);box-shadow:0 1px 0 var(--border)}

.page-head{margin-bottom:20px}
.page-head h2{font-size:19px;font-weight:700}
.page-head p{font-size:13px;color:var(--muted);margin-top:2px}
.plan-form-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:12px}
@media(max-width:1100px){.plan-form-grid{grid-template-columns:repeat(3,1fr)}}
@media(max-width:860px){.plan-form-grid{grid-template-columns:repeat(2,1fr)}}
@media(max-width:560px){.plan-form-grid{grid-template-columns:1fr}}
.card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg);padding:20px 22px;margin-bottom:18px}
.card .hd{display:flex;justify-content:space-between;align-items:center;margin-bottom:14px}
.card .hd h3{font-size:15px;font-weight:600}
.card .hd .sub{font-size:12px;color:var(--faint)}
.metrics{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:14px;margin-bottom:18px}
.metric{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:16px 18px}
.metric .l{font-size:12.5px;color:var(--muted)}
.metric .v{font-size:26px;font-weight:700;margin-top:4px;letter-spacing:-.5px}
.metric .d{font-size:12px;color:var(--faint);margin-top:2px}
table{width:100%;border-collapse:collapse;font-size:13.5px}
th{text-align:left;padding:10px 12px;border-bottom:1px solid var(--border);color:var(--muted);font-weight:500;font-size:12.5px;white-space:nowrap;background:var(--surface)}
td{padding:11px 12px;border-bottom:1px solid #f0f1f3;vertical-align:middle}
tbody tr:hover{background:#fafbfc}
tbody tr:last-child td{border-bottom:none}
.col-num{width:36px;text-align:center;color:var(--faint);font-size:12px;font-weight:500}
.tag{display:inline-flex;align-items:center;gap:5px;padding:2px 9px;border-radius:999px;font-size:12px;font-weight:500;white-space:nowrap}
.tag::before{content:"";width:6px;height:6px;border-radius:50%;background:currentColor}
.tg-green{background:var(--success-bg);color:#067647}
.tg-amber{background:var(--warning-bg);color:#b54708}
.tg-red{background:var(--danger-bg);color:#b42318}
.tg-gray{background:#f2f4f7;color:#475467}
.tg-blue{background:var(--primary-soft);color:var(--primary)}
.btn{display:inline-flex;align-items:center;gap:6px;padding:8px 15px;border:1px solid var(--border-strong);border-radius:8px;background:var(--surface);cursor:pointer;font-size:13px;font-weight:500;color:var(--text);transition:all .12s}
.btn:hover{border-color:#98a2b3;background:#f9fafb}
.btn.primary{background:var(--primary);border-color:var(--primary);color:#fff}
.btn.primary:hover{background:var(--primary-hover)}
.btn.danger{color:var(--danger);border-color:#fecdca}
.btn.danger:hover{background:var(--danger-bg)}
.btn.sm{padding:5px 11px;font-size:12.5px;border-radius:7px}
.btn.ghost{border-color:transparent;color:var(--muted)}
.btn.ghost:hover{background:#f2f4f7;color:var(--text)}
.btn[disabled]{opacity:.5;cursor:not-allowed}
input[type=text],input[type=number],select{height:36px;padding:0 12px;border:1px solid var(--border-strong);border-radius:8px;font-size:13.5px;color:var(--text);background:var(--surface);outline:none}
input[type=text]:focus,input[type=number]:focus,select:focus{border-color:var(--primary);box-shadow:0 0 0 3px rgba(37,99,235,.12)}
.upload-zone{border:1.5px dashed var(--border-strong);border-radius:var(--radius-lg);padding:34px;text-align:center;color:var(--muted);cursor:pointer;transition:all .15s;background:#fcfcfd}
.upload-zone:hover,.upload-zone.drag{border-color:var(--primary);background:var(--primary-soft);color:var(--primary)}
.upload-zone .big{font-size:15px;font-weight:600;color:var(--text)}
.upload-zone .small{font-size:12.5px;color:var(--faint);margin-top:6px}
.empty{color:var(--faint);text-align:center;padding:36px 0;font-size:13px}
.filter-bar{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-bottom:14px}
.pager{display:flex;align-items:center;gap:10px;justify-content:flex-end;margin-top:14px;font-size:13px;color:var(--muted)}
.pager .btn{padding:5px 12px}
.toast{position:fixed;top:20px;right:20px;z-index:300;display:flex;flex-direction-column;gap:8px}
.toast-item{background:var(--surface);border:1px solid var(--border);border-radius:10px;padding:12px 16px;font-size:13.5px;box-shadow:var(--shadow);display:flex;align-items:center;gap:9px;min-width:220px;max-width:360px;animation:tin .2s ease}
.toast-item.ok::before{content:"";width:8px;height:8px;border-radius:50%;background:var(--success)}
.toast-item.err::before{content:"";width:8px;height:8px;border-radius:50%;background:var(--danger)}
@keyframes tin{from{opacity:0;transform:translateY(-6px)}to{opacity:1;transform:none}}
.modal-mask{position:fixed;inset:0;background:rgba(16,24,40,.45);z-index:200;display:none;align-items:center;justify-content:center}
.modal-mask.show{display:flex}
.modal{background:var(--surface);border-radius:var(--radius-lg);padding:24px 26px;width:min(94vw,1100px);max-width:94vw;max-height:88vh;overflow-y:auto;box-shadow:0 8px 30px rgba(16,24,40,.15)}
.modal h3{font-size:16px;font-weight:700;margin-bottom:6px}
.modal .desc{font-size:13px;color:var(--muted);margin-bottom:16px}
.modal .acts{display:flex;gap:10px;justify-content:end;margin-top:20px}
#modal-body{overflow-x:auto}
.field{margin-bottom:14px}
.field label{display:block;font-size:12.5px;font-weight:500;color:var(--muted);margin-bottom:6px}
.tree{font-size:13.5px}
.tree ul{list-style:none;padding-left:0}
.tree .tnode{display:flex;align-items:center;gap:8px;padding:7px 8px;border-radius:7px;cursor:default}
.tree .tnode:hover{background:#f9fafb}
.tree .tnode.root{font-weight:600}
.tree .twist{width:16px;height:16px;display:inline-flex;align-items:center;justify-content:center;color:var(--faint);cursor:pointer;transition:transform .15s;flex-shrink:0;font-size:10px}
.tree .twist.open{transform:rotate(90deg)}
.tree .twist.leaf{visibility:hidden}
.tree .children{padding-left:22px;border-left:1px dashed var(--border)}
.tree .code{font-family:var(--mono);font-weight:500}
.tree .meta{color:var(--muted);font-size:12.5px}
.tree .qty{color:var(--faint);font-size:12px}
.cfg-group{margin-bottom:26px}
.cfg-group h3{font-size:14px;font-weight:700;margin-bottom:4px}
.cfg-group .desc{font-size:12.5px;color:var(--faint);margin-bottom:14px}
.cfg-row{display:grid;grid-template-columns:minmax(200px,1fr) 320px;gap:16px;align-items:center;padding:12px 0;border-bottom:1px solid #f0f1f3}
.cfg-row:last-child{border-bottom:none}
.cfg-row .info .l{font-size:13.5px;font-weight:500}
.cfg-row .info .d{font-size:12px;color:var(--faint)}
.cfg-switch{position:relative;width:40px;height:22px;border-radius:999px;background:var(--border-strong);cursor:pointer;transition:background .15s;display:inline-block}
.cfg-switch::after{content:"";position:absolute;top:2px;left:2px;width:18px;height:18px;border-radius:50%;background:#fff;transition:left .15s;box-shadow:0 1px 2px rgba(0,0,0,.2)}
.cfg-switch.on{background:var(--primary)}
.cfg-switch.on::after{left:20px}
.hidden{display:none!important}
.row-tools{display:flex;gap:8px;align-items:center}
.note{font-size:12px;color:var(--faint)}

/* ====== 列表工具栏（多选/批量操作） ====== */
.table-toolbar{display:flex;gap:10px;align-items:center;margin-bottom:8px;padding:6px 0}
.chk-all{display:flex;align-items:center;gap:5px;font-size:12.5px;color:var(--muted);cursor:pointer}
.chk-all input{width:16px;height:16px;cursor:pointer}
.row-chk{width:16px;height:16px;cursor:pointer;accent-color:var(--primary)}

/* ====== 通知配置开关 ====== */
.switch-wrap{display:inline-flex;align-items:center;cursor:pointer}
.switch-wrap input{display:none}
.switch-slider{position:relative;width:40px;height:22px;border-radius:999px;background:var(--border-strong);transition:background .15s;display:inline-block;vertical-align:middle}
.switch-slider::after{content:"";position:absolute;top:2px;left:2px;width:18px;height:18px;border-radius:50%;background:#fff;transition:left .15s;box-shadow:0 1px 2px rgba(0,0,0,.2)}
.switch-wrap input:checked + .switch-slider{background:var(--primary)}
.switch-wrap input:checked + .switch-slider::after{left:20px}
.notify-card{border-left:4px solid var(--border)}

/* ====== 生产大屏（深色主题） ====== */
#page-bigscreen{background:linear-gradient(135deg,#0f172a 0%,#1e293b 50%,#0f172a 100%);min-height:100vh;color:#e2e8f0;padding:0!important;margin:0!important}
.bs-header{display:flex;justify-content:space-between;align-items:center;padding:16px 32px;border-bottom:1px solid rgba(255,255,255,.08);background:rgba(15,23,42,.8);backdrop-filter:blur(8px);position:sticky;top:0;z-index:10}
.bs-title{font-size:22px;font-weight:700;color:#fff;letter-spacing:2px}
.bs-time{font-size:14px;color:#94a3b8;font-variant-numeric:tabular-nums}
.bs-body{padding:24px 32px;display:flex;flex-direction:column;gap:18px}
.bs-row{display:grid;grid-template-columns:repeat(3,1fr);gap:18px}
.bs-card{background:rgba(30,41,59,.7);border:1px solid rgba(255,255,255,.06);border-radius:12px;padding:20px;backdrop-filter:blur(4px)}
.bs-card h3{font-size:14px;color:#94a3b8;margin-bottom:14px;font-weight:500}
.bs-wide{grid-column:1/-1}
.bs-stat-row{display:grid;grid-template-columns:repeat(4,1fr);gap:16px}
.bs-stat{text-align:center;padding:12px 8px}
.bs-stat .bs-v{font-size:32px;font-weight:700;color:#fff;line-height:1.2}
.bs-stat .bs-ok{color:#34d399}
.bs-stat .bs-warn{color:#fbbf24}
.bs-stat .bs-info{color:#60a5fa}
.bs-stat .bs-l{font-size:11px;color:#64748b;margin-top:2px}
.bs-log-list{display:flex;flex-direction:column;gap:6px;max-height:240px;overflow-y:auto}
.bs-log-item{display:flex;gap:12px;padding:8px 12px;background:rgba(255,255,255,.02);border-radius:6px;font-size:12.5px;align-items:baseline}
.bs-log-time{color:#64748b;white-space:nowrap;min-width:140px;font-variant-numeric:tabular-nums}
.bs-log-action{color:#60a5fa;min-width:80px}
.bs-log-detail{color:#94a3b8;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
