/* ==========================================================================
   PurplePVP Network — GitHub 暗色主题风格
   ========================================================================== */

:root {
  --bg-canvas: #0d1117;
  --bg-default: #010409;
  --bg-subtle: #161b22;
  --bg-inset: #010409;
  --bg-overlay: #161b22;

  --border-default: #30363d;
  --border-muted: #21262d;

  --fg-default: #e6edf3;
  --fg-muted: #8b949e;
  --fg-subtle: #6e7681;
  --fg-on-emphasis: #ffffff;

  --accent-fg: #a855f7;
  --accent-emphasis: #8957e5;
  --accent-subtle: rgba(168, 85, 247, 0.15);
  --accent-muted: rgba(168, 85, 247, 0.4);

  --success-fg: #3fb950;
  --success-subtle: rgba(63, 185, 80, 0.15);
  --attention-fg: #d29922;
  --danger-fg: #f85149;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial,
    sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --radius: 6px;
  --rail-w: 78px;
  --shadow-md: 0 3px 6px rgba(1, 4, 9, 0.15);
  --shadow-lg: 0 8px 24px rgba(1, 4, 9, 0.5);
}

[data-color-mode="light"] {
  --bg-canvas: #ffffff;
  --bg-default: #ffffff;
  --bg-subtle: #f6f8fa;
  --bg-inset: #f6f8fa;
  --border-default: #d0d7de;
  --border-muted: #d8dee4;
  --fg-default: #1f2328;
  --fg-muted: #656d76;
  --fg-subtle: #6e7781;
  --accent-fg: #8250df;
}

* { box-sizing: border-box; }

/* 防止 SVG 在样式缺失时按容器撑满（兜底） */
svg { max-width: 100%; }
svg[width]:not([width=""]), svg[height]:not([height=""]) { flex-shrink: 0; }

html { scroll-behavior: smooth; scroll-padding-top: 20px; }

body {
  margin: 0;
  background: var(--bg-canvas);
  color: var(--fg-default);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

code, kbd { font-family: var(--font-mono); font-size: 12px; }

code {
  background: rgba(110, 118, 129, 0.25);
  padding: 0.2em 0.4em;
  border-radius: var(--radius);
  white-space: nowrap;
}

/* ===================== 左侧竖向导航栏 ===================== */

.side-rail {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--rail-w);
  z-index: 120;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 16px 0 16px;
  background: var(--bg-default);
  border-right: 1px solid var(--border-default);
  overflow-y: auto;
  scrollbar-width: none;
}

.side-rail::-webkit-scrollbar { display: none; }

.rail-logo {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  margin-bottom: 14px;
  flex-shrink: 0;
  transition: box-shadow 0.25s, transform 0.25s;
}

.rail-logo img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: block;
  filter: drop-shadow(0 0 10px rgba(168, 85, 247, 0.55));
}

.rail-logo:hover {
  transform: scale(1.06);
  box-shadow: 0 0 0 2px var(--accent-muted), 0 0 20px rgba(168, 85, 247, 0.55);
}

.rail-group { display: flex; flex-direction: column; gap: 2px; width: 100%; align-items: center; }

.rail-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 60px;
  padding: 9px 0 8px;
  border: none;
  border-radius: var(--radius);
  background: none;
  color: var(--fg-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
}

.rail-item svg { width: 21px; height: 21px; flex-shrink: 0; }

.rail-label {
  font-size: 10.5px;
  line-height: 1.15;
  letter-spacing: -0.1px;
  white-space: nowrap;
}

.rail-item:hover {
  background: var(--bg-subtle);
  color: var(--fg-default);
  text-decoration: none;
}

.rail-item.active {
  background: var(--accent-subtle);
  color: var(--accent-fg);
}

/* 左侧高亮条 */
.rail-item.active::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 22px;
  border-radius: 0 3px 3px 0;
  background: var(--accent-fg);
}

.rail-spacer { flex: 1; min-height: 8px; max-height: 40px; }

.rail-divider {
  width: 32px;
  height: 1px;
  margin: 10px 0;
  background: var(--border-default);
  flex-shrink: 0;
}

