/* ============================================================
   League Skin 管理后台 - 双主题设计系统（与桌面端令牌统一）
   暗色：电竞深黑蓝 + 蓝色强调  /  亮色：白灰五级层 + 深蓝强调
   ============================================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #0A0C10;
  --bg-elevated: #10131A;
  --bg-card: #141821;
  --bg-hover: #1B202B;
  --bg-input: #0E1117;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #F2F4F8;
  --text-secondary: rgba(242, 244, 248, 0.7);
  --text-muted: rgba(242, 244, 248, 0.5);
  --accent: #4C8DFF;
  --accent-strong: #2E6BE6;
  --accent-soft: rgba(76, 141, 255, 0.12);
  --amber: #F59E0B;
  --danger: #EF4444;
  --success: #34D399;
  --radius: 6px;
  --radius-lg: 8px;
  --shadow-card: 0 10px 32px rgba(4, 7, 14, 0.55);
  /* 字体统一 */
  --font-heading: 'Microsoft YaHei', sans-serif;
  --font-body: 'Microsoft YaHei', sans-serif;
  --font-mono: 'Microsoft YaHei', sans-serif;
  /* 表面（供亮色主题覆盖） */
  --sidebar-bg: linear-gradient(180deg, #0B1424, #070D1B);
  --topbar-bg: rgba(11, 18, 32, 0.6);
  --card-footer-bg: rgba(11, 18, 32, 0.4);
  --table-head-bg: rgba(11, 18, 32, 0.5);
  --toast-bg: rgba(15, 23, 42, 0.95);
  --login-card-bg: rgba(15, 23, 42, 0.82);
  --login-radial-2: rgba(15, 23, 42, 0.9);
  /* ---- 字号 / 字重 / 字距（与桌面端令牌对齐） ---- */
  --fs-xs: 11px;
  --fs-sm: 12px;
  --fs-base: 13px;
  --fs-md: 14px;
  --fs-lg: 15px;
  --fs-xl: 16px;
  --fs-2xl: 18px;
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
  --tracking-tight: -0.01em;
  --tracking-normal: 0.01em;
  --tracking-wide: 0.02em;
  --tracking-wider: 0.04em;
  /* 卡片顶部内高光（克制质感，替代外发光） */
  --card-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  --modal-overlay: transparent;
  --modal-shadow: 0 8px 40px rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}

/* ============================================================
   白色主题
   ============================================================ */
[data-theme="light"] {
  --bg: #F6F7FB;
  --bg-elevated: #EEF0F5;
  --bg-card: #FFFFFF;
  --bg-hover: #F3F5F9;
  --bg-input: #EAEDF3;
  --border: rgba(15, 23, 42, 0.09);
  --border-strong: rgba(15, 23, 42, 0.18);
  --text: #101828;
  --text-secondary: rgba(16, 24, 40, 0.7);
  --text-muted: rgba(16, 24, 40, 0.5);
  --accent: #2563EB;
  --accent-strong: #1D4ED8;
  --accent-soft: rgba(37, 99, 235, 0.08);
  --amber: #D97706;
  --danger: #DC2626;
  --success: #16A34A;
  --radius: 6px;
  --radius-lg: 8px;
  --shadow-card: 0 8px 24px rgba(15, 23, 42, 0.08);
  /* 字体统一 */
  --font-heading: 'Microsoft YaHei', sans-serif;
  --font-body: 'Microsoft YaHei', sans-serif;
  --font-mono: 'Microsoft YaHei', sans-serif;
  --card-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  --modal-overlay: transparent;
  --modal-shadow: 0 8px 40px rgba(0, 0, 0, 0.15);
  color-scheme: light;
  --sidebar-bg: linear-gradient(180deg, #F7F9FC, #EDF0F5);
  --topbar-bg: rgba(255, 255, 255, 0.75);
  --card-footer-bg: rgba(240, 242, 246, 0.7);
  --table-head-bg: rgba(234, 237, 242, 0.9);
  --toast-bg: rgba(255, 255, 255, 0.96);
  --login-card-bg: rgba(255, 255, 255, 0.88);
  --login-radial-2: rgba(226, 232, 240, 0.75);
  color-scheme: light;
}

html, body, #root {
  height: 100%;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: rgba(76, 141, 255, 0.28);
  color: var(--text);
}

/* 滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 5px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #475569; }

/* 尊重系统减弱动效设置 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================================
   登录页
   ============================================================ */
