/* ==================== 后台管理样式 ==================== */
:root {
  --admin-primary: #1a5fba;
  --admin-dark: #1a2138;
  --admin-sidebar: #1e293b;
  --admin-sidebar-hover: #334155;
  --admin-bg: #f1f5f9;
  --admin-card: #ffffff;
  --admin-border: #e2e8f0;
  --admin-text: #334155;
  --admin-text-light: #64748b;
  --admin-success: #22c55e;
  --admin-warning: #f59e0b;
  --admin-danger: #ef4444;
  --admin-radius: 10px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--admin-bg);
  color: var(--admin-text);
}

/* ==================== 登录页 ==================== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f2747 0%, #1a5fba 100%);
  padding: 20px;
}

.login-card {
  background: #fff;
  border-radius: 16px;
  padding: 48px 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo .icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--admin-primary), #ff6b35);
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.login-logo h1 {
  font-size: 1.4rem;
  color: var(--admin-dark);
  font-weight: 700;
}

.login-logo p {
  font-size: 0.85rem;
  color: var(--admin-text-light);
  margin-top: 4px;
}

.login-form .form-group {
  margin-bottom: 20px;
}

.login-form label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--admin-text);
  margin-bottom: 8px;
}

.login-form input {
  width: 100%;
  padding: 12px 16px;
  font-size: 0.95rem;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  background: #f8fafc;
  transition: all 0.3s;
}

.login-form input:focus {
  outline: none;
  border-color: var(--admin-primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(26,95,186,0.1);
}

.login-form .btn-login {
  width: 100%;
  padding: 14px;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background: var(--admin-primary);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
}

.login-form .btn-login:hover {
  background: #144a91;
}

.login-error {
  background: #fef2f2;
  color: var(--admin-danger);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-bottom: 16px;
  display: none;
}

.login-error.show { display: block; }

.login-hint {
  text-align: center;
  margin-top: 20px;
  font-size: 0.8rem;
  color: var(--admin-text-light);
}

/* ==================== 管理后台布局 ==================== */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

/* 侧边栏 */
.sidebar {
  width: 240px;
  background: var(--admin-sidebar);
  color: #cbd5e1;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s;
}

.sidebar-header {
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-header .logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--admin-primary), #ff6b35);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.1rem;
  font-weight: 700;
}

.sidebar-header span {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 0;
  overflow-y: auto;
}

.sidebar-nav .nav-section {
  padding: 8px 24px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #64748b;
  margin-top: 16px;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  font-size: 0.9rem;
  color: #cbd5e1;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}

.sidebar-nav a:hover {
  background: var(--admin-sidebar-hover);
  color: #fff;
}

.sidebar-nav a.active {
  background: var(--admin-sidebar-hover);
  color: #fff;
  border-left-color: var(--admin-primary);
}

.sidebar-nav a .icon {
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px 24px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.sidebar-footer a {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: #94a3b8;
}

.sidebar-footer a:hover { color: #fff; }

/* 主内容 */
.main-content {
  flex: 1;
  margin-left: 240px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  background: #fff;
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--admin-border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-left h1 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--admin-dark);
}

.topbar-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  color: var(--admin-text);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-right .user-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-right .avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--admin-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
}

.topbar-right .user-name {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--admin-text);
}

.content-area {
  flex: 1;
  padding: 32px;
}

/* ==================== 统计卡片 ==================== */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--admin-card);
  border-radius: var(--admin-radius);
  padding: 24px;
  border: 1px solid var(--admin-border);
}

.stat-card .stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.stat-card .stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.stat-card .stat-icon.blue { background: #dbeafe; color: #2563eb; }
.stat-card .stat-icon.green { background: #dcfce7; color: #16a34a; }
.stat-card .stat-icon.orange { background: #ffedd5; color: #ea580c; }
.stat-card .stat-icon.purple { background: #f3e8ff; color: #9333ea; }

.stat-card .stat-trend {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
}

.stat-trend.up { color: var(--admin-success); background: #dcfce7; }
.stat-trend.down { color: var(--admin-danger); background: #fef2f2; }

.stat-card .stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--admin-dark);
  line-height: 1;
}

.stat-card .stat-label {
  font-size: 0.85rem;
  color: var(--admin-text-light);
  margin-top: 8px;
}

/* ==================== 数据卡片 ==================== */
.data-card {
  background: var(--admin-card);
  border-radius: var(--admin-radius);
  border: 1px solid var(--admin-border);
  margin-bottom: 24px;
  overflow: hidden;
}

.data-card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.data-card-header h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--admin-dark);
}

.data-card-header .actions {
  display: flex;
  gap: 8px;
}

.data-card-body {
  padding: 24px;
}

/* 表格 */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--admin-text-light);
  border-bottom: 2px solid var(--admin-border);
  white-space: nowrap;
}

.data-table td {
  padding: 14px 16px;
  font-size: 0.88rem;
  color: var(--admin-text);
  border-bottom: 1px solid var(--admin-border);
}

.data-table tr:hover td {
  background: #f8fafc;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 600;
}