.rail-search { margin-top: 2px; }

.rail-join {
  background: var(--accent-emphasis);
  color: #fff;
  width: 62px;
  margin-top: 4px;
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.35);
}

.rail-join:hover {
  background: #a855f7;
  color: #fff;
}

.rail-avatar {
  position: relative;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-top: 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, #a855f7, #6b21a8);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  border: 1px solid var(--border-default);
  flex-shrink: 0;
}

/* 悬停提示 */
.rail-item[data-tip]::after,
.rail-avatar[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%) translateX(-4px);
  padding: 4px 9px;
  border-radius: var(--radius);
  background: var(--bg-overlay);
  border: 1px solid var(--border-default);
  color: var(--fg-default);
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s, transform 0.15s;
  box-shadow: var(--shadow-md);
  z-index: 10;
}

.rail-avatar { position: relative; }

.rail-item[data-tip]:hover::after,
.rail-avatar[data-tip]:hover::after {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

/* ===================== 搜索抽屉 ===================== */

.search-drawer {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 14vh;
  background: rgba(1, 4, 9, 0.72);
  backdrop-filter: blur(3px);
  animation: fadeIn 0.15s ease;
}

.search-drawer[hidden] { display: none; }

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(620px, calc(100vw - 40px));
  padding: 12px 16px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-default);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  animation: slideDown 0.18s ease;
}

@keyframes slideDown {
  from { transform: translateY(-8px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.search-icon { width: 16px; height: 16px; color: var(--fg-muted); flex-shrink: 0; }

.search-box input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--fg-default);
  font: inherit;
  font-size: 15px;
}

.search-box input::placeholder { color: var(--fg-subtle); }

.search-box kbd {
  background: var(--bg-canvas);
  border: 1px solid var(--border-default);
  border-radius: 4px;
  padding: 1px 6px;
  color: var(--fg-muted);
  font-size: 11px;
  flex-shrink: 0;
}

/* ===================== 通用按钮 ===================== */

.gh-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: inherit;
  font-weight: 600;
  font-size: 13px;
  padding: 5px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border-default);
  background: var(--bg-subtle);
  color: var(--fg-default);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

.gh-btn:hover { background: #21262d; text-decoration: none; }
.gh-btn:active { transform: scale(0.98); }

.gh-btn-primary {
  background: var(--accent-emphasis);
  border-color: rgba(168, 85, 247, 0.6);
  color: #fff;
}

.gh-btn-primary:hover { background: #a855f7; }

/* ===================== 布局 ===================== */

/* ===================== 布局 ===================== */

.gh-layout {
  display: grid;
  grid-template-columns: 296px minmax(0, 1fr);
  gap: 24px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
  align-items: start;
}

/* 大屏：为左侧固定导航让出空间，内容在剩余空间内居中 */
@media (min-width: 721px) {
  body {
    padding-left: var(--rail-w);
    box-sizing: border-box;
  }

  .gh-layout {
    box-sizing: border-box;
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
  }
}

/* ===================== 左边栏 ===================== */

.gh-sidebar { position: sticky; top: 24px; }

.side-card {
  padding: 16px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
  background: var(--bg-subtle);
  text-align: center;
}

.side-logo {
  display: grid;
  place-items: center;
  margin-bottom: 12px;
}

.side-logo img {
  width: 170px;
  height: 170px;
  border-radius: 50%;
  filter: drop-shadow(0 0 22px rgba(168, 85, 247, 0.45));
  transition: transform 0.4s ease, filter 0.4s ease;
}

.side-logo img:hover {
  transform: scale(1.04) rotate(-2deg);
  filter: drop-shadow(0 0 32px rgba(168, 85, 247, 0.7));
}

.side-title {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.side-title span { color: var(--accent-fg); }

.side-desc {
  margin: 0 0 14px;
  color: var(--fg-muted);
  font-size: 13px;
  line-height: 1.5;
}

.side-ip {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
}

.side-ip code {
  flex: 1;
  background: var(--bg-inset);
  border: 1px solid var(--border-default);
  padding: 7px 8px;
  font-size: 12px;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
}

.copy-btn {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  background: var(--bg-subtle);
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
  color: var(--fg-muted);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.copy-btn:hover { color: var(--accent-fg); border-color: var(--accent-muted); background: var(--accent-subtle); }

.side-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--border-default);
  padding-top: 12px;
}

.side-stats div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.side-stats strong { font-size: 16px; font-weight: 700; }
.side-stats span { font-size: 11px; color: var(--fg-muted); }

.side-stats div + div { border-left: 1px solid var(--border-default); }

/* ===================== 主内容 ===================== */

.gh-content { min-width: 0; }

.repo-head {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-default);
}

.repo-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 20px;
  font-weight: 400;
  flex-wrap: wrap;
}