.login-page {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background:
    radial-gradient(1000px 460px at 50% -10%, rgba(76, 141, 255, 0.10), transparent 60%),
    radial-gradient(700px 360px at 90% 110%, var(--login-radial-2), transparent 60%),
    var(--bg);
}

.login-glow {
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(76, 141, 255, 0.14), transparent 70%);
  filter: blur(60px);
  pointer-events: none;
}

.login-card {
  position: relative;
  width: 340px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 38px 32px 30px;
  background: var(--login-card-bg);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6);
}

.login-theme {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 2;
}

.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.login-name {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--text);
}

.login-caption {
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.login-error {
  padding: 9px 12px;
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: var(--radius);
  background: rgba(239, 68, 68, 0.08);
  color: var(--danger);
  font-size: 12px;
}

.login-foot {
  margin-top: 4px;
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
}

/* ============================================================
   品牌标识
   ============================================================ */
.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}

.brand-mark-lg {
  width: 44px;
  height: 44px;
  border-radius: 8px;
}

/* ============================================================
   布局：侧边栏 + 工作区
   ============================================================ */
.app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.sidebar {
  width: 232px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  padding: 20px 14px 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 6px 20px;
  border-bottom: 1px solid var(--border);
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.brand-name {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text);
  white-space: nowrap;
}

.brand-sub {
  font-size: 9.5px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 16px;
  overflow-y: auto;
}

.nav-label {
  padding: 14px 10px 6px;
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  user-select: none;
}

.nav-label:first-child {
  padding-top: 0;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  font-weight: var(--fw-medium);
  text-align: left;
  cursor: pointer;
  transition: all 0.18s ease;
}

.nav-item:active { transform: scale(0.98); }

.nav-item svg { flex-shrink: 0; opacity: 0.85; }

.nav-item::before {
  content: '';
  position: absolute;
  left: -14px;
  top: 24%;
  bottom: 24%;
  width: 3px;
  border-radius: 2px;
  background: var(--accent);
  opacity: 0;
  transition: opacity 0.18s ease;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.nav-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.nav-item.active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: rgba(76, 141, 255, 0.22);
}

.nav-item.active::before { opacity: 1; }
.nav-item.active svg { opacity: 1; }

.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  margin-top: 14px;
}

.server-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.ss-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.ss-title { font-size: 12px; color: var(--text); }
.ss-sub { font-size: 11px; color: var(--text-muted); }

.logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.logout-btn:hover {
  border-color: rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.08);
  color: var(--danger);
}

.logout-btn:focus-visible {
  outline: 2px solid var(--danger);
  outline-offset: 1px;
}

/* ---- 状态点 ---- */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot.online {
  background: var(--accent);
}

.status-dot.offline {
  background: var(--danger);
}

/* ============================================================
   工作区
   ============================================================ */
.workspace {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.topbar {
  flex-shrink: 0;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 26px;
  background: var(--topbar-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.topbar-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.topbar-title {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text);
  white-space: nowrap;
}

.topbar-crumb {
  font-size: 11px;
  color: var(--text-muted);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 12px;
  white-space: nowrap;
}

.clock {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  color: var(--text-secondary);
}

/* 主题切换按钮 */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.18s ease;
  flex-shrink: 0;
}

.theme-toggle:hover {
  background: var(--bg-hover);
  color: var(--text);
  border-color: var(--border-strong);
}

.theme-toggle:active { transform: scale(0.92); }

.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 26px;
}

.loading {
  padding: 80px;
  text-align: center;
  color: var(--text-muted);
}

/* ============================================================
   页面通用
   ============================================================ */
.page {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: page-in 0.25s ease-out;
}

@keyframes page-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-head {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.page-title {
  font-family: var(--font-heading);
  font-size: var(--fs-2xl);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--tracking-tight);
  color: var(--text);
}

.page-desc {
  font-size: var(--fs-base);
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 62ch;
}

/* ============================================================
   卡片
   ============================================================ */
.card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card), var(--card-highlight);
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.card-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-size: var(--fs-base);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--tracking-wide);
  color: var(--text-secondary);
}

.card-title svg { color: var(--accent); }

.card-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  background: var(--card-footer-bg);
}

