/* ============================================================
   深色为默认主题，支持 ?theme=light 切换浅色
   --------七游团队--------
   ============================================================ */

:root {
  color-scheme: dark;
  --bg-body: #101116;
  --bg-panel: #171920;
  --bg-card: #1d2029;
  --bg-card-hover: #242836;
  --bg-topbar: rgba(20, 22, 29, 0.82);
  --bg-notice: #13313b;
  --bg-tab: #1b1e27;
  --bg-tab-active: linear-gradient(135deg, #6b50ff, #22aaff);
  --border: #2a2e3a;
  --border-strong: #3b4150;
  --text-1: #f2f4fa;
  --text-2: #b6bccb;
  --text-3: #7d8598;
  --accent: #63b3ff;
  --accent-strong: #8fd0ff;
  --notice-accent: #45d9c5;
  --gradient: linear-gradient(135deg, #6b50ff, #22aaff);
  --shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
  --radius-sm: 8px;
  --radius: 12px;
  --font: "Microsoft YaHei", "PingFang SC", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
}

:root[data-theme="light"],
:root[data-pvf-theme="light"],
:root[data-pvf-theme="VS2019Light"] {
  color-scheme: light;
  --bg-body: #eef2f8;
  --bg-panel: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f4f7fd;
  --bg-topbar: rgba(255, 255, 255, 0.85);
  --bg-notice: #e5f2ff;
  --bg-tab: #eef2f9;
  --bg-tab-active: linear-gradient(135deg, #2563eb, #0ea5e9);
  --border: #e3e9f3;
  --border-strong: #c9d4e5;
  --text-1: #1b2436;
  --text-2: #47536b;
  --text-3: #75819a;
  --accent: #2563eb;
  --accent-strong: #1d4ed8;
  --notice-accent: #2563eb;
  --gradient: linear-gradient(135deg, #2563eb, #0ea5e9);
  --shadow: 0 10px 24px rgba(28, 54, 110, 0.10);
  --shadow-sm: 0 2px 6px rgba(28, 54, 110, 0.08);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  min-height: 100vh;
  background:
    radial-gradient(1200px 500px at 15% -10%, rgba(107, 80, 255, 0.16), transparent 60%),
    radial-gradient(1000px 500px at 90% -10%, rgba(34, 170, 255, 0.14), transparent 60%),
    var(--bg-body);
  color: var(--text-1);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
}

.shell {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 16px 28px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 4px;
  background: var(--bg-topbar);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.brand-logo {
  width: 38px;
  height: 38px;
  object-fit: contain;
  border-radius: 10px;
  flex: 0 0 auto;
}

.brand-logo.brand-letter {
  display: grid;
  place-items: center;
  background: var(--gradient);
  color: #fff;
  font-weight: 800;
  font-size: 18px;
  box-shadow: var(--shadow-sm);
}

.brand-block {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  min-width: 0;
}

.brand {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.subtitle { font-size: 12px; color: var(--text-3); white-space: nowrap; }

.topbar-spacer { flex: 1 1 auto; }

.visit-pill {
  flex: 0 0 auto;
  padding: 6px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--bg-panel);
  color: var(--text-2);
  font-size: 12px;
  white-space: nowrap;
}

/* ---------- 公告栏 ---------- */
.notice-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 18px;
  padding: 10px 16px;
  border: 1px solid rgba(69, 217, 197, 0.35);
  border-left: 3px solid var(--notice-accent);
  border-radius: var(--radius);
  background: var(--bg-notice);
  color: var(--text-1);
}

.notice-icon { display: inline-flex; flex: 0 0 auto; color: var(--notice-accent); }
.notice-text { flex: 1 1 auto; font-size: 13.5px; }

/* ---------- 分类标签 ---------- */
.cat-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
}

.cat-tab {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--border);
  background: var(--bg-tab);
  color: var(--text-2);
  font: inherit;
  font-size: 13px;
  padding: 7px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.cat-tab:hover {
  color: var(--text-1);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.cat-tab.is-active {
  background: var(--bg-tab-active);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(107, 80, 255, 0.35);
}

/* ---------- 导航网格（双排） ---------- */
.nav-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-content: start;
}

.nav-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text-1);
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.nav-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.nav-card:active { transform: translateY(0); }

/* 图标 */
.nav-icon {
  position: relative;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  overflow: hidden;
}

.nav-icon-letter {
  font-size: 17px;
  font-weight: 800;
  color: var(--accent);
  text-transform: uppercase;
}

.nav-icon img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 6px;
  background: var(--bg-panel);
}

.nav-icon img.failed { display: none; }

/* 文字 */
.nav-copy {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-title {
  font-size: 14.5px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-desc {
  font-size: 12.5px;
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-arrow {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  color: var(--text-3);
  opacity: 0.85;
  transform: translate(0, 0) rotate(0deg);
  transition: all 0.18s ease;
}

.nav-card:hover .nav-arrow {
  opacity: 1;
  color: var(--accent-strong);
  border-color: var(--border-strong);
  background: var(--bg-card-hover);
  transform: translate(2px, -2px) rotate(12deg);
  box-shadow: var(--shadow-sm);
}

/* 悬停详细介绍气泡 */
.nav-card::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%) translateY(6px);
  z-index: 60;
  width: max-content;
  max-width: 300px;
  padding: 9px 13px;
  border-radius: 10px;
  background: #0e0f14;
  border: 1px solid var(--border-strong);
  color: #e8ecf5;
  font-size: 12.5px;
  line-height: 1.6;
  white-space: pre-line;
  text-align: left;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s;
}

.nav-card:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

:root[data-theme="light"] .nav-card::after,
:root[data-pvf-theme="light"] .nav-card::after,
:root[data-pvf-theme="VS2019Light"] .nav-card::after {
  background: #ffffff;
  color: #26314a;
}

.nav-card.hidden { display: none; }

.empty-tip {
  grid-column: 1 / -1;
  padding: 40px 16px;
  text-align: center;
  color: var(--text-3);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
}

/* ---------- 页脚 ---------- */
.site-footer {
  margin-top: 26px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 12px;
  color: var(--text-3);
}

.site-footer code {
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--bg-tab);
  color: var(--accent);
}

/* ---------- 移动端 ---------- */
@media (max-width: 720px) {
  .shell { padding: 0 12px 20px; }
  .brand { font-size: 14.5px; }
  .subtitle { display: none; }
  .visit-pill { font-size: 11px; padding: 5px 9px; }
  .nav-grid { grid-template-columns: 1fr; }
  .cat-tabs { gap: 6px; }
  .cat-tab { padding: 6px 12px; font-size: 12.5px; }
  .nav-card { padding: 12px; }
}
