/* ==================== CSS 变量 ==================== */
:root {
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --primary-light: rgba(59, 130, 246, 0.1);
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: #16161f;
  --bg-hover: #1e1e2a;
  --border: #2a2a3a;
  --border-light: #3a3a4a;
  --text-primary: #f0f0f5;
  --text-secondary: #a0a0b0;
  --text-muted: #606070;
  --success: #22c55e;
  --success-bg: rgba(34, 197, 94, 0.1);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.1);
  --error: #ef4444;
  --error-bg: rgba(239, 68, 68, 0.1);
  --info: #06b6d4;
  --info-bg: rgba(6, 182, 212, 0.1);
  --gradient-primary: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

/* ==================== 基础样式 ==================== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 14px; }
body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 100vh;
  background: 
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(59, 130, 246, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(139, 92, 246, 0.1) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
}

/* ==================== 布局 ==================== */
.app-layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
}
.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid var(--border);
}
.logo { display: flex; align-items: center; gap: 10px; }
.logo-icon {
  font-size: 1.8rem;
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.logo-text { font-size: 1rem; font-weight: 600; }
.sidebar-nav { flex: 1; padding: 12px 10px; display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
  font-size: 0.9rem;
}
.nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.nav-item.active,
.nav-item.router-link-active { background: var(--primary-light); color: var(--primary); }
.main-content { flex: 1; margin-left: 220px; min-height: 100vh; display: flex; flex-direction: column; }
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.page-title { font-size: 1.3rem; font-weight: 600; }
.status-indicator { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; color: var(--success); }
.status-dot {
  width: 6px; height: 6px;
  background: var(--success);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
.page-content { flex: 1; padding: 24px; }

/* ==================== 卡片 ==================== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: all 0.3s ease;
}
.card:hover { border-color: var(--border-light); }
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.card-title { font-size: 1rem; font-weight: 600; display: flex; align-items: center; gap: 8px; }

/* ==================== 按钮 ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 500;
  font-family: var(--font-sans);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.2);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: var(--shadow-md), 0 0 30px rgba(59, 130, 246, 0.3); }
.btn-secondary { background: var(--bg-hover); color: var(--text-primary); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-danger { background: var(--error); color: white; }
.btn-danger:hover { background: #dc2626; }
.btn-ghost { background: transparent; color: var(--text-secondary); border: 1px solid transparent; }
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-lg { padding: 12px 24px; font-size: 0.95rem; }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }

/* ==================== 输入框 ==================== */
.input {
  width: 100%;
  padding: 10px 14px;
  font-size: 0.9rem;
  font-family: var(--font-sans);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  transition: all 0.2s ease;
}
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.input::placeholder { color: var(--text-muted); }
.textarea { min-height: 100px; resize: vertical; font-family: var(--font-mono); font-size: 0.8rem; line-height: 1.5; }
.select {
  appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a0a0b0' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

/* ==================== 标签 ==================== */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  font-size: 0.7rem;
  font-weight: 500;
  border-radius: 12px;
}
.tag-success { background: var(--success-bg); color: var(--success); }
.tag-warning { background: var(--warning-bg); color: var(--warning); }
.tag-error { background: var(--error-bg); color: var(--error); }
.tag-info { background: var(--info-bg); color: var(--info); }
.tag-purple { background: rgba(139, 92, 246, 0.15); color: #8b5cf6; }
.tag-locked { background: rgba(225, 29, 72, 0.15); color: #e11d48; }

/* ==================== 表格 ==================== */
.table-container { overflow-x: auto; border-radius: var(--radius-md); border: 1px solid var(--border); }
.table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); }
.table th { background: var(--bg-secondary); font-weight: 600; color: var(--text-secondary); text-transform: uppercase; font-size: 0.7rem; letter-spacing: 0.5px; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--bg-hover); }

/* ==================== Grid ==================== */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1200px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 768px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* ==================== 统计卡片 ==================== */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 100%;
  background: var(--status-color, var(--primary));
}
.stat-icon {
  font-size: 1.6rem;
  width: 40px; height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
}
.stat-value { font-size: 1.5rem; font-weight: 700; line-height: 1.2; margin-bottom: 2px; }
.stat-label { font-size: 0.8rem; color: var(--text-secondary); }

/* ==================== 表单 ==================== */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 0.8rem; font-weight: 500; color: var(--text-secondary); margin-bottom: 6px; }
.form-hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }
.form-row { display: flex; gap: 12px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }

/* ==================== 选项按钮组 ==================== */
.option-group { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.option-btn {
  padding: 6px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.2s ease;
}
.option-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.option-btn.active { background: var(--primary); border-color: var(--primary); color: white; }

/* ==================== 进度条 ==================== */
.progress { height: 6px; background: var(--bg-secondary); border-radius: 3px; overflow: hidden; }
.progress-bar { height: 100%; background: var(--gradient-primary); border-radius: 3px; transition: width 0.5s ease; }

/* ==================== 加载 ==================== */
.loading { display: flex; align-items: center; justify-content: center; gap: 4px; padding: 40px; }
.loading-dot { width: 6px; height: 6px; background: var(--primary); border-radius: 50%; animation: bounce 1.4s ease-in-out infinite; }
.loading-dot:nth-child(1) { animation-delay: -0.32s; }
.loading-dot:nth-child(2) { animation-delay: -0.16s; }
@keyframes bounce { 0%, 80%, 100% { transform: scale(0); } 40% { transform: scale(1); } }

/* ==================== 空状态 ==================== */
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); }
.empty-state .icon { font-size: 3rem; margin-bottom: 12px; opacity: 0.3; }
.empty-state .title { font-size: 1.1rem; color: var(--text-secondary); margin-bottom: 6px; }

/* ==================== 错误信息 ==================== */
.error-msg { padding: 10px 14px; background: var(--error-bg); border: 1px solid var(--error); border-radius: var(--radius-md); color: var(--error); font-size: 0.85rem; margin-top: 12px; }

/* ==================== 结果列表 ==================== */
.result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  margin-bottom: 6px;
}
.result-index {
  width: 24px; height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-hover);
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.result-username { font-weight: 600; font-family: var(--font-mono); color: var(--primary); }
.result-meta { display: flex; gap: 12px; font-size: 0.75rem; color: var(--text-secondary); margin-top: 2px; }

/* ==================== 分页 ==================== */
.pagination { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 16px; border-top: 1px solid var(--border); }
.page-info { font-size: 0.85rem; color: var(--text-secondary); }

/* ==================== 滚动条 ==================== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }

/* ==================== 复选框 ==================== */
.checkbox-label { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 0.85rem; color: var(--text-secondary); }
.checkbox-label input { width: 16px; height: 16px; accent-color: var(--primary); }

/* ==================== 提示信息 ==================== */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 12px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  z-index: 1000;
  animation: slideIn 0.3s ease;
}
.toast-success { border-color: var(--success); }
.toast-error { border-color: var(--error); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

