/* ============================================================
   WitchSpringR 攻略站 — 主题样式
   风格：墨绿 + 灰白黑 / 几何 / 等宽字体 / 硬边 / 小圆角
   ============================================================ */

:root {
  /* 基础色板（深青绿编辑器背景，取自游戏封面森林阴影，非纯黑） */
  --bg: #0e1d1c;
  --bg-deep: #081412;
  --bg-panel: #122825;
  --bg-panel-2: #17302c;
  --bg-sidebar: #0f1f1e;
  --bg-hovert: #1a3733;
  --bg-active: #20443f;

  /* 封面主强调色：青绿（取自封面 #87a9ac） */
  --accent: #6fb8b0;
  --accent-bright: #9adcd4;
  --accent-dim: #3f8f86;

  /* 暖粉点缀（取自封面 #cd7883） */
  --pink: #cd7883;
  --pink-bright: #e59aa3;

  /* 文字 */
  --text: #dcecea;
  --text-dim: #93b0ac;
  --text-faint: #64807c;
  --text-on-accent: #071314;

  /* 边框 / 分隔 */
  --border: #2a4a46;
  --border-soft: #1e3a36;
  --border-hard: #3d625c;

  /* 强调色系（badge 等，克制，仍以青绿为主） */
  --gold: #c9a86a;

  /* 字体 */
  --mono: "JetBrains Mono", "Consolas", "SFMono-Regular", Menlo, monospace;
  --sans: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", var(--mono);

  --radius: 4px;
  --radius-sm: 3px;
}

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

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.6;
  overflow: hidden;
}

::selection { background: var(--accent-dim); color: var(--text-on-accent); }

a { color: var(--accent-bright); text-decoration: none; }
a:hover { text-decoration: underline; }

/* 等宽字体默认用于代码题感元素 */
.mono, code, kbd, pre, .article-content code {
  font-family: var(--mono);
}

/* ============================================================
   背景几何纹理：球形投影网格 + 魔法阵圆环 + 十字星
   ============================================================ */
#bggeo {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    /* 球形投影网格：两组径向渐变交错，模拟经纬网格 */
    radial-gradient(circle at 50% 42%, rgba(111,184,176,0.05) 0%, transparent 55%),
    radial-gradient(circle at 50% 42%, transparent 0 30%, rgba(111,184,176,0.06) 31% 32%, transparent 33% 66%, rgba(111,184,176,0.05) 67% 68%, transparent 69%),
    repeating-radial-gradient(circle at 50% 42%, rgba(111,184,176,0.05) 0 1px, transparent 1px 44px),
    repeating-linear-gradient(0deg, rgba(111,184,176,0.04) 0 1px, transparent 1px 44px),
    repeating-linear-gradient(90deg, rgba(111,184,176,0.04) 0 1px, transparent 1px 44px),
    radial-gradient(ellipse at top, var(--bg-panel) 0%, var(--bg) 55%, var(--bg-deep) 100%);
}

/* 魔法阵装饰圆环（右下） */
#bggeo::before {
  content: "";
  position: absolute;
  right: -140px;
  bottom: -140px;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  border: 1px solid rgba(111,184,176,0.10);
  box-shadow:
    inset 0 0 0 34px rgba(111,184,176,0.03),
    inset 0 0 0 72px rgba(111,184,176,0.025),
    0 0 0 1px rgba(111,184,176,0.06),
    0 0 0 120px rgba(111,184,176,0.02);
  background:
    repeating-conic-gradient(from 0deg, rgba(111,184,176,0.05) 0deg 12deg, transparent 12deg 30deg);
  animation: spin 60s linear infinite;
}

/* 魔法阵装饰圆环（左上，小） */
#bggeo::after {
  content: "";
  position: absolute;
  left: -80px;
  top: -80px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  border: 1px dashed rgba(111,184,176,0.10);
  background:
    repeating-conic-gradient(from 45deg, rgba(111,184,176,0.04) 0deg 20deg, transparent 20deg 40deg);
  animation: spin 40s linear infinite reverse;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* 十字星点缀（三角分布的菱形星） */
