/* =============================================
   AI工具导航 - 管理员页面样式
   ============================================= */
@import url('style.css?v=20250328');

.admin-layout {
  min-height: 100vh;
  background: var(--bg-secondary);
}

/* 管理员登录页 */
.login-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.login-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 48px 40px;
  width: 100%; max-width: 420px;
  box-shadow: var(--shadow-lg);
}
.login-logo {
  text-align: center; margin-bottom: 32px;
}
.login-logo .logo-icon {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, var(--accent), #9c27b0);
  border-radius: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 26px; color: #fff;
  margin-bottom: 12px;
}
.login-title { font-size: 22px; font-weight: 700; color: var(--text-primary); }
.login-sub { font-size: 14px; color: var(--text-muted); margin-top: 4px; }

.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 13px; font-weight: 500; color: var(--text-secondary); margin-bottom: 6px; }
.form-input {
  width: 100%; height: 44px;
  background: var(--bg-secondary);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  font-size: 14px; color: var(--text-primary);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-error { font-size: 12px; color: #e53935; margin-top: 4px; display: none; }

.btn-login {
  width: 100%; height: 46px;
  background: var(--accent);
  color: #fff;
  border-radius: 23px;
  font-size: 15px; font-weight: 600;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  margin-top: 24px;
}
.btn-login:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--accent-glow);
}
.btn-hint { text-align: center; font-size: 12px; color: var(--text-muted); margin-top: 12px; }

/* 管理主界面 */
.admin-container {
  display: none;
  min-height: 100vh;
  flex-direction: column;
}
.admin-container.show { display: flex; }

.admin-topbar {
  height: var(--navbar-h);
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  display: flex; align-items: center; padding: 0 24px;
  gap: 16px; position: sticky; top: 0; z-index: 100;
}
.admin-topbar .logo { font-size: 16px; }
.topbar-sep { flex: 1; }
.topbar-badge {
  font-size: 12px; color: var(--accent);
  background: var(--accent-light); padding: 3px 10px;
  border-radius: 10px; font-weight: 500;
}
.topbar-user { font-size: 13px; color: var(--text-secondary); }
.btn-logout {
  height: 32px; padding: 0 14px;
  border: 1.5px solid var(--border-color);
  border-radius: 16px;
  font-size: 13px; color: var(--text-secondary);
  transition: all var(--transition);
}
.btn-logout:hover { border-color: #e53935; color: #e53935; }

.admin-body { display: flex; flex: 1; }

/* 管理侧边栏 */
.admin-sidebar {
  width: 200px; flex-shrink: 0;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  padding: 16px 8px;
}
.admin-nav-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px; color: var(--text-secondary);
  transition: background var(--transition), color var(--transition);
  margin-bottom: 2px;
}
.admin-nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.admin-nav-item.active { background: var(--accent-light); color: var(--accent); font-weight: 500; }
.admin-nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }

/* 管理内容区 */
.admin-content {
  flex: 1; padding: 28px;
  overflow-y: auto;
}

.admin-panel { display: none; }
.admin-panel.active { display: block; }

.panel-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px;
}
.panel-title { font-size: 20px; font-weight: 700; }

.btn-add {
  display: flex; align-items: center; gap: 6px;
  height: 38px; padding: 0 18px;
  background: var(--accent); color: #fff;
  border-radius: 19px; font-size: 14px; font-weight: 500;
  transition: background var(--transition), transform var(--transition);
}
.btn-add:hover { background: var(--accent-hover); transform: translateY(-1px); }

/* 工具列表表格 */
.tool-table {
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.table-header {
  display: grid;
  grid-template-columns: 40px 220px 120px 1fr 120px 100px;
  padding: 12px 16px;
  background: var(--bg-hover);
  font-size: 12px; font-weight: 600;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border-color);
}
.table-row {
  display: grid;
  grid-template-columns: 40px 220px 120px 1fr 120px 100px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  align-items: center;
  font-size: 14px;
  transition: background var(--transition);
}
.table-row:last-child { border-bottom: none; }
.table-row:hover { background: var(--bg-hover); }

