/* 运维小巴 · 聚合中心 v1.0 */
:root {
  --primary: #1E5BB5;
  --primary-light: #3b82f6;
  --primary-dark: #14448a;
  --primary-soft: #e8f0fc;
  --bg: #f5f7fa;
  --bg-soft: #eef2f7;
  --card: #ffffff;
  --text: #1f2937;
  --text-muted: #6b7280;
  --text-light: #9ca3af;
  --border: #e5e7eb;
  --gold: #d97706;
  --cyan: #0891b2;
  --green: #10b981;
  --red: #ef4444;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow: 0 2px 8px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .04);
  --shadow-lg: 0 10px 30px rgba(30, 91, 181, .12), 0 2px 6px rgba(15, 23, 42, .06);
  --radius: 10px;
  --radius-sm: 6px;
  --sidebar-w: 220px;
  --topbar-h: 60px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  font-family: "Noto Sans CJK SC", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ============ 顶栏 ============ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--topbar-h);
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .08);
}
.topbar-left { display: flex; align-items: center; gap: 32px; }
.topbar-right { display: flex; align-items: center; gap: 12px; font-size: 13px; }

.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 32px; height: 32px;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px;
  color: #fff;
}
.brand-title { font-size: 16px; font-weight: 600; line-height: 1.2; }
.brand-sub { font-size: 11px; opacity: .8; letter-spacing: .5px; }

.topnav { display: flex; gap: 4px; }
.topnav-item {
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 14px;
  opacity: .85;
  transition: background .2s, opacity .2s;
}
.topnav-item:hover { background: rgba(255,255,255,.1); opacity: 1; }
.topnav-item.active {
  background: rgba(255,255,255,.18);
  opacity: 1;
  font-weight: 500;
}

.topbar-divider { opacity: .4; }
.topbar-user { font-weight: 500; }
.topbar-role { opacity: .8; cursor: pointer; }
.topbar-role:hover { opacity: 1; }

/* ============ 布局 ============ */
.layout {
  display: flex;
  min-height: calc(100vh - var(--topbar-h));
}

/* ============ 侧边栏 ============ */
.sidebar {
  width: var(--sidebar-w);
  background: #fff;
  border-right: 1px solid var(--border);
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: var(--topbar-h);
  align-self: flex-start;
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
}
.sidebar-group-title {
  font-size: 12px;
  color: var(--text-light);
  font-weight: 500;
  padding: 0 8px 8px;
  letter-spacing: .5px;
}
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  transition: background .2s, color .2s;
  margin-bottom: 2px;
}
.sidebar-item:hover {
  background: var(--primary-soft);
  color: var(--primary);
}
.sidebar-item:hover .sidebar-arrow {
  transform: translateX(2px);
  color: var(--primary);
}
.sidebar-label { flex: 1; }
.sidebar-arrow { color: var(--text-light); font-size: 16px; transition: transform .2s, color .2s; }

.dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-blue { background: var(--primary); }
.dot-cyan { background: var(--cyan); }
.dot-gold { background: var(--gold); }

.sidebar-footer {
  margin-top: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 12px 8px 4px;
  border-top: 1px solid var(--border);
}
.sidebar-stat {
  background: var(--primary-soft);
  border-radius: var(--radius-sm);
  padding: 10px 6px;
  text-align: center;
}
.stat-num {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.2;
}
.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ============ 主区域 ============ */
.main {
  flex: 1;
  padding: 32px 40px 40px;
  min-width: 0;
}

.welcome {
  background: #fff;
  border-radius: var(--radius);
  padding: 32px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  box-shadow: var(--shadow);
  margin-bottom: 32px;
  position: relative;
  overflow: hidden;
}
.welcome::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--primary-soft) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}
.welcome-text, .welcome-art { position: relative; z-index: 1; }
.welcome-text h1 {
  margin: 0 0 8px;
  font-size: 28px;
  font-weight: 600;
  color: var(--text);
}
.welcome-tilde { color: var(--primary); font-weight: 400; }
.welcome-sub {
  margin: 0 0 16px;
  font-size: 14px;
  color: var(--text-muted);
}
.welcome-sub strong { color: var(--primary); font-weight: 600; }
.welcome-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--primary-soft);
  color: var(--primary);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
}
.welcome-art { flex-shrink: 0; }
.welcome-art svg { width: 280px; height: auto; display: block; }

.section-title {
  margin: 0 0 16px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title::before {
  content: "";
  width: 3px;
  height: 14px;
  background: var(--primary);
  border-radius: 2px;
}

/* ============ 站点卡片 ============ */
.cards { margin-bottom: 32px; }
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: transform .2s, box-shadow .2s, border-color .2s;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 12px;
  cursor: pointer;
}
.card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--primary);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform .2s;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
}
.card:hover::before { transform: scaleY(1); }

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.card-icon {
  width: 42px; height: 42px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.card-icon.cat-263 { background: linear-gradient(135deg, var(--primary), var(--primary-light)); }
.card-icon.cat-bt { background: linear-gradient(135deg, var(--cyan), #06b6d4); }
.card-icon.cat-xs { background: linear-gradient(135deg, var(--gold), #f59e0b); }

.card-tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 500;
  background: var(--primary-soft);
  color: var(--primary);
}
.card-tag.tag-bt { background: #cffafe; color: var(--cyan); }
.card-tag.tag-xs { background: #fef3c7; color: var(--gold); }

.card-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}
.card-desc {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  flex: 1;
}
.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
  font-size: 12px;
  color: var(--text-light);
}
.card-url {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  color: var(--text-muted);
}
.card-go {
  color: var(--primary);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: gap .2s;
}
.card:hover .card-go { gap: 8px; }

/* ============ 快捷入口 ============ */
.shortcuts { margin-bottom: 24px; }
.shortcut-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.shortcut {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: border-color .2s, transform .2s, background .2s;
}
.shortcut:hover {
  border-color: var(--primary-light);
  background: var(--primary-soft);
  transform: translateY(-1px);
}
.shortcut-icon { font-size: 22px; }
.shortcut-name {
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
}

/* ============ 页脚 ============ */
.page-footer {
  text-align: center;
  font-size: 12px;
  color: var(--text-light);
  padding: 16px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}
.dot-sep { opacity: .5; }

/* ============ 响应式 ============ */
@media (max-width: 900px) {
  .sidebar { display: none; }
  .main { padding: 20px; }
  .welcome { flex-direction: column; padding: 24px; text-align: center; }
  .welcome-meta { justify-content: center; }
  .welcome-art { display: none; }
  .topnav { display: none; }
}
@media (max-width: 600px) {
  .topbar { padding: 0 12px; }
  .brand-sub { display: none; }
  .topbar-role { display: none; }
  .card-grid { grid-template-columns: 1fr; }
  .welcome-text h1 { font-size: 22px; }
}