.star {
  position: absolute;
  color: var(--accent);
  text-shadow: 0 0 6px rgba(95,212,160,0.5);
  animation: twinkle 3.2s ease-in-out infinite;
}
@keyframes twinkle {
  0%, 100% { opacity: 0.25; transform: scale(0.8); }
  50% { opacity: 0.9; transform: scale(1.1); }
}

/* ============================================================
   应用外壳
   ============================================================ */
#app {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* ============================================================
   顶部菜单栏（VS Code 风格）
   ============================================================ */
.topbar {
  display: flex;
  align-items: center;
  gap: 18px;
  height: 40px;
  flex: 0 0 40px;
  padding: 0 14px;
  background: var(--bg-deep);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  white-space: nowrap;
}

.logo {
  width: 22px;
  height: 22px;
  color: var(--accent-bright);
  display: inline-block;
}
.logo svg { width: 100%; height: 100%; display: block; }

.brand-name {
  font-family: var(--mono);
  font-weight: 700;
  letter-spacing: 1px;
  font-size: 13px;
  color: var(--text);
}
.brand-name .accent { color: var(--accent-bright); }
.brand-sub { color: var(--text-faint); font-weight: 400; letter-spacing: 0; }

.topbar-tabs { display: flex; gap: 2px; height: 100%; }
.tb-item {
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  font-size: 13px;
  color: var(--text-dim);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  user-select: none;
}
.tb-item:hover { color: var(--text); background: var(--bg-panel); }
.tb-item.active {
  color: var(--accent-bright);
  border-bottom-color: var(--accent-bright);
}

.topbar-right { margin-left: auto; display: flex; align-items: center; }
.mode-hint {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-faint);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px 8px;
  background: var(--bg-panel);
}
.mode-hint.warn { color: var(--gold); border-color: rgba(201,168,106,0.4); }

/* ============================================================
   布局：左侧栏 + 主内容
   ============================================================ */
.layout {
  flex: 1;
  display: flex;
  min-height: 0; /* 允许子元素滚动 */
}

/* ============================================================
   左侧分区导航
   ============================================================ */
.sidebar {
  flex: 0 0 238px;
  min-width: 238px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 10px 0 24px;
}

.side-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px 8px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--text-faint);
  text-transform: uppercase;
}
.side-head::before { content: "▸"; color: var(--accent); }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px;
  margin: 1px 8px;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  cursor: pointer;
  user-select: none;
  border: 1px solid transparent;
  font-size: 13px;
}
.nav-item:hover { background: var(--bg-hovert); color: var(--text); }
.nav-item.active {
  background: var(--bg-active);
  color: var(--accent-bright);
  border-color: var(--border);
}
.nav-ico {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.nav-ico svg { width: 16px; height: 16px; }
.nav-count {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-faint);
  background: var(--bg-panel);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 0 7px;
}
.nav-item.active .nav-count { color: var(--accent-bright); }

.side-foot {
  margin-top: 18px;
  padding: 10px 14px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-faint);
  border-top: 1px solid var(--border-soft);
  line-height: 1.7;
}

/* ============================================================
   主内容区
   ============================================================ */
.content {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding: 22px 28px 60px;
}

/* 页头 */
.page-head { margin-bottom: 18px; }
.page-title {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}
.page-title .rule { color: var(--accent); }
.page-sub {
  margin-top: 6px;
  color: var(--text-dim);
  font-size: 13px;
}

/* 硬边分隔线 */
.hr {
  height: 1px;
  margin: 18px 0;
  background: linear-gradient(90deg, var(--border-hard), var(--border-soft) 60%, transparent);
  border: 0;
}

/* ============================================================
   搜索框
   ============================================================ */
.search-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 12px;
  max-width: 620px;
  margin-bottom: 18px;
}
.search-wrap:focus-within { border-color: var(--accent); }
.search-ico { width: 16px; height: 16px; color: var(--text-faint); flex: 0 0 16px; }
.search-ico svg { width: 100%; height: 100%; }
.search-wrap input {
  flex: 1;
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
  height: 36px;
}
.search-wrap input::placeholder { color: var(--text-faint); }
.search-clear {
  border: 0;
  background: transparent;
  color: var(--text-faint);
  font-size: 15px;
  cursor: pointer;
  padding: 2px 4px;
}
.search-clear:hover { color: var(--text); }

