/* ============ 设计变量 ============ */
:root {
  --bg: #f6f8fc;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --border: #e8edf5;
  --border-strong: #d6dfeb;
  --text: #16213e;
  --muted: #64748b;
  --muted-light: #94a3b8;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-soft: #eff6ff;
  --primary-border: #bfdbfe;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --success: #16a34a;
  --warning: #d97706;

  /* 多彩强调色 */
  --c-blue: #2563eb;
  --c-blue-2: #60a5fa;
  --c-violet: #7c3aed;
  --c-violet-2: #a78bfa;
  --c-cyan: #0891b2;
  --c-cyan-2: #22d3ee;
  --c-orange: #ea580c;
  --c-orange-2: #fbbf24;
  --c-rose: #e11d48;
  --c-rose-2: #fb7185;
  --c-green: #16a34a;
  --c-green-2: #4ade80;

  --radius: 16px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.03), 0 4px 16px rgba(15, 23, 42, 0.04);
  --shadow-hover: 0 12px 32px rgba(37, 99, 235, 0.13), 0 2px 8px rgba(15, 23, 42, 0.05);
  --topbar-h: 62px;
  --sidebar-w: 226px;
}

/* ============ 基础重置 ============ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

img {
  max-width: 100%;
  display: block;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ============ 顶部栏 ============ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--topbar-h);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  display: flex;
  align-items: center;
}

.topbar-inner {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 750;
  font-size: 16px;
  white-space: nowrap;
  letter-spacing: -0.3px;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(135deg, #2563eb, #60a5fa 55%, #7c3aed);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.32);
}

.brand-name {
  background: linear-gradient(120deg, #16213e, #2563eb);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}

.topnav a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 13px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 550;
  transition: background 0.18s, color 0.18s, transform 0.18s;
}

.topnav a:hover {
  background: var(--surface-soft);
  color: var(--primary);
  transform: translateY(-1px);
}

.topnav a.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
}

.topbar-action {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 15px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), #4f46e5);
  color: #fff;
  font-size: 13px;
  font-weight: 650;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
  transition: transform 0.18s, box-shadow 0.18s;
}

.topbar-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35);
}

/* ============ 内容容器 ============ */
.wrap {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 30px 20px 68px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.page-title {
  margin: 0;
  font-size: 26px;
  line-height: 1.3;
  font-weight: 780;
  letter-spacing: -0.6px;
  background: linear-gradient(120deg, #16213e, #334155);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.page-desc {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

/* ============ 按钮 ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.4;
  transition: background 0.18s, border-color 0.18s, color 0.18s, transform 0.12s, box-shadow 0.18s;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #4f46e5);
  color: #fff;
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.32);
  transform: translateY(-1px);
}

.btn-ghost {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
  box-shadow: var(--shadow);
}

.btn-ghost:hover {
  border-color: var(--primary-border);
  color: var(--primary);
  background: var(--primary-soft);
}

.btn-danger {
  background: var(--danger-soft);
  color: var(--danger);
}

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

.btn-sm {
  padding: 6px 11px;
  font-size: 12px;
}

.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 8px;
}

/* ============ 卡片与网格 ============ */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
  gap: 15px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.2s, border-color 0.2s;
}

.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: var(--primary-border);
}

.site-card {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 16px;
  min-height: 86px;
}

.site-icon {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  display: grid;
  place-items: center;
  overflow: hidden;
  font-size: 18px;
  font-weight: 750;
  color: var(--primary);
  transition: transform 0.2s;
}

.card-hover:hover .site-icon {
  transform: scale(1.06) rotate(-3deg);
}

.site-icon img {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

/* 彩色图标：按网格位置自动分配色系，无需改页面 */
.grid > .card:nth-child(6n + 1) .site-icon { background: linear-gradient(135deg, #dbeafe, #bfdbfe); color: #1d4ed8; }
.grid > .card:nth-child(6n + 2) .site-icon { background: linear-gradient(135deg, #ede9fe, #ddd6fe); color: #6d28d9; }
.grid > .card:nth-child(6n + 3) .site-icon { background: linear-gradient(135deg, #cffafe, #a5f3fc); color: #0e7490; }
.grid > .card:nth-child(6n + 4) .site-icon { background: linear-gradient(135deg, #ffedd5, #fed7aa); color: #c2410c; }
.grid > .card:nth-child(6n + 5) .site-icon { background: linear-gradient(135deg, #ffe4e6, #fecdd3); color: #be123c; }
.grid > .card:nth-child(6n + 6) .site-icon { background: linear-gradient(135deg, #dcfce7, #bbf7d0); color: #15803d; }

.site-body {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.site-name {
  font-size: 14px;
  font-weight: 680;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-desc {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-host {
  color: var(--muted-light);
  font-size: 11px;
  margin-top: 3px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 34px 0 16px;
  font-size: 17px;
  font-weight: 750;
  letter-spacing: -0.2px;
}

.section-title:first-child {
  margin-top: 0;
}

.section-title .dot {
  width: 5px;
  height: 18px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--c-blue-2), var(--c-blue));
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}

.section-count {
  color: var(--muted-light);
  font-size: 12px;
  font-weight: 550;
}

/* ============ 文章卡片 ============ */
.article-card {
  padding: 19px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-height: 156px;
}

.article-title {
  font-size: 15px;
  font-weight: 720;
  line-height: 1.45;
}

.article-summary {
  color: var(--muted);
  font-size: 12.5px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-meta {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted-light);
  font-size: 11.5px;
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ============ 标签 / 徽章 ============ */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 7px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 11px;
  font-weight: 600;
}

.tag-neutral {
  background: var(--surface-soft);
  color: var(--muted);
  border: 1px solid var(--border);
}

.tag-green {
  background: #f0fdf4;
  color: var(--success);
}

.tag-amber {
  background: #fffbeb;
  color: var(--warning);
}

.tag-blue { background: #eff6ff; color: var(--c-blue); }
.tag-violet { background: #f5f3ff; color: var(--c-violet); }
.tag-cyan { background: #ecfeff; color: var(--c-cyan); }
.tag-orange { background: #fff7ed; color: var(--c-orange); }

/* ============ 搜索与筛选 ============ */
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 220px;
  max-width: 420px;
}

.search-box svg {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted-light);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  padding: 10px 12px 10px 40px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  box-shadow: var(--shadow);
}

.search-box input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.filter-pills {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.pill {
  padding: 7px 13px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 550;
  transition: all 0.18s;
}

.pill:hover {
  border-color: var(--primary-border);
  color: var(--primary);
  transform: translateY(-1px);
}

.pill.active {
  background: linear-gradient(135deg, var(--primary), #4f46e5);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.22);
}

/* ============ 空状态 ============ */
.empty {
  padding: 52px 20px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 0%, rgba(37, 99, 235, 0.05), transparent 60%),
    var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
}

.empty-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 15px;
  border-radius: 16px;
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  color: var(--primary);
  display: grid;
  place-items: center;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.12);
}

.empty-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 5px;
}

.empty-desc {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 17px;
}

/* ============ Hero 欢迎区 ============ */
.hero {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  padding: 40px 44px 34px;
  margin-bottom: 8px;
  color: #fff;
  background:
    radial-gradient(circle at 85% 15%, rgba(167, 139, 250, 0.55), transparent 45%),
    radial-gradient(circle at 12% 90%, rgba(34, 211, 238, 0.35), transparent 40%),
    linear-gradient(120deg, #1d4ed8 0%, #2563eb 42%, #4f46e5 72%, #6d28d9 100%);
  box-shadow: 0 18px 44px rgba(37, 99, 235, 0.24);
}

/* 网格纹理 */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(135deg, #000, transparent 75%);
  -webkit-mask-image: linear-gradient(135deg, #000, transparent 75%);
  pointer-events: none;
}

/* 漂浮光斑 */
.hero::after {
  content: '';
  position: absolute;
  width: 260px;
  height: 260px;
  right: -60px;
  bottom: -140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.22), transparent 70%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 640px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(6px);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.3px;
  margin-bottom: 18px;
}

.hero-title {
  margin: 0;
  font-size: 35px;
  line-height: 1.22;
  font-weight: 800;
  letter-spacing: -1px;
}

.hero-title .accent {
  background: linear-gradient(90deg, #fff, #bae6fd 60%, #e9d5ff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  margin: 14px 0 0;
  font-size: 14px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.88);
  max-width: 520px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.hero-actions {
  display: flex;
  gap: 11px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 19px;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 680;
  transition: transform 0.18s, box-shadow 0.18s, background 0.18s;
}

.hero-btn:hover {
  transform: translateY(-2px);
}

.hero-btn-primary {
  background: #fff;
  color: #1d4ed8;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.14);
}

.hero-btn-primary:hover {
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.2);
}

.hero-btn-glass {
  background: rgba(255, 255, 255, 0.13);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.32);
  backdrop-filter: blur(6px);
}

.hero-btn-glass:hover {
  background: rgba(255, 255, 255, 0.22);
}

/* ============ 统计卡片 ============ */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
}

.stat-card {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 19px;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
  display: block;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.stat-card::after {
  content: '';
  position: absolute;
  right: -18px;
  top: -18px;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  opacity: 0.5;
}

.stat-card:nth-child(1)::after { background: radial-gradient(circle, #dbeafe, transparent 70%); }
.stat-card:nth-child(2)::after { background: radial-gradient(circle, #ede9fe, transparent 70%); }
.stat-card:nth-child(3)::after { background: radial-gradient(circle, #cffafe, transparent 70%); }
.stat-card:nth-child(4)::after { background: radial-gradient(circle, #ffedd5, transparent 70%); }

.stat-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
}

.stat-icon {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: #fff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.stat-card:nth-child(1) .stat-icon { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.stat-card:nth-child(2) .stat-icon { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }
.stat-card:nth-child(3) .stat-icon { background: linear-gradient(135deg, #06b6d4, #0e7490); }
.stat-card:nth-child(4) .stat-icon { background: linear-gradient(135deg, #f59e0b, #ea580c); }

.stat-value {
  position: relative;
  z-index: 1;
  font-size: 30px;
  font-weight: 800;
  margin-top: 12px;
  letter-spacing: -1.2px;
  line-height: 1;
}

.stat-card:nth-child(1) .stat-value { color: var(--c-blue); }
.stat-card:nth-child(2) .stat-value { color: var(--c-violet); }
.stat-card:nth-child(3) .stat-value { color: var(--c-cyan); }
.stat-card:nth-child(4) .stat-value { color: var(--c-orange); }

/* ============ 模块引导卡 ============ */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
}

.quick-card {
  position: relative;
  overflow: hidden;
  display: block;
  padding: 21px 20px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.22s, border-color 0.22s;
}

.quick-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  opacity: 0;
  transition: opacity 0.22s;
}

.quick-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
  border-color: var(--primary-border);
}

.quick-card:hover::before {
  opacity: 1;
}

.quick-blue::before { background: linear-gradient(180deg, #60a5fa, #2563eb); }
.quick-violet::before { background: linear-gradient(180deg, #a78bfa, #7c3aed); }
.quick-cyan::before { background: linear-gradient(180deg, #22d3ee, #0891b2); }
.quick-orange::before { background: linear-gradient(180deg, #fbbf24, #ea580c); }
.quick-rose::before { background: linear-gradient(180deg, #fb7185, #e11d48); }

.quick-icon {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  color: #fff;
  margin-bottom: 15px;
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.11);
}

.quick-blue .quick-icon { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.quick-violet .quick-icon { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }
.quick-cyan .quick-icon { background: linear-gradient(135deg, #06b6d4, #0e7490); }
.quick-orange .quick-icon { background: linear-gradient(135deg, #f59e0b, #ea580c); }
.quick-rose .quick-icon { background: linear-gradient(135deg, #fb7185, #e11d48); }

.quick-title {
  font-size: 15px;
  font-weight: 730;
  margin-bottom: 6px;
}

.quick-desc {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.65;
  min-height: 41px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.quick-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 12px;
  font-size: 12px;
  font-weight: 650;
}

.quick-blue .quick-link { color: var(--c-blue); }
.quick-violet .quick-link { color: var(--c-violet); }
.quick-cyan .quick-link { color: var(--c-cyan); }
.quick-orange .quick-link { color: var(--c-orange); }
.quick-rose .quick-link { color: var(--c-rose); }

.quick-card:hover .quick-link svg {
  transform: translateX(3px);
}

.quick-link svg {
  transition: transform 0.18s;
}

/* ============ 后台布局 ============ */
.admin-shell {
  min-height: 100dvh;
}

.admin-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 40;
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.admin-sidebar .brand {
  padding: 0 8px 20px;
}

.admin-nav-label {
  padding: 14px 10px 6px;
  color: var(--muted-light);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.admin-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 550;
  transition: all 0.16s;
}

.admin-nav a:hover {
  background: var(--surface-soft);
  color: var(--text);
}

.admin-nav a.active {
  background: linear-gradient(135deg, var(--primary-soft), #e0e7ff);
  color: var(--primary);
  font-weight: 700;
  box-shadow: inset 3px 0 0 var(--primary);
}

.admin-main {
  margin-left: var(--sidebar-w);
  min-height: 100dvh;
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--topbar-h);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
}

.admin-topbar strong {
  background: linear-gradient(120deg, #16213e, #334155);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.admin-content {
  padding: 28px 28px 68px;
}

/* ============ 统计卡片（后台） ============ */
.stat-grid.admin-stats {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

/* ============ 表格 ============ */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th {
  text-align: left;
  padding: 12px 15px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 13px 15px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

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

tbody tr:hover {
  background: var(--surface-soft);
}

.row-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.cell-title {
  font-weight: 650;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cell-sub {
  color: var(--muted-light);
  font-size: 11.5px;
  margin-top: 2px;
}

/* ============ 表单 ============ */
.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 650;
}

.field-hint {
  color: var(--muted-light);
  font-size: 11.5px;
  margin-top: 4px;
}

.input,
.textarea,
.select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  transition: border-color 0.18s, box-shadow 0.18s;
}

.input:focus,
.textarea:focus,
.select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.textarea {
  min-height: 140px;
  resize: vertical;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.6;
}

.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  max-width: 820px;
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

/* ============ 模态框 ============ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(3px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop.open {
  display: flex;
}

.modal {
  width: 100%;
  max-width: 520px;
  max-height: 90dvh;
  overflow-y: auto;
  background: var(--surface);
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
  padding: 24px;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.modal-title {
  font-size: 17px;
  font-weight: 750;
}

/* ============ 登录页 ============ */
.login-page {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 20px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 18%, rgba(96, 165, 250, 0.28), transparent 42%),
    radial-gradient(circle at 82% 82%, rgba(167, 139, 250, 0.26), transparent 42%),
    linear-gradient(135deg, #eef4ff, #f6f8fc);
}

.login-page::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(37, 99, 235, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 99, 235, 0.045) 1px, transparent 1px);
  background-size: 38px 38px;
  pointer-events: none;
}

.login-card {
  position: relative;
  width: 100%;
  max-width: 390px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 20px;
  padding: 36px;
  box-shadow: 0 20px 60px rgba(37, 99, 235, 0.16);
}

.login-mark {
  width: 50px;
  height: 50px;
  border-radius: 15px;
  background: linear-gradient(135deg, #2563eb, #60a5fa 55%, #7c3aed);
  color: #fff;
  display: grid;
  place-items: center;
  margin-bottom: 20px;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.32);
}

.login-title {
  font-size: 22px;
  font-weight: 800;
  margin: 0 0 5px;
  letter-spacing: -0.5px;
}

.login-desc {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 26px;
}

.alert {
  padding: 10px 13px;
  border-radius: 9px;
  font-size: 12.5px;
  margin-bottom: 14px;
  display: none;
}

.alert-error {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid #fecaca;
}

.alert-success {
  background: #f0fdf4;
  color: var(--success);
  border: 1px solid #bbf7d0;
}

/* ============ 文章正文 ============ */
.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 28px;
  align-items: start;
}

.prose {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 34px 38px;
  box-shadow: var(--shadow);
  font-size: 15px;
  line-height: 1.85;
  overflow-wrap: break-word;
}

.prose h1,
.prose h2,
.prose h3 {
  line-height: 1.35;
  margin: 1.6em 0 0.6em;
  letter-spacing: -0.2px;
}

.prose h1:first-child,
.prose h2:first-child,
.prose h3:first-child {
  margin-top: 0;
}

.prose h2 {
  font-size: 20px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.prose h3 {
  font-size: 17px;
}

.prose p {
  margin: 0 0 1em;
}

.prose a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.prose code {
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  font-size: 0.88em;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
}

.prose pre {
  padding: 16px;
  border-radius: 10px;
  background: #0f172a;
  color: #e2e8f0;
  overflow-x: auto;
  line-height: 1.6;
}

.prose pre code {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
}

.prose blockquote {
  margin: 1.2em 0;
  padding: 10px 16px;
  border-left: 3px solid var(--primary);
  background: var(--primary-soft);
  border-radius: 0 8px 8px 0;
  color: var(--muted);
}

.prose img {
  border-radius: 10px;
  margin: 1em 0;
}

.prose ul,
.prose ol {
  padding-left: 1.5em;
  margin-bottom: 1em;
}

.side-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 17px;
  box-shadow: var(--shadow);
  position: sticky;
  top: calc(var(--topbar-h) + 20px);
}

.side-card h3 {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
}

.side-meta {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 12.5px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}

.side-meta:last-child {
  border-bottom: none;
}

/* ============ 文件列表 ============ */
.file-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  color: var(--primary);
  display: grid;
  place-items: center;
}

.file-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.file-info {
  min-width: 0;
  flex: 1;
}

.file-name {
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============ 功能开关 ============ */
.feature-list {
  display: grid;
  gap: 10px;
  max-width: 820px;
}

.feature-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 17px;
}

.feature-body {
  flex: 1;
  min-width: 0;
}

.feature-name {
  font-size: 14px;
  font-weight: 680;
  margin-bottom: 2px;
}

.toggle {
  width: 44px;
  height: 25px;
  flex: 0 0 44px;
  padding: 3px;
  border: none;
  border-radius: 999px;
  background: #cbd5e1;
  transition: background 0.2s;
}

.toggle span {
  display: block;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s;
}

.toggle.on {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.toggle.on span {
  transform: translateX(19px);
}

/* ============ 访问统计图表 ============ */
.chart {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 180px;
  padding-top: 10px;
}

.chart-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
}

.chart-bars {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  border-bottom: 1px solid var(--border);
}

.chart-bar {
  width: 11px;
  border-radius: 4px 4px 0 0;
  transition: height 0.4s;
}

.chart-bar.pv { background: linear-gradient(180deg, #60a5fa, #2563eb); }
.chart-bar.uv { background: linear-gradient(180deg, #a78bfa, #7c3aed); }

.chart-label {
  margin-top: 8px;
  font-size: 10px;
  color: var(--muted-light);
  white-space: nowrap;
}

.chart-legend {
  display: flex;
  gap: 18px;
  justify-content: flex-end;
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted);
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.swatch.pv { background: var(--c-blue); }
.swatch.uv { background: var(--c-violet); }

/* ============ 图床 ============ */
.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 15px;
}

.image-card {
  overflow: hidden;
}

.image-thumb {
  display: block;
  height: 140px;
  background: var(--surface-soft);
  border-bottom: 1px solid var(--border);
}

.image-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.image-card:hover .image-thumb img {
  transform: scale(1.04);
}

.image-info {
  padding: 12px 13px;
}

.image-name {
  font-size: 13px;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

/* ============ 页脚 ============ */
.footer {
  text-align: center;
  padding: 24px 20px 40px;
  color: var(--muted-light);
  font-size: 12px;
}

/* ============ 入场动画 ============ */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero,
.stat-grid,
.quick-grid,
.section-title,
.grid > .card,
.empty {
  animation: fade-up 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.grid > .card:nth-child(2) { animation-delay: 0.04s; }
.grid > .card:nth-child(3) { animation-delay: 0.08s; }
.grid > .card:nth-child(4) { animation-delay: 0.12s; }
.grid > .card:nth-child(5) { animation-delay: 0.16s; }
.grid > .card:nth-child(n+6) { animation-delay: 0.2s; }
.quick-grid { animation-delay: 0.1s; }

/* ============ 响应式 ============ */
@media (max-width: 1024px) {
  .stat-grid,
  .quick-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .article-layout {
    grid-template-columns: 1fr;
  }
  .side-card {
    position: static;
  }
}

@media (max-width: 768px) {
  :root {
    --sidebar-w: 0px;
  }
  .topbar-inner {
    padding: 0 14px;
    gap: 12px;
  }
  .topnav a span {
    display: none;
  }
  .topnav a {
    padding: 8px;
  }
  .wrap {
    padding: 18px 14px 48px;
  }
  .brand-name {
    display: none;
  }
  .hero {
    padding: 30px 24px 26px;
    border-radius: 18px;
  }
  .hero-title {
    font-size: 27px;
  }
  .page-title {
    font-size: 22px;
  }
  .stat-grid,
  .quick-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 11px;
  }
  .stat-value {
    font-size: 25px;
  }
  .admin-sidebar {
    position: sticky;
    top: 0;
    width: 100%;
    height: auto;
    padding: 10px 14px;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .admin-sidebar .brand {
    padding: 0;
  }
  .admin-sidebar .admin-nav-label,
  .admin-sidebar .admin-nav-foot {
    display: none;
  }
  .admin-nav {
    display: flex;
    flex-direction: row;
    gap: 4px;
  }
  .admin-nav a {
    white-space: nowrap;
    padding: 7px 10px;
  }
  .admin-nav a span {
    display: none;
  }
  .admin-main {
    margin-left: 0;
  }
  .admin-topbar {
    padding: 0 14px;
  }
  .admin-content {
    padding: 18px 14px 48px;
  }
  .prose {
    padding: 20px;
  }
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
  }
}

@media (max-width: 460px) {
  .hero-actions {
    flex-direction: column;
  }
  .hero-btn {
    justify-content: center;
  }
}
