/* ============================================================
   卡密通 · CardPass — 暗色科技风后台样式 (Dark Tech Dashboard)
   ============================================================ */

:root {
  --bg-primary: #080c14;      /* 深空蓝黑 */
  --bg-secondary: #0d1424;    /* 卡片 / 侧栏底色 */
  --bg-tertiary: #111827;      /* 略亮用于对比 */
  --bg-card: rgba(17, 24, 39, 0.8); /* 玻璃卡片底 */
  --border: rgba(255, 255, 255, 0.08);
  --border-bright: rgba(255, 255, 255, 0.15);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #475569;
  --accent-purple: #8b5cf6;
  --accent-blue: #3b82f6;
  --accent-cyan: #06b6d4;
  --accent-green: #10b981;
  --accent-red: #ef4444;
  --accent-orange: #f59e0b;
  --accent-gradient: linear-gradient(135deg, #8b5cf6, #3b82f6);
  --glow-purple: 0 0 20px rgba(139, 92, 246, 0.3);
  --glow-blue: 0 0 20px rgba(59, 130, 246, 0.3);
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.3);
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}

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

html, body {
  height: 100%;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-primary);
}

/* 动态网格渐变背景 (mesh gradient) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(40% 45% at 18% 18%, rgba(139, 92, 246, 0.20), transparent 60%),
    radial-gradient(38% 42% at 82% 26%, rgba(59, 130, 246, 0.18), transparent 60%),
    radial-gradient(45% 45% at 50% 88%, rgba(6, 182, 212, 0.14), transparent 62%),
    var(--bg-primary);
  background-size: 200% 200%, 200% 200%, 200% 200%, 100% 100%;
  animation: meshShift 26s ease-in-out infinite;
}
@keyframes meshShift {
  0%   { background-position: 0%   0%,   100% 0%,   50%  100%, 0 0; }
  50%  { background-position: 28%  42%,  68%  30%,  42%  58%,  0 0; }
  100% { background-position: 0%   0%,   100% 0%,   50%  100%, 0 0; }
}

/* 细腻颗粒质感叠层 (premium grain) */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.04;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea, button { font-family: inherit; font-size: 14px; outline: none; }