.search-summary {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-faint);
  margin-bottom: 12px;
}
.search-summary b { color: var(--accent-bright); font-weight: 600; }

/* ============================================================
   攻略卡片 / 列表
   ============================================================ */
.article-list { display: flex; flex-direction: column; gap: 8px; }

.article-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-panel);
  border: 1px solid var(--border-soft);
  border-left: 3px solid var(--accent-dim);
  border-radius: var(--radius);
  padding: 10px 14px;
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.article-card:hover {
  background: var(--bg-panel-2);
  border-left-color: var(--accent);
  border-color: var(--border);
}
.card-ico {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  color: var(--accent-bright);
}
.card-ico svg { width: 100%; height: 100%; }
.card-main { flex: 1; min-width: 0; }
.card-title {
  font-size: 14px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.article-card:hover .card-title { color: var(--accent-bright); }
.card-meta {
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-faint);
}
.badge {
  display: inline-block;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 6px;
  line-height: 16px;
  font-size: 11px;
}
.badge.src { color: var(--pink-bright); border-color: rgba(205,120,131,0.35); }
.badge.cat { color: var(--accent-bright); border-color: rgba(111,184,176,0.4); }

.card-img-tag {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent-bright);
  border: 1px solid rgba(111,184,176,0.4);
  border-radius: var(--radius-sm);
  padding: 0 6px;
  line-height: 16px;
  white-space: nowrap;
}
.card-img-tag.none { color: var(--text-faint); border-color: var(--border-soft); }

/* 空态 */
.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-faint);
  font-family: var(--mono);
}
.empty .empty-ico { font-size: 28px; margin-bottom: 10px; color: var(--accent-dim); }

/* ============================================================
   图鉴（卡片网格）
   ============================================================ */
.tp-loading {
  padding: 40px;
  text-align: center;
  color: var(--text-dim);
  font-family: var(--mono);
}
.tp-loading .spin {
  display: inline-block;
  width: 18px; height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
}