.table-icon {
  width: 28px; height: 28px;
  border-radius: 7px;
  background: var(--bg-hover);
  border: 1px solid var(--border-color);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
}
.table-icon img { width: 100%; height: 100%; object-fit: cover; }
.table-name { font-weight: 500; }
.table-cat { color: var(--text-muted); font-size: 13px; }
.table-desc { color: var(--text-secondary); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table-url { color: var(--accent); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.table-actions { display: flex; gap: 6px; }
.btn-edit, .btn-del {
  height: 28px; padding: 0 10px;
  border-radius: 6px; font-size: 12px;
  transition: all var(--transition);
}
.btn-edit { background: var(--accent-light); color: var(--accent); }
.btn-edit:hover { background: var(--accent); color: #fff; }
.btn-del { background: #ffebee; color: #e53935; }
.btn-del:hover { background: #e53935; color: #fff; }
[data-theme="dark"] .btn-del { background: rgba(229,57,53,0.15); }

/* 弹出表单 */
.form-modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 2000;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
  padding: 20px;
}
.form-modal-backdrop.active { opacity: 1; pointer-events: all; }
.form-modal {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  max-width: 600px; width: 100%;
  max-height: 90vh; overflow-y: auto;
  padding: 32px;
  box-shadow: var(--shadow-lg);
  transform: scale(0.96);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.form-modal-backdrop.active .form-modal { transform: scale(1); }
.form-modal-title {
  font-size: 18px; font-weight: 700;
  margin-bottom: 24px;
  display: flex; align-items: center; justify-content: space-between;
}

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .form-group.full { grid-column: 1 / -1; }
.form-textarea {
  width: 100%; min-height: 80px;
  background: var(--bg-secondary);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 14px; color: var(--text-primary);
  font-family: inherit; resize: vertical;
  outline: none; line-height: 1.6;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-select {
  width: 100%; height: 44px;
  background: var(--bg-secondary);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  font-size: 14px; color: var(--text-primary);
  outline: none; cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-actions { display: flex; gap: 10px; margin-top: 20px; justify-content: flex-end; }
.btn-cancel {
  height: 40px; padding: 0 20px;
  border: 1.5px solid var(--border-color);
  border-radius: 20px; font-size: 14px;
  color: var(--text-secondary);
  transition: all var(--transition);
}
.btn-cancel:hover { border-color: var(--accent); color: var(--accent); }
.btn-save {
  height: 40px; padding: 0 24px;
  background: var(--accent); color: #fff;
  border-radius: 20px; font-size: 14px; font-weight: 500;
  transition: background var(--transition);
}
.btn-save:hover { background: var(--accent-hover); }

/* 分类管理 */
.cat-manage-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.cat-manage-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px;
  transition: border-color var(--transition);
}
.cat-manage-card:hover { border-color: var(--accent); }
.cat-manage-header { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.cat-manage-emoji { font-size: 20px; }
.cat-manage-name { font-weight: 600; flex: 1; }
.cat-manage-count { font-size: 12px; color: var(--text-muted); }
.cat-manage-subs { display: flex; flex-wrap: wrap; gap: 4px; }
.sub-chip {
  font-size: 11px; color: var(--text-muted);
  background: var(--bg-hover);
  padding: 2px 8px; border-radius: 6px;
}

/* 统计卡片 */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 28px; }
.stat-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.stat-card-num { font-size: 28px; font-weight: 800; color: var(--text-primary); }
.stat-card-label { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.stat-card-icon { font-size: 28px; margin-bottom: 8px; }

/* Toast提示 */
.toast {
  position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%) translateY(10px);
  background: var(--text-primary); color: var(--bg-primary);
  padding: 10px 20px; border-radius: 20px;
  font-size: 14px; font-weight: 500;
  opacity: 0; pointer-events: none;
  transition: all 0.3s;
  z-index: 3000; white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