/* 统一图标 (Lucide 风格内联 SVG) */
.ic {
  width: 18px;
  height: 18px;
  display: inline-block;
  vertical-align: middle;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.ic-inline { width: 15px; height: 15px; margin-right: 4px; vertical-align: -2px; }

/* ============================================================
   顶部栏 Topbar
   ============================================================ */
.topbar {
  height: 60px;
  background: rgba(13, 20, 36, 0.72);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  display: flex;
  align-items: center;
  padding: 0 22px;
  border-bottom: 1px solid var(--border-bright);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 8px 30px -12px rgba(139, 92, 246, 0.35);
}
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 240px; }
.topbar-left .logo {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--accent-gradient);
  display: flex; align-items: center; justify-content: center;
  color: #fff; box-shadow: var(--glow-purple);
}
.topbar-left .logo .ic { width: 20px; height: 20px; stroke: #fff; }
.topbar-left .logo-title {
  font-size: 18px; font-weight: 800; letter-spacing: 0.5px;
  background: linear-gradient(135deg, #c4b5fd, #93c5fd);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.topbar-left .logo-sub { color: var(--text-muted); font-size: 12px; }
.topbar-center { flex: 1; text-align: center; }
.topbar-right {
  display: flex; align-items: center; gap: 16px;
  font-size: 13px; color: var(--text-secondary);
}
.topbar-link { color: var(--text-secondary); transition: color 0.2s, text-shadow 0.2s; }
.topbar-link:hover { color: var(--accent-cyan); text-shadow: 0 0 10px rgba(6, 182, 212, 0.5); }
.topbar-link.danger { color: #fca5a5; }
.topbar-link.danger:hover { color: var(--accent-red); text-shadow: 0 0 10px rgba(239, 68, 68, 0.5); }
.user-info { display: flex; align-items: center; gap: 6px; color: var(--text-secondary); }
.user-info .ic { width: 16px; height: 16px; color: var(--accent-cyan); }
.badge-plan {
  padding: 3px 12px; border-radius: 999px;
  background: rgba(139, 92, 246, 0.14);
  border: 1px solid rgba(139, 92, 246, 0.35);
  color: #c4b5fd; font-size: 12px; font-weight: 600;
  box-shadow: 0 0 12px -4px rgba(139, 92, 246, 0.5);
}

/* ============================================================
   主体布局 Layout (带网格底纹)
   ============================================================ */
.layout {
  display: flex;
  min-height: calc(100vh - 60px);
  position: relative;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 44px 44px;
}

/* 侧边栏 Sidebar (玻璃暗色) - 固定定位 */
.sidebar {
  position: fixed;
  top: 60px; left: 0; bottom: 0;
  width: 210px;
  background: rgba(13, 20, 36, 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 18px 0;
  z-index: 50;
}
.sidebar-section { padding: 6px 0; }
.sidebar-section + .sidebar-section { border-top: 1px solid var(--border); margin-top: 6px; padding-top: 12px; }
.sidebar-title {
  padding: 6px 22px; color: var(--text-muted); font-size: 11px;
  text-transform: uppercase; letter-spacing: 1.5px; font-weight: 600;
}
.menu-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 22px; color: var(--text-secondary);
  cursor: pointer; transition: all 0.18s ease;
  border-left: 3px solid transparent;
  font-size: 13.5px;
}
.menu-item:hover { background: rgba(255, 255, 255, 0.04); color: var(--text-primary); }
.menu-item.active {
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.18) 0%, transparent 100%);
  color: #c4b5fd; font-weight: 600;
  border-left-color: var(--accent-purple);
  box-shadow: inset 0 0 22px -6px rgba(139, 92, 246, 0.6);
}
.menu-item.active .ic { filter: drop-shadow(0 0 6px rgba(139, 92, 246, 0.85)); color: var(--accent-purple); }
.mi-icon { width: 22px; display: flex; align-items: center; justify-content: center; }
.mi-icon .ic { width: 19px; height: 19px; }
.sidebar-foot {
  margin-top: auto; padding: 14px 22px;
  color: var(--text-muted); font-size: 12px; text-align: center;
  letter-spacing: 0.5px;
}

.content {
  flex: 1;
  margin-left: 210px;  /* 为固定侧边栏留出空间 */
  padding: 18px 26px;
  min-width: 0;
  overflow-y: auto;
  animation: fadeIn 0.4s ease both;
}

/* ============================================================
   应用选择条 App-bar (玻璃卡片)
   ============================================================ */
.app-bar {
  background: var(--bg-card);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 18px;
  box-shadow: var(--shadow-card);
}
.app-bar-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.app-bar-left > span { color: var(--text-secondary); }
.app-select {
  padding: 7px 12px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: rgba(8, 12, 20, 0.6);
  color: var(--text-primary); cursor: pointer; transition: all 0.2s;
}
.app-select:hover { border-color: var(--border-bright); }
.app-select:focus { border-color: var(--accent-purple); box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.18); }
.app-bar-current { color: var(--text-muted); font-size: 13px; margin-left: 14px; }
.app-bar-current b { color: #93c5fd; font-weight: 600; }
.app-bar-right { display: flex; align-items: center; gap: 8px; color: var(--text-secondary); font-size: 13px; }

.switch-pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 14px; border-radius: 999px; font-size: 12px;
  cursor: pointer; user-select: none; transition: all 0.25s ease;
  border: 1px solid transparent;
}
.switch-pill.on {
  background: rgba(16, 185, 129, 0.14); color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.4); box-shadow: 0 0 14px -4px rgba(16, 185, 129, 0.6);
}
.switch-pill.off {
  background: rgba(239, 68, 68, 0.14); color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.4); box-shadow: 0 0 14px -4px rgba(239, 68, 68, 0.6);
}
.switch-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: currentColor; box-shadow: 0 0 8px currentColor;
}