.repo-owner { color: var(--accent-fg); font-weight: 400; }
.repo-slash { color: var(--fg-muted); }
.repo-title strong { font-weight: 600; }

.pill {
  font-size: 12px;
  font-weight: 500;
  color: var(--fg-muted);
  border: 1px solid var(--border-default);
  border-radius: 2em;
  padding: 0 7px;
  line-height: 18px;
}

.repo-sub {
  margin: 8px 0 0;
  color: var(--fg-muted);
  font-size: 14px;
}

.repo-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  color: var(--fg-muted);
  font-size: 12px;
  flex-wrap: wrap;
}

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

/* 标签页 */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border-default);
  margin-top: 12px;
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar { display: none; }

.tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font: inherit;
  font-size: 14px;
  color: var(--fg-default);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s, color 0.15s;
}

.tab:hover { border-bottom-color: var(--border-default); }

.tab.active {
  font-weight: 600;
  border-bottom-color: #f78166;
}

.counter {
  background: rgba(110, 118, 129, 0.25);
  border-radius: 2em;
  padding: 0 6px;
  font-size: 12px;
  font-weight: 500;
}

.dot-live {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success-fg);
  box-shadow: 0 0 0 3px var(--success-subtle);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* 两栏 */
.repo-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 296px;
  gap: 24px;
  margin-top: 20px;
  align-items: start;
}

/* 分支栏 */
.branch-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.branch-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  font: inherit;
  font-weight: 600;
  font-size: 13px;
  background: var(--accent-subtle);
  border: 1px solid var(--accent-muted);
  border-radius: var(--radius);
  color: var(--fg-default);
  cursor: pointer;
}

.branch-btn:hover { background: rgba(168, 85, 247, 0.25); }

.branch-info { color: var(--fg-muted); font-size: 12px; }

/* 文件表 */
.file-table {
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-default);
}

.file-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) minmax(120px, 2fr) 110px;
  gap: 12px;
  align-items: center;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border-muted);
  color: var(--fg-default);
  font-size: 13px;
}

.file-row:last-child { border-bottom: none; }

a.file-row:hover { background: var(--bg-subtle); text-decoration: none; }

.file-head {
  background: var(--bg-subtle);
  color: var(--fg-muted);
  font-size: 12px;
  font-weight: 600;
  padding: 7px 16px;
}

.fcol-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.fcol-name span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.fcol-msg {
  color: var(--fg-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fcol-time { color: var(--fg-muted); text-align: right; font-size: 12px; }

.file-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  display: inline-block;
  position: relative;
}

.file-icon.file::before {
  content: "";
  position: absolute;
  inset: 0;
  background: currentColor;
  color: var(--fg-subtle);
  clip-path: polygon(25% 0, 75% 0, 100% 25%, 100% 100%, 25% 100%, 0 75%, 0 25%);
}

.file-icon.dir::before {
  content: "";
  position: absolute;
  inset: 0;
  background: currentColor;
  color: var(--accent-fg);
  clip-path: polygon(0 20%, 42% 20%, 50% 32%, 100% 32%, 100% 100%, 0 100%);
}

/* README */
.readme {
  margin-top: 20px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-default);
}

.readme-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-default);
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-muted);
}

.readme-body { padding: 24px 32px 32px; }

.readme-body > h1:first-child {
  margin: 0 0 4px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-default);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.3px;
}

