:root{
  --bg:#0f172a; --bg2:#111c33; --panel:#ffffff; --panel2:#f8fafc;
  --line:#e2e8f0; --text:#0f172a; --muted:#64748b; --primary:#2563eb;
  --primary-d:#1d4ed8; --green:#16a34a; --red:#dc2626; --amber:#d97706;
  --sidebar:#0f172a; --sidebar2:#1e293b; --radius:10px;
}
*{box-sizing:border-box;margin:0;padding:0}
html,body{height:100%}
body{font-family:"Segoe UI","Microsoft YaHei",system-ui,sans-serif;color:var(--text);background:var(--panel2)}
.hidden{display:none !important}
button{font-family:inherit;cursor:pointer}
code{background:#f1f5f9;padding:2px 6px;border-radius:4px;font-size:12px;color:#0f172a}

/* ---- 登录（宝蓝主题重做）---- */
.login-page{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;
  background:
    radial-gradient(ellipse at 18% 28%,rgba(96,165,250,.32),transparent 55%),
    radial-gradient(ellipse at 82% 72%,rgba(59,130,246,.28),transparent 55%),
    linear-gradient(135deg,#0a3d7a 0%,#1554a0 35%,#1e5fa8 65%,#2a7bc4 100%);
  overflow:hidden}
/* 纹理：白色点阵（SVG data URI，无外部依赖） */
.login-page::before{content:"";position:absolute;inset:0;pointer-events:none;
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='28' height='28'><circle cx='2' cy='2' r='1' fill='%23ffffff' opacity='0.55'/></svg>");
  background-size:28px 28px;opacity:.18}
/* 水印：系统名大号倾斜 */
.login-page::after{content:"多媒体数据云平台";position:absolute;top:50%;left:50%;
  transform:translate(-50%,-50%) rotate(-12deg);
  font-size:min(14vw,190px);font-weight:900;color:rgba(255,255,255,.055);
  white-space:nowrap;letter-spacing:.18em;pointer-events:none;user-select:none;
  font-family:"Microsoft YaHei","PingFang SC",system-ui,sans-serif}

/* 浮动装饰圆 */
.deco-circle{position:absolute;border-radius:50%;pointer-events:none;
  background:linear-gradient(135deg,rgba(255,255,255,.10),rgba(255,255,255,.02));
  border:1px solid rgba(255,255,255,.10)}
.deco-circle.c1{width:300px;height:300px;top:-100px;left:-100px;animation:float 9s ease-in-out infinite}
.deco-circle.c2{width:200px;height:200px;bottom:-70px;right:-70px;animation:float 11s ease-in-out infinite reverse}
.deco-circle.c3{width:130px;height:130px;top:18%;right:12%;animation:float 13s ease-in-out infinite}
.deco-circle.c4{width:220px;height:220px;bottom:14%;left:7%;animation:float 10s ease-in-out infinite reverse}
.deco-circle.c5{width:80px;height:80px;top:62%;left:18%;animation:float 7s ease-in-out infinite}
.deco-circle.c6{width:100px;height:100px;top:35%;left:80%;animation:float 8s ease-in-out infinite reverse}
@keyframes float{0%,100%{transform:translateY(0) rotate(0deg)}50%{transform:translateY(-22px) rotate(6deg)}}

/* 装饰对角光带 */
.login-page .light-bar{position:absolute;pointer-events:none;opacity:.10;
  background:linear-gradient(90deg,transparent,rgba(255,255,255,.6),transparent)}
.login-page .light-bar.b1{width:60%;height:2px;top:22%;left:-10%;transform:rotate(-18deg)}
.login-page .light-bar.b2{width:50%;height:2px;top:78%;right:-10%;transform:rotate(-18deg)}

.login-card{position:relative;z-index:1;width:420px;max-width:92vw;
  background:rgba(255,255,255,.98);border-radius:16px;padding:38px 34px 30px;
  box-shadow:0 25px 60px rgba(0,0,0,.35),0 0 0 1px rgba(255,255,255,.1);
  backdrop-filter:blur(10px)}
.login-brand{text-align:center;margin-bottom:26px}
.login-brand .logo{font-size:54px;display:inline-block;
  filter:drop-shadow(0 4px 10px rgba(37,99,235,.35))}
.login-brand h1{font-size:22px;font-weight:700;color:#0f172a;margin-top:6px;letter-spacing:.5px}
.login-brand p{color:#64748b;font-size:13px;margin-top:6px;letter-spacing:.3px}

.login-card label{display:block;font-size:13px;color:#475569;font-weight:600;margin:16px 0 6px;letter-spacing:.2px}
.login-input-wrap{position:relative;display:flex;align-items:center;
  border:1px solid #e2e8f0;border-radius:10px;background:#fff;
  transition:border-color .15s,box-shadow .15s}
.login-input-wrap:focus-within{border-color:var(--primary);box-shadow:0 0 0 3px rgba(37,99,235,.12)}
.login-input-wrap .icon{padding:0 12px 0 14px;font-size:16px;color:#94a3b8;flex-shrink:0;line-height:1}
.login-input-wrap input{flex:1;border:none;outline:none;background:transparent;
  padding:12px 14px 12px 0;font-size:14px;color:#0f172a;min-width:0}
.login-card button[type=submit]{width:100%;margin-top:22px;padding:12px;
  background:linear-gradient(135deg,#2563eb,#1d4ed8);color:#fff;border:none;border-radius:10px;
  font-size:15px;font-weight:600;letter-spacing:1px;cursor:pointer;transition:.15s;
  box-shadow:0 4px 14px rgba(37,99,235,.35)}
.login-card button[type=submit]:hover{background:linear-gradient(135deg,#1d4ed8,#1e40af);
  box-shadow:0 6px 18px rgba(37,99,235,.45);transform:translateY(-1px)}
.login-card button[type=submit]:active{transform:translateY(0)}
.login-card .error-msg{color:var(--red);font-size:13px;margin-top:10px;min-height:18px;text-align:center}

/* 兼容：如果未来重新引入登录页脚注 */
.login-hint{margin-top:18px;font-size:12px;color:var(--muted);border-top:1px dashed var(--line);padding-top:12px}
.login-hint .hint-row{display:flex;justify-content:space-between;margin-top:5px}

/* ---- 布局 ---- */
.app{display:flex;height:100vh}
.sidebar{width:230px;background:var(--sidebar);color:#cbd5e1;display:flex;flex-direction:column}
.brand{display:flex;align-items:center;gap:8px;padding:18px 18px;font-size:17px;font-weight:700;color:#fff;border-bottom:1px solid #1e293b}
.brand .logo{font-size:24px}
.sidebar nav{flex:1;overflow:auto;padding:10px}
.nav-group{font-size:11px;color:#64748b;padding:14px 14px 6px;letter-spacing:1px}
.nav-item{display:flex;align-items:center;gap:10px;padding:10px 14px;border-radius:8px;font-size:14px;color:#cbd5e1;cursor:pointer;margin-bottom:2px}
.nav-item:hover{background:var(--sidebar2)}
.nav-item.active{background:var(--primary);color:#fff}
.nav-item .ic{font-size:16px;width:20px;text-align:center}
.sidebar-footer{padding:12px;border-top:1px solid #1e293b}
#user-box{font-size:13px;color:#cbd5e1;margin-bottom:8px;line-height:1.5}
#user-box b{color:#fff}

.main{flex:1;display:flex;flex-direction:column;background:var(--panel2);min-width:0}
.topbar{height:56px;background:#fff;border-bottom:1px solid var(--line);display:flex;align-items:center;
  justify-content:space-between;padding:0 22px}
#page-title{font-size:17px;font-weight:700}
.topbar-right{color:var(--muted);font-size:13px}
.content{flex:1;overflow:auto;padding:22px}

/* ---- 通用组件 ---- */
.btn{padding:9px 16px;border:none;border-radius:8px;font-size:14px;background:#e2e8f0;color:#0f172a;transition:.15s}
.btn:hover{filter:brightness(.96)}
.btn-primary{background:var(--primary);color:#fff}
.btn-primary:hover{background:var(--primary-d)}
.btn-success{background:var(--green);color:#fff}
.btn-danger{background:var(--red);color:#fff}
.btn-ghost{background:transparent;color:#cbd5e1;border:1px solid #334155}
.btn-ghost:hover{background:var(--sidebar2)}
.btn-sm{padding:6px 11px;font-size:13px}
.btn:disabled{opacity:.5;cursor:not-allowed}

.card{background:#fff;border:1px solid var(--line);border-radius:var(--radius);padding:18px}
.grid{display:grid;gap:16px}
.cols-4{grid-template-columns:repeat(4,1fr)}
.cols-3{grid-template-columns:repeat(3,1fr)}
.cols-2{grid-template-columns:repeat(2,1fr)}
@media(max-width:1100px){.cols-4{grid-template-columns:repeat(2,1fr)}}
.stat{background:#fff;border:1px solid var(--line);border-radius:var(--radius);padding:16px 18px}
.stat .label{font-size:13px;color:var(--muted)}
.stat .value{font-size:28px;font-weight:700;margin-top:6px}
.stat .sub{font-size:12px;color:var(--muted);margin-top:4px}

table{width:100%;border-collapse:collapse;font-size:13px}
th,td{padding:10px 12px;text-align:left;border-bottom:1px solid var(--line);white-space:nowrap}
th{background:var(--panel2);color:var(--muted);font-weight:600}
tbody tr:hover{background:#f8fafc}
td.wrap{white-space:normal}

.toolbar{display:flex;flex-wrap:wrap;gap:10px;align-items:center;margin-bottom:14px}
.toolbar .spacer{flex:1}
input.in,select.in{padding:8px 11px;border:1px solid var(--line);border-radius:8px;font-size:13px;outline:none;background:#fff}
input.in:focus,select.in:focus{border-color:var(--primary)}
select.in{height:36px}

.badge{display:inline-block;padding:2px 9px;border-radius:20px;font-size:12px;font-weight:600}
.b-green{background:#dcfce7;color:#166534}
.b-red{background:#fee2e2;color:#991b1b}
.b-amber{background:#fef3c7;color:#92400e}
.b-blue{background:#dbeafe;color:#1e40af}
.b-gray{background:#f1f5f9;color:#475569}

.page-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:16px}
.page-head h2{font-size:20px}
.muted{color:var(--muted)}
.section-title{font-size:15px;font-weight:700;margin:6px 0 12px}

/* modal —— 统一弹窗样式：header / body / actions */
.modal-mask{position:fixed;inset:0;background:rgba(15,23,42,.55);display:flex;align-items:center;justify-content:center;z-index:50;padding:24px;backdrop-filter:blur(2px)}
.modal{background:#fff;border-radius:14px;width:520px;max-width:92vw;max-height:90vh;display:flex;flex-direction:column;box-shadow:0 24px 64px rgba(0,0,0,.35);overflow:hidden}
.modal h3{font-size:18px;font-weight:700;padding:20px 24px 14px;letter-spacing:.3px;border-bottom:1px solid var(--line);flex-shrink:0;display:flex;align-items:center;gap:8px}
.modal-body{padding:20px 24px 22px;overflow:auto;flex:1;min-height:0}
.modal-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:10px;padding-top:16px;border-top:1px dashed var(--line)}
.modal-actions .btn{min-width:88px;padding:9px 18px;font-size:14px;font-weight:600}
.modal-wide{width:760px}

/* charts */
.chart-box{background:#fff;border:1px solid var(--line);border-radius:var(--radius);padding:16px}
.chart-box h4{font-size:14px;margin-bottom:10px;color:#334155}
canvas{max-width:100%}

/* media thumb */
.thumb{width:64px;height:42px;border-radius:6px;background:#e2e8f0;display:flex;align-items:center;justify-content:center;font-size:18px;color:#64748b;overflow:hidden}
.thumb img{width:100%;height:100%;object-fit:cover}

.toast{position:fixed;top:20px;left:50%;transform:translateX(-50%);background:#0f172a;color:#fff;
  padding:11px 20px;border-radius:8px;font-size:14px;z-index:99;box-shadow:0 8px 24px rgba(0,0,0,.3)}
.pagination{display:flex;gap:8px;align-items:center;margin-top:14px;justify-content:flex-end}
.empty{padding:40px;text-align:center;color:var(--muted)}
.flex{display:flex;gap:10px;align-items:center}
.mt{margin-top:16px}
.kv{font-size:13px;line-height:1.9}
.kv b{display:inline-block;width:110px;color:var(--muted)}
.tag{display:inline-block;background:#eef2ff;color:#3730a3;padding:1px 8px;border-radius:6px;font-size:12px;margin:2px}

/* ===========================================================
   v2 组件样式（驾驶舱 / 平台监控 / 资源中心 / 面板 / 真实/模拟 标签）
   =========================================================== */

/* ---- 驾驶舱：KPI 卡片网格 ---- */
.kpi-grid{display:grid;grid-template-columns:repeat(6,1fr);gap:14px;margin-bottom:4px}
@media(max-width:1380px){.kpi-grid{grid-template-columns:repeat(3,1fr)}}
@media(max-width:760px){.kpi-grid{grid-template-columns:repeat(2,1fr)}}
.kpi-card{display:flex;gap:12px;align-items:center;background:#fff;border:1px solid var(--line);
  border-radius:var(--radius);padding:14px 16px;transition:.15s}
.kpi-card:hover{box-shadow:0 4px 14px rgba(15,23,42,.08)}
.kpi-ic{width:42px;height:42px;border-radius:10px;background:var(--panel2);
  display:flex;align-items:center;justify-content:center;font-size:22px;flex-shrink:0}
.kpi-t{font-size:12px;color:var(--muted)}
.kpi-v{font-size:22px;font-weight:700;margin-top:2px;color:var(--text);line-height:1.1}
.kpi-s{font-size:11px;color:var(--muted);margin-top:2px;line-height:1.3}

/* ---- 面板行 / 面板 ---- */
.panel-row{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;margin-top:14px}
@media(max-width:1100px){.panel-row{grid-template-columns:repeat(2,1fr)}}
@media(max-width:680px){.panel-row{grid-template-columns:1fr}}
.panel{background:#fff;border:1px solid var(--line);border-radius:var(--radius);padding:14px 16px;min-width:0}
.panel-h{font-size:13px;font-weight:600;color:#334155;margin-bottom:10px;
  display:flex;align-items:center;justify-content:space-between}
.panel-h .muted{font-weight:400}

/* ---- 信息提示框 ---- */
.note{margin-top:12px;padding:10px 14px;background:#eff6ff;border:1px solid #bfdbfe;
  border-radius:8px;color:#1e40af;font-size:12px;line-height:1.6}

/* ---- 分段控件（全部/真实/模拟）---- */
.seg{display:inline-flex;background:#e2e8f0;border-radius:8px;padding:3px;gap:2px}
.seg-btn{padding:6px 14px;border:none;background:transparent;border-radius:6px;
  font-size:13px;color:#475569;cursor:pointer;transition:.15s}
.seg-btn.active{background:#fff;color:var(--primary);box-shadow:0 1px 3px rgba(0,0,0,.08)}
.seg-btn:hover:not(.active){color:var(--text)}

/* ---- 平台监控：组件健康卡片 ---- */
.comp-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:12px}
.comp-card{background:#fff;border:1px solid var(--line);border-radius:10px;
  padding:14px 16px;position:relative}
.comp-card.ok{border-left:3px solid var(--green)}
.comp-card.warn{border-left:3px solid var(--amber)}
.comp-top{display:flex;align-items:center;gap:8px;margin-bottom:6px;font-size:13px;font-weight:600;color:#334155}
.dot{width:8px;height:8px;border-radius:50%;display:inline-block}
.comp-card.ok .dot{background:var(--green)}
.comp-card.warn .dot{background:var(--amber);animation:pulse 1.4s infinite}
@keyframes pulse{0%,100%{opacity:1}50%{opacity:.4}}
.comp-status{font-size:13px;font-weight:600;color:#334155;margin-bottom:4px}
.comp-detail{font-size:11px;color:var(--muted);line-height:1.5}

/* ---- 资源中心：媒体卡片网格 ---- */
.media-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(210px,1fr));gap:14px;margin-top:14px}
.media-card{background:#fff;border:1px solid var(--line);border-radius:10px;overflow:hidden;
  cursor:pointer;transition:.15s}
.media-card:hover{box-shadow:0 6px 18px rgba(15,23,42,.10);transform:translateY(-1px)}
.mc-thumb{position:relative;width:100%;aspect-ratio:16/9;background:#eef2f7;
  display:flex;align-items:center;justify-content:center;overflow:hidden}
.mc-thumb img{width:100%;height:100%;object-fit:cover;display:block}
.mc-thumb > div{font-size:32px;color:#94a3b8}
.mc-body{padding:10px 12px}
.mc-name{font-size:13px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#0f172a}
.mc-meta{font-size:11px;color:var(--muted);margin-top:3px;line-height:1.4}

/* 真实/模拟 标签（贴在缩略图左上角）*/
.tag-real,.tag-sim{position:absolute;top:6px;left:6px;padding:1px 8px;border-radius:10px;
  font-size:11px;font-weight:600;letter-spacing:.5px;z-index:1}
.tag-real{background:rgba(22,163,74,.92);color:#fff}
.tag-sim{background:rgba(217,119,6,.92);color:#fff}

/* ---- 仪表盘迷你列表（最近资源/告警）---- */
.mini-list{display:flex;flex-direction:column;gap:4px;max-height:240px;overflow:auto}
.mini-item{display:flex;gap:10px;align-items:center;padding:6px 4px;border-radius:6px;transition:.15s;min-width:0}
.mini-item:hover{background:var(--panel2)}
.mini-item > div:last-child{flex:1;min-width:0}
.mi-t{font-size:13px;color:#0f172a;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mi-s{font-size:11px;color:var(--muted);margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* ---- 通用表格（.tbl 显式类）---- */
.tbl{width:100%;border-collapse:collapse;font-size:13px}
.tbl th,.tbl td{padding:10px 12px;text-align:left;border-bottom:1px solid var(--line);white-space:nowrap}
.tbl th{background:var(--panel2);color:var(--muted);font-weight:600}
.tbl tbody tr:hover{background:#f8fafc}

/* ---- 分页器 ---- */
.pager{display:flex;justify-content:flex-end;align-items:center;gap:8px;margin-top:14px;color:var(--muted);font-size:13px}

/* ---- 图表 canvas ---- */
.chart{display:block;max-width:100%;margin:0 auto}

/* ---- 登录页脚注 ---- */
.hint-note{margin-top:8px;padding-top:8px;border-top:1px dashed var(--line);color:#92400e;font-size:11px;line-height:1.5}

/* ---- 上传/详情模态 ---- */
.modal-wide{width:680px}
.kv-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:8px 18px}
.progress{height:8px;background:#e2e8f0;border-radius:4px;overflow:hidden;margin-top:6px}
.progress > div{height:100%;background:var(--primary);transition:width .2s}
.progress.failed > div{background:var(--red)}
.progress.warn > div{background:var(--amber)}

/* ---- 状态徽章（与原 .badge 区分，更紧凑）---- */
.status{display:inline-block;padding:2px 8px;border-radius:6px;font-size:11px;font-weight:600}
.s-ok{background:#dcfce7;color:#166534}
.s-warn{background:#fef3c7;color:#92400e}
.s-err{background:#fee2e2;color:#991b1b}
.s-info{background:#dbeafe;color:#1e40af}
.s-gray{background:#f1f5f9;color:#475569}

/* ---- 工具栏微调（让 select/input 与按钮对齐）---- */
.toolbar select,.toolbar input[type=text],.toolbar input[type=search],.toolbar input:not([type]){
  padding:8px 11px;border:1px solid var(--line);border-radius:8px;font-size:13px;outline:none;background:#fff;height:36px}
.toolbar select:focus,.toolbar input:focus{border-color:var(--primary)}

/* ---- 故障注入滑块 ---- */
.fault-slider{display:flex;gap:10px;align-items:center;margin:10px 0}
.fault-slider input[type=range]{flex:1}
.fault-val{min-width:42px;text-align:right;font-weight:600;color:var(--primary)}

/* =========================================================
   表单自动美化（弹窗 + 模拟控制台）—— 直接子元素 label/input/select 自动获得合理间距
   这样所有现有弹窗（label + input 直接排列）无需改 HTML 即可获得良好排版
   ========================================================= */
.modal-body > label,
.sim-form > label,
.grid2 > label{
  display:block;
  font-size:13px;
  color:#475569;
  font-weight:600;
  letter-spacing:.2px;
  margin:14px 0 6px;
}
.modal-body > label:first-child,
.sim-form > label:first-child{margin-top:2px}
.modal-body > input,
.modal-body > select,
.modal-body > textarea,
.sim-form > input,
.sim-form > select,
.grid2 > input,
.grid2 > select{
  display:block;
  width:100%;
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:8px;
  font-size:14px;
  outline:none;
  background:#fff;
  color:var(--text);
  margin:0 0 4px;
  transition:border-color .15s, box-shadow .15s;
  font-family:inherit;
}
.modal-body > input:focus,
.modal-body > select:focus,
.modal-body > textarea:focus,
.sim-form > input:focus,
.sim-form > select:focus,
.grid2 > input:focus,
.grid2 > select:focus{
  border-color:var(--primary);
  box-shadow:0 0 0 3px rgba(37,99,235,.12)
}
.modal-body > input[placeholder], .sim-form > input[placeholder]{color:#94a3b8}
.modal-body > input::placeholder, .sim-form > input::placeholder{color:#94a3b8}

.grid2{display:grid;grid-template-columns:1fr 1fr;gap:0 14px;margin-bottom:6px}
.grid2 > input, .grid2 > select{margin-bottom:0}
/* grid2 单元格用 <div> 包裹 label+input 的形式（如模拟控制台表单） */
.grid2 > div{min-width:0}
.grid2 > div > label{display:block;font-size:13px;color:#475569;font-weight:600;letter-spacing:.2px;margin:14px 0 6px}
.grid2 > div > label:first-child{margin-top:2px}
.grid2 > div > input,
.grid2 > div > select{display:block;width:100%;padding:10px 12px;border:1px solid var(--line);border-radius:8px;font-size:14px;outline:none;background:#fff;color:var(--text);margin:0 0 4px;transition:border-color .15s,box-shadow .15s;font-family:inherit}
.grid2 > div > input:focus,
.grid2 > div > select:focus{border-color:var(--primary);box-shadow:0 0 0 3px rgba(37,99,235,.12)}
.grid2 > div > input::placeholder{color:#94a3b8}

/* =========================================================
   模拟控制台（场景化仿真）—— 卡片式左栏 + 表单/日志右栏
   ========================================================= */
.sim-wrap{display:grid;grid-template-columns:340px 1fr;gap:18px;align-items:start}
@media(max-width:1024px){.sim-wrap{grid-template-columns:1fr}}

.sim-left{background:#fff;border:1px solid var(--line);border-radius:12px;padding:18px 18px 14px;display:flex;flex-direction:column;position:sticky;top:0}
.sim-left h3{font-size:15px;font-weight:700;margin-bottom:12px;display:flex;align-items:center;gap:8px;color:#0f172a}
.scn-list{display:flex;flex-direction:column;gap:8px;max-height:calc(100vh - 220px);overflow:auto;padding-right:2px}
.scn-card{padding:11px 13px;border:1px solid var(--line);border-radius:10px;cursor:pointer;transition:all .15s;background:#fafbfc;display:flex;flex-direction:column;gap:6px}
.scn-card:hover{border-color:#93c5fd;background:#f0f7ff;transform:translateY(-1px)}
.scn-card.active{border-color:var(--primary);background:linear-gradient(135deg,#eff6ff,#f5faff);box-shadow:0 3px 10px rgba(37,99,235,.12)}
.scn-row1{display:flex;align-items:center;gap:8px}
.scn-key{display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;border-radius:7px;background:#e2e8f0;color:#475569;font-weight:700;font-size:12px;flex-shrink:0;letter-spacing:.5px}
.scn-card.active .scn-key{background:var(--primary);color:#fff}
.scn-name{font-weight:700;font-size:13.5px;color:#0f172a;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.scn-params{display:flex;flex-wrap:wrap;gap:4px;margin-top:2px}
.scn-chip{font-size:11px;background:#fff;border:1px solid var(--line);padding:2px 7px;border-radius:5px;color:#64748b;line-height:1.4}
.scn-card.active .scn-chip{background:#fff;border-color:#bfdbfe;color:#1e40af}

.sim-right{display:flex;flex-direction:column;gap:14px;min-width:0}
.sim-form{background:#fff;border:1px solid var(--line);border-radius:12px;padding:20px 22px 22px}
.sim-form-head{font-size:15px;font-weight:700;margin:0 0 14px;display:flex;align-items:center;gap:8px;color:#0f172a;padding-bottom:12px;border-bottom:1px solid var(--line)}
.sim-form-head .muted{font-weight:400;margin-left:auto;font-size:12px}
.sim-actions{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-top:16px;padding-top:16px;border-top:1px dashed var(--line)}
.sim-actions .btn{padding:9px 20px;font-weight:600;font-size:14px}
.sim-actions .btn-danger:disabled{background:#e2e8f0;color:#94a3b8}

.sim-log-panel{background:#0f172a;border-radius:12px;padding:14px 18px 16px;display:flex;flex-direction:column;border:1px solid #1e293b}
.sim-log-head{color:#cbd5e1;font-size:13px;font-weight:600;padding-bottom:8px;margin-bottom:10px;border-bottom:1px solid #1e293b;display:flex;align-items:center;gap:8px}
.sim-log-head .dot-live{width:8px;height:8px;border-radius:50%;background:#22c55e;box-shadow:0 0 8px #22c55e;animation:pulse 1.4s infinite}

/* 通用 task-log / log-line（采集任务详情、设备心跳、模拟日志 共用） */
.task-log{flex:1;max-height:320px;overflow:auto;font-family:Consolas,Monaco,"Cascadia Mono",monospace;font-size:12.5px;line-height:1.75;color:#e2e8f0;padding:2px 4px}
.task-log::-webkit-scrollbar{width:6px}
.task-log::-webkit-scrollbar-thumb{background:#334155;border-radius:3px}
.log-line{padding:2px 6px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;border-radius:3px}
.log-line:hover{background:rgba(255,255,255,.05)}
.task-log .empty{color:#64748b;text-align:center;padding:24px 0}

/* 表格内可换行单元 */
td.wrap{white-space:normal;line-height:1.6}

/* =========================================================
   分片上传弹窗（可靠传输）—— 表单区、故障注入、进度日志
   之所以单独写：.up-form 是包装层，auto-styling 的直接子元素选择器命中不到，
   故这里显式覆盖；同时给 file input / range / 进度条 上专用样式
   ========================================================= */
.btn-amber{background:var(--amber);color:#fff}
.btn-amber:hover{filter:brightness(.96)}
.btn-amber:disabled{background:#e2e8f0 !important;color:#94a3b8 !important}

.up-form{margin-bottom:6px}
.up-form > label,
.up-progress > label{
  display:block;font-size:13px;color:#475569;font-weight:600;letter-spacing:.2px;margin:16px 0 6px
}
.up-form > label:first-child{margin-top:2px}
.up-form > input:not([type=file]):not([type=range]),
.up-form > select{
  display:block;width:100%;padding:10px 12px;border:1px solid var(--line);border-radius:8px;
  font-size:14px;outline:none;background:#fff;color:var(--text);margin:0 0 4px;
  transition:border-color .15s,box-shadow .15s;font-family:inherit
}
.up-form > input:not([type=file]):not([type=range]):focus,
.up-form > select:focus{border-color:var(--primary);box-shadow:0 0 0 3px rgba(37,99,235,.12)}

/* 原生 file input 美化：让"选择文件"按钮变蓝色，文件名区干净 */
.up-form > input[type=file]{
  display:block;width:100%;padding:7px;border:1px dashed #93c5fd;border-radius:8px;
  font-size:13px;background:#f0f7ff;cursor:pointer;margin:0 0 4px;color:#1e40af
}
.up-form > input[type=file]::file-selector-button{
  padding:8px 16px;border:none;border-radius:6px;background:var(--primary);color:#fff;
  font-size:13px;font-weight:600;margin-right:12px;cursor:pointer;font-family:inherit;
  transition:background .15s
}
.up-form > input[type=file]::file-selector-button:hover{background:var(--primary-d)}

/* 故障注入：浅灰底 + 圆角容器，滑块 + 百分比 + 应用按钮 一行 */
.fault-row{
  display:flex;align-items:center;gap:12px;margin:8px 0 18px;padding:10px 14px;
  background:#f8fafc;border:1px solid var(--line);border-radius:8px
}
.fault-row input[type=range]{flex:1;height:6px;accent-color:var(--primary);cursor:pointer}
.fault-row .fault-val{min-width:48px;text-align:right;font-weight:700;color:var(--primary);font-size:14px;font-variant-numeric:tabular-nums}
.fault-row .btn{padding:7px 16px;font-size:13px;font-weight:600}

/* 进度区：深色终端风格 */
.up-progress{margin-top:18px;padding:14px 16px;background:#0f172a;border-radius:10px;color:#e2e8f0;border:1px solid #1e293b}
.up-progress > .up-bar{height:8px;background:#1e293b;border-radius:4px;overflow:hidden;margin-bottom:10px}
.up-bar-fill{height:100%;background:linear-gradient(90deg,#3b82f6,#22c55e);width:0%;transition:width .2s}
.up-stats{font-size:12.5px;color:#cbd5e1;margin-bottom:8px;font-family:Consolas,Monaco,monospace;line-height:1.6}
.up-log{max-height:160px;overflow:auto;font-family:Consolas,Monaco,monospace;font-size:12.5px;line-height:1.75;color:#e2e8f0}
.up-log::-webkit-scrollbar{width:6px}
.up-log::-webkit-scrollbar-thumb{background:#334155;border-radius:3px}
.up-log .log-line{padding:1px 4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;border-radius:3px}
.up-log .log-line:hover{background:rgba(255,255,255,.05)}