.tp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 6px;
}
.tp-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.12s ease, transform 0.12s ease, background 0.12s ease;
  display: flex;
  flex-direction: column;
}
.tp-card:hover {
  border-color: var(--accent);
  background: var(--bg-panel-2);
  transform: translateY(-2px);
}
.tp-thumb {
  aspect-ratio: 1 / 1;
  background: var(--bg-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.tp-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }

/* 几何风格占位图 */
.tp-fb {
  position: relative;
  background:
    radial-gradient(circle at 50% 50%, rgba(111,184,176,0.10), transparent 60%),
    var(--bg-deep);
}
.tp-fb-ring {
  position: absolute;
  width: 68%; height: 68%;
  border: 1px solid var(--accent-dim);
  border-radius: 50%;
  box-shadow: inset 0 0 0 10px rgba(111,184,176,0.05), 0 0 0 12px rgba(111,184,176,0.03);
}
.tp-fb-letter {
  position: relative;
  font-family: var(--mono);
  font-size: 34px;
  color: var(--accent);
  text-shadow: 0 0 12px rgba(111,184,176,0.5);
}

.tp-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; }
.tp-name {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tp-card:hover .tp-name { color: var(--accent-bright); }
.tp-tag {
  align-self: flex-start;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--pink-bright);
  border: 1px solid rgba(205,120,131,0.35);
  border-radius: var(--radius-sm);
  padding: 0 6px;
  line-height: 15px;
}
/* 装备图鉴：类型角标配色（武器/盾牌/盔甲/饰品） */
.tp-tag.tg-weapon { color: var(--pink-bright); border-color: rgba(205,120,131,0.35); }
.tp-tag.tg-shield { color: #8fc1ea; border-color: rgba(143,193,234,0.4); }
.tp-tag.tg-armor { color: #d8b26a; border-color: rgba(216,178,106,0.4); }
.tp-tag.tg-trinket { color: #a5e39a; border-color: rgba(165,227,154,0.4); }
.tp-loc {
  font-size: 11px;
  color: var(--text-faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 素材图鉴：筛选/搜索工具条 */
.mat-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  margin: 8px 0 10px;
  background: var(--bg-panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  font-family: var(--mono);
}
.mat-bar select,
.mat-bar input,
.mat-bar .mat-clear {
  background: var(--bg-deep);
  color: var(--text);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-size: 12px;
  height: 28px;
  padding: 0 8px;
}
.mat-bar select:focus,
.mat-bar input:focus,
.mat-bar .mat-clear:focus {
  border-color: var(--accent);
  outline: none;
}
.mat-bar .mat-q {
  flex: 1;
  min-width: 170px;
}
.mat-bar .mat-clear {
  cursor: pointer;
  transition: border-color 0.12s ease, color 0.12s ease;
}
.mat-bar .mat-clear:hover {
  border-color: var(--accent);
  color: var(--accent-bright);
}
.mat-bar .mat-count {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-faint);
  white-space: nowrap;
}

/* 图鉴详情模态 */
.tp-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(4,10,9,0.72);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.tp-dialog {
  width: 100%;
  max-width: 520px;
  max-height: 86vh;
  overflow-y: auto;
  background: var(--bg-panel);
  border: 1px solid var(--border-hard);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
}
.tp-dhead {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-deep);
}
.tp-dcat {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--accent-bright);
  text-transform: uppercase;
}
.tp-dclose {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: var(--text-faint);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
}
.tp-dclose:hover { color: var(--text); }
.tp-dhead-sp { flex: 1; }
.tp-mlink {
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  font-size: 11px;
  font-family: var(--mono);
  padding: 3px 8px;
  border-radius: var(--radius);
  cursor: pointer;
}
.tp-mlink:hover { background: var(--accent); color: #04261f; }
.tp-dbody {
  display: flex;
  gap: 16px;
  padding: 18px;
  border-bottom: 1px solid var(--border-soft);
}
.tp-dthumb {
  width: 110px;
  height: 110px;
  flex: 0 0 110px;
  background: var(--bg-deep);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tp-dthumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.tp-dinfo { display: flex; flex-direction: column; justify-content: center; gap: 6px; min-width: 0; }
.tp-dname { font-family: var(--mono); font-size: 20px; font-weight: 700; color: var(--text); }
.tp-dsub { font-family: var(--mono); font-size: 12px; color: var(--text-faint); }
.tp-detail { padding: 6px 18px 18px; }
/* 图鉴双链：详情里的关联图鉴入口 */
.tp-xlink {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 18px;
  padding: 7px 10px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: var(--bg-panel);
  font-family: var(--mono);
  font-size: 12px;
}
.tp-xlink-label { color: var(--text-faint); }
.tp-xlink a { color: var(--accent-bright); text-decoration: none; }
.tp-xlink a:hover { text-decoration: underline; }
.tp-table {
  border-collapse: collapse;
  width: 100%;
}
.tp-table th, .tp-table td {
  border: 1px solid var(--border-soft);
  padding: 7px 10px;
  text-align: left;
  font-size: 13px;
  vertical-align: top;
}
.tp-table th {
  width: 74px;
  background: var(--bg-panel-2);
  color: var(--accent-bright);
  font-family: var(--mono);
  font-size: 12px;
  white-space: nowrap;
}
.tp-table td { color: var(--text); line-height: 1.6; }

/* ============================================================
   支线图鉴：卡片 + 完整剧情页 + 系列分组 + 滑动条
   ============================================================ */
.side-groups { display: flex; flex-direction: column; gap: 18px; margin-top: 6px; }
.side-group { display: flex; flex-direction: column; gap: 8px; }
.side-group-title {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-bright);
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
}
.side-group-count {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  color: var(--text-faint);
}
.side-track-wrap { position: relative; }
.side-track {
  display: flex;
  gap: 12px;
  padding: 2px;
}
.side-track.scroll { overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: 6px; }
.side-track.scroll::-webkit-scrollbar { height: 8px; }
.side-card {
  flex: 0 0 220px;
  background: var(--bg-panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.12s ease, transform 0.06s ease;
  scroll-snap-align: start;
}
.side-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.side-card .tp-thumb { height: 118px; }
.side-body { padding: 9px 11px 11px; display: flex; flex-direction: column; gap: 5px; }
.side-tags { display: flex; gap: 5px; flex-wrap: wrap; }
.side-stage, .side-tl {
  font-family: var(--mono);
  font-size: 10px;
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  color: var(--text-dim);
}
.side-tl { color: var(--gold); border-color: rgba(201,168,106,0.4); }
.side-tl.miss { color: #e05a5a; border-color: rgba(224,90,90,0.45); }
.side-name { font-family: var(--mono); font-size: 13px; font-weight: 700; color: var(--text); line-height: 1.35; }
.side-loc { font-family: var(--mono); font-size: 11px; color: var(--text-faint); line-height: 1.4; }
/* 图鉴双链：宝箱卡片上的关联图鉴链接 */
.side-xlink {
  display: inline-block;
  margin-top: 2px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent-bright);
  text-decoration: none;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.side-xlink:hover { text-decoration: underline; }

/* 滑动按钮 */
.side-scroll-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-panel);
  color: var(--accent-bright);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  opacity: 0.85;
}
.side-scroll-btn:hover { background: var(--bg-active); border-color: var(--accent); opacity: 1; }
.side-scroll-l { left: -12px; }
.side-scroll-r { right: -12px; }

/* 完整剧情页弹窗 */
.side-dialog { max-width: 640px; }
.side-dbody { padding: 16px 20px 20px; display: flex; flex-direction: column; gap: 14px; }
.side-dhead { display: flex; gap: 14px; }
.side-dthumb { width: 132px; height: 120px; flex: 0 0 auto; }
.side-dinfo { display: flex; flex-direction: column; justify-content: center; gap: 8px; min-width: 0; }
.side-dname { font-family: var(--mono); font-size: 19px; font-weight: 700; color: var(--text); line-height: 1.3; }
.side-dmeta { display: flex; flex-direction: column; gap: 3px; font-family: var(--mono); font-size: 12px; color: var(--text-faint); line-height: 1.5; }
.side-sec { display: flex; flex-direction: column; gap: 6px; }
.side-sec-title {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-bright);
  border-bottom: 1px solid var(--border);
  padding-bottom: 4px;
}
.side-step { display: flex; gap: 9px; align-items: flex-start; }
.side-step-n {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg-deep);
  border: 1px solid var(--accent);
  color: var(--accent-bright);
  font-family: var(--mono);
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}
.side-step-t { font-size: 13px; color: var(--text); line-height: 1.7; }
.side-table td { line-height: 1.7; }
.side-miss-banner {
  border: 1px solid rgba(224,90,90,0.5);
  border-left: 3px solid #e05a5a;
  background: rgba(224,90,90,0.08);
  color: #e08a8a;
  padding: 8px 11px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  line-height: 1.6;
}
.side-uncertain {
  border: 1px solid rgba(201,168,106,0.5);
  border-left: 3px solid var(--gold);
  background: rgba(201,168,106,0.08);
  padding: 8px 11px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  line-height: 1.7;
}
.side-uncertain b { color: var(--gold); font-family: var(--mono); }
.side-uncertain p { margin: 4px 0; color: var(--text-dim); }
.side-sources {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-faint);
  border-top: 1px dashed var(--border);
  padding-top: 8px;
}
.side-sources a { color: var(--accent-bright); text-decoration: none; word-break: break-all; }
.side-sources a:hover { text-decoration: underline; }