.readme-body h3 {
  margin: 26px 0 12px;
  font-size: 17px;
  font-weight: 600;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-muted);
}

.readme-body p { margin: 0 0 12px; color: var(--fg-default); }

.lead { font-size: 15px; color: var(--fg-muted) !important; }

.steps { margin: 0 0 12px; padding-left: 22px; }
.steps li { margin-bottom: 6px; }

.md-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 12px;
  font-size: 13px;
}

.md-table th, .md-table td {
  border: 1px solid var(--border-default);
  padding: 7px 12px;
  text-align: left;
}

.md-table thead th { background: var(--bg-subtle); font-weight: 600; }
.md-table tbody tr:nth-child(even) { background: rgba(110, 118, 129, 0.06); }
.md-table td:last-child code { color: var(--accent-fg); }

.cmd-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.cmd {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 9px 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius);
  transition: border-color 0.15s;
}

.cmd:hover { border-color: var(--accent-muted); }
.cmd span { color: var(--fg-muted); font-size: 12px; }
.cmd code { background: none; padding: 0; color: var(--accent-fg); font-weight: 600; }

blockquote {
  margin: 16px 0 0;
  padding: 8px 16px;
  border-left: 4px solid var(--accent-emphasis);
  background: var(--accent-subtle);
  border-radius: 0 var(--radius) var(--radius) 0;
}

blockquote p { margin: 0; }

/* ===================== 区块通用 ===================== */

.section { margin-top: 36px; }

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-default);
  font-size: 16px;
  font-weight: 600;
}

.section-title svg { color: var(--accent-fg); }

