:root {
  --bg: #f5f6f8; --card: #fff; --border: #e3e6ea;
  --text: #1f2329; --muted: #86909c; --primary: #185fa5;
  --ok: #0f6e56; --warn: #854f0b; --danger: #a32d2d;
}
* { box-sizing: border-box; margin: 0; }
body { font: 14px/1.6 -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif; background: var(--bg); color: var(--text); }
.layout { display: flex; min-height: 100vh; }
/* boot() 未确认登录态前整个 layout 不显示，避免刷新闪现已登录的内页（用户登出后再刷时）*/
.layout[hidden] { display: none !important; }
.sidebar { width: 200px; background: #10243a; color: #cfd8e3; padding: 20px 0; display: flex; flex-direction: column; }
.brand { font-weight: 600; font-size: 15px; padding: 0 20px 18px; color: #fff; }
.sidebar nav { flex: 1; }
.sidebar nav a { display: block; padding: 10px 20px; cursor: pointer; color: #cfd8e3; }
.sidebar nav a:hover { background: #1a3450; }
.sidebar nav a.active { background: #1a3450; color: #fff; border-left: 3px solid #378add; }
.sidebar-foot { padding: 16px 20px 0; }
.status-pill { font-size: 12px; padding: 4px 10px; border-radius: 12px; display: inline-block; }
.status-pill.on { background: #0f6e56; color: #fff; }
.status-pill.off { background: #854f0b; color: #fff; }
.status-pill.loading { background: #5f5e5a; color: #fff; }
main { flex: 1; padding: 24px 32px; max-width: 1200px; }
.tab { display: none; }
.tab.active { display: block; }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar input, .toolbar select, .panel input, .panel textarea, .form-grid input {
  border: 1px solid var(--border); border-radius: 6px; padding: 7px 10px; font: inherit; background: #fff;
}
.toolbar input#sku-query, .toolbar input#comp-query { width: 300px; }
button { background: var(--primary); color: #fff; border: 0; border-radius: 6px; padding: 8px 16px; font: inherit; cursor: pointer; }
button:hover { filter: brightness(1.1); }
button.ghost { background: #fff; color: var(--primary); border: 1px solid var(--primary); }
table.grid { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; margin-bottom: 20px; }
.grid th, .grid td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--border); font-size: 13px; vertical-align: top; }
.grid th { background: #eef1f4; font-weight: 500; white-space: nowrap; }
.grid tr:last-child td { border-bottom: 0; }
.grid td.num, .grid th.num { text-align: right; }
.panel { background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 18px; margin-bottom: 20px; }
.panel h3 { font-size: 14px; margin-bottom: 10px; }
.panel textarea { width: 100%; border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; font: inherit; }
.hint { color: var(--muted); font-size: 12px; }
.row { display: flex; gap: 10px; align-items: center; margin-top: 8px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.form-grid label { font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.hidden { display: none !important; }
.badge { font-size: 12px; padding: 2px 8px; border-radius: 10px; white-space: nowrap; }
.badge.ok { background: #e1f5ee; color: var(--ok); }
.badge.warn { background: #faeeda; color: var(--warn); }
.badge.danger { background: #fcebeb; color: var(--danger); }
.tag { font-size: 12px; padding: 2px 8px; border-radius: 10px; background: #e6f1fb; color: var(--primary); }
.danger-text { color: var(--danger); font-weight: 600; }
.ok-text { color: var(--ok); font-weight: 600; }
h3 { font-size: 14px; margin: 8px 0 12px; }

/* 运营总览 */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat-card { background: #fff; border: 1px solid var(--border, #e3e7ec); border-radius: 10px; padding: 14px 16px; }
.stat-card .v { font-size: 22px; font-weight: 700; margin-top: 4px; }
.stat-card .v.red { color: #c0392b; }
.stat-card .l { font-size: 12px; color: #78828c; }
.dash-grid { display: grid; grid-template-columns: 3fr 2fr; gap: 12px; }
@media (max-width: 900px) { .dash-grid { grid-template-columns: 1fr; } }
#login-overlay { position: fixed; inset: 0; z-index: 100; overflow: hidden;
  /* 第二十八轮：让 .login-stage 在视口里整体垂直居中 */
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(59,130,246,.35), transparent 60%),
    radial-gradient(ellipse 70% 50% at 90% 90%, rgba(139,92,246,.30), transparent 60%),
    linear-gradient(135deg, #0a0e27 0%, #0f1338 50%, #161a4d 100%);
  color: #e8edf6;
}
#login-overlay.hidden { display: none !important; }

/* ---------- 装饰：网格 + 漂浮光斑 + 波形 ---------- */
.login-bg { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.grid-bg {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(99,160,255,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99,160,255,.06) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, #000 30%, transparent 80%);
}
.orb {
  position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55;
}
.orb-1 { width: 360px; height: 360px; background: #3b82f6; top: -80px; left: -100px;
  animation: orbFloat 18s ease-in-out infinite; }
.orb-2 { width: 280px; height: 280px; background: #8b5cf6; bottom: -80px; right: -60px;
  animation: orbFloat 22s ease-in-out infinite reverse; }
/* orb-3 已移除：原 top:40% left:50% 的青色光斑正好压到密码输入框中央，影响输入 */
/* @keyframes orbFloat 仍保留（如未来需要） */
@keyframes orbFloat {
  0%,100% { transform: translate(0,0) scale(1); }
  33% { transform: translate(40px,-30px) scale(1.08); }
  66% { transform: translate(-30px,20px) scale(.95); }
}
.wave-deco { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 240px; opacity: .7; }

/* ---------- 主舞台：左右双栏（由 #login-overlay flex 居中） ---------- */
.login-stage {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1.2fr 1fr; align-items: start; gap: 40px;
  width: min(1080px, 92vw);
  margin: 0 auto;
  /* 第二十八轮：去掉 min-height:100vh + padding:60px 0，让 stage 由 overlay 居中；
     短视口（内容超过 100vh）时 grid 自身允许垂直溢出滚动 */
}
@media (max-width: 880px) {
  /* 手机端保留上下 padding 40px，确保登录卡不会贴到屏幕顶/底 */
  .login-stage { grid-template-columns: 1fr; padding: 40px 0; }
  .login-left { display: none !important; }
}

/* ---------- 左侧：品牌 + 主标题 ---------- */
.login-left { display: flex; flex-direction: column; padding-right: 12px; min-height: clamp(440px, 72vh, 540px); }
.brand-mark { display: flex; align-items: center; gap: 14px; }
.brand-text { font-size: 32px; font-weight: 700; letter-spacing: 1.2px; color: #fff; }
.brand-dot { color: #3b82f6; font-size: 32px; line-height: 1; }

/* 中央 hero 块：内容紧跟品牌（去掉 flex:1，靠 hero-footer margin-top:auto 推底部）*/
.hero-block { display: flex; flex-direction: column; justify-content: flex-start; padding: 14px 0 0; }

/* 上眉小标（OPERATION CENTER · 2026） */
.hero-eyebrow { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.eyebrow-line { display: inline-block; width: 36px; height: 1px; background: linear-gradient(90deg, #3b82f6, transparent); }
.eyebrow-text { font-size: 11px; letter-spacing: 3px; color: #64748b; font-family: ui-monospace, "SF Mono", Menlo, monospace; text-transform: uppercase; }

/* 主标题"运营中心"：超大、渐变、轻微发光 */
.hero-title {
  font-size: clamp(56px, 8vw, 96px); font-weight: 800; line-height: 1; margin: 0 0 18px;
  letter-spacing: -2px;
  background: linear-gradient(135deg, #ffffff 0%, #c7d2fe 50%, #a78bfa 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 80px rgba(99,102,241,.25);
}

/* 副标题 */
.hero-sub { font-size: 16px; color: #94a3b8; margin: 0 0 26px; letter-spacing: .5px; max-width: 480px; line-height: 1.6; }

/* 装饰分隔线（短水平 + 渐变） */
.hero-divider { width: 80px; height: 2px; margin: 0 0 24px;
  background: linear-gradient(90deg, #3b82f6 0%, #8b5cf6 50%, transparent 100%);
  border-radius: 2px; box-shadow: 0 0 12px rgba(59,130,246,.55);
}

/* 能力标签（一行 4 个能力，中间用 · 分隔） */
.hero-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 14px; letter-spacing: .5px; }
.ht { color: #cbd5e1; padding: 4px 10px; border-radius: 4px; background: rgba(255,255,255,.04); border: 1px solid rgba(99,160,255,.14); }
.ht-sep { color: #475569; font-weight: 700; }

/* 底部状态条：呼吸绿点 + 版本标识 */
.hero-footer { display: none; /* 第三十轮：删除左下角「绿点 + v2026.09 硅谷部署 ONLINE」状态条，整体居中后这一行会浮在视口中部偏下，反而显零散；HTML 保留以便回滚 */ }
.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #4ade80; box-shadow: 0 0 10px #4ade80;
  animation: pulseDot 2s ease-in-out infinite;
}
@keyframes pulseDot { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
.version-tag {
  padding: 5px 12px; font-size: 11px; color: #94a3b8;
  letter-spacing: .8px; font-family: ui-monospace, "SF Mono", Menlo, monospace;
  border: 1px solid rgba(99,160,255,.20); border-radius: 4px;
  background: rgba(15,23,42,.5);
}

/* ---------- 右侧：登录卡片（玻璃态） ---------- */
.login-card {
  padding: 36px 32px 28px;
  border: 1px solid rgba(99,160,255,.22);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,.06) 0%, rgba(255,255,255,.02) 100%);
  backdrop-filter: blur(20px);
  box-shadow:
    0 0 0 1px rgba(99,160,255,.10) inset,
    0 30px 80px -20px rgba(8,15,40,.55),
    0 0 60px -10px rgba(59,130,246,.25);
  position: relative;
}
.login-card::before {
  content: ""; position: absolute; inset: 0; border-radius: 14px;
  padding: 1px;
  background: linear-gradient(135deg, rgba(59,130,246,.4), rgba(139,92,246,.0) 60%, rgba(6,182,212,.3));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none;
}
.card-title {
  font-size: 22px; font-weight: 700; color: #fff; margin: 0 0 6px;
  background: linear-gradient(90deg, #60a5fa, #a78bfa);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.card-sub { font-size: 13px; color: #94a3b8; margin: 0 0 28px; }

/* 输入字段 */
.field { position: relative; display: block; margin-bottom: 22px; }
.field-label { display: block; font-size: 14px; color: #cbd5e1; letter-spacing: .3px; margin-bottom: 8px; text-transform: uppercase; font-weight: 500; }
.field input {
  width: 100%; padding: 12px 0 10px;
  background: transparent; border: 0; border-bottom: 1px solid rgba(148,163,184,.3);
  color: #fff; font: inherit; font-size: 15px;
  outline: none; transition: border-color .25s;
}
.field input::placeholder { color: #475569; }
.field input:focus { border-bottom-color: transparent; }
.field-bar {
  position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: linear-gradient(90deg, #3b82f6, #8b5cf6, #06b6d4);
  transform: scaleX(0); transform-origin: left center;
  transition: transform .35s cubic-bezier(.4,0,.2,1);
}
.field input:focus ~ .field-bar { transform: scaleX(1); }

/* 按钮 */
.login-btn {
  width: 100%; padding: 13px 18px; margin-top: 6px;
  background: linear-gradient(135deg, #3b82f6 0%, #6366f1 50%, #8b5cf6 100%);
  background-size: 200% 100%; background-position: 0% 50%;
  color: #fff; border: 0; border-radius: 8px;
  font-size: 14px; font-weight: 600; letter-spacing: 1px;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 6px 24px -6px rgba(59,130,246,.55);
  transition: background-position .6s ease, transform .15s, box-shadow .25s;
}
.login-btn:hover { background-position: 100% 50%; box-shadow: 0 8px 30px -6px rgba(139,92,246,.65); }
.login-btn:active { transform: translateY(1px); }

/* 提示信息 */
#login-msg.hint { min-height: 18px; margin: 12px 0 0; font-size: 12px; color: #f87171; text-align: center; }

/* 底部安全标识 */
.login-foot {
  margin-top: 24px; padding-top: 16px;
  border-top: 1px solid rgba(99,160,255,.10);
  display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 11px; color: #64748b; letter-spacing: .5px;
}
.dot-secure {
  width: 6px; height: 6px; border-radius: 50%;
  background: #4ade80; box-shadow: 0 0 8px #4ade80;
  animation: pulseDot 2s ease-in-out infinite;
}
@keyframes pulseDot { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

/* 错误状态 */
.login-card.error .field input { border-bottom-color: #f87171; }
.login-card.error .login-btn { background: linear-gradient(135deg, #ef4444, #b91c1c); }
.login-card.error { animation: shake .35s ease; }
@keyframes shake {
  20%, 60% { transform: translateX(-4px); }
  40%, 80% { transform: translateX(4px); }
}
#keepa-modal { position: fixed; inset: 0; background: rgba(16,36,58,.45); display: flex; align-items: center; justify-content: center; z-index: 90; }
#keepa-modal.hidden { display: none; }
.modal-box { background: #fff; border-radius: 12px; padding: 22px; width: min(680px, 92vw); }
#batch-preview table { margin-top: 12px; }
#batch-preview td.err { color: var(--danger); }
code { background: #eef1f4; border-radius: 4px; padding: 1px 6px; font-size: 12px; }
.platform-switch { display: flex; gap: 6px; padding: 0 16px 14px; }
.platform-switch button { flex: 1; background: #1a3450; color: #8fa5bb; border: 1px solid #2a4a68; border-radius: 6px; padding: 7px 0; font-size: 13px; }
.platform-switch button.active { background: #378add; border-color: #378add; color: #fff; }