/* ============================================================
   首页分区概览
   ============================================================ */
.home-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 6px;
}
.home-tile {
  background: var(--bg-panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.home-tile:hover { border-color: var(--accent); background: var(--bg-panel-2); }
.tile-ico { width: 26px; height: 26px; color: var(--accent-bright); }
.tile-ico svg { width: 100%; height: 100%; }
.tile-name { font-family: var(--mono); font-size: 15px; color: var(--text); font-weight: 600; }
.tile-count { font-family: var(--mono); font-size: 12px; color: var(--text-faint); }
.tile-count b { color: var(--accent-bright); }

/* ============================================================
   文章详情
   ============================================================ */
.article-detail {
  max-width: 860px;
}
.detail-head { margin-bottom: 16px; }
.detail-cat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent-bright);
  margin-bottom: 8px;
}
.detail-cat svg { width: 14px; height: 14px; }
.detail-title {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text);
}
.detail-meta {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-faint);
}
.detail-actions {
  display: flex;
  gap: 8px;
  margin: 14px 0;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent-bright);
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  cursor: pointer;
}
.btn:hover { border-color: var(--accent); background: var(--bg-active); }
.btn svg { width: 14px; height: 14px; }
.btn.back { color: var(--text-dim); }
.btn.back:hover { color: var(--text); }