/* 游戏模式 */
.mode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.mode-card {
  position: relative;
  padding: 16px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
  background: var(--bg-default);
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.mode-card:hover {
  border-color: var(--accent-muted);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.mode-badge {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  font-weight: 800;
  font-size: 12px;
  color: #fff;
  margin-bottom: 10px;
  background: linear-gradient(135deg, #a855f7, #6b21a8);
}

.mode-badge.db { background: linear-gradient(135deg, #7c3aed, #4c1d95); }
.mode-badge.gp { background: linear-gradient(135deg, #c084fc, #7e22ce); }
.mode-badge.ar { background: linear-gradient(135deg, #9333ea, #581c87); }
.mode-badge.su { background: linear-gradient(135deg, #d8b4fe, #7c3aed); }

.mode-card h3 { margin: 0 0 6px; font-size: 15px; font-weight: 600; }
.mode-card p { margin: 0 0 10px; color: var(--fg-muted); font-size: 12.5px; line-height: 1.55; }

.tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: 2em;
  background: var(--accent-subtle);
  color: var(--accent-fg);
  border: 1px solid var(--accent-muted);
}

.tag.soon {
  background: rgba(210, 153, 34, 0.15);
  color: var(--attention-fg);
  border-color: rgba(210, 153, 34, 0.4);
}

.mode-soon { border-style: dashed; opacity: 0.85; }

/* 排行榜 */
.lb-tabs { display: flex; gap: 6px; margin-bottom: 10px; }

.lb-tab {
  padding: 4px 12px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  background: var(--bg-subtle);
  border: 1px solid var(--border-default);
  border-radius: 2em;
  color: var(--fg-muted);
  cursor: pointer;
}

.lb-tab.active {
  background: var(--accent-subtle);
  border-color: var(--accent-muted);
  color: var(--accent-fg);
}

.lb-table {
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
  overflow: hidden;
}

.lb-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 70px 70px 70px;
  gap: 8px;
  align-items: center;
  padding: 9px 16px;
  border-bottom: 1px solid var(--border-muted);
  font-size: 13px;
}

.lb-row:last-child { border-bottom: none; }

.lb-head {
  background: var(--bg-subtle);
  color: var(--fg-muted);
  font-size: 12px;
  font-weight: 600;
}

.lb-rank { color: var(--fg-muted); font-weight: 600; }
.lb-player { display: flex; align-items: center; gap: 8px; min-width: 0; }
.lb-player > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.lb-head-img {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid var(--border-default);
}

.lb-val { text-align: right; color: var(--fg-muted); font-variant-numeric: tabular-nums; }

.top1 { background: var(--accent-subtle); }
.top1 .lb-rank { color: var(--accent-fg); }

.lb-note { margin: 8px 0 0; color: var(--fg-subtle); font-size: 12px; display: flex; align-items: center; gap: 5px; }
.lb-note svg { flex-shrink: 0; }

.lb-empty { color: var(--fg-subtle); font-style: normal; }

.lb-you {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-fg);
  background: var(--accent-subtle);
  border: 1px solid var(--accent-muted);
  border-radius: 2em;
  padding: 0 6px;
  line-height: 16px;
}

/* 状态 */
.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
}

.status-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
  background: var(--bg-default);
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--fg-subtle);
  flex-shrink: 0;
}

.status-item[data-state="up"] .status-dot {
  background: var(--success-fg);
  box-shadow: 0 0 0 4px var(--success-subtle);
}

.status-item[data-state="down"] .status-dot {
  background: var(--danger-fg);
  box-shadow: 0 0 0 4px rgba(248, 81, 73, 0.15);
}

.status-item > div { display: flex; flex-direction: column; min-width: 0; }
.status-item strong { font-size: 13px; font-weight: 600; }
.status-item small { color: var(--fg-muted); font-size: 11px; }

.status-val {
  margin-left: auto;
  font-size: 12px;
  color: var(--fg-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-align: right;
}

.status-item[data-state="up"] .status-val { color: var(--success-fg); }

/* 加入 */
.join-card {
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
  overflow: hidden;
}

.join-step {
  display: flex;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-muted);
}

.join-step:last-child { border-bottom: none; }

.join-num {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--accent-subtle);
  border: 1px solid var(--accent-muted);
  color: var(--accent-fg);
  font-size: 12px;
  font-weight: 700;
}

.join-step strong { display: block; font-size: 13px; margin-bottom: 2px; }
.join-step p { margin: 0; color: var(--fg-muted); font-size: 12.5px; }

.join-ip-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.join-ip-row code {
  flex: 1;
  min-width: 200px;
  padding: 9px 14px;
  font-size: 14px;
  background: var(--bg-inset);
  border: 1px dashed var(--accent-muted);
  text-align: center;
}

/* FAQ */
.faq {
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
  margin-bottom: 8px;
  background: var(--bg-default);
  overflow: hidden;
}

.faq summary {
  padding: 11px 16px;
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  list-style: none;
  position: relative;
  padding-left: 34px;
  transition: background 0.15s;
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary::before {
  content: "›";
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  color: var(--fg-muted);
  transition: transform 0.2s;
}

.faq[open] summary::before { transform: translateY(-50%) rotate(90deg); }

.faq summary:hover { background: var(--bg-subtle); }

.faq p { margin: 0; padding: 0 16px 14px 34px; color: var(--fg-muted); font-size: 13px; }

/* 页脚 */
.site-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 40px;
  padding-top: 16px;
  border-top: 1px solid var(--border-default);
  color: var(--fg-subtle);
  font-size: 12px;
  flex-wrap: wrap;
}

.foot-left { display: flex; align-items: center; gap: 6px; font-weight: 600; color: var(--fg-muted); }
.foot-logo { border-radius: 50%; object-fit: cover; }
.foot-links { display: flex; gap: 14px; }
.foot-links a { color: var(--fg-muted); }
.foot-right { margin-left: auto; }

/* ===================== 右侧栏 ===================== */

.repo-aside { display: flex; flex-direction: column; gap: 16px; }

.aside-block {
  padding: 16px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
  background: var(--bg-default);
}

.aside-block h3 {
  margin: 0 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-muted);
  font-size: 13px;
  font-weight: 600;
}

.aside-block p { margin: 0; color: var(--fg-muted); font-size: 12.5px; }

.rel-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 12.5px;
  color: var(--fg-muted);
}

.rel-tag {
  background: var(--success-subtle);
  color: var(--success-fg);
  border: 1px solid rgba(63, 185, 80, 0.4);
  border-radius: 2em;
  padding: 0 7px;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-mono);
}

.lang-bar {
  display: flex;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 10px;
}

.lang-list { list-style: none; margin: 0; padding: 0; }

.lang-list li {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 0;
  font-size: 12px;
  color: var(--fg-muted);
}

.lang-list i { width: 8px; height: 8px; border-radius: 50%; }
.lang-list b { margin-left: auto; color: var(--fg-default); font-weight: 600; }

.link-list { list-style: none; margin: 0; padding: 0; }
.link-list li { padding: 3px 0; font-size: 12.5px; }

/* ===================== 提示 ===================== */

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 20px);
  padding: 10px 18px;
  background: var(--accent-emphasis);
  color: #fff;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  box-shadow: var(--shadow-lg);
  z-index: 200;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ===================== 响应式 ===================== */