/* ============================================================
   徽章
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

.badge-green { background: var(--accent-soft); color: var(--accent); }
.badge-red { background: rgba(239, 68, 68, 0.12); color: var(--danger); }
.badge-gray { background: rgba(148, 163, 184, 0.14); color: var(--text-muted); }
.badge-success { background: rgba(16, 185, 129, 0.12); color: #10b981; }
.badge-muted { background: rgba(148, 163, 184, 0.14); color: var(--text-muted); }

/* ============================================================
   表单
   ============================================================ */
.field,
.form-row {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field label,
.form-row label {
  font-size: 12px;
  color: var(--text-secondary);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.input {
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg-input);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 13px;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
  width: 100%;
}

.input::placeholder { color: var(--text-muted); }

.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

textarea.input { resize: vertical; line-height: 1.6; }

.input-date { width: 150px; flex-shrink: 0; }

.hint {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.6;
}

.hint code {
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
}

/* ============================================================
   按钮
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.btn:hover {
  background: var(--bg-hover);
  color: var(--text);
  border-color: var(--text-muted);
}

.btn:active { transform: scale(0.98); }

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-strong), var(--accent));
  border-color: transparent;
  color: #fff;
  font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #3A6FE8, var(--accent));
  color: #fff;
  border-color: transparent;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.btn-ghost {
  border-style: dashed;
  color: var(--text-muted);
}

.btn-ghost:hover {
  border-style: dashed;
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.btn-danger { color: var(--danger); }

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.45);
  color: var(--danger);
}

.btn-sm { padding: 4px 11px; font-size: 12px; }

.btn-block { width: 100%; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.18s ease;
  flex-shrink: 0;
}

.icon-btn:hover { background: var(--bg-hover); color: var(--text); }

.icon-btn:active { transform: scale(0.95); }

.icon-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.icon-btn-danger:hover {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.4);
  color: var(--danger);
}

/* ============================================================
   开关
   ============================================================ */
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.switch-title { font-size: 13px; font-weight: 500; color: var(--text); }
.switch-desc { font-size: 11px; color: var(--text-muted); margin-top: 2px; line-height: 1.5; }

.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
  cursor: pointer;
}

.switch input { opacity: 0; width: 0; height: 0; }

.slider {
  position: absolute;
  inset: 0;
  background: var(--border-strong);
  border-radius: 22px;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s ease;
}

.switch input:checked + .slider {
  background: var(--accent);
}

.switch input:checked + .slider::before { transform: translateX(18px); }

.switch input:focus-visible + .slider {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.switch-lg { transform: scale(1.25); }

/* ============================================================
   仪表盘
   ============================================================ */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}

.stat-card {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card), var(--card-highlight);
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.stat-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }

.stat-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  flex-shrink: 0;
}

.stat-good .stat-icon { background: var(--accent-soft); color: var(--accent); }
.stat-warn .stat-icon { background: rgba(245, 158, 11, 0.14); color: var(--amber); }
.stat-bad .stat-icon { background: rgba(239, 68, 68, 0.14); color: var(--danger); }
.stat-neutral .stat-icon { background: rgba(148, 163, 184, 0.12); color: var(--text-secondary); }

.stat-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.stat-label { font-size: var(--fs-xs); color: var(--text-muted); letter-spacing: 0.04em; }
.stat-value { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 19px; font-weight: 600; color: var(--text); }
.stat-sub { font-size: var(--fs-xs); color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}

.kv-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 2px;
  border-bottom: 1px dashed var(--border);
}

.kv-row:last-child { border-bottom: none; }

.kv-label { font-size: 12px; color: var(--text-muted); }
.kv-value {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--text);
  text-align: right;
}

.action-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.action-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-input);
  color: var(--text);
  font-family: var(--font-body);
  cursor: pointer;
  text-align: left;
  transition: all 0.18s ease;
}

.action-item:hover {
  border-color: rgba(76, 141, 255, 0.35);
  background: var(--accent-soft);
}

.action-item:active { transform: scale(0.99); }

.action-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.action-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--bg-hover);
  color: var(--accent);
  flex-shrink: 0;
}

.action-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.action-label { font-size: 13px; font-weight: 500; color: var(--text); }
.action-desc { font-size: 11px; color: var(--text-muted); }
.action-arrow { flex-shrink: 0; color: var(--text-muted); transition: transform 0.18s ease; }

.action-item:hover .action-arrow { transform: translateX(3px); color: var(--accent); }

/* ============================================================
   Banner 页面
   ============================================================ */
.banner-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}

.img-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.img-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-input);
  color: var(--text-muted);
  overflow: hidden;
  flex-shrink: 0;
}