/* 本地正文（HTML 片段） */
.article-content {
  background: var(--bg-panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 22px;
  line-height: 1.8;
  color: var(--text);
}
.article-content h1, .article-content h2, .article-content h3 {
  font-family: var(--mono);
  color: var(--accent-bright);
  margin: 18px 0 10px;
  font-weight: 700;
}
.article-content h1 { font-size: 20px; border-bottom: 1px solid var(--border); padding-bottom: 6px; }
.article-content h2 { font-size: 17px; }
.article-content h3 { font-size: 15px; }
.article-content p { margin: 8px 0; }
.article-content ul, .article-content ol { margin: 8px 0 8px 22px; }
.article-content li { margin: 4px 0; }
.article-content img {
  display: block;
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 14px auto;
}
.article-content blockquote {
  border-left: 3px solid var(--accent);
  padding: 6px 12px;
  margin: 10px 0;
  color: var(--text-dim);
  background: var(--bg-panel-2);
}
.article-content code {
  background: var(--bg-deep);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 1px 5px;
  font-size: 12px;
  color: var(--accent-bright);
}
.article-content table { border-collapse: collapse; width: 100%; margin: 12px 0; }
.article-content th, .article-content td {
  border: 1px solid var(--border);
  padding: 6px 10px;
  text-align: left;
  font-size: 13px;
}
.article-content th { background: var(--bg-panel-2); color: var(--accent-bright); font-family: var(--mono); }

/* 加载 / 降级提示 */
.detail-loading { padding: 40px; text-align: center; color: var(--text-dim); font-family: var(--mono); }
.detail-loading .spin {
  display: inline-block;
  width: 18px; height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
}
.fallback-box {
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  background: var(--bg-panel);
  padding: 16px;
  margin: 14px 0;
}
.fallback-box h4 {
  font-family: var(--mono);
  color: var(--gold);
  margin-bottom: 8px;
  font-size: 14px;
}
.fallback-box p { color: var(--text-dim); font-size: 13px; margin-bottom: 10px; }

/* iframe 降级正文 */
.detail-iframe {
  width: 100%;
  height: 70vh;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff; /* 外部页面大多为浅色 */
}

/* 全收集地图：整块填充主内容区（去掉内边距让地图铺满） */
.content:has(.map-frame) {
  padding: 0;
  overflow: hidden;
}
.map-frame {
  width: 100%;
  height: calc(100vh - 40px);
  border: 0;
  border-radius: 0;
  background: #f4ecd8;
  display: block;
}

/* ============================================================
   提示条
   ============================================================ */
.notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--bg-panel);
  border: 1px solid rgba(201,168,106,0.35);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 18px;
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.7;
}
.notice b { color: var(--gold); font-family: var(--mono); }
.notice code {
  font-family: var(--mono);
  background: var(--bg-deep);
  border: 1px solid var(--border-soft);
  padding: 0 5px;
  border-radius: var(--radius-sm);
  color: var(--accent-bright);
}

/* ============================================================
   滚动条
   ============================================================ */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 5px;
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--accent-dim); }

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 760px) {
  .sidebar { flex-basis: 60px; min-width: 60px; }
  .nav-item { justify-content: center; padding: 10px 0; }
  .nav-item .nav-label, .nav-item .nav-count { display: none; }
  .side-head, .side-foot { display: none; }
  .brand-sub, .mode-hint { display: none; }
  .content { padding: 16px 14px 40px; }
}