/* =====================================================
 * AI助手 管理后台样式 v2.1
 * 设计体系：8pt grid · OKLCH 中性灰 · light/dark dual theme
 * ===================================================== */
*{margin:0;padding:0;box-sizing:border-box}
*,::before,::after{border:0 solid;-webkit-tap-highlight-color:transparent}
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
body{overflow-x:hidden}
body.sidebar-open{overflow:hidden}

/* =========================================
 * 1. Design Tokens —— Light（默认）
 * ========================================= */
:root{
  /* —— 中性色（Slate 体系，专业冷灰） —— */
  --slate-25:#fcfcfd;
  --slate-50:#f8fafc;
  --slate-100:#f1f5f9;
  --slate-200:#e2e8f0;
  --slate-300:#cbd5e1;
  --slate-400:#94a3b8;
  --slate-500:#64748b;
  --slate-600:#475569;
  --slate-700:#334155;
  --slate-800:#1e293b;
  --slate-900:#0f172a;
  --slate-950:#020617;

  /* —— 品牌主色 Indigo（现代专业） —— */
  --brand-50:#eef2ff;
  --brand-100:#e0e7ff;
  --brand-200:#c7d2fe;
  --brand-300:#a5b4fc;
  --brand-400:#818cf8;
  --brand-500:#6366f1;
  --brand-600:#4f46e5;
  --brand-700:#4338ca;
  --brand-800:#3730a3;

  /* —— 语义色 —— */
  --success:#10b981;--success-bg:#d1fae5;--success-fg:#065f46;
  --danger:#ef4444;--danger-bg:#fee2e2;--danger-fg:#991b1b;
  --warning:#f59e0b;--warning-bg:#fef3c7;--warning-fg:#92400e;
  --info:#06b6d4;--info-bg:#cffafe;--info-fg:#155e75;

  /* —— 表面层级（elevation） —— */
  --bg:var(--slate-50);              /* 页面背景 */
  --bg-subtle:var(--slate-100);      /* 次要背景 */
  --surface:#ffffff;                 /* 卡片表面 */
  --surface-hover:var(--slate-50);   /* 卡片 hover */
  --surface-raised:#ffffff;          /* 浮起表面 */
  --border:var(--slate-200);
  --border-strong:var(--slate-300);
  --border-subtle:var(--slate-100);
  --divider:var(--slate-200);

  /* —— 文字 —— */
  --text:var(--slate-900);
  --text-sec:var(--slate-600);
  --text-muted:var(--slate-400);
  --text-inverse:#ffffff;

  /* —— 主色语义引用 —— */
  --accent:var(--brand-600);
  --accent-hover:var(--brand-700);
  --accent-fg:#ffffff;
  --accent-light:var(--brand-50);
  --accent-ring:rgba(79,70,229,.18);

  /* —— 侧栏 —— */
  --sidebar:#0f172a;
  --sidebar-border:rgba(255,255,255,.06);
  --sidebar-text:#94a3b8;
  --sidebar-text-hover:#e2e8f0;
  --sidebar-active-bg:linear-gradient(135deg,#4f46e5,#6366f1);
  --sidebar-group:#475569;

  /* —— 半径节奏 —— */
  --radius-xs:6px;
  --radius-sm:8px;
  --radius:10px;
  --radius-md:12px;
  --radius-lg:16px;
  --radius-xl:20px;

  /* —— 间距节奏 (8pt grid) —— */
  --sp-1:4px;--sp-2:8px;--sp-3:12px;--sp-4:16px;
  --sp-5:20px;--sp-6:24px;--sp-8:32px;--sp-10:40px;--sp-12:48px;

  /* —— 字体 —— */
  --font:"Inter","SF Pro Text",-apple-system,BlinkMacSystemFont,"Segoe UI",
         "PingFang SC","Microsoft YaHei UI","Hiragino Sans GB",sans-serif;
  --font-mono:"JetBrains Mono","SF Mono",ui-monospace,Menlo,Consolas,monospace;

  /* —— 字号节奏 —— */
  --fs-xs:11px;--fs-sm:12px;--fs-base:13px;--fs-md:14px;
  --fs-lg:16px;--fs-xl:18px;--fs-2xl:22px;--fs-3xl:28px;

  /* —— 阴影体系（Vercel 风格） —— */
  --shadow-xs:0 1px 2px rgba(15,23,42,.04);
  --shadow-sm:0 1px 3px rgba(15,23,42,.06),0 1px 2px rgba(15,23,42,.04);
  --shadow-md:0 4px 6px -1px rgba(15,23,42,.07),0 2px 4px -2px rgba(15,23,42,.05);
  --shadow-lg:0 10px 15px -3px rgba(15,23,42,.08),0 4px 6px -4px rgba(15,23,42,.05);
  --shadow-xl:0 20px 25px -5px rgba(15,23,42,.1),0 8px 10px -6px rgba(15,23,42,.06);
  --shadow-2xl:0 25px 50px -12px rgba(15,23,42,.18);
  --shadow-focus:0 0 0 3px var(--accent-ring);

  /* —— 动效缓动 —— */
  --ease:cubic-bezier(.4,0,.2,1);
  --ease-out:cubic-bezier(.16,1,.3,1);
  --ease-in:cubic-bezier(.4,0,1,1);
  --dur-fast:120ms;
  --dur:180ms;
  --dur-slow:280ms;
}

/* =========================================
 * 2. Dark Theme tokens —— [data-theme="dark"]
 * ========================================= */
[data-theme="dark"]{
  --slate-25:#0b1220;
  --slate-50:#0f172a;
  --slate-100:#111827;
  --slate-200:#1f2937;
  --slate-300:#374151;
  --slate-400:#6b7280;
  --slate-500:#9ca3af;
  --slate-600:#d1d5db;
  --slate-700:#e5e7eb;
  --slate-800:#f3f4f6;
  --slate-900:#f9fafb;

  --brand-50:#1e1b4b;
  --brand-100:#312e81;

  --success-bg:rgba(16,185,129,.15);--success-fg:#6ee7b7;
  --danger-bg:rgba(239,68,68,.15);--danger-fg:#fca5a5;
  --warning-bg:rgba(245,158,11,.15);--warning-fg:#fcd34d;
  --info-bg:rgba(6,182,212,.15);--info-fg:#67e8f9;

  --bg:#0a0f1c;
  --bg-subtle:#0f172a;
  --surface:#111827;
  --surface-hover:#1a2235;
  --surface-raised:#1a2235;
  --border:#1f2937;
  --border-strong:#374151;
  --border-subtle:#162033;
  --divider:#1f2937;

  --text:#f1f5f9;
  --text-sec:#cbd5e1;
  --text-muted:#64748b;

  --accent:#818cf8;
  --accent-hover:#a5b4fc;
  --accent-fg:#0a0f1c;
  --accent-light:rgba(129,140,248,.12);
  --accent-ring:rgba(129,140,248,.28);

  --sidebar:#070b14;
  --sidebar-border:rgba(255,255,255,.04);
  --sidebar-text:#64748b;
  --sidebar-text-hover:#cbd5e1;
  --sidebar-active-bg:linear-gradient(135deg,#6366f1,#818cf8);
  --sidebar-group:#3b4658;

  --shadow-xs:0 1px 2px rgba(0,0,0,.5);
  --shadow-sm:0 1px 3px rgba(0,0,0,.4),0 1px 2px rgba(0,0,0,.3);
  --shadow-md:0 4px 6px -1px rgba(0,0,0,.5),0 2px 4px -2px rgba(0,0,0,.4);
  --shadow-lg:0 10px 15px -3px rgba(0,0,0,.5),0 4px 6px -4px rgba(0,0,0,.4);
  --shadow-xl:0 20px 25px -5px rgba(0,0,0,.6),0 8px 10px -6px rgba(0,0,0,.5);
  --shadow-2xl:0 25px 50px -12px rgba(0,0,0,.7);
}

/* =========================================
 * 3. Base
 * ========================================= */
html,body{height:100%}
body{
  font-family:var(--font);
  background:var(--bg);
  color:var(--text);
  font-size:var(--fs-md);
  line-height:1.6;
  overflow-x:hidden;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  font-feature-settings:"cv02","cv03","cv04","cv11";
  transition:background var(--dur) var(--ease),color var(--dur) var(--ease);
}
a{color:var(--accent);text-decoration:none;transition:color var(--dur-fast)}
a:hover{color:var(--accent-hover)}
button{font-family:inherit}
:focus-visible{outline:none;box-shadow:var(--shadow-focus)}
.hidden{display:none!important}

/* —— scrollbar —— */
::-webkit-scrollbar{width:8px;height:8px}
::-webkit-scrollbar-track{background:transparent}
::-webkit-scrollbar-thumb{background:var(--slate-300);border-radius:4px;border:2px solid var(--bg)}
::-webkit-scrollbar-thumb:hover{background:var(--slate-400)}
.sidebar::-webkit-scrollbar{width:6px}
.sidebar::-webkit-scrollbar-thumb{background:rgba(255,255,255,.1);border:none}
.sidebar::-webkit-scrollbar-thumb:hover{background:rgba(255,255,255,.18)}

/* =========================================
 * 4. Login
 * ========================================= */
.login-wrap{display:flex;align-items:center;justify-content:center;min-height:100vh;min-height:100dvh;padding:var(--sp-5);background:#0a0f1c;position:relative;overflow:hidden}
.login-wrap::before{content:'';position:absolute;width:600px;height:600px;border-radius:50%;background:radial-gradient(circle,rgba(99,102,241,.18) 0%,transparent 70%);top:-200px;right:-100px;animation:loginOrb1 12s ease-in-out infinite alternate;pointer-events:none}
.login-wrap::after{content:'';position:absolute;width:500px;height:500px;border-radius:50%;background:radial-gradient(circle,rgba(79,70,229,.14) 0%,transparent 70%);bottom:-180px;left:-80px;animation:loginOrb2 10s ease-in-out infinite alternate;pointer-events:none}
.login-card{position:relative;z-index:1;display:flex;width:880px;max-width:100%;min-height:480px;border-radius:var(--radius-xl);overflow:hidden;box-shadow:0 30px 80px rgba(0,0,0,.5),0 0 0 1px rgba(255,255,255,.04);animation:fadeUp .6s var(--ease-out)}
.login-brand{flex:1;background:linear-gradient(160deg,#1e1b4b 0%,#312e81 40%,#4338ca 100%);padding:52px 44px;display:flex;flex-direction:column;justify-content:center;position:relative;overflow:hidden}
.login-brand::after{content:'';position:absolute;width:280px;height:280px;border-radius:50%;background:rgba(255,255,255,.04);top:-60px;right:-60px}
.login-brand .brand-icon{width:48px;height:48px;border-radius:14px;background:rgba(255,255,255,.12);display:flex;align-items:center;justify-content:center;margin-bottom:28px;backdrop-filter:blur(8px)}
.login-brand .brand-icon span{font-size:22px;color:#fff;font-weight:800}
.login-brand h2{color:#fff;font-size:28px;font-weight:800;line-height:1.3;margin-bottom:12px;letter-spacing:-.02em}
.login-brand p{color:rgba(255,255,255,.6);font-size:14px;line-height:1.7}
.login-brand .brand-features{margin-top:36px;display:flex;flex-direction:column;gap:12px}
.login-brand .brand-features .feat{display:flex;align-items:center;gap:10px;color:rgba(255,255,255,.72);font-size:13px}
.login-brand .brand-features .feat-dot{width:6px;height:6px;border-radius:50%;background:#a5b4fc;flex-shrink:0;box-shadow:0 0 8px rgba(165,180,252,.6)}
.login-form{background:var(--surface);padding:52px 44px;width:380px;flex-shrink:0;display:flex;flex-direction:column;justify-content:center}
.login-form h1{font-size:24px;font-weight:800;margin-bottom:4px;color:var(--text);letter-spacing:-.02em}
.login-form .login-sub{color:var(--text-muted);font-size:13px;margin-bottom:32px}
.login-field{position:relative;margin-bottom:16px}
.login-field label{display:block;font-size:12px;font-weight:600;color:var(--text-sec);margin-bottom:6px;letter-spacing:.3px}
.login-field input{width:100%;border:1.5px solid var(--border);border-radius:var(--radius);padding:11px 14px 11px 40px;font-size:14px;outline:none;transition:border var(--dur),box-shadow var(--dur),background var(--dur);background:var(--bg-subtle);color:var(--text)}
.login-field input:focus{border-color:var(--accent);box-shadow:var(--shadow-focus);background:var(--surface)}
.login-field .field-icon{position:absolute;left:13px;bottom:11px;width:18px;height:18px;color:var(--text-muted);pointer-events:none;transition:color var(--dur)}
.login-field input:focus~.field-icon{color:var(--accent)}
/* 密码可见性切换按钮（注意要覆盖 .login-form button 的默认全宽样式） */
.login-form button.login-eye{
  position:absolute;right:8px;bottom:6px;
  width:30px;height:30px;margin:0;padding:0;
  background:transparent;background-image:none;
  border:none;border-radius:6px;
  display:flex;align-items:center;justify-content:center;
  color:var(--text-muted);cursor:pointer;font-size:14px;font-weight:normal;
  transition:color var(--dur),background var(--dur);
  box-shadow:none;letter-spacing:normal;
}
.login-form button.login-eye:hover{color:var(--accent);background:var(--bg-subtle);transform:none;box-shadow:none}
.login-form button.login-eye:active{transform:none}
.login-form button.login-eye:focus{outline:none;color:var(--accent)}
#loginPwd{padding-right:42px}

/* 记住账号密码 */
.login-options{
  display:flex;align-items:center;justify-content:space-between;
  margin:-4px 0 14px;
}
.login-check{
  display:inline-flex;align-items:center;gap:8px;
  font-size:13px;color:var(--text-sec);cursor:pointer;
  user-select:none;
}
.login-check input{
  position:absolute;opacity:0;width:0;height:0;
}
.login-check-box{
  width:16px;height:16px;border-radius:4px;
  border:1.5px solid var(--border-strong);
  background:var(--surface);
  display:inline-flex;align-items:center;justify-content:center;
  transition:all var(--dur);flex-shrink:0;
}
.login-check-box::after{
  content:'';width:9px;height:5px;
  border-left:2px solid #fff;border-bottom:2px solid #fff;
  transform:rotate(-45deg) translateY(-1px) scale(0);
  transition:transform var(--dur);
}
.login-check input:checked + .login-check-box{
  background:var(--accent);border-color:var(--accent);
}
.login-check input:checked + .login-check-box::after{
  transform:rotate(-45deg) translateY(-1px) scale(1);
}
.login-check input:focus-visible + .login-check-box{
  box-shadow:var(--shadow-focus);
}
.login-check:hover .login-check-box{border-color:var(--accent)}

.login-form button{width:100%;margin-top:8px;padding:13px;border:none;border-radius:var(--radius);background:linear-gradient(135deg,#4f46e5,#6366f1);color:#fff;font-size:15px;font-weight:700;cursor:pointer;transition:transform var(--dur-fast),box-shadow var(--dur-slow),opacity var(--dur);letter-spacing:.3px}
.login-form button:hover{box-shadow:0 8px 24px rgba(79,70,229,.4);transform:translateY(-1px)}
.login-form button:active{transform:translateY(0) scale(.98)}
.login-form button:disabled{opacity:.5;cursor:not-allowed;transform:none;box-shadow:none}
.login-err{color:var(--danger);font-size:13px;margin-top:12px;display:none;padding:8px 12px;background:var(--danger-bg);border-radius:var(--radius-sm);line-height:1.5}
.login-footer{margin-top:24px;text-align:center;color:var(--text-muted);font-size:11px}
@keyframes loginOrb1{from{transform:translate(0,0) scale(1)}to{transform:translate(-40px,30px) scale(1.15)}}
@keyframes loginOrb2{from{transform:translate(0,0) scale(1)}to{transform:translate(30px,-20px) scale(1.1)}}

/* =========================================
 * 5. Layout
 * ========================================= */
.app{display:flex;min-height:100vh;min-height:100dvh}

.sidebar{
  width:240px;background:var(--sidebar);
  display:flex;flex-direction:column;flex-shrink:0;
  position:fixed;top:0;left:0;bottom:0;z-index:50;
  transition:transform var(--dur-slow) var(--ease),width var(--dur) var(--ease);
  border-right:1px solid var(--sidebar-border);
}
.sidebar .logo{padding:22px 22px 18px;display:flex;align-items:center;gap:10px}
.sidebar .logo .dot{width:10px;height:10px;border-radius:50%;background:linear-gradient(135deg,#a5b4fc,#6366f1);box-shadow:0 0 12px rgba(99,102,241,.6)}
.sidebar .logo span{color:#fff;font-size:16px;font-weight:700;letter-spacing:-.01em}
.sidebar .logo .tag{color:#a5b4fc;font-size:10px;font-weight:600;background:rgba(99,102,241,.15);border-radius:4px;padding:2px 7px}
.sidebar hr{border:none;height:1px;background:var(--sidebar-border);margin:0}
.sidebar nav{padding:8px 0;flex:1;overflow-y:auto;overflow-x:hidden}
.sidebar .nav-group{padding:16px 22px 6px;font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:1.2px;color:var(--sidebar-group)}
.sidebar nav button{
  display:flex;align-items:center;gap:10px;
  width:calc(100% - 20px);text-align:left;
  border:none;background:transparent;color:var(--sidebar-text);
  font-size:13px;font-weight:500;padding:10px 16px;cursor:pointer;
  border-radius:var(--radius-sm);margin:1px 10px;
  transition:background var(--dur-fast),color var(--dur-fast),transform var(--dur-fast);position:relative;
}
.sidebar nav button:hover{background:rgba(255,255,255,.06);color:var(--sidebar-text-hover)}
.sidebar nav button.active{background:var(--sidebar-active-bg);color:#fff;font-weight:600;box-shadow:0 4px 12px rgba(79,70,229,.35)}
.sidebar .user-area{padding:14px 16px;border-top:1px solid var(--sidebar-border);display:flex;align-items:center;gap:10px}
.sidebar .user-area .u-avatar{width:34px;height:34px;border-radius:var(--radius-sm);background:linear-gradient(135deg,#6366f1,#4f46e5);display:flex;align-items:center;justify-content:center;color:#fff;font-size:13px;font-weight:700;flex-shrink:0;box-shadow:0 2px 8px rgba(79,70,229,.4)}
.sidebar .user-area .u-info{flex:1;min-width:0}
.sidebar .user-area .u-name{color:#e2e8f0;font-size:13px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sidebar .user-area .u-role{color:var(--sidebar-group);font-size:11px}
.sidebar .user-area .u-logout{background:none;border:none;color:var(--sidebar-group);cursor:pointer;padding:6px;border-radius:var(--radius-xs);transition:all var(--dur-fast);font-size:16px;line-height:1;display:flex;align-items:center;justify-content:center}
.sidebar .user-area .u-logout:hover{background:rgba(239,68,68,.12);color:#ef4444}
.sidebar .ver{color:#3b4658;font-size:11px;padding:8px 22px;font-family:var(--font-mono)}

.main{flex:1;margin-left:240px;overflow-y:auto;padding:28px 36px;min-height:100vh;transition:margin-left var(--dur) var(--ease)}

/* =========================================
 * 6. Mobile
 * ========================================= */
.mobile-header{display:none;position:fixed;top:0;left:0;right:0;z-index:40;background:var(--surface);border-bottom:1px solid var(--border);padding:10px 14px;align-items:center;gap:10px;box-shadow:var(--shadow-sm)}
.hamburger{background:none;border:none;cursor:pointer;padding:10px;margin:-6px;display:flex;flex-direction:column;justify-content:center;gap:5px;min-width:44px;min-height:44px;border-radius:var(--radius-sm)}
.hamburger span{display:block;width:20px;height:2px;background:var(--text);border-radius:1px;transition:transform var(--dur),opacity var(--dur)}
.hamburger.open span:nth-child(1){transform:translateY(7px) rotate(45deg)}
.hamburger.open span:nth-child(2){opacity:0}
.hamburger.open span:nth-child(3){transform:translateY(-7px) rotate(-45deg)}
.mobile-header .m-title{font-size:15px;font-weight:700;color:var(--text);flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.mobile-header .m-theme{margin-left:auto;color:var(--text-sec);background:var(--bg-subtle);border:1px solid var(--border);min-width:40px;min-height:40px;border-radius:var(--radius-sm);display:inline-flex;align-items:center;justify-content:center}
.mobile-header .m-theme:hover{color:var(--accent);background:var(--accent-light)}
.sidebar-overlay{display:none;position:fixed;inset:0;background:rgba(0,0,0,.55);z-index:45;backdrop-filter:blur(3px)}
.sidebar-overlay.show{display:block}

/* =========================================
 * 7. Page Header
 * ========================================= */
.page-hdr{margin-bottom:2px}
.page-hdr h2{font-size:var(--fs-2xl);font-weight:800;line-height:1.25;color:var(--text);letter-spacing:-.02em}
.page-hdr p{color:var(--text-muted);font-size:13px;margin-top:2px;line-height:1.4}
.accent-bar{height:3px;background:linear-gradient(90deg,#4f46e5,#7c3aed,#ec4899);border-radius:2px;margin:8px 0 16px;max-width:120px}

/* =========================================
 * 8. Stat Cards
 * ========================================= */
.stats{display:grid;grid-template-columns:repeat(5,1fr);gap:14px;margin-bottom:24px}
.stat-card{
  background:var(--surface);border:1px solid var(--border);
  border-radius:var(--radius-md);padding:20px;
  display:flex;align-items:center;gap:14px;
  transition:transform var(--dur),box-shadow var(--dur),border-color var(--dur);
  cursor:default;position:relative;overflow:hidden;
}
.stat-card::before{content:'';position:absolute;top:0;left:0;right:0;height:2px;background:transparent;transition:background var(--dur)}
.stat-card:hover{transform:translateY(-3px);box-shadow:var(--shadow-md);border-color:var(--border-strong)}
.stat-card:hover::before{background:var(--accent)}
.stat-card .icon-dot{width:44px;height:44px;border-radius:var(--radius-md);display:flex;align-items:center;justify-content:center;font-size:19px;flex-shrink:0}
.stat-card .val{font-size:26px;font-weight:800;line-height:1.1;color:var(--text);letter-spacing:-.02em;font-variant-numeric:tabular-nums}
.stat-card .lbl{font-size:12px;color:var(--text-muted);font-weight:500;margin-top:2px}

/* =========================================
 * 9. Charts
 * ========================================= */
.chart-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin-bottom:24px}
.chart-card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-md);padding:22px 24px;transition:box-shadow var(--dur),border-color var(--dur)}
.chart-card:hover{box-shadow:var(--shadow-sm);border-color:var(--border-strong)}
.chart-card h3{font-size:15px;font-weight:700;margin-bottom:16px;display:flex;align-items:center;gap:8px;color:var(--text)}
.chart-card h3 .dot{width:8px;height:8px;border-radius:50%;flex-shrink:0}
.chart-card canvas{width:100%!important;height:200px!important}
.chart-card-wide{grid-column:1 / -1}
.chart-card-wide canvas{height:220px!important}

/* ===== 未来 30 天回库候选详情 ===== */
.rf30-modal{max-width:860px;width:100%}
.rf30-hint{
  display:inline-flex;align-items:center;justify-content:center;
  width:16px;height:16px;margin-left:6px;border-radius:50%;
  font-size:11px;font-weight:700;cursor:help;vertical-align:middle;
  color:var(--text-muted);border:1px solid var(--border);background:transparent;
}
.rf30-kpis{
  display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-bottom:14px;
}
.rf30-kpi{
  padding:12px 14px;border:1px solid var(--border);border-radius:10px;
  background:var(--bg-subtle, rgba(0,0,0,.02));
}
.rf30-kpi-lbl{font-size:11px;color:var(--text-muted);margin-bottom:4px}
.rf30-kpi-val{
  font-size:20px;font-weight:700;color:var(--text);
  font-variant-numeric:tabular-nums;letter-spacing:-0.02em;line-height:1.2;
}
.rf30-kpi-sub{font-size:11px;color:var(--text-muted);margin-top:4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.rf30-kpi-backlog{border-color:rgba(245,158,11,.45);background:rgba(245,158,11,.08)}
.rf30-kpi-backlog .rf30-kpi-val{color:#f59e0b}
.rf30-chart-wrap{height:260px;position:relative;margin-bottom:16px}
.rf30-grid-hd{
  display:flex;align-items:center;justify-content:space-between;gap:10px;
  font-size:13px;font-weight:600;color:var(--text);margin-bottom:8px;
}
.rf30-legend{display:flex;align-items:center;gap:8px;font-size:11px;font-weight:500;color:var(--text-muted)}
.rf30-lg{display:inline-block;width:10px;height:10px;border-radius:3px}
.rf30-lg-low{background:rgba(124,58,237,.25)}
.rf30-lg-mid{background:rgba(124,58,237,.55)}
.rf30-lg-high{background:rgba(124,58,237,.9)}
.rf30-grid{
  display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:8px;
  max-height:280px;overflow:auto;padding-bottom:2px;
}
.rf30-cell{
  padding:10px 10px 9px;border:1px solid var(--border);border-radius:8px;
  background:var(--surface);transition:border-color .15s, background .15s;
}
.rf30-cell.is-today{border-color:#7c3aed;box-shadow:inset 0 0 0 1px rgba(124,58,237,.35)}
.rf30-cell.is-peak{border-color:#a78bfa}
.rf30-cell.is-weekend .rf30-cell-wd{color:#f59e0b}
.rf30-cell-top{display:flex;align-items:baseline;justify-content:space-between;gap:4px;margin-bottom:6px}
.rf30-cell-date{font-size:12px;font-weight:600;color:var(--text)}
.rf30-cell-wd{font-size:10px;color:var(--text-muted)}
.rf30-cell-count{
  font-size:15px;font-weight:700;color:var(--text);
  font-variant-numeric:tabular-nums;letter-spacing:-0.02em;
}
.rf30-cell-bar{
  margin-top:6px;height:3px;border-radius:2px;background:rgba(124,58,237,.12);overflow:hidden;
}
.rf30-cell.is-clickable{cursor:pointer}
.rf30-cell.is-clickable:hover{border-color:rgba(124,58,237,.55);background:rgba(124,58,237,.06)}
.rf30-cell-backlog{border-color:rgba(245,158,11,.55)!important;background:rgba(245,158,11,.1)!important}
.rf30-cell-backlog:hover{border-color:#f59e0b!important;background:rgba(245,158,11,.16)!important}
.rf30-cell-backlog .rf30-cell-count{color:#f59e0b}
.rf30-run-btn{
  margin-top:8px;width:100%;padding:4px 8px!important;font-size:11px!important;
  min-height:0!important;line-height:1.2;
}
@media (max-width:720px){
  .rf30-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}
  .rf30-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
  .rf30-chart-wrap{height:220px}
}

/* ===== 激活码使用量历史大窗 ===== */
.modal.act-hist-modal{
  max-width:min(1120px,96vw);width:min(1120px,96vw);
  overflow:hidden;display:flex;flex-direction:column;max-height:90vh;
}
.modal.act-hist-modal .modal-body{
  flex:1;min-height:0;overflow-x:hidden;overflow-y:auto;
  display:flex;flex-direction:column;
  padding-bottom:12px;
}
.act-hist-ranges{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:12px}
.act-hist-ranges .btn.is-on{
  background:#059669;border-color:#059669;color:#fff;
}
.act-hist-hint{
  font-size:12px;color:var(--text-muted);margin:-4px 0 8px;
}
.act-hist-legend{
  display:flex;align-items:center;gap:8px;flex-wrap:wrap;
  font-size:11px;color:var(--text-muted);margin:0 0 8px;
}
.act-hist-lg{display:inline-block;width:10px;height:10px;border-radius:3px;margin-right:2px}
.act-hist-lg-wd{background:rgba(5,150,105,.75)}
.act-hist-lg-we{background:rgba(245,158,11,.85)}
.act-hist-lg-today{background:rgba(16,185,129,.95);box-shadow:0 0 0 1px rgba(16,185,129,.4)}
.act-hist-chart-scroll{
  flex:1;min-height:260px;overflow-x:auto;overflow-y:hidden;
  -webkit-overflow-scrolling:touch;
  padding-bottom:6px;
  scrollbar-color:rgba(5,150,105,.55) transparent;
}
.act-hist-chart-scroll::-webkit-scrollbar{height:10px}
.act-hist-chart-scroll::-webkit-scrollbar-track{background:rgba(5,150,105,.08);border-radius:6px}
.act-hist-chart-scroll::-webkit-scrollbar-thumb{background:rgba(5,150,105,.45);border-radius:6px}
.act-hist-chart-inner{height:260px;position:relative;min-width:100%}
.act-hist-chart-inner canvas{display:block;width:100%!important;height:100%!important}
.act-hist-wd-hd{
  font-size:12px;font-weight:600;color:var(--text);margin:10px 0 8px;
}
.act-hist-wd-grid{
  display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:6px;
  flex-shrink:0;
}
.act-hist-wd{
  padding:8px 8px 7px;border:1px solid var(--border);border-radius:8px;
  background:var(--bg-subtle,rgba(0,0,0,.02));
}
.act-hist-wd.is-we{border-color:rgba(245,158,11,.4);background:rgba(245,158,11,.08)}
.act-hist-wd.is-peak{border-color:rgba(5,150,105,.55)}
.act-hist-wd-name{font-size:11px;color:var(--text-muted);margin-bottom:2px}
.act-hist-wd.is-we .act-hist-wd-name{color:#d97706;font-weight:600}
.act-hist-wd-val{
  font-size:15px;font-weight:700;color:var(--text);
  font-variant-numeric:tabular-nums;line-height:1.2;
}
.act-hist-wd-sub{font-size:10px;color:var(--text-muted);margin-top:3px}

.act-hist-insight{
  margin:0 0 12px;padding:12px 14px;border:1px solid var(--border);border-radius:12px;
  background:var(--bg-subtle,rgba(0,0,0,.02));
}
.act-hist-verdict{
  font-size:13px;line-height:1.55;color:var(--text);margin:0 0 10px;
}
.act-hist-verdict b{font-weight:700}
.act-hist-verdict.is-down{color:#dc2626}
.act-hist-verdict.is-up{color:#059669}
.act-hist-verdict.is-flat{color:var(--text)}
.act-hist-verdict .act-hist-note{display:block;margin-top:4px;font-size:12px;color:var(--text-muted);font-weight:500}
.act-hist-cmp{
  display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin-bottom:10px;
}
.act-hist-cmp-card{
  padding:10px 10px 8px;border:1px solid var(--border);border-radius:10px;background:var(--surface);
}
.act-hist-cmp-card.is-now{border-color:rgba(5,150,105,.5);background:rgba(5,150,105,.08)}
.act-hist-cmp-lbl{font-size:11px;color:var(--text-muted);margin-bottom:3px}
.act-hist-cmp-val{
  font-size:18px;font-weight:700;color:var(--text);
  font-variant-numeric:tabular-nums;letter-spacing:-.02em;line-height:1.2;
}
.act-hist-delta{font-size:12px;font-weight:600;margin-top:4px;display:block}
.act-hist-delta.is-down{color:#dc2626}
.act-hist-delta.is-up{color:#059669}
.act-hist-delta.is-flat,.act-hist-delta.is-na{color:var(--text-muted);font-weight:500}
.act-hist-spark{
  display:flex;align-items:flex-end;gap:6px;height:86px;margin:4px 0 12px;
  overflow-x:auto;padding:0 2px 2px;
}
.act-hist-spark-col{
  flex:1;min-width:36px;max-width:72px;display:flex;flex-direction:column;align-items:center;height:100%;
}
.act-hist-spark-bar{
  flex:1;width:100%;min-height:40px;display:flex;align-items:flex-end;justify-content:center;
}
.act-hist-spark-bar i{
  display:block;width:70%;min-height:3px;border-radius:3px 3px 0 0;background:rgba(5,150,105,.7);
}
.act-hist-spark-col.is-we .act-hist-spark-bar i{background:rgba(245,158,11,.8)}
.act-hist-spark-col.is-today .act-hist-spark-bar i{background:#059669}
.act-hist-spark-col.is-today.is-down .act-hist-spark-bar i{background:#dc2626}
.act-hist-spark-n{font-size:10px;font-weight:600;font-variant-numeric:tabular-nums;margin-top:3px;color:var(--text)}
.act-hist-spark-d{font-size:10px;color:var(--text-muted);white-space:nowrap}
.act-hist-period{display:flex;flex-direction:column;gap:6px}
.act-hist-period-row{
  display:flex;align-items:baseline;justify-content:space-between;gap:10px;
  font-size:12px;padding:6px 8px;border-radius:8px;background:var(--surface);border:1px solid var(--border);
}
.act-hist-period-row span:first-child{color:var(--text-sec)}
.act-hist-weak{margin-top:10px;font-size:12px;color:var(--text-sec);line-height:1.5}
.act-hist-weak-tags{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px}
.act-hist-weak-tag{
  font-size:11px;padding:3px 8px;border-radius:999px;
  background:rgba(220,38,38,.08);color:#dc2626;border:1px solid rgba(220,38,38,.25);
}

/* =========================================
 * 10. Toolbar / Buttons
 * ========================================= */
.toolbar{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-bottom:14px}
.toolbar input,.toolbar select,.toolbar textarea{
  border:1.5px solid var(--border);border-radius:var(--radius-sm);
  padding:9px 14px;font-size:13px;outline:none;
  background:var(--surface);color:var(--text);
  transition:border var(--dur),box-shadow var(--dur),background var(--dur);
}
.toolbar input::placeholder,.toolbar textarea::placeholder{color:var(--text-muted)}
.toolbar input:focus,.toolbar select:focus,.toolbar textarea:focus{border-color:var(--accent);box-shadow:var(--shadow-focus)}
.toolbar input{width:260px;max-width:100%}
.toolbar select{min-width:120px}
.toolbar textarea{
  width:auto;max-width:100%;min-height:40px;line-height:1.45;resize:vertical;
  font-family:inherit;
}

.btn{
  border:none;border-radius:var(--radius-sm);
  padding:9px 18px;font-size:13px;font-weight:600;
  cursor:pointer;transition:background var(--dur),box-shadow var(--dur),transform var(--dur-fast),color var(--dur);
  white-space:nowrap;position:relative;
  display:inline-flex;align-items:center;justify-content:center;gap:6px;
  line-height:1.2;
}
.btn:active{transform:scale(.97)}
.btn:disabled{opacity:.5;cursor:not-allowed;transform:none}
.btn-primary{background:var(--accent);color:var(--accent-fg)}
.btn-primary:hover{background:var(--accent-hover);box-shadow:0 4px 12px var(--accent-ring)}
.btn-success{background:var(--success);color:#fff}
.btn-success:hover{background:#059669;box-shadow:0 4px 12px rgba(16,185,129,.25)}
.btn-danger{background:var(--danger);color:#fff}
.btn-danger:hover{background:#dc2626;box-shadow:0 4px 12px rgba(239,68,68,.25)}
.btn-warning{background:var(--warning);color:#fff}
.btn-warning:hover{background:#d97706;box-shadow:0 4px 12px rgba(245,158,11,.25)}
.btn-outline{background:var(--surface);color:var(--text);border:1.5px solid var(--border)}
.btn-outline:hover{background:var(--bg-subtle);border-color:var(--border-strong)}
.btn-sm{padding:6px 12px;font-size:12px}
.btn-icon{display:inline-flex;align-items:center;gap:6px}

/* =========================================
 * 11. Table
 * ========================================= */
.table-wrap{
  background:var(--surface);border:1px solid var(--border);
  border-radius:var(--radius-md);overflow-x:auto;-webkit-overflow-scrolling:touch;
  box-shadow:var(--shadow-xs);scrollbar-width:thin;
}
#pgPluginModelCatalog{
  display:flex;flex-direction:column;flex:1;min-height:0;margin:0;
}
.main:has(#pgPluginModelCatalog:not(.hidden)){
  padding:16px 16px 0;height:100vh;overflow:hidden;display:flex;flex-direction:column;
}
#pgPluginModelCatalog .accent-bar{display:none}
#pmcTable{width:100%;min-width:0;table-layout:fixed}
#pmcTable th,#pmcTable td{padding:8px 10px}
#pmcTable td{white-space:nowrap}
#pmcTable .input{width:100%;min-width:0;font-size:12px;padding:6px 8px}
.pmc-hdr{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:8px}
.pmc-hdr h2{font-size:20px}
.pmc-hdr p{margin-top:2px}
.pmc-hdr-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.pmc-status{font-size:12px;color:var(--text-muted)}
.pmc-add{margin:0 0 10px;padding:12px 14px;border:1px solid var(--border);border-radius:var(--radius-md);background:var(--surface)}
.pmc-add-grid{display:grid;grid-template-columns:1fr 1fr 1fr auto;gap:10px;align-items:end}
.pmc-add-grid>label{display:flex;flex-direction:column;gap:6px;font-size:12px;color:var(--text-sec);font-weight:600}
.pmc-add-opts{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding-bottom:2px}
.pmc-toolbar{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:0 0 10px}
.pmc-search{max-width:240px;flex:1;min-width:140px}
.pmc-pills{display:flex;gap:4px;flex-wrap:wrap}
.pmc-pill{
  border:1px solid var(--border);background:transparent;color:var(--text-sec);
  border-radius:999px;padding:5px 11px;font-size:12px;font-weight:600;cursor:pointer;
}
.pmc-pill.active,.pmc-pill:hover{border-color:var(--accent);color:var(--accent);background:var(--accent-light)}
.pmc-bulk{display:flex;gap:6px;margin-left:auto;flex-wrap:wrap}
.pmc-table-wrap{
  flex:1;min-height:0;max-height:none;overflow:auto;width:100%;
  border-radius:var(--radius-md);
}
#pmcTable tbody tr{cursor:pointer}
#pmcTable tbody tr.pmc-hidden-row td{opacity:.48}
#pmcTable tbody tr.pmc-editing td{background:var(--accent-light)}
#pmcTable tbody tr:hover td{background:rgba(99,102,241,.08)}
.pmc-name{font-weight:600;color:var(--text);display:block;line-height:1.3}
.pmc-id{display:block;margin-top:1px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:11px;color:var(--text-muted)}
.pmc-up{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;color:var(--text-sec);display:block;overflow:hidden;text-overflow:ellipsis}
.pmc-empty{text-align:center;color:var(--text-muted);padding:28px 16px;white-space:normal}
.pmc-switch{width:40px;height:22px;display:inline-block;vertical-align:middle}
.pmc-switch .slider::before{width:16px;height:16px;left:3px;top:3px}
.pmc-switch input:checked+.slider::before{transform:translateX(18px)}
.pmc-link{
  border:0;background:transparent;color:var(--accent);cursor:pointer;font-size:12px;font-weight:600;padding:4px 6px;
}
.pmc-link.danger{color:var(--danger-fg,#f87171)}
#pmcTable th:nth-child(1),#pmcTable td:nth-child(1){width:44px}
#pmcTable th:nth-child(2),#pmcTable td:nth-child(2){width:38%}
#pmcTable th:nth-child(4),#pmcTable td:nth-child(4),
#pmcTable th:nth-child(5),#pmcTable td:nth-child(5){width:76px;text-align:center}
#pmcTable th:nth-child(6),#pmcTable td:nth-child(6){width:108px;text-align:right}
@media (max-width:1100px){
  .pmc-add-grid{grid-template-columns:1fr 1fr}
  .pmc-bulk{margin-left:0}
}
table{width:100%;border-collapse:collapse;min-width:700px}
th{
  background:var(--bg-subtle);color:var(--text-sec);
  font-size:11px;font-weight:600;text-align:left;
  padding:10px 12px;line-height:1.25;
  border-bottom:1px solid var(--border);
  text-transform:uppercase;letter-spacing:.5px;
  white-space:nowrap;position:sticky;top:0;z-index:1;
}
td{
  padding:10px 12px;line-height:1.4;
  border-bottom:1px solid var(--border-subtle);
  font-size:13px;vertical-align:middle;white-space:nowrap;
  color:var(--text);
}
tr:last-child td{border-bottom:none}
tbody tr{transition:background var(--dur-fast)}
tbody tr:hover td{background:var(--accent-light)}

/* 失效账号分析表：用中性半透明高亮，避免悬停行在暗色主题下变白看不清 */
#deadTbody tr:hover td{background:rgba(127,127,127,.14)}
#deadTbody tr.dead-suspect td{background:rgba(217,119,6,.10)}
#deadTbody tr.dead-suspect:hover td{background:rgba(217,119,6,.20)}

.badge{display:inline-flex;align-items:center;gap:4px;padding:3px 10px;border-radius:999px;font-size:11px;font-weight:600;line-height:1.4}
.badge-clickable{cursor:pointer;transition:filter var(--dur),box-shadow var(--dur);user-select:none}
.badge-clickable:hover{filter:brightness(.93);box-shadow:0 0 0 2px var(--brand-100)}
[data-theme="dark"] .badge-clickable:hover{box-shadow:0 0 0 2px rgba(99,102,241,.3)}
.badge-green{background:var(--success-bg);color:var(--success-fg)}
.badge-red{background:var(--danger-bg);color:var(--danger-fg)}
.badge-gray{background:var(--bg-subtle);color:var(--text-sec)}
.badge-yellow{background:var(--warning-bg);color:var(--warning-fg)}
.badge-blue{background:var(--accent-light);color:var(--accent)}

.actions{display:flex;gap:6px;flex-wrap:wrap}
.empty-row{text-align:center;color:var(--text-muted);padding:32px 16px!important;font-size:14px}

/* =========================================
 * 12. Pager
 * ========================================= */
.pager{display:flex;align-items:center;justify-content:space-between;padding:12px 14px;font-size:13px;color:var(--text-sec);flex-wrap:wrap;gap:8px}
.pager-btns{display:flex;gap:4px;flex-wrap:wrap}
.pager-btns button{
  border:1px solid var(--border);background:var(--surface);
  color:var(--text);border-radius:var(--radius-xs);
  padding:6px 12px;font-size:13px;cursor:pointer;
  transition:background var(--dur-fast),border-color var(--dur-fast);
  font-variant-numeric:tabular-nums;min-width:34px;
}
.pager-btns button:hover{background:var(--bg-subtle);border-color:var(--border-strong)}
.pager-btns button:disabled{opacity:.4;cursor:default}
.pager-btns button.active{background:var(--accent);color:var(--accent-fg);border-color:var(--accent)}

/* =========================================
 * 13. Modal
 * ========================================= */
.modal-bg{position:fixed;inset:0;background:rgba(15,23,42,.5);display:none;align-items:center;justify-content:center;z-index:100;padding:16px;backdrop-filter:blur(6px);animation:fadeIn .2s ease}
[data-theme="dark"] .modal-bg{background:rgba(0,0,0,.7)}
.modal-bg.show{display:flex}
.modal{
  background:var(--surface);border-radius:var(--radius-lg);
  width:480px;max-width:100%;max-height:90vh;overflow-y:auto;
  box-shadow:var(--shadow-2xl);animation:modalSlideUp .25s var(--ease-out);
  border:1px solid var(--border);
}
.modal.act-hist-modal{
  width:min(1120px,96vw);max-width:96vw;
  overflow:hidden;display:flex;flex-direction:column;max-height:90vh;
}
.modal.act-hist-modal .modal-body{
  flex:1;min-height:0;overflow-x:hidden;overflow-y:auto;
  display:flex;flex-direction:column;
  padding-bottom:12px;
}
.modal-hdr{padding:22px 24px 0;display:flex;justify-content:space-between;align-items:center;position:sticky;top:0;background:var(--surface);z-index:1;border-radius:var(--radius-lg) var(--radius-lg) 0 0}
.modal-hdr h3{font-size:17px;font-weight:700;color:var(--text);letter-spacing:-.01em}
.modal-hdr .close{background:none;border:none;font-size:22px;cursor:pointer;color:var(--text-muted);line-height:1;padding:6px;border-radius:var(--radius-sm);transition:all var(--dur-fast);width:34px;height:34px;display:flex;align-items:center;justify-content:center}
.modal-hdr .close:hover{background:var(--danger-bg);color:var(--danger)}
.modal-body{padding:20px 24px;color:var(--text)}
.modal-body label{display:block;font-size:13px;font-weight:500;color:var(--text-sec);margin-bottom:6px;margin-top:14px}
.modal-body label:first-child{margin-top:0}
.modal-body input,.modal-body select,.modal-body textarea{
  width:100%;border:1.5px solid var(--border);border-radius:var(--radius-sm);
  padding:10px 14px;font-size:14px;outline:none;
  background:var(--surface);color:var(--text);
  transition:border var(--dur),box-shadow var(--dur);
}
.modal-body input::placeholder,.modal-body textarea::placeholder{color:var(--text-muted)}
.modal-body input:focus,.modal-body select:focus,.modal-body textarea:focus{border-color:var(--accent);box-shadow:var(--shadow-focus)}
.modal-body textarea{resize:vertical;min-height:60px;font-family:var(--font)}
.modal-ft{padding:16px 24px 22px;display:flex;justify-content:flex-end;gap:10px;position:sticky;bottom:0;background:var(--surface);border-radius:0 0 var(--radius-lg) var(--radius-lg);border-top:1px solid var(--border-subtle)}

/* =========================================
 * 14. Settings
 * ========================================= */
.setting-row{
  background:var(--surface);border:1px solid var(--border);
  border-radius:var(--radius-md);padding:20px 24px;margin-bottom:14px;
  transition:box-shadow var(--dur-fast),border-color var(--dur);color:var(--text);
}
.setting-row:hover{box-shadow:var(--shadow-sm);border-color:var(--border-strong)}
.setting-row label{font-size:13px;font-weight:600;color:var(--text-sec);margin-bottom:8px;display:block}
.setting-row .row{display:flex;gap:10px;flex-wrap:wrap}
.setting-row input{
  flex:1;min-width:0;border:1.5px solid var(--border);border-radius:var(--radius-sm);
  padding:10px 14px;font-size:14px;outline:none;
  background:var(--surface);color:var(--text);
  transition:border var(--dur),box-shadow var(--dur);
}
.setting-row input:focus{border-color:var(--accent);box-shadow:var(--shadow-focus)}
.settings-group-title{
  margin:22px 0 10px;padding:0 2px;
  font-size:12px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;
  color:var(--text-muted);
}
.settings-group-title:first-of-type{margin-top:4px}

/* =========================================
 * 15. Menu Grid
 * ========================================= */
.menu-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:16px}
.menu-card{
  background:var(--surface);border:1px solid var(--border);
  border-radius:var(--radius-md);padding:22px 24px;
  display:flex;align-items:center;justify-content:space-between;
  transition:box-shadow var(--dur),border-color var(--dur);cursor:grab;color:var(--text);
}
.menu-card:hover{box-shadow:var(--shadow-md);border-color:var(--border-strong)}
.menu-card.drag-over{border-color:var(--accent);background:var(--accent-light);box-shadow:0 0 0 2px var(--accent-ring)}
.menu-card .info h4{font-size:15px;font-weight:600;margin-bottom:2px;color:var(--text)}
.menu-card .info p{font-size:12px;color:var(--text-muted)}

/* =========================================
 * 16. Switch
 * ========================================= */
.switch{position:relative;display:inline-block;width:44px;height:24px;flex-shrink:0}
.switch input{opacity:0;width:0;height:0}
.switch .slider{position:absolute;inset:0;background:var(--slate-300);border-radius:24px;cursor:pointer;transition:background var(--dur)}
.switch .slider::before{content:'';position:absolute;left:3px;top:3px;width:18px;height:18px;background:#fff;border-radius:50%;transition:transform var(--dur);box-shadow:0 1px 3px rgba(0,0,0,.15)}
.switch input:checked+.slider{background:var(--accent)}
.switch input:checked+.slider::before{transform:translateX(20px)}

/* =========================================
 * 17. Chip Checkbox
 * ========================================= */
.chip-check{display:inline-flex;align-items:center;cursor:pointer;user-select:none}
.chip-check input{display:none}
.chip-check span{
  padding:6px 14px;border-radius:999px;font-size:12px;font-weight:600;
  border:1.5px solid var(--border);background:var(--surface);color:var(--text-sec);
  transition:all var(--dur-fast);
}
.chip-check input:checked+span{background:var(--accent);color:var(--accent-fg);border-color:var(--accent)}
.chip-check:hover span{border-color:var(--accent)}

/* =========================================
 * 18. Message Badges & Cards
 * ========================================= */
.msg-badge{display:inline-flex;align-items:center;justify-content:center;min-width:18px;height:18px;border-radius:10px;background:#ef4444;color:#fff;font-size:10px;font-weight:700;padding:0 5px;margin-left:6px;animation:badgePulse 2s infinite;font-variant-numeric:tabular-nums}
.msg-card{
  background:var(--surface);border:1px solid var(--border);
  border-radius:var(--radius-md);padding:18px 22px;margin-bottom:12px;
  cursor:pointer;transition:box-shadow var(--dur),transform var(--dur-fast),border-color var(--dur);
  color:var(--text);
}
.msg-card:hover{box-shadow:var(--shadow-md);transform:translateY(-1px);border-color:var(--border-strong)}
.msg-card.unread{border-left:4px solid var(--accent)}
.msg-card .msg-title{font-size:14px;font-weight:600;margin-bottom:4px;display:flex;align-items:center;gap:8px;color:var(--text)}
.msg-card .msg-title .dot{width:6px;height:6px;border-radius:50%;background:var(--accent);flex-shrink:0;animation:badgePulse 2s infinite}
.msg-card .msg-time{font-size:12px;color:var(--text-muted)}

/* =========================================
 * 19. Spinner / Loading
 * ========================================= */
.spinner{display:inline-block;width:16px;height:16px;border:2px solid rgba(255,255,255,.3);border-top-color:#fff;border-radius:50%;animation:spin .6s linear infinite;vertical-align:middle}
.spinner-dark{border-color:var(--border);border-top-color:var(--accent)}
.table-loading-row{display:flex;align-items:center;justify-content:center;padding:40px;color:var(--text-muted);font-size:14px;gap:10px}

/* ===== 批量操作浮条 ===== */
.bulk-bar{
  display:flex;align-items:center;gap:10px;
  padding:10px 14px;margin-bottom:12px;
  background:var(--brand-50);
  border:1px solid var(--brand-200);
  border-radius:var(--radius-md);
  animation:fadeIn .2s ease;
  font-size:13px;color:var(--brand-700);
  flex-wrap:wrap;
}
[data-theme="dark"] .bulk-bar{background:rgba(99,102,241,.12);border-color:rgba(99,102,241,.35);color:var(--brand-300)}
.bulk-bar.hidden{display:none}
.bulk-text strong{color:var(--brand-700);font-weight:700;font-size:15px;margin:0 2px}
[data-theme="dark"] .bulk-text strong{color:var(--brand-200)}
.bulk-divider{width:1px;height:18px;background:var(--brand-200)}
[data-theme="dark"] .bulk-divider{background:rgba(99,102,241,.3)}

/* ===== 信息提示卡片（多主题适配） ===== */
.info-tip{
  border-radius:var(--radius-md);
  padding:12px 14px;margin-bottom:16px;
  border:1px solid var(--border);background:var(--bg-subtle);
}
.info-tip .info-tip-title{font-size:13px;font-weight:700;margin-bottom:5px;color:var(--text)}
.info-tip .info-tip-body{font-size:12px;line-height:1.8;color:var(--text-sec)}
.info-tip-warning{background:var(--warning-bg);border-color:#fcd34d}
.info-tip-warning .info-tip-title{color:var(--warning-fg)}
.info-tip-warning .info-tip-body{color:var(--warning-fg)}
[data-theme="dark"] .info-tip-warning{background:rgba(245,158,11,.12);border-color:rgba(245,158,11,.35)}
[data-theme="dark"] .info-tip-warning .info-tip-title{color:#fbbf24}
[data-theme="dark"] .info-tip-warning .info-tip-body{color:#fcd34d}
.info-tip-success{background:var(--success-bg);border-color:#86efac}
.info-tip-success .info-tip-title{color:var(--success-fg)}
[data-theme="dark"] .info-tip-success{background:rgba(16,185,129,.12);border-color:rgba(16,185,129,.35)}
[data-theme="dark"] .info-tip-success .info-tip-title{color:#34d399}
.info-tip-subtle{background:var(--bg-subtle);border-style:dashed;border-color:var(--border-strong)}

/* ===== 顶部统计条（每页统计） ===== */
.stats-strip{
  display:flex;gap:18px;flex-wrap:wrap;
  padding:10px 14px;margin-bottom:12px;
  background:var(--surface);border:1px solid var(--border);
  border-radius:var(--radius-md);font-size:12px;color:var(--text-sec);
}
.stats-strip .stat-item{display:flex;align-items:center;gap:6px}
.stats-strip .stat-item strong{font-size:15px;color:var(--text);font-weight:700}
.stats-strip .stat-dot{width:8px;height:8px;border-radius:50%;flex-shrink:0}

/* ===== 可选中表格 ===== */
.table-selectable tbody tr.selected{background:var(--brand-50)}
[data-theme="dark"] .table-selectable tbody tr.selected{background:rgba(99,102,241,.12)}
/* 激活码列表：横向滚动时固定「卡密」列（含重置额度按钮） */
#pgActivations .table-selectable th:nth-child(1),
#pgActivations .table-selectable td:nth-child(1){
  position:sticky;left:0;z-index:4;background:var(--surface);
  box-shadow:2px 0 4px rgba(0,0,0,.06);
}
#pgActivations .table-selectable th:nth-child(2),
#pgActivations .table-selectable td:nth-child(2){
  position:sticky;left:36px;z-index:4;background:var(--surface);
  min-width:240px;max-width:320px;white-space:normal;
  box-shadow:4px 0 10px rgba(0,0,0,.1);
}
#pgActivations .table-selectable tbody tr:hover td:nth-child(-n+2){background:var(--accent-light)}
#pgActivations .table-selectable tbody tr.selected td:nth-child(-n+2){background:var(--brand-50)}
[data-theme="dark"] #pgActivations .table-selectable tbody tr.selected td:nth-child(-n+2){background:rgba(99,102,241,.12)}
.table-selectable input[type="checkbox"]{
  width:16px;height:16px;cursor:pointer;
  accent-color:var(--brand-600);
}

/* ===== 幽灵按钮 ===== */
.btn-ghost{
  background:transparent;border:none;color:var(--text-sec);
}
.btn-ghost:hover{background:var(--surface-hover);color:var(--text)}

/* 全屏 Loading Overlay（长任务进度反馈） */
.loading-overlay{position:fixed;inset:0;background:rgba(15,23,42,.55);backdrop-filter:blur(8px);z-index:300;display:flex;align-items:center;justify-content:center;animation:fadeIn .2s ease}
.loading-overlay.hidden{display:none}
[data-theme="dark"] .loading-overlay{background:rgba(0,0,0,.7)}
.loading-card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg);padding:32px 40px;min-width:320px;max-width:480px;box-shadow:var(--shadow-2xl);text-align:center}
.loading-spinner{width:48px;height:48px;border:4px solid var(--border);border-top-color:var(--brand-600);border-radius:50%;animation:spin .8s linear infinite;margin:0 auto 18px}
.loading-title{font-size:16px;font-weight:700;color:var(--text);margin-bottom:6px}
.loading-msg{font-size:13px;color:var(--text-sec);line-height:1.6;margin-bottom:12px}
.loading-progress{width:100%;height:6px;background:var(--border-subtle);border-radius:3px;overflow:hidden;margin-bottom:8px}
.loading-progress-bar{height:100%;background:linear-gradient(90deg,var(--brand-500),var(--brand-400));border-radius:3px;width:0%;transition:width .3s ease}
.loading-elapsed{font-size:11px;color:var(--text-muted)}

/* =========================================
 * 20. Toast
 * ========================================= */
.toast{
  position:fixed;top:20px;right:20px;
  background:var(--slate-800);color:#fff;
  padding:14px 22px;border-radius:var(--radius-md);
  font-size:13px;font-weight:500;z-index:200;
  opacity:0;transform:translateY(-10px);
  transition:opacity var(--dur),transform var(--dur);
  pointer-events:none;box-shadow:var(--shadow-2xl);max-width:380px;
}
[data-theme="dark"] .toast{background:#1e293b;border:1px solid var(--border-strong)}
.toast.show{opacity:1;transform:translateY(0)}
body:has(.modal-bg.show){overflow:hidden}
@media(max-width:768px){
  .toast{left:12px;right:12px;top:calc(12px + env(safe-area-inset-top,0px));max-width:none}
}

/* =========================================
 * 21. Theme Toggle Button (Phase 1 minimal)
 * ========================================= */
.theme-toggle{
  background:none;border:none;
  color:var(--sidebar-group);cursor:pointer;
  padding:6px;border-radius:var(--radius-xs);
  transition:all var(--dur-fast);
  font-size:16px;line-height:1;
  display:flex;align-items:center;justify-content:center;
  width:30px;height:30px;
}
.theme-toggle:hover{background:rgba(255,255,255,.08);color:#fbbf24}
[data-theme="dark"] .theme-toggle:hover{color:#a5b4fc}

/* =========================================
 * 21b. Model Manager（Cursor Pro 模型开关）
 * ========================================= */
.model-mgr{
  border:1px solid var(--border);border-radius:var(--radius-md);
  background:var(--bg-subtle);overflow:hidden;
}
.model-mgr-toolbar{
  display:flex;gap:10px;flex-wrap:wrap;align-items:center;
  padding:12px 14px;background:var(--surface);
  border-bottom:1px solid var(--border);
}
.model-mgr-search{
  position:relative;flex:0 0 220px;min-width:180px;
}
.model-mgr-search svg{position:absolute;left:12px;top:50%;transform:translateY(-50%);color:var(--text-muted);pointer-events:none}
.model-mgr-search input{
  width:100%;padding:8px 12px 8px 34px;
  border:1.5px solid var(--border);border-radius:var(--radius-sm);
  font-size:13px;background:var(--surface);color:var(--text);outline:none;
  transition:border var(--dur),box-shadow var(--dur);
}
.model-mgr-search input:focus{border-color:var(--accent);box-shadow:var(--shadow-focus)}
.model-mgr-add{
  flex:1;min-width:240px;display:flex;gap:6px;align-items:center;
}
.model-mgr-add input{
  flex:1;padding:8px 12px;border:1.5px solid var(--border);
  border-radius:var(--radius-sm);font-size:13px;font-family:var(--font-mono);
  background:var(--surface);color:var(--text);outline:none;
  transition:border var(--dur),box-shadow var(--dur);
}
.model-mgr-add input:focus{border-color:var(--accent);box-shadow:var(--shadow-focus)}
.model-mgr-actions{display:flex;gap:6px;flex-wrap:wrap}

.model-mgr-section{
  padding:12px 14px;border-bottom:1px solid var(--border);
  background:var(--surface);
}
.model-mgr-section:last-of-type{border-bottom:none}
.model-mgr-section-hdr{
  display:flex;align-items:center;justify-content:space-between;
  margin-bottom:10px;
}
.model-mgr-section-title{
  display:flex;align-items:center;gap:8px;
  font-size:12px;font-weight:700;color:var(--text-sec);
  text-transform:uppercase;letter-spacing:.5px;
}
.model-dot{width:8px;height:8px;border-radius:50%;flex-shrink:0}
.model-count{
  display:inline-flex;align-items:center;justify-content:center;
  min-width:22px;height:18px;padding:0 6px;
  background:var(--bg-subtle);color:var(--text-sec);
  border-radius:9px;font-size:11px;font-weight:700;
  font-variant-numeric:tabular-nums;letter-spacing:0;
}
.model-clear-btn{
  background:none;border:none;color:var(--text-muted);
  font-size:12px;cursor:pointer;padding:4px 8px;
  border-radius:var(--radius-xs);
  transition:background var(--dur-fast),color var(--dur-fast);
}
.model-clear-btn:hover{background:var(--danger-bg);color:var(--danger)}

.model-list{
  display:flex;flex-wrap:wrap;gap:6px;
  min-height:42px;align-content:flex-start;
}
.model-list:empty::after{
  content:'空 — 从下方预设或顶部输入框添加';
  color:var(--text-muted);font-size:12px;
  padding:10px 4px;font-style:italic;
}

.model-chip{
  display:inline-flex;align-items:center;gap:4px;
  padding:5px 10px 5px 12px;
  border-radius:999px;
  font-size:12px;font-weight:600;font-family:var(--font-mono);
  border:1.5px solid var(--border);background:var(--surface);
  color:var(--text-sec);
  cursor:pointer;user-select:none;
  transition:all var(--dur-fast);line-height:1.3;
  white-space:nowrap;
}
.model-chip:hover{border-color:var(--accent);transform:translateY(-1px);box-shadow:var(--shadow-xs)}
.model-chip[data-state="allow"]{
  background:var(--success-bg);color:var(--success-fg);
  border-color:transparent;
}
.model-chip[data-state="allow"]:hover{box-shadow:0 2px 6px rgba(16,185,129,.2)}
.model-chip[data-state="block"]{
  background:var(--danger-bg);color:var(--danger-fg);
  border-color:transparent;
}
.model-chip[data-state="block"]:hover{box-shadow:0 2px 6px rgba(239,68,68,.2)}
.model-chip[data-state="off"]{
  background:var(--surface);color:var(--text-muted);
  border-style:dashed;
}
.model-chip.ghost{cursor:default;pointer-events:none;opacity:.85}
.model-chip .x{
  display:inline-flex;align-items:center;justify-content:center;
  width:14px;height:14px;border-radius:50%;
  background:rgba(0,0,0,.06);color:inherit;
  font-size:14px;line-height:1;cursor:pointer;
  transition:background var(--dur-fast);
  margin-left:2px;
}
.model-chip .x:hover{background:rgba(0,0,0,.18)}
[data-theme="dark"] .model-chip .x{background:rgba(255,255,255,.08)}
[data-theme="dark"] .model-chip .x:hover{background:rgba(255,255,255,.18)}
.model-chip.hidden-by-search{display:none}

.model-mgr-presets{
  padding:14px;border-top:1px solid var(--border);
  background:var(--bg-subtle);
}
.model-mgr-preset-hdr{
  display:flex;align-items:center;justify-content:space-between;
  margin-bottom:10px;font-size:12px;color:var(--text-muted);
  flex-wrap:wrap;gap:8px;
}
.model-mgr-legend{display:inline-flex;gap:6px;flex-wrap:wrap}
.model-mgr-legend .model-chip{padding:3px 8px;font-size:11px}
.model-preset-group{margin-bottom:10px}
.model-preset-group:last-child{margin-bottom:0}
.model-preset-group-title{
  font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.6px;
  color:var(--text-muted);margin-bottom:6px;
}
.model-preset-group .model-list{min-height:0}

.model-mgr-footer{
  display:flex;align-items:center;justify-content:space-between;
  gap:10px;padding:12px 14px;
  background:var(--surface);border-top:1px solid var(--border);
}
.model-mgr-status{font-size:12px;color:var(--text-muted);display:inline-flex;align-items:center;gap:6px}
.model-mgr-status[data-dirty="1"]{color:var(--warning)}
.model-mgr-status[data-dirty="1"]::before{
  content:'';width:8px;height:8px;border-radius:50%;
  background:var(--warning);animation:badgePulse 2s infinite;
}

@media(max-width:640px){
  .model-mgr-search,.model-mgr-add{flex:1 1 100%;min-width:0}
}

/* =========================================
 * 22. Animations
 * ========================================= */
@keyframes fadeIn{from{opacity:0}to{opacity:1}}
@keyframes fadeUp{from{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}
@keyframes modalSlideUp{from{opacity:0;transform:translateY(16px) scale(.97)}to{opacity:1;transform:translateY(0) scale(1)}}
@keyframes spin{to{transform:rotate(360deg)}}
@keyframes fieldShake{0%,100%{transform:translateX(0)}20%,60%{transform:translateX(-6px)}40%,80%{transform:translateX(6px)}}
@keyframes badgePulse{0%,100%{opacity:1}50%{opacity:.7}}
@media (prefers-reduced-motion:reduce){
  *,::before,::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important}
}

/* =========================================
 * 23. Responsive
 * ========================================= */
@media (hover:none){
  .stat-card:hover{transform:none;box-shadow:none;border-color:var(--border)}
  .stat-card:hover::before{background:transparent}
  .chart-card:hover{box-shadow:none;border-color:var(--border)}
  .setting-row:hover{box-shadow:none;border-color:var(--border)}
  tbody tr:hover td{background:transparent}
  .btn:hover{box-shadow:none}
  .sidebar nav button:hover{background:transparent;color:var(--sidebar-text)}
  .sidebar nav button.active:hover{background:var(--sidebar-active-bg);color:#fff}
}

@media(max-width:1200px){
  .stats{grid-template-columns:repeat(auto-fit,minmax(150px,1fr))}
  .main{padding:24px 22px}
}
@media(max-width:900px){
  .chart-grid{grid-template-columns:1fr}
}
@media(max-width:768px){
  .sidebar{
    width:min(280px,86vw);
    transform:translateX(-100%);
    padding-bottom:env(safe-area-inset-bottom,0px);
  }
  .sidebar.open{transform:translateX(0);box-shadow:var(--shadow-2xl)}
  .mobile-header{
    display:flex;
    padding-top:max(10px,env(safe-area-inset-top,0px));
    padding-left:max(12px,env(safe-area-inset-left,0px));
    padding-right:max(12px,env(safe-area-inset-right,0px));
  }
  .sidebar-overlay.show{display:block}
  .main{
    margin-left:0;
    padding:calc(56px + env(safe-area-inset-top,0px)) 12px calc(28px + env(safe-area-inset-bottom,0px));
    width:100%;
    max-width:100%;
    overflow-x:hidden;
  }
  .page-hdr h2{font-size:18px}
  .page-hdr p{font-size:12px;line-height:1.5}
  .stats{grid-template-columns:repeat(2,1fr);gap:8px;margin-bottom:16px}
  .stat-card{padding:12px;gap:10px}
  .stat-card .val{font-size:20px}
  .stat-card .lbl{font-size:11px}
  .stat-card .icon-dot{width:36px;height:36px;font-size:16px}
  .chart-grid{grid-template-columns:1fr;gap:12px}
  .chart-card{padding:14px}
  .chart-card h3{font-size:13px;margin-bottom:10px}
  .chart-card canvas{height:170px!important}
  .chart-card-wide canvas{height:200px!important}
  .act-hist-chart-scroll{min-height:200px}
  .act-hist-chart-inner{height:200px}
  .act-hist-wd-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
  .act-hist-cmp{grid-template-columns:repeat(2,minmax(0,1fr))}
  .act-hist-period-row{flex-direction:column;align-items:flex-start;gap:4px}

  .toolbar{flex-direction:column;align-items:stretch;gap:8px}
  .toolbar > div[style*="flex:1"]{display:none}
  .toolbar input,.toolbar select{
    width:100%;max-width:100%;min-width:0;min-height:44px;font-size:16px;
  }
  .toolbar .btn,.toolbar button.btn{width:100%;min-height:44px;justify-content:center}

  .table-wrap{
    margin-left:-12px;margin-right:-12px;
    border-radius:0;border-left:none;border-right:none;
  }
  table{min-width:560px}
  th,td{padding:8px 10px;font-size:12px}
  .actions{gap:6px}
  .actions .btn{min-height:36px}

  .pager{flex-direction:column;align-items:stretch;gap:10px}
  .pager-btns{justify-content:center}
  .pager-btns button{min-width:40px;min-height:40px;padding:8px 12px}

  .modal-bg{
    padding:0;align-items:flex-end;
    padding-top:env(safe-area-inset-top,0px);
  }
  .modal-bg.show{display:flex}
  .modal-bg .modal{
    width:100%!important;max-width:100%!important;
    max-height:min(92dvh,calc(100% - 12px));
    border-radius:16px 16px 0 0;margin:0;
    animation:modalSheetUp .28s var(--ease-out);
  }
  .modal-hdr{padding:16px 16px 0;border-radius:16px 16px 0 0}
  .modal-hdr h3{font-size:16px;padding-right:8px;line-height:1.35}
  .modal-hdr .close{width:40px;height:40px}
  .modal-body{padding:14px 16px}
  .modal-body input,.modal-body select,.modal-body textarea{font-size:16px;min-height:44px}
  .modal-ft{
    flex-wrap:wrap;flex-direction:column-reverse;gap:8px;
    padding:12px 16px max(16px,env(safe-area-inset-bottom,0px));
    border-radius:0;
  }
  .modal-ft .btn{width:100%;min-height:44px}

  .setting-row{padding:14px 16px}
  .setting-row .row{flex-direction:column}
  .setting-row input,.setting-row select{font-size:16px;min-height:44px;width:100%}
  .menu-grid{grid-template-columns:1fr}
  .info-tip{padding:12px}
  .tk-dropdown{display:block;width:100%}
  .tk-menu{left:0;right:auto;min-width:100%}
  .sidebar nav button{min-height:44px;font-size:14px;padding:12px 16px}
}

@keyframes modalSheetUp{from{opacity:.6;transform:translateY(24px)}to{opacity:1;transform:translateY(0)}}

@media(max-width:480px){
  .stats{grid-template-columns:1fr 1fr;gap:8px}
  .stat-card{padding:10px;flex-direction:column;align-items:flex-start;gap:8px}
  .stat-card .val{font-size:18px}
  .stat-card .icon-dot{width:32px;height:32px;font-size:14px}
  .page-hdr h2{font-size:17px}
}
@media(max-width:860px){
  .login-card{flex-direction:column;width:min(420px,100%);min-height:auto}
  .login-brand{padding:32px 32px 24px;min-height:auto}
  .login-brand h2{font-size:22px}
  .login-brand .brand-features{display:none}
  .login-form{width:100%;padding:32px}
}
@media(max-width:440px){
  .login-wrap{padding:12px;padding-bottom:max(12px,env(safe-area-inset-bottom,0px))}
  .login-card{width:100%;border-radius:18px}
  .login-brand{padding:28px 24px 20px}
  .login-brand .brand-icon{width:40px;height:40px;margin-bottom:18px}
  .login-brand h2{font-size:20px}
  .login-brand p{font-size:12px}
  .login-form{padding:28px 24px}
  .login-form h1{font-size:20px}
  .login-field input{font-size:16px;min-height:44px}
}

/* —— Token 维护下拉菜单 —— */
.tk-dropdown{position:relative;display:inline-block}
.tk-menu{position:absolute;top:calc(100% + 6px);right:0;min-width:220px;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow-lg);padding:6px;z-index:60;display:none;flex-direction:column;gap:2px}
.tk-dropdown.open .tk-menu{display:flex}
.tk-menu .tk-title{font-size:11px;color:var(--text-muted);padding:6px 10px 3px;letter-spacing:.3px}
.tk-menu button{display:flex;align-items:center;gap:8px;width:100%;text-align:left;background:none;border:none;color:var(--text);font-size:13px;padding:8px 10px;border-radius:var(--radius-sm);cursor:pointer;white-space:nowrap;transition:background var(--dur-fast)}
.tk-menu button:hover{background:var(--surface-hover)}
.tk-menu .tk-sep{height:1px;background:var(--border);margin:5px 2px}

/* =========================================
 * 每日回库
 * ========================================= */
#pgDailyRecycle .dr-intro{
  max-width:720px;color:var(--text-muted);font-size:13px;line-height:1.65;margin-top:4px;
}
#pgDailyRecycle .dr-timeline{
  display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;
  margin:4px 0 22px;position:sticky;top:0;z-index:6;
  background:color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);
  padding:8px 0 12px;
}
#pgDailyRecycle .dr-tl{
  display:flex;align-items:center;gap:10px;text-decoration:none;
  background:var(--surface);border:1px solid var(--border);
  border-radius:var(--radius-md);padding:12px 14px;
  color:var(--text);transition:border-color var(--dur),box-shadow var(--dur),transform var(--dur-fast);
}
#pgDailyRecycle .dr-tl:hover{border-color:var(--border-strong);box-shadow:var(--shadow-sm);transform:translateY(-1px)}
#pgDailyRecycle .dr-tl-time{
  font-size:15px;font-weight:800;letter-spacing:-.03em;font-variant-numeric:tabular-nums;
  font-family:var(--font-mono);min-width:52px;color:var(--accent);
}
#pgDailyRecycle .dr-tl-name{font-size:13px;font-weight:650;line-height:1.2}
#pgDailyRecycle .dr-tl-sub{font-size:11px;color:var(--text-muted);margin-top:2px;font-weight:500}
#pgDailyRecycle .dr-tl.is-on{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-ring)}
#pgDailyRecycle .dr-chip:empty{display:none}
#pgDailyRecycle .dr-k{color:var(--text);font-weight:700}
#pgDailyRecycle .dr-ok{color:#059669}
#pgDailyRecycle .dr-warn{color:#d97706}
#pgDailyRecycle .dr-bad{color:#dc2626}
#pgDailyRecycle .dr-accent{color:var(--accent)}
#pgDailyRecycle .dr-muted{color:var(--text-muted);margin-top:4px}
#pgDailyRecycle .dr-tl[data-tone="violet"] .dr-tl-time{color:#7c3aed}
#pgDailyRecycle .dr-tl[data-tone="amber"] .dr-tl-time{color:#d97706}
#pgDailyRecycle .dr-tl[data-tone="rose"] .dr-tl-time{color:#e11d48}
#pgDailyRecycle .dr-tl[data-tone="sky"] .dr-tl-time{color:#0284c7}
#pgDailyRecycle .dr-tl[data-tone="teal"] .dr-tl-time{color:#0f766e}

#pgDailyRecycle .dr-job{
  background:var(--surface);border:1px solid var(--border);
  border-radius:var(--radius-lg);padding:0;margin-bottom:22px;
  box-shadow:var(--shadow-xs);overflow:hidden;scroll-margin-top:84px;
}
#pgDailyRecycle .dr-job[data-tone="violet"]{border-left:3px solid #7c3aed}
#pgDailyRecycle .dr-job[data-tone="amber"]{border-left:3px solid #d97706}
#pgDailyRecycle .dr-job[data-tone="rose"]{border-left:3px solid #e11d48}
#pgDailyRecycle .dr-job[data-tone="sky"]{border-left:3px solid #0284c7}
#pgDailyRecycle .dr-job[data-tone="teal"]{border-left:3px solid #0f766e}
#pgDailyRecycle .dr-job-hd{
  display:flex;align-items:flex-start;gap:14px;
  padding:18px 20px 16px;border-bottom:1px solid var(--border-subtle);
  background:var(--bg-subtle);
}
#pgDailyRecycle .dr-job-clock{
  flex-shrink:0;width:64px;height:64px;border-radius:var(--radius-md);
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  font-weight:800;letter-spacing:-.03em;line-height:1;
}
#pgDailyRecycle .dr-job-clock b{font-size:16px;font-family:var(--font-mono)}
#pgDailyRecycle .dr-job-clock small{font-size:10px;font-weight:650;margin-top:4px;opacity:.85;letter-spacing:.04em}
#pgDailyRecycle .dr-job[data-tone="violet"] .dr-job-clock{background:#ede9fe;color:#5b21b6}
#pgDailyRecycle .dr-job[data-tone="amber"] .dr-job-clock{background:#fef3c7;color:#92400e}
#pgDailyRecycle .dr-job[data-tone="rose"] .dr-job-clock{background:#ffe4e6;color:#9f1239}
#pgDailyRecycle .dr-job[data-tone="sky"] .dr-job-clock{background:#e0f2fe;color:#075985}
#pgDailyRecycle .dr-job[data-tone="teal"] .dr-job-clock{background:#ccfbf1;color:#115e59}
[data-theme="dark"] #pgDailyRecycle .dr-job[data-tone="violet"] .dr-job-clock{background:rgba(124,58,237,.22);color:#c4b5fd}
[data-theme="dark"] #pgDailyRecycle .dr-job[data-tone="amber"] .dr-job-clock{background:rgba(245,158,11,.2);color:#fcd34d}
[data-theme="dark"] #pgDailyRecycle .dr-job[data-tone="rose"] .dr-job-clock{background:rgba(244,63,94,.22);color:#fda4af}
[data-theme="dark"] #pgDailyRecycle .dr-job[data-tone="sky"] .dr-job-clock{background:rgba(14,165,233,.2);color:#7dd3fc}
[data-theme="dark"] #pgDailyRecycle .dr-job[data-tone="teal"] .dr-job-clock{background:rgba(20,184,166,.2);color:#5eead4}
#pgDailyRecycle .dr-job-hd h3{font-size:16px;font-weight:750;color:var(--text);letter-spacing:-.02em;margin:0 0 4px}
#pgDailyRecycle .dr-job-hd p{font-size:12.5px;line-height:1.55;color:var(--text-sec);margin:0;max-width:820px}

#pgDailyRecycle .dr-job-body{padding:16px 20px 20px}
#pgDailyRecycle .dr-job .stats{margin:0 0 16px;grid-template-columns:repeat(auto-fit,minmax(168px,1fr))}
#pgDailyRecycle .dr-job .stat-card{padding:14px 16px}
#pgDailyRecycle .dr-job .stat-card .val{font-size:20px}

#pgDailyRecycle .dr-config{border:1px solid var(--border);border-radius:var(--radius-md);padding:16px 16px 14px;background:var(--bg-subtle)}
#pgDailyRecycle .dr-config-title{font-size:12px;font-weight:700;color:var(--text-sec);letter-spacing:.04em;text-transform:uppercase;margin:0 0 6px}
#pgDailyRecycle .dr-help{font-size:12px;color:var(--text-muted);line-height:1.55;margin:0 0 14px}
#pgDailyRecycle .dr-switches{display:flex;flex-wrap:wrap;gap:8px 16px;align-items:center;margin-bottom:14px}
#pgDailyRecycle .dr-switch-row{display:inline-flex;align-items:center;gap:8px;font-size:13px;color:var(--text);font-weight:550}
#pgDailyRecycle .dr-fields{
  display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:12px;margin-bottom:14px;
}
#pgDailyRecycle .dr-field{display:flex;flex-direction:column;gap:6px;min-width:0}
#pgDailyRecycle .dr-field > span{font-size:11px;font-weight:650;color:var(--text-muted)}
#pgDailyRecycle .dr-field .input,
#pgDailyRecycle .input{
  width:100%;border:1.5px solid var(--border);border-radius:var(--radius-sm);
  padding:8px 10px;font-size:13px;outline:none;background:var(--surface);color:var(--text);
  font-variant-numeric:tabular-nums;transition:border var(--dur),box-shadow var(--dur);
}
#pgDailyRecycle .dr-field .input:focus,
#pgDailyRecycle .input:focus{border-color:var(--accent);box-shadow:var(--shadow-focus)}
#pgDailyRecycle textarea.input{
  font-family:var(--font-mono);font-size:12px;resize:vertical;min-height:56px;line-height:1.45;
}
#pgDailyRecycle .dr-proxy > span{display:block;font-size:11px;font-weight:650;color:var(--text-muted);margin-bottom:6px}
#pgDailyRecycle .dr-actions{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-top:14px}
#pgDailyRecycle .btn-danger-ghost{color:var(--danger);border-color:rgba(239,68,68,.35)}
#pgDailyRecycle .btn-success-ghost{color:#059669;border-color:rgba(16,185,129,.4)}
#pgDailyRecycle .btn-info-ghost{color:#0891b2;border-color:rgba(6,182,212,.45)}
#pgDailyRecycle .dr-inline-field{display:inline-flex;align-items:center;gap:6px;font-size:12px;color:var(--text-sec);font-weight:550}
#pgDailyRecycle .dr-inline-field .input{width:88px}
#pgDailyRecycle .dr-preview-row{display:flex;flex-wrap:wrap;gap:14px 20px;align-items:center;margin-bottom:8px;font-size:13px;color:var(--text-sec)}
#pgDailyRecycle .dr-preview-row b{font-size:16px;color:var(--text);font-variant-numeric:tabular-nums}
#pgDailyRecycle .dr-pill{
  display:inline-flex;margin:2px 6px 2px 0;padding:2px 10px;border-radius:999px;
  background:var(--accent-light);border:1px solid var(--border);color:var(--accent);
  font-size:12px;font-weight:600;
}
#pgDailyRecycle .dr-chip{
  display:inline-flex;align-items:center;font-size:12px;font-weight:600;
  color:var(--info-fg);background:var(--info-bg);border:1px solid transparent;
  border-radius:999px;padding:4px 10px;min-height:28px;
}
[data-theme="dark"] #pgDailyRecycle .dr-chip{color:#67e8f9;background:rgba(6,182,212,.12);border-color:rgba(6,182,212,.25)}
#pgDailyRecycle .dr-note{
  margin-top:12px;padding:12px 14px;border-radius:var(--radius-sm);
  background:var(--surface);border:1px solid var(--border);
  font-size:13px;color:var(--text-sec);line-height:1.55;
}
#pgDailyRecycle .dr-progress{
  margin-top:12px;padding:14px 16px;border-radius:var(--radius-md);
  background:var(--surface);border:1px solid var(--border);
}
#pgDailyRecycle .dr-progress-hd{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:8px}
#pgDailyRecycle .dr-progress-hd strong{font-size:14px;color:var(--text)}
#pgDailyRecycle .dr-progress-hd span{font-size:12px;color:var(--text-muted);font-variant-numeric:tabular-nums}
#pgDailyRecycle .dr-bar{height:8px;background:var(--bg-subtle);border-radius:999px;overflow:hidden;margin-bottom:8px;border:1px solid var(--border-subtle)}
#pgDailyRecycle .dr-bar > div{height:100%;width:0;background:linear-gradient(90deg,var(--brand-500),var(--brand-400));transition:width .35s var(--ease)}
#pgDailyRecycle .dr-progress-detail{font-size:12.5px;color:var(--text-sec);line-height:1.6}
#pgDailyRecycle .dr-progress-tip{margin-top:8px;font-size:12px;color:var(--text-muted)}

#pgDailyRecycle .dr-log-hd{
  display:flex;flex-wrap:wrap;gap:8px;align-items:center;
  margin:16px 0 10px;padding-top:4px;
}
#pgDailyRecycle .dr-log-hd > span:first-child{
  font-size:13px;font-weight:700;color:var(--text);margin-right:4px;
}
#pgDailyRecycle .dr-log-hd .input{width:170px}
#pgDailyRecycle .dr-job .table-wrap{margin:0}
#pgDailyRecycle tr[data-live="1"] td{background:var(--brand-50)}
[data-theme="dark"] #pgDailyRecycle tr[data-live="1"] td{background:rgba(99,102,241,.12)}

@media(max-width:1100px){
  #pgDailyRecycle .dr-timeline{grid-template-columns:1fr 1fr}
  #pgDailyRecycle .dr-job .stats{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:768px){
  #pgDailyRecycle .dr-timeline{grid-template-columns:1fr;position:static}
  #pgDailyRecycle .dr-job-hd{flex-direction:column;gap:10px}
  #pgDailyRecycle .dr-fields{grid-template-columns:1fr 1fr}
}

/* =========================================
 * 版本更新配置（自动保存）
 * ========================================= */
.upd-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:10px}
.upd-hint{margin:6px 0 0;font-size:12px;color:#94a3b8;line-height:1.5}
.upd-legend{display:flex;flex-wrap:wrap;gap:8px 14px;margin:0 0 14px;font-size:12px;color:var(--text-sec)}
.upd-legend b{color:var(--text);font-weight:600}
.upd-save-status{font-size:12px;font-weight:600;white-space:nowrap;padding:4px 10px;border-radius:999px;background:transparent;color:var(--text-muted);min-height:24px}
.upd-save-status.is-pending{color:#b45309;background:rgba(245,158,11,.12)}
.upd-save-status.is-saving{color:#0369a1;background:rgba(14,165,233,.12)}
.upd-save-status.is-saved{color:#15803d;background:rgba(34,197,94,.12)}
.upd-save-status.is-error{color:#b91c1c;background:rgba(239,68,68,.12)}
.upd-platforms{display:flex;flex-direction:column;gap:12px}
.upd-card{
  border:1px solid var(--border);border-radius:12px;padding:14px 16px;
  background:var(--surface);transition:border-color var(--dur);
}
.upd-card:hover{border-color:var(--border-strong)}
.upd-card-top{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:12px}
.upd-card-title{font-size:14px;font-weight:700;color:var(--text)}
.upd-toggles{display:flex;align-items:center;gap:14px;flex-wrap:wrap}
.upd-tog{display:inline-flex;align-items:center;gap:8px;margin:0;cursor:pointer;user-select:none}
.upd-tog>span:first-child{font-size:12px;font-weight:600;color:var(--text-sec)}
.upd-fields{display:grid;grid-template-columns:140px 1fr;gap:10px}
.upd-field{display:flex;flex-direction:column;gap:4px;margin:0}
.upd-field>span{font-size:11px;color:#94a3b8;font-weight:600}
.upd-field input{width:100%}
.upd-field-ver{grid-column:1}
.upd-field-grow{grid-column:2}
.upd-field-full{grid-column:1 / -1}
.upd-upload{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:10px}
.upd-upstat{font-size:12px;color:#94a3b8}
.upd-global{margin-top:14px;display:flex;flex-direction:column;gap:12px}
.upd-force-row{
  display:flex;align-items:center;justify-content:space-between;gap:16px;
  padding:12px 14px;border:1px solid var(--border);border-radius:10px;background:var(--border-light);
}
.upd-force-title{font-size:13px;font-weight:700;color:var(--text)}
.upd-force-desc{font-size:12px;color:#94a3b8;margin-top:2px;line-height:1.45}
.upd-exempt{margin-top:14px;padding:12px 14px;background:var(--border-light);border-radius:10px}
.upd-exempt-title{font-size:13px;font-weight:700;margin-bottom:4px}
.upd-exempt-form{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:10px}
.upd-exempt-form input:first-child{flex:1;min-width:220px}
.upd-exempt-form input:nth-child(2){width:180px}
@media(max-width:900px){
  .upd-fields{grid-template-columns:1fr}
  .upd-field-ver,.upd-field-grow,.upd-field-full{grid-column:1}
  .upd-card-top{align-items:flex-start}
  .upd-force-row{flex-direction:column;align-items:flex-start}
}
