/* ==========================================================================
   云上未来 · 运营管理后台样式
   深色侧边栏 + 浅色内容区 / 桌面为主
   ========================================================================== */

:root {
  --primary: #1e6fff;
  --primary-deep: #1559d8;
  --primary-soft: #eaf2ff;
  --primary-tint: #f5f9ff;
  --accent: #00b6a1;
  --text: #1f2937;
  --text-2: #475569;
  --text-3: #94a3b8;
  --border: #e5e7eb;
  --bg: #f5f7fa;
  --card: #ffffff;
  --danger: #ef4444;
  --warning: #f59e0b;
  --sidebar-w: 232px;
  --r-md: 10px;
  --r-lg: 16px;
  --shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.08);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: transparent; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; line-height: 1.3; }
p { margin: 0; }
img { max-width: 100%; display: block; }

/* ---------- 布局 ---------- */
.admin-layout { display: flex; min-height: 100vh; }

/* ---------- 侧边栏 ---------- */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: #0f172a;
  color: rgba(255, 255, 255, 0.7);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform 0.3s ease;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.sidebar-brand .logo {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: linear-gradient(135deg, #1e6fff, #4f8cff);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}
.sidebar-brand .logo-img {
  height: 34px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
}
.sidebar-brand .name { color: #fff; font-weight: 600; font-size: 15px; line-height: 1.2; }
.sidebar-brand .sub { font-size: 11px; color: rgba(255, 255, 255, 0.45); margin-top: 2px; }

.sidebar-nav { flex: 1; padding: 16px 12px; overflow-y: auto; }
.sidebar-nav .group-label {
  padding: 12px 12px 6px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.35);
  letter-spacing: 1px;
  text-transform: uppercase;
}
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  margin-bottom: 2px;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  transition: all 0.2s ease;
}
.sidebar-nav a svg { flex-shrink: 0; opacity: 0.75; }
.sidebar-nav a:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.sidebar-nav a.active {
  background: linear-gradient(135deg, #1e6fff, #4f8cff);
  color: #fff;
  box-shadow: 0 6px 16px rgba(30, 111, 255, 0.35);
}
.sidebar-nav a.active svg { opacity: 1; }

.sidebar-foot { padding: 16px 20px; border-top: 1px solid rgba(255, 255, 255, 0.08); font-size: 12px; color: rgba(255, 255, 255, 0.4); }
.sidebar-foot a { color: rgba(255, 255, 255, 0.6); }
.sidebar-foot a:hover { color: #fff; }

/* ---------- 主区域 ---------- */
.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 90;
  height: 60px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
}
.topbar .page-title { font-size: 16px; font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.topbar-right .back-site {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-2);
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 100px;
  transition: all 0.2s ease;
}
.topbar-right .back-site:hover { color: var(--primary); border-color: var(--primary); }
.topbar-right .avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, #1e6fff, #4f8cff);
  color: #fff; font-size: 13px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.menu-btn {
  display: none;
  width: 36px; height: 36px;
  align-items: center; justify-content: center;
  border-radius: 8px; color: var(--text-2);
}
.menu-btn:hover { background: var(--primary-tint); }

.content { padding: 28px; flex: 1; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 12px;
}
.card-head h3 { font-size: 16px; }
.card-head .desc { font-size: 13px; color: var(--text-3); margin-top: 2px; }
.card-body { padding: 24px; }

/* ---------- 统计卡片 ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px;
  position: relative;
  overflow: hidden;
}
.stat-card::after {
  content: '';
  position: absolute;
  right: -20px;
  top: -20px;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: var(--primary-tint);
}
.stat-card .label { font-size: 13px; color: var(--text-2); }
.stat-card .num { font-size: 32px; font-weight: 700; color: var(--text); margin-top: 8px; line-height: 1; }
.stat-card .num small { font-size: 15px; font-weight: 500; color: var(--text-3); margin-left: 2px; }
.stat-card .trend { font-size: 12px; margin-top: 10px; color: var(--text-3); }
.stat-card .trend.up { color: var(--danger); }
.stat-card .trend.down { color: var(--accent); }
.stat-card.blue::after { background: rgba(30, 111, 255, 0.08); }
.stat-card.green::after { background: rgba(0, 182, 161, 0.1); }
.stat-card.orange::after { background: rgba(245, 158, 11, 0.12); }
.stat-card.purple::after { background: rgba(139, 92, 246, 0.1); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  font-size: 14px;
  border-radius: 8px;
  transition: all 0.2s ease;
  white-space: nowrap;
  border: 1px solid transparent;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-deep); box-shadow: 0 6px 16px rgba(30, 111, 255, 0.3); }
.btn-outline { background: #fff; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-ghost { background: var(--bg); color: var(--text-2); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--text-3); }
.btn-danger { background: #fee2e2; color: #dc2626; }
.btn-danger:hover { background: #fecaca; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-xs { padding: 4px 10px; font-size: 12px; border-radius: 6px; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead th {
  text-align: left;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-3);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
tbody tr:hover { background: var(--primary-tint); }
tbody tr:last-child td { border-bottom: 0; }
td .strong { font-weight: 600; color: var(--text); }
td .sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }

/* 状态徽标 */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 12px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 500;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-new { background: #fef3c7; color: #b45309; }
.badge-follow { background: #dbeafe; color: #1d4ed8; }
.badge-done { background: #d1fae5; color: #047857; }
.badge-all { background: var(--bg); color: var(--text-2); }
.badge-draft { background: var(--bg); color: var(--text-3); }
.badge-published { background: #d1fae5; color: #047857; }

/* 操作按钮组 */
.ops { display: flex; gap: 8px; flex-wrap: wrap; }
.ops .btn { padding: 5px 10px; font-size: 12px; border-radius: 6px; }

/* ---------- 空状态 ---------- */
.empty-state {
  text-align: center;
  padding: 60px 24px;
}
.empty-state .ic {
  width: 72px; height: 72px;
  margin: 0 auto 16px;
  background: var(--primary-tint);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--primary);
}
.empty-state h4 { font-size: 16px; margin-bottom: 8px; }
.empty-state p { color: var(--text-2); font-size: 13px; max-width: 420px; margin: 0 auto; }

/* ---------- 筛选条 ---------- */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.filter-chip {
  padding: 7px 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 13px;
  color: var(--text-2);
  transition: all 0.2s ease;
}
.filter-chip.active, .filter-chip:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.filter-chip .cnt { opacity: 0.7; margin-left: 4px; font-size: 12px; }

/* ---------- 分类 Tab（内容管理） ---------- */
.cm-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
  overflow-x: auto;
}
.cm-tab {
  padding: 12px 20px;
  font-size: 14px;
  color: var(--text-2);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  transition: all 0.2s ease;
}
.cm-tab:hover { color: var(--primary); }
.cm-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.cm-panel { display: none; }
.cm-panel.active { display: block; }

/* 素材网格 */
.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 16px;
}
.asset-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}
.asset-item .thumb {
  aspect-ratio: 4/3;
  display: flex; align-items: center; justify-content: center;
  background: #fff;
  padding: 8px;
}
.asset-item .thumb img { max-width: 90%; max-height: 90%; object-fit: contain; }
.asset-item .meta { padding: 8px 10px; font-size: 12px; color: var(--text-2); display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.asset-item .meta .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 提示条 */
.notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 18px;
  background: var(--primary-tint);
  border: 1px solid rgba(30, 111, 255, 0.2);
  border-radius: var(--r-md);
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.7;
  margin-bottom: 20px;
}
.notice svg { flex-shrink: 0; color: var(--primary); margin-top: 2px; }

/* ---------- 响应式 ---------- */
@media (max-width: 1024px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .menu-btn { display: flex; }
  .content { padding: 16px; }
  .topbar { padding: 0 16px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .stat-card { padding: 18px; }
  .stat-card .num { font-size: 24px; }
}