/* ============================================================
   统计卡片 Stat cards
   ============================================================ */
.card-stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 14px; margin-bottom: 18px;
}
.stat-card {
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  box-shadow: var(--shadow-card), 0 0 26px -14px rgba(139, 92, 246, 0.55);
  position: relative; overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  animation: fadeInUp 0.5s ease both;
}
.stat-card::after {
  content: ""; position: absolute; top: -40%; right: -30%;
  width: 160px; height: 160px; border-radius: 50%;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.18), transparent 70%);
  pointer-events: none;
}
.stat-card:hover { transform: translateY(-3px); border-color: var(--border-bright); }
.stat-card:nth-child(1) { animation-delay: 0.02s; }
.stat-card:nth-child(2) { animation-delay: 0.08s; }
.stat-card:nth-child(3) { animation-delay: 0.14s; }
.stat-card:nth-child(4) { animation-delay: 0.20s; }
.stat-label {
  color: var(--text-secondary); font-size: 13px; margin-bottom: 10px;
  display: flex; align-items: center; gap: 7px;
}
.stat-label .ic { width: 16px; height: 16px; color: var(--accent-cyan); }
.stat-value {
  font-size: 30px; font-weight: 800; letter-spacing: -0.5px;
  background: linear-gradient(135deg, #c4b5fd, #93c5fd);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat-value.blue { background: linear-gradient(135deg, #60a5fa, #3b82f6); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat-value.green { background: linear-gradient(135deg, #6ee7b7, #10b981); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat-value.orange { background: linear-gradient(135deg, #fcd34d, #f59e0b); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat-value.red { background: linear-gradient(135deg, #fca5a5, #ef4444); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat-unit { font-size: 14px; color: var(--text-muted); font-weight: 500; -webkit-text-fill-color: var(--text-muted); }
.stat-value-mini { font-size: 18px; }
.stat-actions { margin-top: 8px; font-size: 12px; display: flex; gap: 6px; flex-wrap: wrap; }
.stat-actions .link { color: var(--accent-cyan); cursor: pointer; transition: color 0.2s; }
.stat-actions .link:hover { color: #67e8f9; text-shadow: 0 0 8px rgba(6, 182, 212, 0.5); }
.link-btn {
  display: inline-flex; align-items: center; gap: 5px;
  margin-top: 10px; font-size: 12px;
  color: #c4b5fd; background: none; border: none; padding: 0; cursor: pointer;
  transition: color 0.2s;
}
.link-btn:hover { color: #a78bfa; text-shadow: 0 0 8px rgba(139, 92, 246, 0.5); }
.link-btn .ic { width: 14px; height: 14px; }

/* 按数值颜色类给卡片上对应光晕 */
.stat-card:has(.stat-value.blue) { box-shadow: var(--shadow-card), 0 0 26px -10px rgba(59, 130, 246, 0.55); }
.stat-card:has(.stat-value.green) { box-shadow: var(--shadow-card), 0 0 26px -10px rgba(16, 185, 129, 0.55); }
.stat-card:has(.stat-value.orange) { box-shadow: var(--shadow-card), 0 0 26px -10px rgba(245, 158, 11, 0.55); }
.stat-card:has(.stat-value.red) { box-shadow: var(--shadow-card), 0 0 26px -10px rgba(239, 68, 68, 0.55); }

/* ============================================================
   面板 Panels (玻璃暗色)
   ============================================================ */
.panel {
  background: var(--bg-card);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  box-shadow: var(--shadow-card);
  margin-bottom: 18px;
  animation: fadeInUp 0.5s ease both;
}
/* 各页面面板保留主题色调 (暗色玻璃) */
#page-notice .panel { background: linear-gradient(180deg, rgba(245, 158, 11, 0.07), rgba(17, 24, 39, 0.82)); }
#page-version .panel { background: linear-gradient(180deg, rgba(6, 182, 212, 0.07), rgba(17, 24, 39, 0.82)); }
#page-custom1 .panel { background: linear-gradient(180deg, rgba(16, 185, 129, 0.07), rgba(17, 24, 39, 0.82)); }
#page-custom2 .panel { background: linear-gradient(180deg, rgba(245, 158, 11, 0.06), rgba(17, 24, 39, 0.82)); }
#page-unbind .panel { background: linear-gradient(180deg, rgba(16, 185, 129, 0.07), rgba(17, 24, 39, 0.82)); }

.panel-title {
  font-size: 15px; font-weight: 700; color: var(--text-primary);
  margin-bottom: 14px; display: flex; align-items: center; gap: 9px;
}
.panel-title .ic { width: 19px; height: 19px; color: var(--accent-purple); }
.panel-sub { font-size: 12px; color: var(--text-muted); font-weight: normal; margin-left: auto; }

.notice-box {
  padding: 16px 18px;
  background: rgba(245, 158, 11, 0.06);
  border-left: 3px solid var(--accent-orange);
  border-radius: var(--radius-sm);
  color: #fcd34d; white-space: pre-wrap; line-height: 1.7;
  font-size: 13.5px;
}

/* ============================================================
   按钮 Buttons (6 种变体 + 渐变光晕)
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 15px; border-radius: var(--radius-sm); border: none;
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.2s ease, filter 0.2s ease;
  white-space: nowrap; color: #fff;
}
.btn .ic { width: 15px; height: 15px; stroke: #fff; }
.btn:hover { transform: translateY(-1px) scale(1.03); filter: brightness(1.08); }
.btn:active { transform: translateY(0) scale(0.99); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; filter: none; }

.btn-purple { background: var(--accent-gradient); box-shadow: 0 4px 14px -4px rgba(139, 92, 246, 0.6); }
.btn-purple:hover { box-shadow: var(--glow-purple), 0 6px 18px -4px rgba(139, 92, 246, 0.7); }

.btn-green { background: linear-gradient(135deg, #10b981, #059669); box-shadow: 0 4px 14px -4px rgba(16, 185, 129, 0.6); }
.btn-green:hover { box-shadow: 0 0 20px rgba(16, 185, 129, 0.45), 0 6px 18px -4px rgba(16, 185, 129, 0.7); }

.btn-red { background: linear-gradient(135deg, #f87171, #dc2626); box-shadow: 0 4px 14px -4px rgba(239, 68, 68, 0.6); }
.btn-red:hover { box-shadow: 0 0 20px rgba(239, 68, 68, 0.45), 0 6px 18px -4px rgba(239, 68, 68, 0.7); }

.btn-orange { background: linear-gradient(135deg, #fbbf24, #d97706); box-shadow: 0 4px 14px -4px rgba(245, 158, 11, 0.6); }
.btn-orange:hover { box-shadow: 0 0 20px rgba(245, 158, 11, 0.45), 0 6px 18px -4px rgba(245, 158, 11, 0.7); }

.btn-blue { background: linear-gradient(135deg, #60a5fa, #2563eb); box-shadow: 0 4px 14px -4px rgba(59, 130, 246, 0.6); }
.btn-blue:hover { box-shadow: var(--glow-blue), 0 6px 18px -4px rgba(59, 130, 246, 0.7); }

.btn-grey {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  box-shadow: none;
}
.btn-grey .ic { stroke: var(--text-secondary); }
.btn-grey:hover { background: rgba(255, 255, 255, 0.12); color: var(--text-primary); border-color: var(--border-bright); filter: none; }

/* ============================================================
   控件行 Control rows
   ============================================================ */
.ctrl-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 9px;
  padding: 9px 0;
}
.ctrl-row + .ctrl-row { border-top: 1px solid var(--border); }
.ctrl-label { color: var(--text-secondary); font-size: 13px; }
.ctrl-state { color: var(--text-muted); font-size: 13px; display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ctrl-warn { color: var(--accent-orange); font-size: 12px; margin-left: 4px; display: inline-flex; align-items: center; }
.ctrl-warn .ic { color: var(--accent-orange); }
.ctrl-hint { color: var(--text-muted); font-size: 12px; margin-left: 4px; max-width: 720px; line-height: 1.6; }

/* 徽标 / 标签 Badges & Tags (胶囊形 + 光晕) */
.badge-ok, .badge-off, .badge-grey {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 11px; border-radius: 999px; font-size: 12px; font-weight: 600;
}
.badge-ok {
  background: rgba(16, 185, 129, 0.14); color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.35); box-shadow: 0 0 12px -4px rgba(16, 185, 129, 0.6);
}
.badge-off {
  background: rgba(239, 68, 68, 0.14); color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.35); box-shadow: 0 0 12px -4px rgba(239, 68, 68, 0.6);
}
.badge-grey {
  background: rgba(255, 255, 255, 0.06); color: var(--text-secondary);
  border: 1px solid var(--border);
}

/* ============================================================
   快捷入口 / 生成 / 批量 / 语言芯片
   ============================================================ */
.gen-row, .quick-row {
  display: flex; flex-wrap: wrap; gap: 9px; align-items: center;
}
.gen-label { color: var(--text-secondary); font-size: 13px; }

.lang-chips { display: flex; flex-wrap: wrap; gap: 9px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 15px; border-radius: 999px;
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.25);
  color: #c4b5fd; font-size: 13px; cursor: pointer; transition: all 0.2s ease;
}
.chip .ic { width: 15px; height: 15px; }
.chip:hover {
  background: var(--accent-gradient); color: #fff; border-color: transparent;
  transform: translateY(-1px); box-shadow: var(--glow-purple);
}
.chip:hover .ic { stroke: #fff; }

/* ============================================================
   表格 Tables
   ============================================================ */
.card-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.card-table thead {
  background: rgba(255, 255, 255, 0.03); color: var(--text-secondary); font-weight: 600;
}
.card-table th, .card-table td {
  padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border);
}
.card-table tbody tr { transition: background 0.18s ease; }
.card-table tbody tr:hover { background: rgba(139, 92, 246, 0.1); }
.card-table tbody tr:hover td:first-child { box-shadow: inset 3px 0 0 var(--accent-purple); }
.card-table .empty { text-align: center; color: var(--text-muted); padding: 44px; }
.row-check, #checkAll {
  accent-color: var(--accent-purple);
  width: 15px;
  height: 15px;
  cursor: pointer;
  vertical-align: middle;
}
.code-cell {
  font-family: "Consolas", "Monaco", monospace; color: #c4b5fd;
  font-weight: 600; letter-spacing: 0.3px;
}
.tag {
  display: inline-block; padding: 3px 9px; border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 600;
}
.tag-unused { background: rgba(99, 102, 241, 0.16); color: #a5b4fc; }
.tag-active { background: rgba(16, 185, 129, 0.16); color: #6ee7b7; }
.tag-expired { background: rgba(239, 68, 68, 0.16); color: #fca5a5; }
.tag-disabled { background: rgba(255, 255, 255, 0.06); color: var(--text-muted); }
.action-link { color: #93c5fd; cursor: pointer; margin-right: 10px; font-size: 12.5px; transition: color 0.2s; }
.action-link:hover { color: #c4b5fd; text-shadow: 0 0 8px rgba(139, 92, 246, 0.5); text-decoration: none; }
.action-link.danger { color: #fca5a5; }
.action-link.danger:hover { color: var(--accent-red); text-shadow: 0 0 8px rgba(239, 68, 68, 0.5); }

.link { color: var(--accent-cyan); cursor: pointer; transition: color 0.2s; }
.link:hover { color: #67e8f9; text-shadow: 0 0 8px rgba(6, 182, 212, 0.5); }

/* 搜索框 */
.search-input {
  padding: 8px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: rgba(8, 12, 20, 0.6); color: var(--text-primary); min-width: 240px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search-input::placeholder { color: var(--text-muted); }
.search-input:focus { border-color: var(--accent-purple); box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.18); }

/* ============================================================
   表单 Forms
   ============================================================ */
.big-textarea {
  width: 100%; min-height: 130px; padding: 13px;
  border: 1px solid var(--border); border-radius: var(--radius-md);
  background: rgba(8, 12, 20, 0.6); color: var(--text-primary);
  resize: vertical; margin-bottom: 14px; font-family: inherit; line-height: 1.6;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.big-textarea::placeholder { color: var(--text-muted); }
.big-textarea:focus { border-color: var(--accent-purple); box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.18); }

.text-input {
  padding: 9px 13px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: rgba(8, 12, 20, 0.6); color: var(--text-primary);
  min-width: 200px; transition: border-color 0.2s, box-shadow 0.2s;
}
.text-input::placeholder { color: var(--text-muted); }
.text-input:focus { border-color: var(--accent-purple); box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.18); }

select.text-input { cursor: pointer; }

.inline-row {
  display: flex; align-items: center; gap: 13px;
  margin: 14px 0; flex-wrap: wrap;
}
.inline-row span { color: var(--text-secondary); font-size: 13px; }
.hint { color: var(--text-muted); font-size: 13px; margin: 10px 0; line-height: 1.6; }
.hint.warn { color: var(--accent-orange); display: flex; align-items: flex-start; gap: 6px; }
.hint.warn .ic { width: 16px; height: 16px; margin-top: 2px; flex-shrink: 0; color: var(--accent-orange); }
.api-box {
  margin-top: 18px; padding: 15px 18px;
  background: rgba(8, 12, 20, 0.55); border-radius: var(--radius-md);
  border-left: 3px solid var(--accent-purple);
}
.api-title { font-size: 13px; color: var(--text-secondary); margin-bottom: 8px; }
.api-box code {
  display: block; font-family: "Consolas", "Monaco", monospace; font-size: 12px;
  color: #c4b5fd; word-break: break-all; line-height: 1.6;
}

/* ============================================================
   日志列表 Logs
   ============================================================ */
.log-list { display: flex; flex-direction: column; gap: 4px; }
.log-item {
  font-size: 13px; color: var(--text-secondary); padding: 7px 0;
  display: flex; align-items: center; gap: 9px;
  border-bottom: 1px solid var(--border);
}
.log-item:last-child { border-bottom: none; }
.log-item .log-icon { color: var(--accent-green); }
.log-item .log-icon .ic { width: 16px; height: 16px; }
.log-empty { color: var(--text-muted); padding: 22px; text-align: center; }

/* ============================================================
   弹窗 Modal (玻璃模糊 + 居中发亮)
   ============================================================ */
.modal-bg {
  position: fixed; inset: 0;
  background: rgba(4, 7, 13, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease both;
}
.modal {
  width: 460px; max-width: 90vw; max-height: 90vh;
  background: rgba(17, 24, 39, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-lg); overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.8), var(--glow-purple);
  animation: modalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes modalPop {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-title {
  padding: 17px 22px; font-size: 15px; font-weight: 700;
  border-bottom: 1px solid var(--border); color: var(--text-primary);
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.12), transparent);
}
.modal-body { padding: 22px; overflow-y: auto; flex: 1; color: var(--text-secondary); line-height: 1.7; }
.modal-body p { margin-bottom: 9px; line-height: 1.7; }
.modal-body label { display: block; font-size: 13px; color: var(--text-secondary); margin: 12px 0 5px; }
.modal-body input, .modal-body select, .modal-body textarea {
  width: 100%; padding: 9px 13px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 14px;
  background: rgba(8, 12, 20, 0.6); color: var(--text-primary);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.modal-body input:focus, .modal-body select:focus, .modal-body textarea:focus {
  border-color: var(--accent-purple); box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.18);
}
.modal-foot {
  padding: 13px 22px; border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 9px;
}

/* ============================================================
   Toast 浮动通知
   ============================================================ */
.toast {
  position: fixed; top: 84px; left: 50%; transform: translateX(-50%);
  padding: 11px 22px; border-radius: 999px; font-size: 14px; font-weight: 500;
  z-index: 2000; color: #fff;
  background: rgba(17, 24, 39, 0.95);
  border: 1px solid var(--border-bright);
  box-shadow: 0 10px 30px -8px rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: toastIn 0.28s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.toast.ok { background: linear-gradient(135deg, rgba(16, 185, 129, 0.95), rgba(5, 150, 105, 0.95)); border-color: rgba(16, 185, 129, 0.5); box-shadow: 0 0 24px -4px rgba(16, 185, 129, 0.6); }
.toast.err { background: linear-gradient(135deg, rgba(239, 68, 68, 0.95), rgba(220, 38, 38, 0.95)); border-color: rgba(239, 68, 68, 0.5); box-shadow: 0 0 24px -4px rgba(239, 68, 68, 0.6); }
.toast.warn { background: linear-gradient(135deg, rgba(245, 158, 11, 0.95), rgba(217, 119, 6, 0.95)); border-color: rgba(245, 158, 11, 0.5); box-shadow: 0 0 24px -4px rgba(245, 158, 11, 0.6); }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-18px) scale(0.95); }
  to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

/* ============================================================
   页面区块淡入 / 加载动画
   ============================================================ */
.page { animation: fadeIn 0.45s ease both; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.spinner {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--accent-purple);
  display: inline-block;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 900px) {
  .card-stats { grid-template-columns: repeat(2, 1fr); }
  .sidebar { width: 64px; }
  .menu-item span:not(.mi-icon) { display: none; }
  .sidebar-title, .sidebar-foot { display: none; }
  .topbar-left .logo-title, .topbar-left .logo-sub { display: none; }
}

/* ============================================================
   数据备份页面
   ============================================================ */
.backup-meta {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.backup-meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  min-width: 160px;
}
.backup-meta-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.backup-meta-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--accent-purple);
  font-variant-numeric: tabular-nums;
}

/* 恢复上传区 */
.backup-restore-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, background 0.2s;
  background: rgba(255, 255, 255, 0.01);
}
.backup-restore-zone.drag-over {
  border-color: var(--accent-purple);
  background: rgba(139, 92, 246, 0.07);
}

/* 恢复预览 */
.restore-preview {
  margin-top: 14px;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 13px;
}
.restore-preview-title {
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.restore-preview-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: var(--text-secondary);
}
.restore-preview-row:last-child { border-bottom: none; }
.restore-preview-row span:last-child { color: var(--text-primary); font-weight: 500; }

/* 代码块 */
.code-block {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-top: 10px;
  overflow-x: auto;
}
.code-block code {
  font-family: 'JetBrains Mono', 'Cascadia Code', 'Fira Code', Consolas, monospace;
  font-size: 13px;
  color: #10b981;
  white-space: pre;
}

/* 备份/恢复页 btn overrides */
#btnBackup { font-size: 15px !important; padding: 11px 28px !important; }
#btnRestore { font-size: 15px !important; padding: 11px 28px !important; }

/* ============================================================
   表格筛选排序工具栏
   ============================================================ */
.table-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  background: rgba(13, 20, 36, 0.4);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
}
.filter-group label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}
.filter-select {
  background: rgba(17, 24, 39, 0.8);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
}
.filter-select:hover, .filter-select:focus {
  border-color: var(--accent-purple);
}
.btn-sort {
  background: rgba(17, 24, 39, 0.8);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-sort:hover {
  border-color: var(--accent-purple);
  color: var(--accent-purple);
}
.btn-sort .ic {
  width: 16px;
  height: 16px;
}
.btn-sm {
  padding: 6px 12px !important;
  font-size: 12px !important;
}

/* hint 中的 code */
.hint code {
  background: rgba(255,255,255,0.07);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 12px;
  font-family: 'JetBrains Mono', Consolas, monospace;
  color: #10b981;
}

/* ============================================================
   教程页面
   ============================================================ */
.tutorial-header {
  background: linear-gradient(135deg, #0d1424 0%, #1a1040 50%, #0d1424 100%);
  border-bottom: 1px solid var(--border);
  padding: 28px 32px 22px;
  margin: -24px -24px 0;
  position: relative;
  overflow: hidden;
}
.tutorial-header::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(139,92,246,0.18) 0%, transparent 70%);
  pointer-events: none;
}
.tutorial-header::after {
  content: '';
  position: absolute;
  bottom: -80px; left: 20%;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(59,130,246,0.12) 0%, transparent 70%);
  pointer-events: none;
}
.tutorial-header-inner {
  position: relative;
  z-index: 1;
}
.tutorial-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0 0 6px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.tutorial-title .ic {
  color: var(--accent-purple);
  width: 26px; height: 26px;
}
.tutorial-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