.img-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.18s ease;
}

/* 轮播图卡片（逐张配置图片/标题/内容） */
.slide-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  box-shadow: var(--card-highlight);
  margin-bottom: 12px;
  overflow: hidden;
}

.slide-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-subtle, var(--bg));
}

.slide-idx {
  flex: 1;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.slide-card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
}

.slide-content {
  resize: vertical;
  min-height: 42px;
}

.slide-card-body .input {
  padding: 7px 10px;
  font-size: 12px;
}

.card-preview { position: sticky; top: 0; }

.banner-preview {
  position: relative;
  height: 200px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-input);
  box-shadow: var(--card-highlight);
}

.banner-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.preview-empty {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 12px;
}

.banner-preview-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 5px;
  padding: 0 20px 14px;
  background: linear-gradient(
    to top,
    rgba(8, 10, 14, 0.85) 0%,
    rgba(8, 10, 14, 0.45) 42%,
    rgba(8, 10, 14, 0.12) 62%,
    transparent 78%
  );
}

.bp-title {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #fff;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.75);
}

.bp-subtitle {
  font-size: 12px;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.65);
}

.preview-thumbs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.preview-thumb {
  width: 46px;
  height: 30px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-input);
}

.preview-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.preview-thumb.current { border-color: var(--accent); }

/* ============================================================
   公告页面
   ============================================================ */
.add-announce {
  display: flex;
  gap: 10px;
  align-items: center;
}

.add-announce .input-link {
  flex: 0 0 160px;
  min-width: 120px;
}

.ann-link-tag {
  display: inline-block;
  vertical-align: middle;
  color: var(--accent);
  opacity: 0.7;
  margin-left: 6px;
  transition: opacity 0.15s;
}

.ann-link-tag:hover { opacity: 1; }

.table {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.table-head,
.table-row {
  display: grid;
  grid-template-columns: 1fr 110px 90px 150px;
  align-items: center;
  gap: 12px;
}

.table-head {
  padding: 10px 14px;
  background: var(--table-head-bg);
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.table-row {
  padding: 12px 14px;
  background: var(--bg-input);
  border-bottom: 1px solid var(--border);
  transition: background 0.15s ease;
}

.table-row:last-child { border-bottom: none; }
.table-row:hover { background: var(--bg-hover); }
.table-row.muted { opacity: 0.55; }

/* ---- 数据表格（订单/商品/卡密）：原生 table，撑满容器 ---- */
.table-scroll {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  font-size: var(--fs-base);
  color: var(--text);
}

.data-table thead th {
  padding: 11px 14px;
  background: var(--table-head-bg);
  border-bottom: 1px solid var(--border);
  font-size: var(--fs-xs);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: left;
  white-space: nowrap;
}

.data-table tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-input);
  vertical-align: middle;
}

.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: var(--bg-hover); }

.data-table td code {
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  color: var(--text);
  word-break: break-all;
}

.td-content {
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.td-date { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: var(--fs-sm); color: var(--text-muted); }
.td-status { display: flex; }

.td-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

/* ---- 公告：拖动排序 ---- */
.table-sortable .table-head,
.table-sortable .table-row {
  grid-template-columns: 44px 1fr 110px 90px 150px;
}

.th-drag { color: var(--text-muted); }

.td-drag {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  color: var(--text-muted);
  opacity: 0.45;
  transition: opacity .15s, color .15s;
}

.table-row:hover .td-drag { opacity: 0.85; color: var(--accent); }
.td-drag:active { cursor: grabbing; }

.sortable-row.dragging {
  opacity: 0.4;
  background: var(--bg-hover);
}

.sortable-row.drag-over {
  border-top: 2px solid var(--accent);
  padding-top: 10px;
}

/* ---- 公告：编辑弹窗 ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--modal-overlay);
  transition: opacity 0.25s, visibility 0.25s;
}

.modal-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--card-highlight), var(--modal-shadow);
  width: 440px;
  max-width: 90vw;
  animation: modalIn 0.2s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(-12px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
}

.modal-title { font-size: 15px; font-weight: 600; color: var(--text); }

.modal-close {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border: none; background: transparent;
  font-size: 20px; color: var(--text-muted);
  cursor: pointer; border-radius: 6px; transition: .15s;
}

.modal-close:hover { background: var(--bg-hover); color: var(--text); }

.modal-body {
  padding: 20px 20px 10px;
  display: flex; flex-direction: column; gap: 14px;
}

.modal-footer {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 10px 20px 18px;
}

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
}

.empty-icon { opacity: 0.5; }

/* ============================================================
   维护页面
   ============================================================ */
.mnt-card {
  border: 1px solid var(--border);
  box-shadow: var(--card-highlight);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.mnt-card.mnt-on {
  border-color: rgba(239, 68, 68, 0.35);
}

.mnt-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
}

.mnt-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 8px;
  flex-shrink: 0;
}