.status-badge.pending { background: #fef3c7; color: #92400e; }
.status-badge.confirmed { background: #dcfce7; color: #166534; }
.status-badge.completed { background: #dbeafe; color: #1e40af; }
.status-badge.cancelled { background: #fef2f2; color: #991b1b; }

/* 图表区域 */
.chart-container {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

.simple-chart {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  height: 240px;
  padding: 20px 0;
}

.chart-bar {
  flex: 1;
  background: linear-gradient(to top, var(--admin-primary), #60a5fa);
  border-radius: 6px 6px 0 0;
  position: relative;
  min-height: 20px;
  transition: all 0.3s;
  cursor: pointer;
}

.chart-bar:hover {
  background: linear-gradient(to top, #144a91, #3b82f6);
}

.chart-bar .bar-label {
  position: absolute;
  bottom: -28px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.78rem;
  color: var(--admin-text-light);
  white-space: nowrap;
}

.chart-bar .bar-value {
  position: absolute;
  top: -24px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--admin-text);
}

/* 行业分布 */
.industry-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.industry-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.industry-item .name {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--admin-text);
  width: 80px;
  flex-shrink: 0;
}

.industry-item .bar-wrap {
  flex: 1;
  height: 8px;
  background: #f1f5f9;
  border-radius: 4px;
  overflow: hidden;
}

.industry-item .bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
}

.industry-item .count {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--admin-text);
  width: 50px;
  text-align: right;
}

/* 按钮 */
.btn-sm {
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 500;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-sm-primary {
  background: var(--admin-primary);
  color: #fff;
}

.btn-sm-primary:hover { background: #144a91; }

.btn-sm-outline {
  background: transparent;
  border: 1px solid var(--admin-border);
  color: var(--admin-text);
}

.btn-sm-outline:hover { background: #f8fafc; }

.btn-sm-danger {
  background: #fef2f2;
  color: var(--admin-danger);
}

.btn-sm-danger:hover { background: #fee2e2; }

/* 筛选栏 */
.filter-bar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.filter-bar input,
.filter-bar select {
  padding: 8px 14px;
  font-size: 0.88rem;
  border: 1px solid var(--admin-border);
  border-radius: 6px;
  background: #fff;
  color: var(--admin-text);
}

.filter-bar input:focus,
.filter-bar select:focus {
  outline: none;
  border-color: var(--admin-primary);
}

/* 响应式 */
@media (max-width: 968px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .topbar-toggle {
    display: block;
  }

  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .chart-container {
    grid-template-columns: 1fr;
  }

  .content-area {
    padding: 20px 16px;
  }
}

/* 6列统计卡片 */
.stats-row {
  grid-template-columns: repeat(6, 1fr);
}

.stat-card .stat-icon.teal { background: #ccfbf1; color: #0891b2; }
.stat-card .stat-icon.red { background: #fee2e2; color: #dc2626; }
.stat-card .stat-icon.blue { background: #dbeafe; color: #2563eb; }

/* 待处理列表 */
.pending-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--admin-border);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}
.pending-item:hover { color: var(--admin-primary); }
.pending-item:last-child { border-bottom: none; }
.pending-item .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.pending-item .dot.red { background: var(--admin-danger); }
.pending-item .dot.orange { background: var(--admin-warning); }
.pending-item .dot.blue { background: var(--admin-primary); }
.pending-item .dot.green { background: var(--admin-success); }

/* ==================== 弹窗 ==================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-box {
  background: #fff;
  border-radius: 12px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--admin-dark);
}

.modal-header button {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--admin-text-light);
  padding: 4px;
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--admin-border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* 表单 */
.form-row {
  margin-bottom: 16px;
}

.form-row label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--admin-text);
  margin-bottom: 6px;
}

.form-row input,
.form-row select,
.form-row textarea {
  width: 100%;
  padding: 10px 14px;
  font-size: 0.9rem;
  border: 1px solid var(--admin-border);
  border-radius: 6px;
  background: #f8fafc;
  color: var(--admin-text);
  font-family: inherit;
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--admin-primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(26,95,186,0.1);
}

.form-row textarea {
  resize: vertical;
}

.form-row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.form-row2 > div {
  margin-bottom: 0;
}

.form-row2 label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--admin-text);
  margin-bottom: 6px;
}

.form-row2 input,
.form-row2 select {
  width: 100%;
  padding: 10px 14px;
  font-size: 0.9rem;
  border: 1px solid var(--admin-border);
  border-radius: 6px;
  background: #f8fafc;
  color: var(--admin-text);
}

.form-row2 input:focus,
.form-row2 select:focus {
  outline: none;
  border-color: var(--admin-primary);
  background: #fff;
}

/* 状态徽章扩展 */
.status-badge.active { background: #dcfce7; color: #166534; }
.status-badge.ended { background: #f1f5f9; color: #64748b; }

@media (max-width: 1200px) {
  .stats-row { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .form-row2 { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .stats-row {
    grid-template-columns: 1fr;
  }

  .data-table {
    font-size: 0.78rem;
  }

  .data-table th,
  .data-table td {
    padding: 10px 8px;
  }
}
