/* ============ CSS Variables ============ */
:root {
  --bili-pink: #FB7299;
  --bili-pink-hover: #FC8BAB;
  --bili-pink-light: #FFF1F5;
  --bili-pink-dark: #E35D82;
  --bili-blue: #00A1D6;
  --bili-blue-hover: #00B5E5;
  --bili-blue-light: #E3F6FD;
  --bili-blue-dark: #0088B9;
  --bili-green: #00C091;
  --bili-green-light: #E8FAF0;
  --bili-orange: #FF6633;
  --bili-orange-light: #FFF3E0;
  --bili-bg: #F4F5F7;
  --card-bg: #FFFFFF;
  --text-primary: #18191C;
  --text-secondary: #61666D;
  --text-muted: #9499A0;
  --border: #E3E5E7;
  --sidebar-w: 220px;
  --topbar-h: 64px;
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 16px;
  --shadow: 0 1px 4px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.08);
  --shadow-card: 0 2px 8px rgba(0,0,0,0.04), 0 0 1px rgba(0,0,0,0.06);
  --transition: 0.2s ease;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  background: var(--bili-bg);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; }
a { color: var(--bili-blue); text-decoration: none; }
a:hover { color: var(--bili-blue-hover); }

/* ============ Animations ============ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.4} }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes floatBubble {
  0%,100% { transform: translateY(0) scale(1); opacity: 0.5; }
  50% { transform: translateY(-30px) scale(1.1); opacity: 0.8; }
}
@keyframes toastIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes toastOut {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(100%); opacity: 0; }
}

/* ============ Auth Page ============ */
#auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #E8F4FD 0%, #F0F2F5 40%, #FDECF0 70%, #F5E6FF 100%);
  position: relative;
  overflow: hidden;
}
#auth-panel::before, #auth-panel::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  animation: floatBubble 8s ease-in-out infinite;
  background: linear-gradient(135deg, rgba(0,161,214,0.08), rgba(251,114,153,0.08));
}
#auth-panel::before {
  width: 400px; height: 400px; top: -100px; right: -80px;
  animation-delay: 0s;
}
#auth-panel::after {
  width: 300px; height: 300px; bottom: -60px; left: -60px;
  animation-delay: -4s;
}
.auth-card {
  width: 420px;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.6);
  border-radius: 20px;
  padding: 44px 40px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.06);
  position: relative;
  z-index: 1;
  animation: fadeInUp 0.5s ease;
}
.auth-logo { text-align: center; margin-bottom: 32px; }
.logo-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px; height: 64px;
  border-radius: 18px;
  margin-bottom: 14px;
  font-size: 24px;
  font-weight: 800;
  color: white;
  background: linear-gradient(135deg, var(--bili-pink), #FF9AB5);
  box-shadow: 0 6px 20px rgba(251,114,153,0.3);
}
.auth-logo h1 {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}
.auth-desc {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 6px;
}
.auth-tabs {
  display: flex;
  background: var(--bili-bg);
  border-radius: var(--radius);
  padding: 4px;
  margin-bottom: 28px;
}
.auth-tabs .tab {
  flex: 1;
  padding: 10px;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  transition: all var(--transition);
}
.auth-tabs .tab.active {
  background: white;
  color: var(--bili-pink);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.input-group { margin-bottom: 18px; }
.input-group label {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-weight: 500;
}
.input-group input, .input-group textarea, .input-group select {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  outline: none;
  transition: all var(--transition);
  background: white;
  color: var(--text-primary);
}
.input-group input:focus, .input-group textarea:focus, .input-group select:focus {
  border-color: var(--bili-pink);
  box-shadow: 0 0 0 3px rgba(251,114,153,0.1);
}
.input-group input::placeholder { color: #C9CCD0; }
.error-msg { color: var(--bili-pink); font-size: 13px; margin-top: 12px; text-align: center; min-height: 20px; }

/* ============ Buttons ============ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 28px;
  background: linear-gradient(135deg, var(--bili-pink), var(--bili-pink-hover));
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  width: 100%;
  box-shadow: 0 2px 8px rgba(251,114,153,0.2);
}
.btn-primary:hover { box-shadow: 0 4px 16px rgba(251,114,153,0.3); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0) scale(0.98); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-primary.btn-blue {
  background: linear-gradient(135deg, var(--bili-blue), var(--bili-blue-hover));
  box-shadow: 0 2px 8px rgba(0,161,214,0.2);
}
.btn-primary.btn-blue:hover { box-shadow: 0 4px 16px rgba(0,161,214,0.3); }
.btn-sm { padding: 7px 18px; font-size: 13px; width: auto; border-radius: var(--radius-sm); }
.btn-lg { padding: 14px 36px; font-size: 15px; width: auto; }
.btn-text {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}
.btn-text:hover { color: var(--bili-pink); background: var(--bili-pink-light); }
.btn-danger-sm {
  padding: 5px 12px;
  font-size: 12px;
  background: transparent;
  color: var(--bili-pink);
  border: 1px solid var(--bili-pink);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}
.btn-danger-sm:hover { background: var(--bili-pink); color: white; }
.btn-ghost-sm {
  padding: 5px 12px;
  font-size: 12px;
  background: transparent;
  color: var(--bili-blue);
  border: 1px solid var(--bili-blue);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}
.btn-ghost-sm:hover { background: var(--bili-blue); color: white; }
.btn-success-sm {
  padding: 5px 12px;
  font-size: 12px;
  background: transparent;
  color: var(--bili-green);
  border: 1px solid var(--bili-green);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}
.btn-success-sm:hover { background: var(--bili-green); color: white; }

/* ============ Topbar ============ */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  z-index: 100;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.logo-small {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--bili-pink), #FF9AB5);
  color: white;
  font-weight: 800;
  font-size: 15px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(251,114,153,0.2);
}
.brand {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}
.topbar-right { display: flex; align-items: center; gap: 12px; }
.header-user {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}
.header-user::before {
  content: "";
  display: inline-block;
  width: 28px; height: 28px;
  background: linear-gradient(135deg, var(--bili-blue-light), var(--bili-pink-light));
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: var(--shadow);
}
.header-balance {
  font-size: 13px;
  color: var(--bili-pink);
  background: var(--bili-pink-light);
  padding: 5px 14px;
  border-radius: 20px;
  font-weight: 600;
}

/* ============ Layout ============ */
.layout {
  display: flex;
  margin-top: var(--topbar-h);
  min-height: calc(100vh - var(--topbar-h));
}

/* ============ Sidebar ============ */
.sidebar {
  width: var(--sidebar-w);
  background: var(--card-bg);
  border-right: 1px solid var(--border);
  padding: 20px 0;
  position: fixed;
  top: var(--topbar-h);
  bottom: 0;
  left: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.sidebar-section { padding: 0 12px; margin-bottom: 6px; }
.sidebar-title {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  padding: 12px 14px 6px;
  font-weight: 600;
}
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  border: none;
  background: transparent;
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--text-secondary);
  transition: all 0.15s;
  text-align: left;
  position: relative;
}
.sidebar-item:hover { background: var(--bili-bg); color: var(--text-primary); }
.sidebar-item.active {
  background: var(--bili-pink-light);
  color: var(--bili-pink);
  font-weight: 600;
}
.sidebar-item.active::before {
  content: "";
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 20px;
  background: var(--bili-pink);
  border-radius: 0 3px 3px 0;
}
.sidebar-item svg { flex-shrink: 0; }
.sidebar-item.danger { color: var(--bili-pink); }
.sidebar-item.danger:hover { background: var(--bili-pink-light); }
.sidebar-bottom { margin-top: auto; padding: 12px; }
.admin-only { display: none; }
.is-admin .admin-only { display: block; }