.mnt-card:not(.mnt-on) .mnt-icon { background: var(--accent-soft); color: var(--accent); }
.mnt-card.mnt-on .mnt-icon { background: rgba(239, 68, 68, 0.14); color: var(--danger); }

.mnt-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.mnt-status { font-size: 15px; font-weight: 600; color: var(--text); }
.mnt-sub { font-size: 12px; color: var(--text-muted); }

/* ============================================================
   版本页面
   ============================================================ */
.ver-compare {
  display: flex;
  align-items: stretch;
  gap: 12px;
}

.ver-box {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card), var(--card-highlight);
}

.ver-box-accent {
  border-color: rgba(76, 141, 255, 0.35);
  background: linear-gradient(160deg, rgba(76, 141, 255, 0.08), var(--bg-card));
}

.ver-label { font-size: var(--fs-xs); letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); }
.ver-value { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 28px; font-weight: 700; color: var(--text); }
.ver-box-accent .ver-value { color: var(--accent); }
.ver-sub { font-size: 11px; color: var(--text-muted); }

/* ============================================================
   Toast
   ============================================================ */
.toasts {
  position: fixed;
  top: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 999;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 240px;
  max-width: 360px;
  padding: 12px 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--toast-bg);
  backdrop-filter: blur(10px);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
  font-size: 13px;
  color: var(--text);
  animation: toast-in 0.25s ease-out;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(24px); }
  to { opacity: 1; transform: translateX(0); }
}

.toast-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  flex-shrink: 0;
}

.toast-success .toast-icon { background: var(--accent-soft); color: var(--accent); }
.toast-error .toast-icon { background: rgba(239, 68, 68, 0.14); color: var(--danger); }

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 900px) {
  .banner-layout,
  .grid-2 {
    grid-template-columns: 1fr;
  }

  .card-preview {
    position: static;
  }
}

@media (max-width: 720px) {
  .app {
    flex-direction: column;
    height: 100dvh;
  }

  /* 侧边栏 → 顶部栏：品牌 + 状态（第一行），导航横滑（第二行） */
  .sidebar {
    width: 100%;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 10px;
    padding: 10px 12px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .brand {
    order: 1;
    padding: 0 6px 0 0;
    border-bottom: none;
  }

  .brand-sub { display: none; }

  .sidebar-footer {
    order: 2;
    margin-left: auto;
    flex-direction: row;
    gap: 8px;
    padding-top: 0;
    border-top: none;
    margin-top: 0;
  }

  .nav {
    order: 3;
    flex: 1 1 100%;
    flex-direction: row;
    margin-top: 0;
    gap: 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .nav-label { display: none; }

  .nav-item {
    padding: 7px 10px;
    white-space: nowrap;
    font-size: 12px;
  }

  .nav-item::before {
    left: 20%;
    right: 20%;
    top: auto;
    bottom: -10px;
    width: auto;
    height: 3px;
  }

  .server-status { display: none; }

  .topbar {
    height: 52px;
    padding: 0 14px;
  }

  .topbar-crumb { display: none; }
  .clock { display: none; }

  .content { padding: 16px; }

  /* 登录页：卡片适配窄屏 */
  .login-card {
    width: calc(100% - 32px);
    max-width: 360px;
    padding: 28px 22px 22px;
  }

  .stat-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
  .stat-card { padding: 12px; }
  .stat-value { font-size: 17px; }

  .table-head,
  .table-row {
    grid-template-columns: 1fr 70px;
  }

  .th-date,
  .td-date,
  .th-status,
  .td-status {
    display: none;
  }

  .th-actions,
  .td-actions {
    grid-column: 2;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .add-announce {
    flex-direction: column;
    align-items: stretch;
  }

  .input-date { width: 100%; }

  .ver-compare {
    flex-direction: column;
  }
}

/* PHP 版视图切换辅助类（React 版用条件渲染，此处补充） */
.hidden { display: none !important; }
