/* ===== Web管理后台共享样式 ===== */
/* 基于index.css扩展，增加侧边栏导航 */

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

:root {
  --primary: #1a56db;
  --primary-light: #5ad6ff;
  --accent: #00e676;
  --warn: #ff9f43;
  --danger: #ff5a5a;
  --bg: #0a1628;
  --bg-card: #0f1d35;
  --bg-sidebar: #08111f;
  --text: #ffffff;
  --text-muted: #9fb3cc;
  --border: rgba(90, 214, 255, 0.18);
}

body {
  font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== 功能页面快捷导航 ===== */
/* 功能页未使用首页侧栏时，也始终保留项目与团队入口。 */
.page-quick-nav {
  position: fixed;
  z-index: 1200;
  top: max(12px, env(safe-area-inset-top));
  right: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px;
  border: 1px solid rgba(90, 214, 255, 0.34);
  border-radius: 12px;
  background: rgba(8, 17, 31, 0.96);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(12px);
}
.page-quick-nav-title {
  padding: 0 5px 0 3px;
  color: var(--text-muted);
  font-size: 11px;
  white-space: nowrap;
}
.page-quick-nav a {
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.18s ease;
}
.page-quick-nav a:hover,
.page-quick-nav a.active {
  border-color: rgba(90, 214, 255, 0.48);
  background: rgba(90, 214, 255, 0.16);
  color: #fff;
}
.page-quick-nav a.active { color: var(--primary-light); }
@media (max-width: 820px) {
  .page-quick-nav {
    top: max(8px, env(safe-area-inset-top));
    right: 8px;
    left: 8px;
    bottom: auto;
    justify-content: center;
    gap: 5px;
    padding: 5px;
    border-radius: 10px;
  }
  .page-quick-nav-title { display: none; }
  .page-quick-nav a { flex: 1; padding: 8px 4px; font-size: 11px; text-align: center; }
}

/* ===== 顶部栏 ===== */
.topbar {
  height: 56px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(90deg, #0f1d35 0%, #0a1d38 100%);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  position: relative;
  z-index: 100;
  flex-shrink: 0;
}
.topbar::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--primary-light), var(--primary));
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo { width: 60px; height: 34px; }
.platform-logo-image { object-fit: cover; object-position: center; border-radius: 6px; border: 1px solid rgba(90,214,255,0.45); box-shadow: 0 0 0 3px rgba(90,214,255,0.08), 0 0 12px rgba(30,120,220,0.22); }
.brand-text { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.brand-title {
  font-size: 14px; font-weight: 600; letter-spacing: .4px; white-space: nowrap;
  background: linear-gradient(90deg, #fff 0%, #5ad6ff 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.brand-tag {
  font-size: 11px; color: var(--primary-light);
  padding: 2px 8px; border-radius: 12px;
  background: rgba(90,214,255,0.1); border: 1px solid rgba(90,214,255,0.25);
}
.topbar-actions { display: flex; align-items: center; gap: 16px; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255,255,255,0.05); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; position: relative;
}
.icon-btn span { font-size: 15px; }
.dot {
  position: absolute; top: 6px; right: 6px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--danger); box-shadow: 0 0 8px var(--danger);
}
.user { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
}
.user-info { display: flex; flex-direction: column; line-height: 1.2; }
.user-name { font-size: 12px; font-weight: 600; }
.user-role { font-size: 10px; color: var(--text-muted); }

/* ===== 布局：侧边栏+主内容 ===== */
.layout {
  flex: 1;
  display: flex;
  overflow: hidden;
}

/* 侧边栏 */
.sidebar {
  width: 210px;
  flex-shrink: 0;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(90,214,255,0.2); border-radius: 2px; }