/* 章节导航 */
.tutorial-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
}
.tut-nav-btn {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}
.tut-nav-btn:hover {
  border-color: var(--accent-purple);
  color: var(--accent-purple);
  background: rgba(139,92,246,0.08);
}
.tut-nav-btn.active {
  background: rgba(139,92,246,0.15);
  border-color: var(--accent-purple);
  color: var(--accent-purple);
  box-shadow: 0 0 12px -4px rgba(139,92,246,0.4);
}

/* 教程内容区 */
.tutorial-content {
  padding: 24px 4px;
  min-height: 400px;
}
.tut-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--text-muted);
  padding: 60px 0;
  font-size: 14px;
}

/* Markdown 渲染 */
.tut-body {
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-secondary);
  max-width: 860px;
}
.tut-body h1 {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0 0 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.tut-body h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--accent-purple);
  margin: 28px 0 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.tut-body h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 20px 0 8px;
}
.tut-body p {
  margin: 8px 0;
}
.tut-body ul, .tut-body ol {
  margin: 8px 0;
  padding-left: 22px;
}
.tut-body li {
  margin: 4px 0;
}
.tut-body code {
  background: rgba(255,255,255,0.07);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12.5px;
  font-family: 'JetBrains Mono', Consolas, monospace;
  color: #10b981;
}
.tut-body pre {
  background: rgba(0,0,0,0.45);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  overflow-x: auto;
  margin: 12px 0;
}
.tut-body pre code {
  background: none;
  padding: 0;
  color: #93c5fd;
  font-size: 12.5px;
  line-height: 1.65;
}
.tut-body blockquote {
  border-left: 3px solid var(--accent-purple);
  margin: 12px 0;
  padding: 8px 14px;
  background: rgba(139,92,246,0.06);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-secondary);
}
.tut-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 13px;
}
.tut-body th {
  background: rgba(139,92,246,0.1);
  padding: 8px 12px;
  text-align: left;
  font-weight: 600;
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.tut-body td {
  padding: 7px 12px;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}
.tut-body tr:hover td {
  background: rgba(255,255,255,0.02);
}
.tut-body a {
  color: #818cf8;
  text-decoration: none;
}
.tut-body a:hover {
  color: #a5b4fc;
  text-decoration: underline;
}
.tut-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 20px 0;
}
.tut-body img {
  max-width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

/* 章节导航按钮 */
.tutorial-footer-nav {
  display: flex;
  justify-content: space-between;
  padding: 16px 0;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}

/* 顶部栏教程按钮 */
.topbar-btn {
  background: rgba(139,92,246,0.12);
  border: 1px solid rgba(139,92,246,0.35);
  border-radius: var(--radius-sm);
  padding: 5px 13px;
  font-size: 12.5px;
  font-weight: 600;
  color: #a78bfa;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s;
  margin-left: 8px;
}
.topbar-btn:hover {
  background: rgba(139,92,246,0.22);
  border-color: rgba(139,92,246,0.6);
  color: #c4b5fd;
  box-shadow: 0 0 14px -4px rgba(139,92,246,0.5);
}
.topbar-btn .ic {
  width: 14px; height: 14px;
}

/* ---------- 分页条（卡密列表） ---------- */
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.pager-info {
  font-size: 13px;
  color: var(--text-secondary);
}
.pager-btns {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.pager-page {
  min-width: 66px;
  text-align: center;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
}
.pager-size {
  width: auto;
  min-width: 96px;
}
@media (max-width: 900px) {
  .pager { flex-direction: column; align-items: stretch; }
  .pager-btns { justify-content: center; }
}