@media (max-width: 1200px) {
  .repo-body { grid-template-columns: minmax(0, 1fr); }
  .repo-aside { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
}

@media (max-width: 900px) {
  .gh-layout { grid-template-columns: minmax(0, 1fr); padding: 16px; padding-left: 16px; }
  .gh-sidebar { position: static; }
  .side-logo img { width: 120px; height: 120px; }
  .repo-title { font-size: 17px; }
  .readme-body { padding: 18px; }
  .file-row { grid-template-columns: minmax(0, 1fr) 90px; }
  .fcol-msg { display: none; }
}

/* 移动端：左侧栏改成底部横向导航 */
@media (max-width: 720px) {
  :root { --rail-w: 0px; }

  body { padding-left: 0; }

  .side-rail {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 62px;
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
    gap: 0;
    padding: 0 4px;
    border-right: none;
    border-top: 1px solid var(--border-default);
    overflow: visible;
    padding-bottom: env(safe-area-inset-bottom, 0);
  }

  .rail-logo { display: none; }
  .rail-group {
    flex-direction: row;
    justify-content: space-around;
    flex: 1;
    gap: 0;
  }

  .rail-item {
    width: auto;
    flex: 1;
    max-width: 74px;
    padding: 6px 2px;
    gap: 2px;
  }

  .rail-item svg { width: 18px; height: 18px; }
  .rail-label { font-size: 9px; }

  .rail-item.active::before {
    left: 50%;
    top: 0;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    border-radius: 0 0 3px 3px;
  }

  /* 底部栏不放搜索/加入/头像，避免拥挤 */
  .rail-spacer,
  .rail-search,
  .rail-join,
  .rail-avatar { display: none; }

  .rail-item[data-tip]::after,
  .rail-avatar[data-tip]::after { display: none; }

  .gh-layout {
    padding-bottom: calc(62px + 16px + env(safe-area-inset-bottom, 0));
    padding-left: 12px;
  }

  .search-drawer { padding-top: 8vh; }
}

@media (max-width: 560px) {
  .gh-btn span.long { display: none; }
  .gh-btn { padding: 5px 10px; font-size: 12px; }
  .repo-aside { grid-template-columns: 1fr; }

  .lb-row { grid-template-columns: 32px minmax(0, 1fr) 50px 50px; }
  .lb-row > *:nth-child(4) { display: none; }

  .join-ip-row code { min-width: 0; width: 100%; }
  .md-table { display: block; overflow-x: auto; white-space: nowrap; }

  .gh-layout { padding: 12px; }
  .side-card { padding: 14px 12px; }
  .side-ip code { font-size: 11px; padding: 6px; }
  .side-stats strong { font-size: 14px; }
  .side-stats span { font-size: 10px; }
  .repo-title { font-size: 16px; }
  .readme-body { padding: 16px 14px; }
  .readme-body > h1:first-child { font-size: 22px; }
  .file-row { padding: 8px 12px; }
  .cmd-grid { grid-template-columns: 1fr 1fr; }
  .mode-grid { grid-template-columns: 1fr; }
  .faq p { padding-left: 18px; }
}

/* 防止任何子元素把页面撑出横向滚动 */
.gh-layout > * { min-width: 0; }
.repo-body > * { min-width: 0; }
.side-ip code { min-width: 0; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