.nav-group { padding: 12px 0; border-bottom: 1px solid rgba(90,214,255,0.06); }
.nav-group:last-child { border-bottom: none; }
.nav-group-title {
  font-size: 10px; color: var(--text-muted);
  padding: 4px 20px 8px; text-transform: uppercase; letter-spacing: 1px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px;
  font-size: 13px; color: var(--text-muted);
  text-decoration: none; cursor: pointer;
  transition: all 0.2s; position: relative;
  border-left: 2px solid transparent;
}
.nav-item:hover { background: rgba(90,214,255,0.06); color: #fff; }
.nav-item.active {
  background: rgba(26,86,219,0.15);
  color: var(--primary-light);
  border-left-color: var(--primary-light);
}
.nav-item.active::after {
  content: ""; position: absolute; right: 0; top: 0; bottom: 0;
  width: 2px; background: var(--primary-light);
}
.nav-icon { font-size: 16px; width: 20px; text-align: center; }
.nav-badge {
  margin-left: auto;
  background: var(--danger); color: #fff;
  font-size: 9px; font-weight: 700;
  min-width: 16px; height: 16px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
}

/* 主内容区 */
.main {
  flex: 1;
  overflow-y: auto;
  padding: 16px 22px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.main::-webkit-scrollbar { width: 6px; }
.main::-webkit-scrollbar-thumb { background: rgba(90,214,255,0.15); border-radius: 3px; }

/* ===== 页面标题 ===== */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2px;
}
.page-title {
  font-size: 18px; font-weight: 600; color: #fff;
  display: flex; align-items: center; gap: 10px;
}
.page-title::before {
  content: ""; width: 4px; height: 18px;
  background: linear-gradient(180deg, var(--primary-light), var(--primary));
  border-radius: 2px;
}
.page-subtitle { font-size: 12px; color: var(--text-muted); }
.breadcrumb { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.breadcrumb a { color: var(--primary-light); text-decoration: none; }
.breadcrumb span { color: var(--text-muted); }

/* ===== 通用面板 ===== */
.panel {
  background: var(--bg-card);
  border-radius: 14px;
  border: 1px solid var(--border);
  box-shadow: 0 8px 30px rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.panel-head {
  height: 44px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(90deg, rgba(90,214,255,0.06), transparent);
}
.panel-title {
  font-size: 14px; font-weight: 600;
  display: flex; align-items: center; gap: 8px; color: #fff;
}
.panel-icon {
  display: inline-block; width: 16px; height: 16px;
  border-radius: 4px; background: var(--primary);
}
.panel-extra { font-size: 11px; color: var(--text-muted); display: flex; align-items: center; gap: 12px; }
.panel-body { padding: 16px; }

/* ===== KPI统计卡 ===== */
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; background: var(--primary-light);
}
.stat-card.warn::before { background: var(--warn); }
.stat-card.danger::before { background: var(--danger); }
.stat-card.success::before { background: var(--accent); }
.stat-icon {
  width: 44px; height: 44px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.stat-icon.blue { background: rgba(26,86,219,0.2); }
.stat-icon.green { background: rgba(0,230,118,0.15); }
.stat-icon.orange { background: rgba(255,159,67,0.15); }
.stat-icon.red { background: rgba(255,90,90,0.2); }
.stat-icon.purple { background: rgba(149,117,205,0.2); }
.stat-info { flex: 1; }
.stat-label { font-size: 12px; color: var(--text-muted); }
.stat-value { font-size: 24px; font-weight: 700; margin-top: 2px; }
.stat-trend { font-size: 11px; margin-top: 2px; }
.stat-trend.up { color: var(--accent); }
.stat-trend.down { color: var(--danger); }

/* ===== 筛选栏 ===== */
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.toolbar-item {
  display: flex; align-items: center; gap: 6px;
}
.toolbar-item label { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.toolbar-item select, .toolbar-item input {
  height: 32px; border-radius: 6px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.05);
  color: var(--text); font-size: 12px;
  padding: 0 10px; outline: none;
  min-width: 100px;
}
.toolbar-item select:hover, .toolbar-item input:hover { border-color: var(--primary-light); }
.btn {
  height: 32px; padding: 0 16px; border-radius: 6px;
  border: none; cursor: pointer; font-size: 12px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 5px;
  transition: all 0.2s;
}
.btn-primary {
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  color: #fff;
}
.btn-primary:hover { opacity: 0.9; box-shadow: 0 4px 12px rgba(26,86,219,0.4); }
.btn-outline {
  background: transparent; color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-outline:hover { border-color: var(--primary-light); color: var(--primary-light); }
.btn-danger {
  background: rgba(255,90,90,0.15); color: var(--danger);
  border: 1px solid rgba(255,90,90,0.3);
}
.btn-success {
  background: rgba(0,230,118,0.15); color: var(--accent);
  border: 1px solid rgba(0,230,118,0.3);
}

/* ===== 表格 ===== */
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.data-table th, .data-table td { padding: 10px 12px; text-align: left; }
.data-table thead {
  background: rgba(90,214,255,0.06);
  color: var(--primary-light); font-weight: 600;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px;
}
.data-table thead th { border-bottom: 1px solid var(--border); }
.data-table tbody tr { border-bottom: 1px solid rgba(90,214,255,0.06); transition: background 0.2s; }
.data-table tbody tr:hover { background: rgba(90,214,255,0.04); }
.data-table td { color: var(--text-muted); }
.data-table td.strong { color: #fff; font-weight: 600; }
.data-table a { color: var(--primary-light); text-decoration: none; }
.data-table a:hover { text-decoration: underline; }

/* 标签 */
.tag { display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px; border-radius: 10px; font-size: 11px; }
.tag-green { background: rgba(0,230,118,0.15); color: var(--accent); }
.tag-yellow { background: rgba(255,159,67,0.15); color: var(--warn); }
.tag-red { background: rgba(255,90,90,0.15); color: var(--danger); }
.tag-blue { background: rgba(90,214,255,0.15); color: var(--primary-light); }
.tag-purple { background: rgba(149,117,205,0.15); color: #b89ff5; }
.tag-gray { background: rgba(159,179,204,0.15); color: var(--text-muted); }

/* 分页 */
.pagination {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-top: 1px solid var(--border);
  font-size: 12px; color: var(--text-muted);
}
.page-btns { display: flex; gap: 6px; }
.page-btn {
  min-width: 30px; height: 30px; border-radius: 6px;
  border: 1px solid var(--border); background: transparent;
  color: var(--text-muted); font-size: 12px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  padding: 0 6px;
}
.page-btn:hover, .page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ===== 网格布局 ===== */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }

/* ===== 图表容器 ===== */
.chart-box { width: 100%; min-height: 240px; }

/* ===== 详情卡片 ===== */
.detail-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}
.detail-row {
  display: flex; padding: 8px 0;
  border-bottom: 1px solid rgba(90,214,255,0.06);
}
.detail-row:last-child { border-bottom: none; }
.detail-label { width: 120px; font-size: 12px; color: var(--text-muted); flex-shrink: 0; }
.detail-value { font-size: 12px; color: #fff; flex: 1; }

/* ===== 进度条 ===== */
.progress-bar { height: 6px; border-radius: 3px; background: rgba(255,255,255,0.08); overflow: hidden; }
.progress-fill { height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--primary), var(--primary-light)); }
.progress-fill.warn { background: linear-gradient(90deg, var(--warn), #ff6b35); }
.progress-fill.danger { background: linear-gradient(90deg, var(--danger), #c0392b); }
.progress-fill.success { background: linear-gradient(90deg, var(--accent), #0a9b4a); }

/* ===== AI诊断块 ===== */
.ai-block {
  background: linear-gradient(135deg, rgba(26,86,219,0.08), rgba(90,214,255,0.05));
  border: 1px solid rgba(90,214,255,0.25);
  border-radius: 12px;
  padding: 16px;
}
.ai-block-title {
  font-size: 13px; font-weight: 600; color: var(--primary-light);
  display: flex; align-items: center; gap: 8px; margin-bottom: 12px;
}
.ai-step {
  display: flex; gap: 12px; padding: 10px 0;
  border-bottom: 1px solid rgba(90,214,255,0.08);
}
.ai-step:last-child { border-bottom: none; }
.ai-step-icon {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; flex-shrink: 0;
}
.ai-step-icon.blue { background: rgba(26,86,219,0.2); }
.ai-step-icon.green { background: rgba(0,230,118,0.15); }
.ai-step-icon.orange { background: rgba(255,159,67,0.15); }
.ai-step-icon.red { background: rgba(255,90,90,0.2); }
.ai-step-content { flex: 1; }
.ai-step-label { font-size: 11px; color: var(--text-muted); }
.ai-step-text { font-size: 13px; color: #fff; margin-top: 2px; }

/* ===== 空状态 ===== */
.empty-state {
  text-align: center; padding: 40px;
  color: var(--text-muted); font-size: 14px;
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.3; }

/* ===== 响应式 ===== */
@media (max-width: 1200px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .sidebar { display: none; }
  .grid-4 { grid-template-columns: 1fr; }
}
