﻿/* ===== 登录页 ===== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a73e8 0%, #0d47a1 100%);
}
.login-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 400px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}
.login-card .logo {
  text-align: center;
  margin-bottom: 32px;
}
.login-card .logo h1 {
  font-size: 24px;
  color: var(--primary);
}
.login-card .logo p {
  color: var(--text-secondary);
  margin-top: 4px;
}

.admin-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.sidebar {
  width: var(--sidebar-width);
  background: #1f2937;
  color: #fff;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: width 0.3s;
  overflow: hidden;
}
.sidebar .sidebar-header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}
.sidebar .sidebar-header h2 {
  font-size: 18px;
  font-weight: 700;
  white-space: nowrap;
}
.sidebar .sidebar-header .logo-icon {
  width: 32px;
  height: 32px;
  background: var(--primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 10px;
  font-size: 16px;
  flex-shrink: 0;
}
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
}
.nav-group {
  margin-bottom: 4px;
}
.nav-group-title {
  padding: 8px 20px;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.nav-item {
  display: flex;
  align-items: center;
  padding: 10px 20px;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  white-space: nowrap;
  user-select: none;
  -webkit-user-select: none;
}
.nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.nav-item.active {
  background: rgba(26, 115, 232, 0.2);
  color: #fff;
}
.nav-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--primary);
}
.nav-item .nav-icon {
  width: 20px;
  margin-right: 12px;
  text-align: center;
  font-size: 16px;
  flex-shrink: 0;
}
.nav-item .nav-label {
  flex: 1;
}
.nav-item .nav-arrow {
  font-size: 12px;
  transition: transform 0.2s;
}
.nav-item .nav-arrow.open {
  transform: rotate(90deg);
}
.nav-sub {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s;
}
.nav-sub.open {
  max-height: 500px;
}
.nav-sub .nav-item {
  padding-left: 52px;
  font-size: 13px;
}
.sidebar-footer {
  padding: 12px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.sidebar-footer .user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  flex-shrink: 0;
}
.sidebar-footer .user-info {
  flex: 1;
  overflow: hidden;
}
.sidebar-footer .user-name {
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-footer .user-role {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
}
.top-header {
  height: var(--header-height);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  padding: 0 20px;
  flex-shrink: 0;
  gap: 16px;
}
.top-header .breadcrumb {
  flex: 1;
  font-size: 14px;
  color: var(--text-secondary);
}
.top-header .breadcrumb span {
  color: var(--text);
  font-weight: 500;
}
.top-header .header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.top-header .header-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.top-header .header-btn:hover {
  background: #f1f3f4;
}
.top-header .header-btn .badge {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  background: var(--danger);
  border-radius: 50%;
}

.page-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}
.page-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.page-title h2 {
  font-size: 20px;
  font-weight: 600;
}
.page-title p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: 4px;
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.search-bar .search-input {
  flex: 1;
  min-width: 200px;
  max-width: 360px;
}

.tabs {
  border-bottom: 1px solid var(--border-light);
  display: flex;
  gap: 0;
  margin-bottom: 20px;
}
.tab-item {
  padding: 12px 20px;
  cursor: pointer;
  color: var(--text-secondary);
  font-weight: 500;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  user-select: none;
}
.tab-item:hover {
  color: var(--text);
}
.tab-item.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.tab-panel {
  display: none;
}
.tab-panel.active {
  display: block;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.stat-card .stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.stat-card .stat-label {
  font-size: 14px;
  color: var(--text-secondary);
}
.stat-card .stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.stat-card .stat-value {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 4px;
}
.stat-card .stat-change {
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.stat-card .stat-change.up {
  color: var(--success);
}
.stat-card .stat-change.down {
  color: var(--danger);
}

.editor-container {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px;
  border-bottom: 1px solid var(--border);
  background: #f8f9fa;
}
.editor-toolbar button {
  padding: 4px 10px;
  border: 1px solid transparent;
  background: none;
  border-radius: 3px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
}
.editor-toolbar button:hover {
  border-color: var(--border);
  background: #fff;
}
.editor-content {
  min-height: 400px;
  padding: 16px;
  outline: none;
  font-size: 15px;
  line-height: 1.8;
}

@media (max-width: 768px) {
  .sidebar {
    width: 0;
    position: fixed;
    z-index: 100;
    height: 100%;
  }
  .sidebar.open {
    width: var(--sidebar-width);
  }
  .form-row {
    flex-direction: column;
  }
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }
}
