/* ═══════════════════════════════════════════
   TSS Portal — Admin Page Styles
   Sidebar, layout, admin-specific overrides
   ═══════════════════════════════════════════ */

/* ═══ Icon action buttons ═══ */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: opacity .15s, transform .1s;
  flex-shrink: 0;
}
.icon-btn:hover { opacity: .75; transform: translateY(-1px); }
.icon-btn:active { transform: none; }
.icon-btn-edit  { background: rgba(99,102,241,.08); color: #6366f1; }
.icon-btn-del   { background: rgba(239,68,68,.08);  color: #ef4444; }

/* ═══ Admin body override ═══ */
body.admin-body {
  display: flex;
  flex-direction: column;
}

/* ═══ Admin header overrides ═══ */
.admin-body .header {
  position: relative;
  height: 64px;
  padding: 0 28px;
  background: rgba(10,10,18,0.55);
  flex-shrink: 0;
}
.admin-body .header::after { opacity: 0.4; animation: none; }
:root.light .admin-body .header {
  background: rgba(240,242,248,0.65);
}

.admin-body .header-logo {
  width: 38px; height: 38px;
  border-radius: 11px;
}
.admin-body .header-logo::before { animation-duration: 5s; }

.admin-body .header h1 {
  font-size: 1.2rem;
  font-weight: 800;
  background: linear-gradient(135deg, #fff, rgba(255,255,255,0.7));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
:root.light .admin-body .header h1 {
  background: linear-gradient(135deg, #1a1a2e, var(--primary));
  -webkit-background-clip: text;
  background-clip: text;
}

.header-tag {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 14px;
  border-radius: 20px;
  background: rgba(99,102,241,0.12);
  color: var(--primary-light);
  border: 1px solid rgba(99,102,241,0.25);
}

/* ═══ Admin background (simplified orbs) ═══ */
.admin-body .orb { filter: blur(100px); opacity: 0.35; }
.admin-body .orb-1 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(99,102,241,0.3), transparent 70%);
  top: -15%; left: -8%;
  animation: orbFloat1 20s ease-in-out infinite;
}
.admin-body .orb-2 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(168,85,247,0.25), transparent 70%);
  bottom: 10%; right: -5%;
  animation: orbFloat2 24s ease-in-out infinite;
}
:root.light .admin-body .orb { opacity: 0.2; }

.admin-body .bg-grid {
  background-size: 50px 50px;
  mask-image: radial-gradient(ellipse at center, black 40%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 40%, transparent 80%);
}

/* ═══ Layout ═══ */
.layout {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ═══ Sidebar ═══ */
.sidebar {
  width: 210px;
  background: var(--bg-card);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-right: 1px solid var(--glass-border);
  padding: 16px 0;
  flex-shrink: 0;
  overflow-y: auto;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 20px;
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
  position: relative;
  border-left: 3px solid transparent;
}
.nav-item:hover { background: var(--bg-card-hover); color: var(--text); }
.nav-item.active {
  background: rgba(99,102,241,0.08);
  color: var(--primary-light);
  border-left-color: var(--primary);
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--primary), var(--accent-purple));
  border-radius: 0 2px 2px 0;
}
.nav-item svg { width: 18px; height: 18px; transition: transform 0.2s; }
.nav-item:hover svg { transform: scale(1.1); }

/* ═══ Content area ═══ */
.content {
  flex: 1;
  padding: 28px 32px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.content-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.content-title {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

/* ═══ LLM 配置页 ═══ */
.llm-section-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 14px;
}
.llm-providers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
  margin-bottom: 8px;
}
.llm-config-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.llm-config-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: rgba(99,102,241,0.04);
  border-bottom: 1px solid var(--border);
}
.llm-provider-name { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.provider-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
}
.provider-badge.minimax { background: rgba(99,102,241,0.15); color: var(--primary-light); }
.provider-badge.glm { background: rgba(16,185,129,0.15); color: var(--accent-emerald); }
.provider-badge.kimi { background: rgba(168,85,247,0.15); color: #c084fc; }
.provider-badge.doubao { background: rgba(14,165,233,0.15); color: #38bdf8; }
.provider-badge.deepseek-v4-flash { background: rgba(6,182,212,0.15); color: #22d3ee; }
.provider-badge.deepseek-v4-pro { background: rgba(239,68,68,0.15); color: #f87171; }
.llm-toggle { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.llm-toggle input { display: none; }
.llm-toggle-track {
  width: 36px; height: 20px;
  background: var(--border);
  border-radius: 10px;
  position: relative;
  transition: background .2s;
}
.llm-toggle input:checked ~ .llm-toggle-track { background: var(--primary); }
.llm-toggle-thumb {
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.3);
}
.llm-toggle input:checked ~ .llm-toggle-track .llm-toggle-thumb { transform: translateX(16px); }
.llm-toggle-label { font-size: .82rem; color: var(--text-secondary); }
.llm-config-body { padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.llm-config-actions { display: flex; align-items: center; gap: 12px; margin-top: 4px; }
.llm-updated-at { font-size: .75rem; color: var(--text-muted); }

.llm-tool-configs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 16px;
}
.llm-tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.llm-tool-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
}
.provider-selector { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.provider-radio-btn {
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid var(--border);
  color: var(--text-secondary);
  transition: all .2s;
  user-select: none;
}
.provider-radio-btn:hover { border-color: var(--primary); color: var(--primary-light); }
.provider-radio-btn.active {
  background: linear-gradient(135deg, var(--primary), var(--accent-purple));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 2px 10px rgba(99,102,241,.35);
}

/* ═══ 拖动排序 ═══ */
.drag-handle {
  cursor: grab;
  color: var(--text-secondary);
  opacity: .6;
  width: 28px;
  user-select: none;
  text-align: center;
}
.drag-handle:hover { opacity: 1; color: var(--primary-light); }
.drag-handle:active { cursor: grabbing; }
tbody tr.dragging { opacity: .4; }
tbody tr.drag-over {
  background: rgba(99,102,241,.12);
  box-shadow: inset 0 2px 0 var(--primary);
}

/* ═══ Responsive ═══ */
@media (max-width: 768px) {
  .sidebar { width: 56px; overflow: hidden; }
  .nav-item span { display: none; }
  .nav-item { justify-content: center; padding: 11px 0; }
  .content { padding: 20px 16px; }
}