/* ============ Content ============ */
.content {
  flex: 1;
  margin-left: var(--sidebar-w);
  padding: 32px 36px;
  min-height: calc(100vh - var(--topbar-h));
  max-width: 1200px;
}
.page { display: none; }
.page.active { display: block; animation: fadeInUp 0.3s ease; }
.page-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 24px;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}
.page-desc {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 20px;
  margin-top: -16px;
}

/* ============ Stat Cards ============ */
.stat-cards { display: flex; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.stat-card {
  flex: 1;
  min-width: 180px;
  padding: 24px;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-card::after {
  content: "";
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.stat-card.blue::after { background: linear-gradient(90deg, var(--bili-blue), var(--bili-blue-hover)); }
.stat-card.cyan::after { background: linear-gradient(90deg, #00B5E5, #00D4FF); }
.stat-card.green::after { background: linear-gradient(90deg, var(--bili-green), #26D9A8); }
.stat-card.pink::after { background: linear-gradient(90deg, var(--bili-pink), var(--bili-pink-hover)); }
.stat-value { font-size: 30px; font-weight: 800; color: var(--text-primary); letter-spacing: -0.5px; }
.stat-label { font-size: 13px; color: var(--text-muted); margin-top: 6px; font-weight: 500; }
.stat-icon {
  position: absolute;
  top: 20px; right: 20px;
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  opacity: 0.9;
}
.stat-card.blue .stat-icon { background: var(--bili-blue-light); }
.stat-card.green .stat-icon { background: var(--bili-green-light); }
.stat-card.pink .stat-icon { background: var(--bili-pink-light); }
.stat-card.cyan .stat-icon { background: #E0F7FA; }

.quick-tip {
  padding: 18px 22px;
  background: linear-gradient(135deg, var(--bili-blue-light), #F0F9FF);
  border-left: 4px solid var(--bili-blue);
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.8;
}
.quick-tip strong { color: var(--bili-blue); }

/* ============ Toolbar ============ */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.toolbar-group { display: flex; gap: 8px; align-items: center; }
.input-sm {
  padding: 7px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  width: 130px;
  outline: none;
  transition: all var(--transition);
}
.input-sm:focus { border-color: var(--bili-pink); box-shadow: 0 0 0 3px rgba(251,114,153,0.1); }

/* ============ Tables ============ */
.table-wrap {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  text-align: left;
  padding: 14px 18px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  background: #FAFBFC;
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.data-table td {
  padding: 14px 18px;
  font-size: 13px;
  color: var(--text-primary);
  border-bottom: 1px solid #F5F5F5;
  transition: background var(--transition);
}
.data-table tbody tr:hover td { background: #FAFBFC; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table .actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ============ Form Cards ============ */
.form-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-card);
  margin-bottom: 20px;
}
.form-card h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 18px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 22px;
}
.form-grid .input-group:last-child { grid-column: span 2; }
.form-hint {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}
.form-hint code {
  background: var(--bili-bg);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  color: var(--bili-blue-dark);
  font-family: "Cascadia Code", "Consolas", monospace;
}

/* ============ Tags / Badges ============ */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}
.tag-green { background: #E8FAF0; color: #00875A; }
.tag-red { background: #FDE8EF; color: #C4264F; }
.tag-gray { background: #F4F5F7; color: #9499A0; }
.tag-muted { background: #F4F5F7; color: #B0B0B0; }
.tag-blue { background: #E3F6FD; color: #0088B9; }
.tag-orange { background: #FFF3E0; color: #E65100; }
.tag-pink { background: var(--bili-pink-light); color: var(--bili-pink); }

/* ============ Quiz Page ============ */
.quiz-info { margin-bottom: 16px; color: var(--text-secondary); }
.quiz-info strong { color: var(--bili-pink); }
.quiz-accounts-list {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 8px;
  box-shadow: var(--shadow-card);
  max-height: 340px;
  overflow-y: auto;
  margin-bottom: 16px;
}
.quiz-account-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius);
  transition: background 0.15s;
}
.quiz-account-item:hover { background: var(--bili-bg); }
.quiz-account-item input[type="checkbox"] {
  width: 18px; height: 18px;
  accent-color: var(--bili-pink);
  cursor: pointer;
}
.quiz-account-item label { font-size: 14px; cursor: pointer; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.quiz-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}
.select-all-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
}

/* ============ Progress Panel ============ */
.progress-header {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  box-shadow: var(--shadow-card);
  margin-bottom: 16px;
}
.progress-status-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 500;
}
.progress-bar-wrap {
  height: 10px;
  background: var(--bili-bg);
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 18px;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--bili-pink), #FF9AB5);
  border-radius: 5px;
  transition: width 0.5s ease;
  position: relative;
}
.progress-bar::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: shimmer 2s infinite;
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.progress-stats { display: flex; gap: 32px; }
.pstat { display: flex; flex-direction: column; align-items: center; }
.pstat-val { font-size: 24px; font-weight: 800; color: var(--text-primary); }
.pstat-ok .pstat-val { color: var(--bili-green); }
.pstat-err .pstat-val { color: var(--bili-pink); }
.pstat-label { font-size: 12px; color: var(--text-muted); margin-top: 2px; font-weight: 500; }
.progress-accounts {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  box-shadow: var(--shadow-card);
  margin-bottom: 16px;
}
.pac-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 14px;
}
.pac-item:not(:last-child) { border-bottom: 1px solid #F5F5F5; }
.pac-icon {
  width: 26px; height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
}
.pac-icon.pending { background: var(--bili-bg); color: var(--text-muted); }
.pac-icon.running { background: var(--bili-pink-light); color: var(--bili-pink); animation: pulse 1.2s infinite; }
.pac-icon.success { background: var(--bili-green-light); color: #00875A; }
.pac-icon.fail { background: #FDE8EF; color: #C4264F; }
.pac-name { flex: 1; font-weight: 500; }
.pac-msg { font-size: 12px; color: var(--text-muted); max-width: 300px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.progress-log-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  box-shadow: var(--shadow-card);
}
.progress-log-card h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 12px;
}
.progress-logs {
  background: #1B1B2F;
  color: #CDD6F4;
  border-radius: var(--radius);
  padding: 16px 20px;
  font-family: "Cascadia Code", "Consolas", "Courier New", monospace;
  font-size: 12px;
  line-height: 1.9;
  max-height: 280px;
  overflow-y: auto;
}
.progress-logs .log-ok { color: #A6E3A1; }
.progress-logs .log-fail { color: #F38BA8; }
.progress-logs .log-info { color: #89B4FA; }

/* ============ Services Page ============ */
.svc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}
.svc-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 22px 14px;
  background: white;
  border-radius: var(--radius-lg);
  border: 2px solid var(--border);
  cursor: pointer;
  transition: all var(--transition);
}
.svc-card:hover {
  border-color: var(--bili-pink);
  background: var(--bili-pink-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.svc-card.active {
  border-color: var(--bili-pink);
  background: var(--bili-pink-light);
  box-shadow: 0 0 0 3px rgba(251,114,153,0.15);
}
.svc-icon { font-size: 32px; margin-bottom: 10px; }
.svc-name { font-size: 14px; font-weight: 600; color: var(--text-primary); margin-bottom: 4px; }
.svc-price { font-size: 13px; color: var(--bili-pink); font-weight: 600; }

/* ============ Modal ============ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.15s ease;
}
.modal-overlay.hidden { display: none; }
.modal {
  background: white;
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 440px;
  max-width: 90vw;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
  animation: fadeInUp 0.25s ease;
}
.modal h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text-primary);
}
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}
.modal-footer .btn-primary { width: auto; }
.btn-cancel {
  padding: 9px 20px;
  background: var(--bili-bg);
  color: var(--text-secondary);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-cancel:hover { background: var(--border); }

/* ============ Global Custom Dialog ============ */
#g-dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.15s ease;
}
#g-dialog-overlay.hidden { display: none; }
.g-dialog {
  background: white;
  border-radius: var(--radius-lg);
  width: 520px;
  max-width: 92vw;
  max-height: 80vh;
  box-shadow: 0 24px 80px rgba(0,0,0,0.18);
  animation: fadeInUp 0.25s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.g-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
}
.g-dialog-header h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.g-dialog-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--bili-bg);
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  flex-shrink: 0;
}
.g-dialog-close:hover { background: var(--border); color: var(--text-primary); }
.g-dialog-body {
  padding: 20px 24px;
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
}
.g-dialog-body .detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #f5f5f5;
}
.g-dialog-body .detail-label { color: var(--text-muted); font-size: 13px; }
.g-dialog-body .detail-value { font-weight: 600; color: var(--text-primary); }
.g-dialog-body .detail-value.pink { color: var(--bili-pink); }
.g-dialog-body .detail-value.green { color: #10b981; }
.g-dialog-body .detail-value.red { color: #ef4444; }
.g-dialog-body .exec-list {
  margin-top: 12px;
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.g-dialog-body .exec-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  font-size: 13px;
  border-bottom: 1px solid #f9f9f9;
}
.g-dialog-body .exec-item:last-child { border-bottom: none; }
.g-dialog-body .exec-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
  font-weight: 700;
}
.g-dialog-body .exec-icon.ok { background: #d1fae5; color: #059669; }
.g-dialog-body .exec-icon.fail { background: #fee2e2; color: #dc2626; }
.g-dialog-body .exec-msg { flex: 1; color: var(--text-secondary); word-break: break-all; }
.g-dialog-body .exec-time { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.g-dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
}
.g-dialog-footer .btn-confirm {
  padding: 9px 28px;
  background: var(--bili-pink);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}
.g-dialog-footer .btn-confirm:hover { background: var(--bili-pink-hover); }
.g-dialog-footer .btn-dialog-cancel {
  padding: 9px 28px;
  background: var(--bili-bg);
  color: var(--text-secondary);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}
.g-dialog-footer .btn-dialog-cancel:hover { background: var(--border); }
.status-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.status-badge.completed { background: #d1fae5; color: #059669; }
.status-badge.running { background: #dbeafe; color: #2563eb; }
.status-badge.pending { background: #fef3c7; color: #d97706; }
.status-badge.failed { background: #fee2e2; color: #dc2626; }

/* ============ Toast Notifications ============ */
.toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  padding: 14px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 280px;
  max-width: 400px;
  animation: toastIn 0.3s ease;
}
.toast.toast-out { animation: toastOut 0.3s ease forwards; }
.toast-success { background: #E8FAF0; color: #00875A; border-left: 4px solid var(--bili-green); }
.toast-error { background: #FDE8EF; color: #C4264F; border-left: 4px solid var(--bili-pink); }
.toast-info { background: #E3F6FD; color: #0088B9; border-left: 4px solid var(--bili-blue); }
.toast-warning { background: var(--bili-orange-light); color: #E65100; border-left: 4px solid var(--bili-orange); }

/* ============ Price Management (Admin) ============ */
.price-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.price-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border);
  transition: all var(--transition);
}
.price-card:hover { box-shadow: var(--shadow-md); }
.price-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.price-card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}
.price-card-title .icon { font-size: 22px; }
.price-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.price-input-row label { font-size: 13px; color: var(--text-muted); min-width: 50px; }
.price-input-row input {
  flex: 1;
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  color: var(--bili-pink);
  outline: none;
  transition: all var(--transition);
}
.price-input-row input:focus { border-color: var(--bili-pink); box-shadow: 0 0 0 3px rgba(251,114,153,0.1); }
.switch {
  position: relative;
  width: 44px; height: 24px;
  background: #CCC;
  border-radius: 12px;
  cursor: pointer;
  transition: background var(--transition);
}
.switch.on { background: var(--bili-green); }
.switch::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 20px; height: 20px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: transform var(--transition);
}
.switch.on::after { transform: translateX(20px); }

/* ============ Empty State ============ */
.empty-state {
  padding: 48px 20px;
  text-align: center;
}
.empty-state-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.6; }
.empty-state-title { font-size: 16px; font-weight: 600; color: var(--text-secondary); margin-bottom: 8px; }
.empty-state-desc { font-size: 13px; color: var(--text-muted); }

/* ============ Announcement Card ============ */
.announcement-card {
  display: flex;
  gap: 16px;
  padding: 20px 24px;
  background: linear-gradient(135deg, #E8F5E9 0%, #F1F8E9 100%);
  border: 1.5px solid #C8E6C9;
  border-radius: var(--radius);
  margin-bottom: 20px;
}
.announcement-icon { font-size: 28px; flex-shrink: 0; margin-top: 2px; }
.announcement-body { flex: 1; }
.announcement-title {
  font-size: 15px;
  font-weight: 700;
  color: #2E7D32;
  margin-bottom: 10px;
}
.announcement-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.announcement-list li {
  font-size: 13px;
  color: #333;
  line-height: 1.6;
  padding-left: 16px;
  position: relative;
}
.announcement-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: #43A047;
  font-weight: 700;
}

/* ============ CK Format Tips ============ */
.ck-format-tips {
  background: #F5F7FA;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-top: 8px;
}
.ck-format-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 10px;
}
.ck-format-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ck-format-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  flex-wrap: wrap;
}
.ck-format-badge {
  display: inline-block;
  background: var(--bili-blue);
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: 10px;
  flex-shrink: 0;
}
.ck-format-item code {
  background: white;
  border: 1px solid #E0E0E0;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 11px;
  color: #555;
  word-break: break-all;
}
.ck-format-desc {
  color: var(--text-muted);
  font-size: 11px;
}

/* ============ CK Preview ============ */
.ck-preview {
  margin-top: 12px;
  padding: 12px 16px;
  background: #FFFDE7;
  border: 1.5px solid #FFF9C4;
  border-radius: var(--radius-sm);
  font-size: 13px;
}
.ck-preview .ck-preview-ok { color: #2E7D32; }
.ck-preview .ck-preview-err { color: var(--bili-pink); }
.ck-preview-count { font-weight: 700; color: var(--bili-blue); }

/* ============ Btn Outline ============ */
.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--bili-blue);
  background: white;
  border: 1.5px solid var(--bili-blue);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}
.btn-outline:hover {
  background: rgba(0,161,214,0.08);
}

/* ============ Page Tabs (Quiz/Upgrade) ============ */
.page-tabs {
  display: flex;
  background: var(--bili-bg);
  border-radius: var(--radius);
  padding: 4px;
  margin-bottom: 20px;
  gap: 4px;
}
.page-tab {
  flex: 1;
  padding: 12px 20px;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}
.page-tab:hover { color: var(--text-primary); background: rgba(255,255,255,0.5); }
.page-tab.active {
  background: white;
  color: var(--bili-pink);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.qtab-content { display: none; animation: fadeInUp 0.3s ease; }
.qtab-content.active { display: block; }

/* ============ Upgrade Page ============ */
.upgrade-stats {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.upgrade-stats .stat-card { min-width: 160px; }

.exp-badge {
  display: inline-block;
  background: #E3F2FD;
  color: #1565C0;
  font-size: 12px;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 10px;
  margin: 0 2px;
}

.upgrade-account-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius);
  transition: background 0.15s;
}
.upgrade-account-item:hover { background: var(--bili-bg); }
.upgrade-account-item:not(:last-child) { border-bottom: 1px solid #F5F5F5; }
.upgrade-account-item input[type="checkbox"] {
  width: 18px; height: 18px;
  accent-color: var(--bili-pink);
  cursor: pointer;
  flex-shrink: 0;
}
.upgrade-acc-info { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.upgrade-acc-name { font-size: 14px; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.upgrade-acc-exp { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.exp-bar-wrap {
  width: 120px;
  height: 8px;
  background: #ECEFF1;
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
}
.exp-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
}
.exp-bar.lv1 { background: linear-gradient(90deg, #42A5F5, #66BB6A); }
.exp-bar.lv2 { background: linear-gradient(90deg, #66BB6A, #FFA726); }
.exp-bar.lv-done { background: var(--bili-green); }

.upgrade-acc-eta {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.eta-days { color: #E65100; }
.eta-done { color: var(--bili-green); }

.today-done-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  background: #E8F5E9;
  color: #2E7D32;
}

/* ============ Scrollbar ============ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #D0D0D0; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #B0B0B0; }
