:root{
  --ink:#0f172a; --sub:#64748b; --muted:#94a3b8;
  --line:#e5e9f0; --line2:#eef2f7;
  --bg:#f6f8fb; --card:#ffffff;
  --brand:#4f46e5; --brand-weak:#eef2ff;
  --green:#10b981; --green-weak:#ecfdf5;
  --amber:#f59e0b; --red:#ef4444; --red-weak:#fef2f2;
  --radius:14px;
  --shadow:0 1px 2px rgba(15,23,42,.05), 0 12px 32px -18px rgba(15,23,42,.35);
  --shadow-lg:0 20px 60px -20px rgba(15,23,42,.35);
}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Hiragino Sans GB","Microsoft YaHei",sans-serif;
  background:var(--bg); color:var(--ink); font-size:14px; line-height:1.55;
  -webkit-font-smoothing:antialiased;
}
a{color:var(--brand);text-decoration:none}
button{font-family:inherit}
input,textarea,select{font-family:inherit;font-size:14px}

/* ---------- 顶栏 ---------- */
.topbar{
  position:sticky;top:0;z-index:20;background:rgba(255,255,255,.86);
  backdrop-filter:saturate(180%) blur(12px);
  border-bottom:1px solid var(--line);
}
.topbar-inner{
  max-width:1120px;margin:0 auto;padding:0 20px;height:60px;
  display:flex;align-items:center;gap:12px;
}
.brand{display:flex;align-items:center;gap:9px;font-weight:700;font-size:16px;letter-spacing:.2px}
.brand-mark{
  width:30px;height:30px;border-radius:9px;display:grid;place-items:center;color:#fff;
  background:linear-gradient(135deg,#6366f1,#8b5cf6);
  box-shadow:0 6px 14px -6px rgba(99,102,241,.9);
}
.brand-mark svg{width:16px;height:16px}
.brand small{font-weight:400;color:var(--muted);font-size:12px;margin-left:2px}
.spacer{flex:1}

/* ---------- 布局 ---------- */
.container{max-width:1120px;margin:0 auto;padding:22px 20px 64px}
.section-head{display:flex;align-items:center;gap:12px;margin:26px 0 14px}
.section-head h2{font-size:15px;margin:0;font-weight:650}
.muted{color:var(--muted)}
.sub{color:var(--sub)}

/* ---------- 按钮 ---------- */
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:6px;
  height:36px;padding:0 14px;border-radius:10px;border:1px solid var(--line);
  background:#fff;color:var(--ink);font-size:13.5px;font-weight:500;cursor:pointer;
  transition:background .15s,border-color .15s,transform .12s,box-shadow .15s;
  white-space:nowrap;user-select:none;
}
.btn:hover{background:#f8fafc;border-color:#d8dfe9}
.btn:active{transform:scale(.98)}
.btn:disabled{opacity:.55;cursor:not-allowed}
.btn-primary{
  background:linear-gradient(135deg,#6366f1,#7c3aed);color:#fff;border:0;
  box-shadow:0 8px 18px -10px rgba(99,102,241,.9);
}
.btn-primary:hover{background:linear-gradient(135deg,#5b5ef0,#7226e6)}
.btn-ghost{background:transparent;border-color:transparent;color:var(--sub)}
.btn-ghost:hover{background:#f1f5f9;color:var(--ink)}
.btn-danger{color:var(--red);border-color:#fbd5d5;background:#fff}
.btn-danger:hover{background:var(--red-weak)}
.btn-sm{height:30px;padding:0 10px;font-size:12.5px;border-radius:8px}
.btn-lg{height:44px;padding:0 20px;font-size:15px;border-radius:12px}
.btn-block{width:100%}
.btn .ico{width:15px;height:15px;display:inline-block}

/* ---------- 统计条 ---------- */
.stats{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;margin-bottom:18px}
.stat{
  background:var(--card);border:1px solid var(--line);border-radius:var(--radius);
  padding:14px 16px;box-shadow:var(--shadow);
}
.stat .k{font-size:12px;color:var(--muted);margin-bottom:2px}
.stat .v{font-size:24px;font-weight:700;letter-spacing:-.5px}
.stat .v small{font-size:12px;font-weight:500;color:var(--muted);margin-left:4px}

.notice{
  display:flex;align-items:flex-start;gap:10px;padding:12px 14px;border-radius:12px;
  background:#fffbeb;border:1px solid #fde68a;color:#92400e;font-size:13px;margin-bottom:16px;
}
.notice .btn{margin-left:auto}
.notice b{font-weight:650}

/* ---------- 工具栏 ---------- */
.toolbar{display:flex;gap:10px;align-items:center;margin-bottom:16px;flex-wrap:wrap}
.search{
  position:relative;flex:1;min-width:180px;max-width:340px;
}
.search input{
  width:100%;height:38px;border-radius:10px;border:1px solid var(--line);
  background:#fff;padding:0 12px 0 34px;outline:none;transition:border-color .15s,box-shadow .15s;
}
.search input:focus{border-color:#c7d2fe;box-shadow:0 0 0 3px rgba(99,102,241,.12)}
.search svg{position:absolute;left:11px;top:11px;width:16px;height:16px;color:var(--muted)}

/* ---------- 卡片网格 ---------- */
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(310px,1fr));gap:16px}
.qcard{
  background:var(--card);border:1px solid var(--line);border-radius:16px;
  box-shadow:var(--shadow);overflow:hidden;display:flex;flex-direction:column;
  transition:box-shadow .2s,transform .2s,border-color .2s;
}
.qcard:hover{box-shadow:var(--shadow-lg);border-color:#dbe3ee}
.qcard.paused{opacity:.72}
.qcard-head{display:flex;align-items:flex-start;gap:10px;padding:14px 16px 10px}
.qcard-title{font-weight:650;font-size:15px;line-height:1.35;word-break:break-word;flex:1;min-width:0}
.pill{
  display:inline-flex;align-items:center;gap:4px;height:22px;padding:0 8px;border-radius:999px;
  font-size:11.5px;font-weight:500;white-space:nowrap;
}
.pill-on{background:var(--green-weak);color:#047857}
.pill-off{background:#f1f5f9;color:#64748b}
.pill-warn{background:#fff7ed;color:#c2410c}
.pill-info{background:var(--brand-weak);color:#4338ca}
.dot{width:6px;height:6px;border-radius:50%;background:currentColor;display:inline-block}

.qcard-body{display:flex;gap:14px;padding:0 16px 12px;align-items:center}
.qr-thumb{
  width:92px;height:92px;border-radius:12px;background:#fff;border:1px solid var(--line2);
  padding:5px;flex:none;display:block;
}
.qr-thumb img{width:100%;height:100%;display:block;image-rendering:pixelated;border-radius:6px}
.qcard-info{min-width:0;flex:1}
.slugline{display:flex;align-items:center;gap:6px;margin-bottom:8px}
.slugline code{
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12.5px;color:#4338ca;
  background:var(--brand-weak);padding:2px 7px;border-radius:6px;overflow:hidden;
  text-overflow:ellipsis;white-space:nowrap;max-width:100%;
}
.iconbtn{
  border:0;background:transparent;width:26px;height:26px;border-radius:7px;cursor:pointer;
  display:grid;place-items:center;color:var(--muted);flex:none;
}
.iconbtn:hover{background:#f1f5f9;color:var(--ink)}
.iconbtn svg{width:14px;height:14px}
.target{
  font-size:12.5px;color:var(--sub);display:flex;align-items:center;gap:6px;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.target .tag{
  font-size:10.5px;padding:1px 6px;border-radius:5px;background:#f1f5f9;color:#64748b;flex:none;
}
.target span{overflow:hidden;text-overflow:ellipsis}
.mini{font-size:12px;color:var(--muted);margin-top:6px}
.mini b{color:var(--ink);font-weight:600}

.qcard-foot{
  display:flex;gap:8px;padding:11px 16px;border-top:1px solid var(--line2);
  background:#fcfdff;margin-top:auto;
}
.qcard-foot .btn{flex:1}
.qcard-foot .btn-primary{flex:1.4}

/* ---------- 空状态 ---------- */
.empty{
  text-align:center;padding:56px 20px;background:var(--card);border:1px dashed #d9e1ec;
  border-radius:18px;color:var(--sub);
}
.empty .big{font-size:15px;font-weight:600;color:var(--ink);margin-bottom:6px}

/* ---------- 弹窗 ---------- */
.overlay{
  position:fixed;inset:0;background:rgba(15,23,42,.42);backdrop-filter:blur(3px);
  display:flex;align-items:center;justify-content:center;padding:20px;z-index:60;
  animation:fade .16s ease both;
}
@keyframes fade{from{opacity:0}to{opacity:1}}
.modal{
  background:#fff;border-radius:18px;width:100%;max-width:520px;max-height:calc(100vh - 48px);
  display:flex;flex-direction:column;box-shadow:0 30px 80px -24px rgba(15,23,42,.5);
  animation:pop .2s cubic-bezier(.2,.9,.3,1.05) both;
}
@keyframes pop{from{opacity:0;transform:translateY(8px) scale(.985)}to{opacity:1;transform:none}}
.modal.wide{max-width:680px}
.modal-head{padding:18px 20px 12px;border-bottom:1px solid var(--line2);display:flex;align-items:flex-start;gap:10px}
.modal-head h3{margin:0;font-size:16px;font-weight:650}
.modal-head p{margin:3px 0 0;font-size:12.5px;color:var(--muted)}
.modal-body{padding:18px 20px;overflow:auto}
.modal-foot{padding:14px 20px;border-top:1px solid var(--line2);display:flex;gap:10px;justify-content:flex-end;background:#fcfdff;border-radius:0 0 18px 18px}
.modal-foot .left{margin-right:auto}

/* ---------- 表单 ---------- */
.field{margin-bottom:14px}
.field > label{display:block;font-size:12.5px;font-weight:550;color:var(--sub);margin-bottom:6px}
.field .hint{font-size:11.5px;color:var(--muted);margin-top:5px;line-height:1.5}
.input,textarea.input,select.input{
  width:100%;height:40px;border:1px solid var(--line);border-radius:10px;background:#fff;
  padding:0 12px;outline:none;transition:border-color .15s,box-shadow .15s;color:var(--ink);
}
textarea.input{height:auto;padding:9px 12px;resize:vertical;min-height:74px;line-height:1.55}
.input:focus,textarea.input:focus,select.input:focus{border-color:#c7d2fe;box-shadow:0 0 0 3px rgba(99,102,241,.12)}
.input:disabled{background:#f8fafc;color:var(--muted)}
.row{display:flex;gap:12px}
.row > *{flex:1;min-width:0}
.seg{display:flex;background:#f1f5f9;border-radius:10px;padding:3px;gap:3px}
.seg button{
  flex:1;height:32px;border:0;background:transparent;border-radius:8px;cursor:pointer;
  font-size:13px;color:var(--sub);font-weight:500;transition:.15s;
}
.seg button.on{background:#fff;color:var(--ink);box-shadow:0 1px 3px rgba(15,23,42,.12)}

.drop{
  border:1.5px dashed #d3dce8;border-radius:12px;padding:18px;text-align:center;cursor:pointer;
  background:#fbfdff;transition:.15s;color:var(--sub);font-size:13px;
}
.drop:hover,.drop.over{border-color:#a5b4fc;background:#f5f7ff}
.drop img{max-height:150px;max-width:100%;border-radius:8px;display:block;margin:0 auto 8px}

/* ---------- 二维码预览 ---------- */
.qr-preview{display:flex;flex-direction:column;align-items:center;gap:12px;padding:8px 0 4px}
.qr-preview img{width:240px;height:240px;border-radius:12px;border:1px solid var(--line2);padding:8px;background:#fff;image-rendering:pixelated}
.qr-preview .url{
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;color:var(--sub);
  background:#f8fafc;border:1px solid var(--line2);padding:6px 10px;border-radius:8px;
  max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}

/* ---------- 列表 ---------- */
.list{border:1px solid var(--line2);border-radius:12px;overflow:hidden}
.list-item{
  display:flex;align-items:center;gap:10px;padding:10px 12px;border-bottom:1px solid var(--line2);
  font-size:13px;background:#fff;
}
.list-item:last-child{border-bottom:0}
.list-item .grow{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.list-item .time{color:var(--muted);font-size:11.5px;flex:none}

/* ---------- 柱状图 ---------- */
.chart{display:flex;align-items:flex-end;gap:3px;height:88px;padding:8px 0 0}
.chart .bar{flex:1;background:#e0e7ff;border-radius:3px 3px 2px 2px;min-height:2px;position:relative;transition:background .15s}
.chart .bar:hover{background:#a5b4fc}
.chart .bar.today{background:linear-gradient(180deg,#818cf8,#6366f1)}
.chart-x{display:flex;justify-content:space-between;font-size:11px;color:var(--muted);margin-top:6px}

.devchips{display:flex;flex-wrap:wrap;gap:6px;margin-top:10px}
.chip{
  font-size:12px;background:#f8fafc;border:1px solid var(--line2);border-radius:999px;
  padding:3px 10px;color:var(--sub);
}
.chip b{color:var(--ink);font-weight:600}

/* ---------- 登录 ---------- */
.login-wrap{
  min-height:100vh;display:flex;align-items:center;justify-content:center;padding:24px;
  background:radial-gradient(900px 480px at 50% -10%,#e4e7ff 0,rgba(228,231,255,0) 65%),var(--bg);
}
.login-card{
  width:100%;max-width:380px;background:#fff;border-radius:20px;padding:30px 26px 24px;
  box-shadow:var(--shadow-lg);text-align:center;
}
.login-card .brand-mark{width:46px;height:46px;border-radius:14px;margin:0 auto 14px}
.login-card .brand-mark svg{width:24px;height:24px}
.login-card h1{font-size:19px;margin:0 0 4px;font-weight:650}
.login-card p{margin:0 0 22px;color:var(--muted);font-size:13px}
.login-card .field{text-align:left}
.login-card .btn{height:44px;font-size:15px;border-radius:12px}
.err{color:var(--red);font-size:12.5px;min-height:18px;text-align:left;margin-top:2px}

/* ---------- 提示 ---------- */
#toast{
  position:fixed;left:50%;bottom:32px;transform:translate(-50%,20px);z-index:90;
  background:rgba(15,23,42,.93);color:#fff;padding:10px 20px;border-radius:999px;
  font-size:13.5px;opacity:0;pointer-events:none;transition:.22s ease;max-width:88vw;text-align:center;
}
#toast.show{opacity:1;transform:translate(-50%,0)}
.loading{padding:60px;text-align:center;color:var(--muted)}

@media (max-width:640px){
  .container{padding:16px 14px 48px}
  .grid{grid-template-columns:1fr}
  .stats{gap:8px}
  .stat{padding:11px 12px}
  .stat .v{font-size:20px}
  .modal{max-height:calc(100vh - 24px);border-radius:16px}
  .modal-body{padding:14px 16px}
  .topbar-inner{padding:0 14px}
  .brand small{display:none}
  .toolbar .btn span{display:none}
}
