:root{
  --primary:#4f46e5;
  --primary-2:#6366f1;
  --primary-soft:#eef2ff;
  --cyan:#06b6d4;
  --green:#10b981;
  --orange:#f59e0b;
  --pink:#ec4899;
  --red:#ef4444;
  --bg:#f4f6fb;
  --card:#ffffff;
  --text:#0f172a;
  --muted:#64748b;
  --border:#e7ecf5;
  --radius:16px;
  --shadow:0 12px 36px rgba(15,23,42,.08);
  --shadow-sm:0 2px 10px rgba(15,23,42,.05);
  --ring:0 0 0 4px rgba(79,70,229,.14);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:"Microsoft YaHei","PingFang SC",system-ui,-apple-system,"Segoe UI",sans-serif;
  background:
    radial-gradient(900px 500px at 100% -10%, #eef2ff 0%, transparent 60%),
    radial-gradient(700px 400px at -10% 100%, #ecfeff 0%, transparent 55%),
    var(--bg);
  color:var(--text);
  -webkit-font-smoothing:antialiased;
}
a{color:var(--primary);text-decoration:none}
button{font-family:inherit}
::selection{background:#c7d2fe}

/* ---------- buttons ---------- */
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:8px;
  height:42px;padding:0 18px;border-radius:11px;border:1px solid transparent;
  font-size:14px;font-weight:600;cursor:pointer;white-space:nowrap;
  transition:transform .16s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease, color .16s ease;
  user-select:none;
}
.btn:active{transform:translateY(1px) scale(.99)}
.btn:disabled{opacity:.55;cursor:not-allowed;transform:none}
.btn-primary{
  color:#fff;
  background:linear-gradient(135deg,var(--primary-2),var(--primary));
  box-shadow:0 8px 20px rgba(79,70,229,.28);
}
.btn-primary:hover{box-shadow:0 12px 26px rgba(79,70,229,.36);transform:translateY(-1px)}
.btn-ghost{background:#fff;border-color:var(--border);color:#334155}
.btn-ghost:hover{border-color:#c7d2fe;color:var(--primary);background:#f8faff}
.btn-danger{background:#fff1f2;color:#e11d48;border-color:#fecdd3}
.btn-danger:hover{background:#ffe4e6}
.btn-sm{height:34px;padding:0 12px;font-size:13px;border-radius:9px}
.btn-block{width:100%}
.btn.is-loading{pointer-events:none;color:transparent!important;position:relative}
.btn.is-loading::after{
  content:"";position:absolute;width:18px;height:18px;border-radius:50%;
  border:2px solid rgba(255,255,255,.5);border-top-color:#fff;
  animation:spin .7s linear infinite;
}
.btn-ghost.is-loading::after{border-color:#c7d2fe;border-top-color:var(--primary)}
.icon-btn{
  width:36px;height:36px;border-radius:10px;border:1px solid transparent;background:transparent;
  color:var(--muted);display:inline-grid;place-items:center;cursor:pointer;font-size:18px;
  transition:.16s;
}
.icon-btn:hover{background:#f1f5f9;color:var(--text)}
.icon-btn svg{width:18px;height:18px}

/* ---------- form ---------- */
.field{display:flex;flex-direction:column;gap:7px;min-width:0}
.field > label{font-size:13px;color:#475569;font-weight:600;display:flex;gap:4px;align-items:center}
.field > label em{color:var(--red);font-style:normal}
.input{
  width:100%;height:44px;padding:0 13px;border-radius:11px;border:1px solid var(--border);
  background:#fff;color:var(--text);font-size:14px;outline:none;
  transition:border-color .18s, box-shadow .18s, background .18s;
}
textarea.input{height:auto;padding:11px 13px;resize:vertical;line-height:1.6}
.input::placeholder{color:#a3aec2}
.input:hover{border-color:#cbd5e1}
.input:focus{border-color:var(--primary-2);box-shadow:var(--ring);background:#fff}
select.input{
  appearance:none;
  background-image:linear-gradient(45deg,transparent 50%,#94a3b8 50%),linear-gradient(135deg,#94a3b8 50%,transparent 50%);
  background-position:calc(100% - 17px) 19px,calc(100% - 12px) 19px;
  background-size:5px 5px,5px 5px;background-repeat:no-repeat;
  padding-right:34px;
}
.hint{font-size:12px;color:var(--muted);line-height:1.5}
.field-error{font-size:12px;color:var(--red);min-height:16px;line-height:1.4}
.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px 16px}
.form-grid .full{grid-column:1/-1}
.form-error{color:var(--red);font-size:13px;min-height:18px}

.pw-toggle{
  position:absolute;right:8px;top:50%;transform:translateY(-50%);
  border:0;background:transparent;color:var(--muted);font-size:12px;cursor:pointer;
  padding:6px 9px;border-radius:8px;transition:.15s;
}
.pw-toggle:hover{background:#f1f5f9;color:var(--primary)}
.tone-blue .stat-icon{background:#eff6ff;color:#2563eb}
.nav-icon{display:inline-grid;place-items:center;width:18px;height:18px;flex:0 0 18px}

/* ---------- login ---------- */
.login-page{min-height:100vh;display:grid;grid-template-columns:1.08fr .92fr}
.login-visual{
  position:relative;overflow:hidden;color:#fff;padding:64px 72px;
  background:linear-gradient(145deg,#0b1220 0%,#171a4a 55%,#312e81 100%);
  display:flex;flex-direction:column;justify-content:center;gap:22px;
}
.login-visual .brand-mark{
  width:56px;height:56px;border-radius:16px;display:grid;place-items:center;
  font-size:24px;font-weight:800;letter-spacing:1px;
  background:linear-gradient(135deg,#818cf8,#4f46e5);
  box-shadow:0 12px 30px rgba(99,102,241,.45);
}
.login-visual h1{font-size:46px;line-height:1.15;margin:6px 0 0;letter-spacing:-1px}
.login-visual h1 span{color:#a5b4fc}
.login-visual .lead{color:#c7d2fe;font-size:15px;line-height:1.8;max-width:460px;margin:0}
.feature-list{list-style:none;padding:0;margin:8px 0 0;display:grid;gap:12px}
.feature-list li{display:flex;align-items:center;gap:10px;color:#dbeafe;font-size:14px}
.feature-list .tick{
  width:22px;height:22px;border-radius:50%;display:grid;place-items:center;
  background:rgba(134,239,172,.14);color:#86efac;font-size:12px;
}
.glow{position:absolute;border-radius:50%;filter:blur(10px);opacity:.55;pointer-events:none;animation:float 9s ease-in-out infinite}
.glow-a{width:340px;height:340px;right:-90px;top:-70px;background:radial-gradient(circle,#6366f1,transparent 68%)}
.glow-b{width:300px;height:300px;left:-100px;bottom:-90px;background:radial-gradient(circle,#06b6d4,transparent 68%);animation-delay:-3s}
.login-visual .visual-foot{position:absolute;left:72px;bottom:34px;color:#64748b;font-size:12px}

.login-panel{display:grid;place-items:center;padding:32px}
.login-card{
  width:100%;max-width:410px;background:#fff;border:1px solid var(--border);border-radius:24px;
  padding:36px 34px;box-shadow:var(--shadow);animation:fadeUp .55s cubic-bezier(.22,1,.36,1) both;
}
.login-card h2{margin:0 0 6px;font-size:26px;letter-spacing:-.5px}
.login-card .sub{margin:0 0 26px;color:var(--muted);font-size:14px}
.input-wrap{position:relative}
.input-wrap .input{padding-left:42px;height:48px}
.input-wrap .input-icon{position:absolute;left:14px;top:50%;transform:translateY(-50%);color:#94a3b8;display:grid}
.input-wrap .input:focus + .input-icon{color:var(--primary)}
.login-card .field{margin-bottom:14px}
.demo-accounts{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:20px;padding-top:18px;border-top:1px dashed var(--border)}
.demo-accounts > span{font-size:12px;color:var(--muted)}
.chip{
  border:1px solid var(--border);background:#f8fafc;color:#475569;border-radius:999px;
  padding:5px 11px;font-size:12px;cursor:pointer;transition:.16s;
}
.chip:hover{border-color:#c7d2fe;color:var(--primary);background:var(--primary-soft)}
.login-card .form-error{text-align:center}
.mobile-brand{display:none}

/* ---------- app shell ---------- */
.app-shell{display:flex;min-height:100vh}
.sidebar{
  width:250px;flex:0 0 250px;height:100vh;position:sticky;top:0;
  display:flex;flex-direction:column;gap:22px;padding:22px 16px;
  color:#cbd5e1;background:linear-gradient(180deg,#0b1220 0%,#0f1a31 100%);
  border-right:1px solid rgba(148,163,184,.08);
}
.brand{display:flex;align-items:center;gap:12px;padding:2px 8px 0}
.brand-logo{
  width:40px;height:40px;border-radius:12px;display:grid;place-items:center;
  font-size:18px;font-weight:800;color:#fff;
  background:linear-gradient(135deg,#818cf8,#4f46e5);
  box-shadow:0 10px 24px rgba(79,70,229,.4);
}
.brand-text{display:flex;flex-direction:column;line-height:1.2}
.brand-text b{color:#fff;font-size:16px;letter-spacing:.5px}
.brand-text span{color:#64748b;font-size:11px;margin-top:2px}
.nav-list{display:flex;flex-direction:column;gap:4px;overflow:auto;flex:1;padding-right:2px}
.nav-list::-webkit-scrollbar{width:4px}
.nav-list::-webkit-scrollbar-thumb{background:#334155;border-radius:4px}
.nav-item{
  display:flex;align-items:center;gap:11px;width:100%;padding:10px 12px;
  border:0;border-radius:11px;background:transparent;color:#94a3b8;
  font-size:13.5px;text-align:left;cursor:pointer;transition:.18s;
}
.nav-item svg{width:18px;height:18px;flex:0 0 18px;opacity:.9}
.nav-item:hover{background:rgba(148,163,184,.1);color:#f1f5f9;transform:translateX(2px)}
.nav-item.active{
  color:#fff;background:linear-gradient(90deg,rgba(99,102,241,.95),rgba(79,70,229,.82));
  box-shadow:0 8px 22px rgba(79,70,229,.35);
}
.sidebar-foot{
  display:flex;align-items:center;gap:8px;padding:12px 10px;border-radius:10px;
  background:rgba(148,163,184,.07);color:#64748b;font-size:11.5px;
}
.sidebar-foot .dot{width:7px;height:7px;border-radius:50%;background:#22c55e;box-shadow:0 0 0 3px rgba(34,197,94,.15)}
.main{flex:1;min-width:0;display:flex;flex-direction:column}
.topbar{
  height:70px;display:flex;align-items:center;justify-content:space-between;
  padding:0 28px;background:rgba(255,255,255,.78);backdrop-filter:blur(14px);
  border-bottom:1px solid var(--border);position:sticky;top:0;z-index:20;
}
.page-title .eyebrow{font-size:10px;letter-spacing:2px;color:#94a3b8;font-weight:700}
.page-title h1{margin:2px 0 0;font-size:19px;letter-spacing:-.2px}
.top-actions{display:flex;align-items:center;gap:12px}
.user-chip{display:flex;align-items:center;gap:10px;padding:6px 10px 6px 6px;border-radius:12px;background:#f8fafc;border:1px solid var(--border)}
.avatar{
  width:34px;height:34px;border-radius:10px;display:grid;place-items:center;
  background:linear-gradient(135deg,#c7d2fe,#818cf8);color:#312e81;font-weight:800;font-size:14px;
}
.user-meta{display:flex;flex-direction:column;line-height:1.25}
.user-meta b{font-size:13px}
.user-meta small{font-size:11px;color:var(--muted)}
.content{padding:26px 28px 40px;max-width:1360px;width:100%;margin:0 auto}

/* ---------- page / cards ---------- */
.page-head{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;margin-bottom:18px;flex-wrap:wrap}
.page-head h2{margin:0;font-size:24px;letter-spacing:-.4px}
.page-head p{margin:5px 0 0;color:var(--muted);font-size:13px}
.head-actions{display:flex;gap:9px;flex-wrap:wrap}
.panel{
  background:var(--card);border:1px solid var(--border);border-radius:var(--radius);
  padding:18px;box-shadow:var(--shadow-sm);margin-bottom:16px;
}
.panel-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}
.panel-head h3{margin:0;font-size:15px}
.stat-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin-bottom:18px}
.stat-grid.cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}
.stat-grid.cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}
@media(max-width:1180px){.stat-grid,.stat-grid.cols-4,.stat-grid.cols-5{grid-template-columns:repeat(2,minmax(0,1fr))}}
.stat-card{
  display:flex;gap:14px;align-items:center;background:#fff;border:1px solid var(--border);
  border-radius:var(--radius);padding:16px;box-shadow:var(--shadow-sm);
  transition:transform .2s,box-shadow .2s;
}
.stat-card:hover{transform:translateY(-3px);box-shadow:var(--shadow)}
.stat-icon{width:46px;height:46px;border-radius:13px;display:grid;place-items:center;background:var(--primary-soft);color:var(--primary)}
.stat-icon svg{width:21px;height:21px}
.stat-body{display:flex;flex-direction:column;gap:2px;min-width:0}
.stat-body span{font-size:12px;color:var(--muted)}
.stat-body b{font-size:23px;letter-spacing:-.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.stat-body small{font-size:11px;color:#94a3b8}
.tone-violet .stat-icon{background:#f5f3ff;color:#7c3aed}
.tone-green .stat-icon{background:#ecfdf5;color:#10b981}
.tone-orange .stat-icon{background:#fff7ed;color:#f97316}
.tone-cyan .stat-icon{background:#ecfeff;color:#0891b2}
.tone-pink .stat-icon{background:#fdf2f8;color:#db2777}
.tone-red .stat-icon{background:#fef2f2;color:#ef4444}

.grid-2{display:grid;grid-template-columns:1.2fr .8fr;gap:16px}
.quick-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.quick{
  display:flex;align-items:center;gap:10px;padding:14px;border-radius:12px;border:1px solid var(--border);
  background:#fbfcff;color:#334155;font-size:13px;font-weight:600;cursor:pointer;transition:.18s;text-align:left;
}
.quick svg{width:19px;height:19px;color:var(--primary)}
.quick:hover{border-color:#c7d2fe;background:var(--primary-soft);transform:translateY(-1px)}
.info-list{list-style:none;padding:0;margin:0}
.info-list li{display:flex;justify-content:space-between;gap:12px;padding:11px 0;border-bottom:1px dashed var(--border);font-size:13px}
.info-list li:last-child{border:0}
.info-list span{color:var(--muted)}
.info-list b{font-weight:600}
.panel-tip{
  margin-top:14px;padding:12px 14px;border-radius:11px;background:#f8faff;
  border:1px dashed #dbe4ff;color:#64748b;font-size:12.5px;line-height:1.7;
}
.panel-tip b{color:var(--primary);font-weight:700}

/* ---------- table ---------- */
.table-wrap{overflow:auto;border-radius:12px;border:1px solid var(--border)}
.table{width:100%;border-collapse:collapse}
.table th,.table td{padding:12px 14px;text-align:left;font-size:13px;white-space:nowrap;border-bottom:1px solid #f1f5f9}
.table th{background:#f8fafc;color:#64748b;font-weight:600;font-size:12px;letter-spacing:.2px;position:sticky;top:0}
.table tbody tr{transition:background .15s}
.table tbody tr:hover{background:#f8faff}
.table tbody tr:last-child td{border-bottom:0}
.table .num{font-variant-numeric:tabular-nums;font-weight:600}
.table .right{text-align:right}
.table .actions-cell{display:flex;gap:6px}
.empty-state{text-align:center;padding:46px 20px;color:var(--muted)}
.empty-state .empty-icon{
  width:52px;height:52px;border-radius:16px;margin:0 auto 12px;display:grid;place-items:center;
  background:#f1f5f9;color:#94a3b8;font-size:22px;
}
.empty-state p{margin:0 0 14px;font-size:13px}
.badge{
  display:inline-flex;align-items:center;gap:5px;padding:3px 9px;border-radius:999px;
  font-size:11.5px;font-weight:600;background:#f1f5f9;color:#475569;
}
.badge-blue{background:#eff6ff;color:#2563eb}
.badge-green{background:#ecfdf5;color:#059669}
.badge-orange{background:#fff7ed;color:#c2410c}
.badge-red{background:#fef2f2;color:#dc2626}
.badge-violet{background:#f5f3ff;color:#7c3aed}
.muted{color:var(--muted)}
.mono{font-family:ui-monospace,Consolas,monospace;font-size:12px}

/* ---------- modal ---------- */
.modal-overlay{
  position:fixed;inset:0;z-index:100;display:grid;place-items:center;padding:22px;
  background:rgba(15,23,42,.45);backdrop-filter:blur(5px);
  opacity:0;transition:opacity .18s ease;
}
.modal-overlay.show{opacity:1}
.modal{
  width:100%;max-width:560px;max-height:90vh;overflow:auto;background:#fff;border-radius:20px;
  box-shadow:0 30px 80px rgba(2,6,23,.32);
  transform:translateY(14px) scale(.97);opacity:0;
  transition:transform .22s cubic-bezier(.22,1,.36,1),opacity .18s;
}
.modal-overlay.show .modal{transform:none;opacity:1}
.modal-sm{max-width:420px}
.modal-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;padding:22px 24px 0}
.modal-head h3{margin:0;font-size:18px;letter-spacing:-.2px}
.modal-head p{margin:5px 0 0;font-size:12.5px;color:var(--muted);line-height:1.6}
.modal-body{padding:18px 24px 4px}
.modal-foot{display:flex;justify-content:flex-end;gap:10px;padding:16px 24px 22px}
.modal-msg{padding:6px 24px 10px;color:#475569;font-size:14px;line-height:1.8}
.modal-open{overflow:hidden}

/* ---------- toast ---------- */
.toast-root{position:fixed;right:24px;bottom:24px;z-index:200;display:flex;flex-direction:column;gap:10px;pointer-events:none}
.toast{
  display:flex;align-items:center;gap:9px;min-width:180px;max-width:360px;
  background:#0f172a;color:#f8fafc;padding:12px 15px;border-radius:12px;font-size:13px;
  box-shadow:0 16px 40px rgba(2,6,23,.3);opacity:0;transform:translateY(10px);
  transition:.24s cubic-bezier(.22,1,.36,1);
}
.toast.show{opacity:1;transform:none}
.toast-dot{width:8px;height:8px;border-radius:50%;background:#38bdf8;flex:0 0 8px}
.toast-success .toast-dot{background:#34d399}
.toast-error .toast-dot{background:#fb7185}
.toast-info .toast-dot{background:#38bdf8}

/* ---------- loading / motion ---------- */
.spinner{width:18px;height:18px;border-radius:50%;border:2px solid #dbe4f3;border-top-color:var(--primary);animation:spin .8s linear infinite;display:inline-block}
.page-loading{display:flex;align-items:center;gap:10px;justify-content:center;padding:80px 20px;color:var(--muted);font-size:13px}
.page-enter{animation:fadeUp .32s cubic-bezier(.22,1,.36,1) both}
.shake{animation:shake .38s ease}
@keyframes spin{to{transform:rotate(360deg)}}
@keyframes fadeUp{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}
@keyframes float{0%,100%{transform:translate3d(0,0,0)}50%{transform:translate3d(0,-18px,0)}}
@keyframes shake{0%,100%{transform:translateX(0)}20%{transform:translateX(-6px)}40%{transform:translateX(6px)}60%{transform:translateX(-4px)}80%{transform:translateX(4px)}}
@keyframes pop{0%{transform:scale(.82);opacity:0}60%{transform:scale(1.04)}100%{transform:scale(1);opacity:1}}
@keyframes glowPulse{0%,100%{box-shadow:0 0 0 0 rgba(79,70,229,.18)}50%{box-shadow:0 0 0 10px rgba(79,70,229,0)}}

@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation-duration:.001ms!important;transition-duration:.001ms!important}
}

@media (max-width:980px){
  .login-page{grid-template-columns:1fr}
  .login-visual{display:none}
  .mobile-brand{display:flex;align-items:center;gap:12px;margin-bottom:20px}
  .mobile-brand .brand-logo{width:40px;height:40px}
  .mobile-brand b{display:block;font-size:16px}
  .mobile-brand small{display:block;font-size:11px;color:var(--muted);margin-top:2px}
  .grid-2{grid-template-columns:1fr}
  .sidebar{width:86px;flex:0 0 86px;padding:18px 10px}
  .brand-text,.nav-item span:last-child,.sidebar-foot span{display:none}
  .sidebar-foot{display:none}
  .nav-item{justify-content:center;padding:12px}
  .brand{justify-content:center;padding:0}
  .content{padding:20px 16px 32px}
  .topbar{padding:0 16px}
}
@media (max-width:640px){
  .form-grid{grid-template-columns:1fr}
  .user-meta{display:none}
  .page-head h2{font-size:20px}
  .stat-grid{grid-template-columns:1fr 1fr}
  .quick{font-size:12px;padding:12px 10px;gap:8px;white-space:nowrap}
  .quick svg{width:17px;height:17px}
}

/* ---------- mobile drawer / phone access ---------- */
.menu-btn{display:none}
.sidebar-backdrop{display:none}
.login-mobile{margin-top:16px;text-align:center;font-size:12.5px}
.login-mobile a{color:var(--primary);font-weight:600}
.login-register{margin-top:14px;text-align:center;font-size:12.5px;color:var(--muted)}
.login-register button{border:0;background:none;color:var(--primary);font-weight:700;cursor:pointer;font-size:12.5px;padding:0 2px}
.remember-row{margin:2px 0 10px;font-size:12.5px;color:var(--muted)}
.remember-row label{display:flex;align-items:center;gap:7px;cursor:pointer}
.remember-row input{width:16px;height:16px;accent-color:var(--primary)}
body.sidebar-open{overflow:hidden}

@media (max-width:760px){
  .sidebar{
    position:fixed;top:0;left:0;bottom:0;z-index:60;
    width:272px;height:100vh;flex:0 0 272px;
    padding:24px 16px;transform:translateX(-105%);
    transition:transform .28s cubic-bezier(.22,1,.36,1);
    box-shadow:24px 0 60px rgba(2,6,23,.35);
  }
  .sidebar.open{transform:none}
  .sidebar .brand-text{display:flex}
  .sidebar .nav-item span:last-child{display:inline}
  .sidebar .nav-item{justify-content:flex-start;padding:12px 13px;font-size:14px}
  .sidebar-foot{display:flex}
  .sidebar .sidebar-foot span{display:inline}
  .menu-btn{display:inline-grid}
  .sidebar-backdrop{
    position:fixed;inset:0;z-index:50;background:rgba(15,23,42,.45);
    backdrop-filter:blur(3px);
  }
  .sidebar-backdrop.show{display:block}
  .topbar{padding:0 14px;gap:8px}
  .page-title h1{font-size:17px}
  .top-actions{gap:6px}
  .content{padding:16px 14px 30px}
}

/* SKU 三级折叠：商品 → 款式（颜色）→ 尺码 */
.sku-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px;flex-wrap:wrap}
.sku-toolbar .muted{font-size:12.5px}
.sku-group{border:1px solid var(--border);border-radius:14px;background:#fff;margin-bottom:12px;overflow:hidden;box-shadow:var(--shadow-sm)}
.sku-group-head{display:flex;align-items:center;gap:11px;width:100%;border:0;background:#fff;padding:15px 16px;cursor:pointer;text-align:left;transition:background .16s}
.sku-group-head:hover{background:#f8faff}
.sku-chev{color:#94a3b8;font-size:10px;transition:transform .2s;display:inline-block;flex:0 0 auto}
.sku-group.open .sku-chev{transform:rotate(90deg)}
.sku-group-name{font-weight:700;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0;flex:1}
.sku-group-meta{font-size:11px;color:#94a3b8;white-space:nowrap;flex:0 0 auto}
.sku-group-body{display:none;border-top:1px solid var(--border);padding:0 14px 14px}
.sku-group.open .sku-group-body{display:block}
.sku-group-actions{display:flex;align-items:center;gap:8px;padding:10px 2px;flex-wrap:wrap}
.sku-group-actions .muted{margin-left:auto;font-size:12px}

.style-list{display:flex;flex-direction:column;gap:8px}
.style-group{border:1px solid var(--border);border-radius:12px;background:#fbfcff;overflow:hidden}
.style-head{display:flex;align-items:center;gap:10px;width:100%;padding:11px 13px;border:0;background:transparent;cursor:pointer;text-align:left;transition:background .16s}
.style-head:hover{background:#f2f6ff}
.style-chev{color:#94a3b8;font-size:9px;transition:transform .2s;display:inline-block;flex:0 0 auto}
.style-group.open .style-chev{transform:rotate(90deg)}
.style-name{font-weight:600;font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
.style-count{margin-left:auto;font-size:12px;color:var(--muted);white-space:nowrap;flex:0 0 auto}
.style-body{display:none;border-top:1px solid var(--border);padding:0 10px 10px;background:#fff}
.style-group.open .style-body{display:block}
.style-actions{display:flex;align-items:center;gap:10px;padding:9px 2px;flex-wrap:wrap}
.style-actions .muted{margin-left:auto;font-size:12px}

.sku-table input[type=checkbox]{width:16px;height:16px;accent-color:var(--primary);cursor:pointer}
.sku-table{table-layout:fixed;width:100%;min-width:1000px}
.sku-table th:nth-child(1){width:34px}
.sku-table th:nth-child(2){width:120px}
.sku-table th:nth-child(3){width:96px}
.sku-table th:nth-child(4){width:160px}
.sku-table th:nth-child(5){width:auto}
.sku-table th:nth-child(6),.sku-table th:nth-child(7),.sku-table th:nth-child(8){width:70px}
.sku-table th:nth-child(9){width:62px}
.sku-table th:nth-child(10){width:112px}
.sku-table td:nth-child(2){white-space:normal;line-height:1.35}
.sku-table td:nth-child(3),.sku-table td:nth-child(4){overflow:hidden;text-overflow:ellipsis}
.sku-table td:nth-child(5){white-space:normal;word-break:break-word;line-height:1.45}
.sku-table td:nth-child(10){white-space:nowrap}
.sku-search{display:flex;align-items:center;gap:8px;margin-bottom:12px;position:relative}
.sku-search .input{height:42px;padding-left:38px;font-size:13.5px;background:#fbfcff}
.sku-search-icon{position:absolute;left:13px;top:50%;transform:translateY(-50%);color:#94a3b8;font-size:18px;pointer-events:none}
.sku-search .btn{flex:0 0 auto}
.sku-empty{padding:42px;text-align:center;color:var(--muted);font-size:13px}

/* 库存三级 + 预警 */
.inv-table{min-width:1000px}
.inv-table th:nth-child(2){width:120px}
.inv-table th:nth-child(3){width:100px}
.inv-table th:nth-child(4){width:170px}
.inv-table th:nth-child(5),.inv-table th:nth-child(6),.inv-table th:nth-child(7),.inv-table th:nth-child(8){width:70px}
.inv-table th:nth-child(9){width:90px}
.inv-table th:nth-child(10){width:80px}
.inv-table td:nth-child(2){white-space:normal;line-height:1.35}
.inv-low td{background:#fff8f8}
.danger-text{color:#dc2626}
.alert-banner{display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap;background:#fff7ed;border:1px solid #fed7aa;color:#9a3412;border-radius:14px;padding:14px 16px;margin-bottom:16px;font-size:13px}
.alert-banner b{margin-right:10px}
.alert-banner .btn{flex:0 0 auto}

/* 手机端适配（2026-11-27） */
@media(max-width:760px){
  .topbar{height:58px;padding:0 10px;gap:6px}
  .topbar>div:first-child{min-width:0;flex:1}
  .menu-btn{display:inline-grid;width:38px;height:38px;margin-left:-4px;flex:0 0 38px}
  .page-title{min-width:0}
  .page-title .eyebrow{display:none}
  .page-title h1{font-size:17px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
  .top-actions{gap:4px;flex:0 0 auto}
  .top-actions .icon-btn[title="手机访问"],.top-actions .icon-btn[title="刷新"]{display:none}
  .top-actions .user-chip{display:none}
  .top-actions .btn{font-size:12px;padding:0 8px;height:32px}
  .content{padding:14px 12px 28px}
  .page-head{margin-bottom:14px}
  .page-head h2{font-size:19px}
  .head-actions{width:100%}
  .head-actions .btn{flex:1;justify-content:center}
  .stat-grid,.stat-grid.cols-4{gap:10px;margin-bottom:14px}
  .stat-card{padding:14px}
  .stat-card .stat-value{font-size:24px}
  .panel{padding:14px;border-radius:14px;margin-bottom:12px}
  .table th,.table td{padding:9px 8px;font-size:12.5px}
  .modal{width:calc(100vw - 20px);max-height:90vh}
  .modal-body{padding:16px}
  .login-mobile{display:none}
}
@media(max-width:420px){
  .page-title h1{font-size:16px}
  .stat-grid,.stat-grid.cols-4,.stat-grid.cols-5{grid-template-columns:1fr}
  .stat-card .stat-value{font-size:22px}
}

.ai-warn{display:flex;align-items:center;gap:12px;flex-wrap:wrap;background:#fff7ed;border:1px solid #fed7aa;color:#9a3412;border-radius:14px;padding:14px 16px;margin-bottom:16px;font-size:13px}
.ai-warn b{font-size:13px}
.ai-warn span{flex:1;min-width:220px}
.ai-panel{display:flex;flex-direction:column;gap:14px}
.ai-messages{max-height:52vh;overflow:auto;border:1px solid var(--border);border-radius:14px;background:#fbfcff;padding:14px;display:flex;flex-direction:column;gap:12px}
.ai-msg{display:flex;flex-direction:column;gap:4px;max-width:88%}
.ai-msg.user{align-self:flex-end;align-items:flex-end}
.ai-role{font-size:11px;color:var(--muted)}
.ai-text{white-space:pre-wrap;word-break:break-word;background:#fff;border:1px solid var(--border);border-radius:12px;padding:10px 13px;font-size:13px;line-height:1.65}
.ai-msg.user .ai-text{background:#4f46e5;color:#fff;border-color:#4f46e5}
.ai-typing{color:var(--muted)}
.ai-suggest{display:flex;gap:8px;flex-wrap:wrap}
.ai-suggest button{border:1px solid var(--border);background:#fff;border-radius:999px;padding:7px 12px;font-size:12px;color:#475569;cursor:pointer;transition:.16s}
.ai-suggest button:hover{border-color:#c7d2fe;color:var(--primary);background:#f5f7ff}
.ai-input{display:flex;gap:10px;align-items:flex-end}
.ai-input textarea{flex:1;min-height:54px;resize:vertical;border:1px solid var(--border);border-radius:12px;padding:11px 13px;font-size:13.5px;font-family:inherit;outline:none}
.ai-input textarea:focus{border-color:var(--primary-2);box-shadow:0 0 0 4px rgba(99,102,241,.12)}
.ai-input .btn{height:44px}
.ai-tools{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:12px;padding-top:4px}
.ai-tools > div{border:1px solid var(--border);border-radius:12px;padding:14px;background:#fbfcff}
.ai-tools b{font-size:13px}
.ai-tools p{margin:6px 0 0;font-size:12px;line-height:1.6;color:var(--muted)}
@media(max-width:760px){.ai-messages{max-height:46vh}.ai-input{flex-direction:column;align-items:stretch}.ai-input .btn{width:100%}}

.category-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:12px;padding:4px 0}
.category-card{display:flex;align-items:center;gap:13px;padding:16px;border:1px solid var(--border);border-radius:14px;background:#fff;cursor:pointer;text-align:left;transition:transform .16s,border-color .16s,box-shadow .16s}
.category-card:hover{transform:translateY(-2px);border-color:#c7d2fe;box-shadow:0 10px 28px rgba(79,70,229,.10)}
.category-icon{width:42px;height:42px;border-radius:12px;background:#eef2ff;color:var(--primary);display:grid;place-items:center;flex:0 0 auto}
.category-icon svg{width:21px;height:21px}
.category-info{display:flex;flex-direction:column;gap:3px;min-width:0}
.category-info b{font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.category-info small{font-size:12px;color:var(--muted)}
.category-arrow{margin-left:auto;color:#94a3b8;font-size:22px;line-height:1}
@media(max-width:760px){.category-grid{grid-template-columns:1fr 1fr;gap:9px}.category-card{padding:12px;gap:9px}.category-icon{width:36px;height:36px}.category-info b{font-size:13px}}
@media (max-width:760px){
  .sku-group-head{padding:13px 12px;flex-wrap:wrap}
  .sku-group-name{font-size:13px}
  .sku-group-meta{flex:1 0 100%;padding-left:21px;margin-top:2px;font-size:10.5px}
  .sku-group-actions .muted{margin-left:0}
  .style-head{padding:10px 11px}
  .style-name{font-size:12.5px}
  .style-count{font-size:11px}
}


/* 批发绑定：AI 识别链接 */
.smart-row{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.smart-row .input{flex:1;min-width:240px;height:42px}
.smart-row select.input{flex:0 0 150px;min-width:150px}
.smart-row .btn{height:42px;flex:0 0 auto}
@media(max-width:640px){.smart-row{flex-direction:column;align-items:stretch}.smart-row select.input{flex:1;min-width:0}.smart-row .btn{width:100%}}
/* 手机端：表格自动转卡片，避免横向滑动 */
@media(max-width:760px){
  .table-wrap{overflow:visible;border:0;border-radius:0}
  .table{display:block;width:100%;border-collapse:initial}\n  .table.sku-table,.table.inv-table{min-width:0;width:100%;table-layout:auto}
  .table thead{display:none}
  .table tbody{display:block}
  .table tbody tr{display:block;background:#fff;border:1px solid var(--border);border-radius:12px;margin-bottom:10px;padding:4px 0;overflow:hidden}
  .table tbody tr:hover{background:#fff}
  .table tbody td{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;padding:7px 12px!important;border:0!important;white-space:normal!important;text-align:right;font-size:12.5px;line-height:1.55}
  .table tbody td::before{content:attr(data-label);color:#64748b;font-weight:600;font-size:12px;flex:0 0 78px;text-align:left;white-space:nowrap}
  .table tbody td[data-label=""]::before{display:none}
  .table tbody td[data-label=""]{justify-content:flex-start}
  .table tbody td .actions-cell{justify-content:flex-end;flex-wrap:wrap}
  .table tbody td .actions-cell .btn{flex:0 0 auto}
  .table tbody td .mono{word-break:break-all}
  .table tfoot{display:block;background:#f8fafc;border:1px solid var(--border);border-radius:12px;margin-top:2px}
  .table tfoot tr{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:8px;padding:10px 12px}
  .table tfoot td{display:block;padding:2px 6px!important;border:0!important;white-space:normal!important;font-size:12.5px}
  .head-actions{flex-wrap:wrap;gap:8px}
  .head-actions .btn{flex:1 1 44%;justify-content:center}
  .modal-foot{flex-wrap:wrap}
  .modal-foot .btn{flex:1 1 40%;justify-content:center}
}
/* V1.28 手机端底部导航 + 精简文字 */
.mobile-tabbar{display:none}
.mobile-more{display:none}
@media(max-width:760px){
  .mobile-tabbar{position:fixed;left:0;right:0;bottom:0;z-index:70;display:flex;justify-content:space-around;align-items:stretch;background:rgba(255,255,255,.98);border-top:1px solid var(--border);box-shadow:0 -8px 24px rgba(15,23,42,.06);padding-bottom:env(safe-area-inset-bottom)}
  .mobile-tab{flex:1;border:0;background:transparent;color:#64748b;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;height:58px;font-size:11px;font-family:inherit;padding:4px 0;cursor:pointer}
  .mobile-tab svg{width:21px;height:21px}
  .mobile-tab.active{color:var(--primary);font-weight:600}
  .content{padding-bottom:92px!important}
  .page-head p{display:none}
  .stat-card small{display:none}
  .head-actions .head-extra{display:none}
  .head-actions.expanded .head-extra{display:inline-flex}
  .head-actions .mobile-more{display:inline-flex;flex:0 0 auto}
  .page-head{margin-bottom:10px}
  .stat-card{padding:12px}
  .stat-card .stat-value{font-size:22px}
}
/* V1.28 手机端进一步精简 */
.sidebar-mobile-actions{display:none}
@media(max-width:760px){
  .top-actions .btn{display:none}
  .page-head h2{display:none}
  .page-head p{display:none}
  .head-actions{gap:8px}
  .head-actions .btn{flex:1 1 0;min-width:0}
  .head-actions .mobile-more{display:inline-flex;flex:0 0 42px;width:42px;padding:0;font-size:12px;position:relative;z-index:2;touch-action:manipulation}
  .head-actions.expanded{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .head-actions.expanded .btn{width:auto;min-width:0;flex:none;font-size:11.5px;padding:8px 6px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .head-actions.expanded .mobile-more{width:100%;flex:none}
  .sidebar-mobile-actions{display:flex;gap:8px;padding:12px 14px calc(14px + env(safe-area-inset-bottom));border-top:1px solid var(--border);margin-top:8px}
  .sidebar-mobile-actions .btn{flex:1;justify-content:center}
}
/* 手机首页库存快捷 */
.mobile-stock-panel{display:none}
@media(max-width:760px){
  .mobile-stock-panel{display:block}
  .dash-stock-row{display:grid;grid-template-columns:1fr 1fr;gap:8px}
  .dash-stock-row .input{height:40px;min-width:0}
  .dash-stock-actions{display:grid;grid-template-columns:1fr 1fr 1fr;gap:8px;margin-top:10px}
  .dash-stock-actions .btn{justify-content:center}
  .mobile-stock-panel .hint{display:none}
}
.sku-inline-edit{margin-left:8px;vertical-align:middle}
.sku-table th:last-child,.sku-table td:last-child{position:sticky;right:0;background:#fff;z-index:2;box-shadow:-6px 0 8px -6px rgba(15,23,42,.12)}
.sku-table th:last-child{background:#f8fafc;z-index:3}
@media(max-width:760px){.sku-table th:last-child,.sku-table td:last-child{position:static;box-shadow:none}}
