/* ============================================================
   LoliHub · 二次元风格主题
   ============================================================ */

:root {
  --pink: #ff9ad5;
  --pink-2: #ff6fb5;
  --purple: #a98bff;
  --cyan: #7fe9ff;
  --gold: #ffd479;
  --ink: #fdfaff;
  --ink-2: #f0eafd;
  --muted: #d0c8e9;
  --glass-rgb: 19, 13, 33;
  --glass-alpha: 0.76;
  --glass-2-alpha: 0.86;
  --glass-3-alpha: 0.93;
  --glass: rgba(var(--glass-rgb), var(--glass-alpha));
  --glass-2: rgba(25, 17, 42, var(--glass-2-alpha));
  --glass-3: rgba(30, 21, 50, var(--glass-3-alpha));
  --border: rgba(255, 255, 255, 0.2);
  --border-2: rgba(255, 255, 255, 0.11);
  --shadow: 0 18px 50px rgba(8, 4, 18, 0.45);
  --radius: 18px;
  --radius-sm: 12px;
  --bg-cover-image: none;
  --bg-cover-fade: 0.72;
  --bg-blur: 2px;
  --bg-bright: 1.02;
  --bg-sat: 1.08;
  --bg-pos: center;
  --repo-gap: 18px;
  --card-pad: 18px;
  --card-min: 208px;
  --max-w: 1180px;
  --sidebar-w: 320px;
  --shadow-a: 0.34;
  --hover-lift: 3px;
  --hero-alpha: 0.3;
  --hero-blur: 20px;
  --code-fs: 13.2px;
  --code-lh: 1.74;
  --md-fs: 14.5px;
  --topbar-alpha: 0.88;
  --font: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", "Cascadia Code", "Fira Code", Consolas, "Courier New", monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  color: var(--ink);
  background: #0e0a18;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--cyan); text-decoration: none; }
a:hover { color: #b6f4ff; }

img { max-width: 100%; }

::selection { background: rgba(255, 154, 213, 0.35); color: #fff; }

/* ---------------- 背景层 ---------------- */
.bg-layer {
  position: fixed;
  inset: -3%;
  z-index: -3;
  background-image: var(--bg-cover-image);
  background-size: cover;
  background-position: var(--bg-pos);
  background-repeat: no-repeat;
  transform: scale(1.06);
  filter: blur(var(--bg-blur)) saturate(var(--bg-sat)) brightness(var(--bg-bright));
  opacity: 0;
  transition: opacity 0.8s ease;
}
.bg-layer.ready { opacity: 1; }

.bg-veil {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(900px 520px at 12% -8%, rgba(255, 154, 213, 0.16), transparent 62%),
    radial-gradient(760px 480px at 92% 4%, rgba(169, 139, 255, 0.16), transparent 60%),
    linear-gradient(180deg, rgba(10, 6, 20, 0.04) 0%, rgba(10, 6, 20, calc(var(--bg-cover-fade) * 0.3)) 48%, rgba(9, 5, 17, 0.55) 100%);
  backdrop-filter: blur(0.5px) saturate(1.06);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 18% 32%, rgba(255, 255, 255, 0.12), transparent 1.4px),
    radial-gradient(circle at 72% 68%, rgba(255, 255, 255, 0.1), transparent 1.2px);
  background-size: 260px 260px, 190px 190px;
  opacity: 0.5;
  mix-blend-mode: screen;
}

.petals {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.85;
}

/* ---------------- 密度 ---------------- */
body.density-compact { --repo-gap: 12px; --card-pad: 14px; --card-min: 188px; }
body.density-normal { --repo-gap: 18px; --card-pad: 18px; --card-min: 208px; }
body.density-comfortable { --repo-gap: 24px; --card-pad: 22px; --card-min: 232px; }

body.no-bg {
  background:
    radial-gradient(900px 600px at 15% 0%, rgba(255, 154, 213, 0.14), transparent 60%),
    radial-gradient(800px 520px at 85% 10%, rgba(169, 139, 255, 0.14), transparent 60%),
    #0e0a18;
}

/* 无行号 / 关闭动效 */
body.no-code-lines .code-line::before { display: none; }
body.no-code-lines .code-line { padding-left: 18px; }
body.no-anim *, body.no-anim *::before, body.no-anim *::after {
  transition: none !important;
  animation: none !important;
}

/* ---------------- 布局 ---------------- */
.wrap { width: min(var(--max-w), calc(100% - 40px)); margin: 0 auto; }
.main { position: relative; z-index: 1; padding: 28px 0 70px; min-height: 60vh; flex: 1 0 auto; }
.main-wide { width: min(1440px, calc(100% - 40px)); }

/* ---------------- 顶栏 ---------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(22px) saturate(1.2);
  background: linear-gradient(180deg, rgba(13, 8, 24, var(--topbar-alpha)), rgba(13, 8, 24, calc(var(--topbar-alpha) * 0.82)));
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 28px rgba(4, 2, 10, 0.36);
}
.topbar-in {
  display: flex;
  align-items: center;
  gap: 18px;
  height: 66px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 800;
  letter-spacing: 0.02em;
  flex: none;
}
.brand:hover { color: #fff; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  font-size: 17px;
  font-weight: 900;
  color: #2a1230;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  box-shadow: 0 4px 12px rgba(255, 127, 190, 0.28);
}
.brand-mark.small { width: 24px; height: 24px; border-radius: 8px; font-size: 12px; }
.brand-text { display: flex; align-items: baseline; gap: 7px; font-size: 16px; }
.brand-text em {
  font-style: normal;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0.75;
}

.top-search {
  position: relative;
  flex: 1;
  max-width: 460px;
}
.top-search input {
  width: 100%;
  height: 38px;
  padding: 0 14px 0 38px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.1);
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.top-search input::placeholder { color: rgba(240, 235, 253, 0.72); }
.top-search input:focus {
  border-color: rgba(255, 154, 213, 0.65);
  background: rgba(255, 255, 255, 0.11);
  box-shadow: 0 0 0 4px rgba(255, 154, 213, 0.12);
}
.search-ico {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  opacity: 0.85;
}

.top-nav { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.nav-link {
  padding: 8px 12px;
  border-radius: 10px;
  color: #f0eafc;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.18s, color 0.18s;
}
.nav-link:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.nav-link.on { color: #fff; background: rgba(255, 154, 213, 0.16); }

.icon-btn {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
  font-size: 16px;
  transition: transform 0.35s, background 0.2s;
}
.icon-btn:hover { background: rgba(255, 154, 213, 0.2); transform: rotate(20deg) scale(1.05); }

.user-chip { position: relative; }
.chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 5px 11px 5px 6px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.09);
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
}
.chip-btn i { font-style: normal; font-size: 10px; opacity: 0.6; }
.chip-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 170px;
  padding: 6px;
  border-radius: 14px;
  background: var(--glass-3);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  display: none;
  flex-direction: column;
  gap: 2px;
  z-index: 60;
}
.user-chip.open .chip-menu { display: flex; }
.chip-menu a, .chip-menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--ink-2);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
}
.chip-menu a:hover, .chip-menu button:hover { background: rgba(255, 255, 255, 0.09); color: #fff; }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.16s, box-shadow 0.22s, background 0.2s, border-color 0.2s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-sm { height: 36px; padding: 0 14px; font-size: 13px; }
.btn-block { width: 100%; }

.btn-primary {
  background: linear-gradient(135deg, var(--pink) 0%, color-mix(in srgb, var(--pink) 55%, var(--purple)) 48%, var(--purple) 100%);
  color: #290b30;
  font-weight: 800;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.22);
  box-shadow: 0 10px 26px color-mix(in srgb, var(--pink) 34%, transparent);
}
.btn-primary:hover { box-shadow: 0 14px 32px color-mix(in srgb, var(--pink) 48%, transparent); color: #290b30; }

.btn-ghost {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--border);
  color: var(--ink);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.13); color: #fff; }

.btn-soft {
  background: rgba(127, 233, 255, 0.2);
  border-color: rgba(127, 233, 255, 0.5);
  color: #dcfaff;
}
.btn-soft:hover { background: rgba(127, 233, 255, 0.3); color: #fff; }

.btn-danger {
  background: rgba(255, 86, 116, 0.18);
  border-color: rgba(255, 86, 116, 0.45);
  color: #ffb3c0;
}
.btn-danger:hover { background: rgba(255, 86, 116, 0.3); color: #fff; }

.link-btn {
  border: 0;
  background: none;
  color: var(--cyan);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 8px;
}
.link-btn:hover { background: rgba(127, 233, 255, 0.12); color: #d6faff; }
.link-btn.tiny { font-size: 12px; }
.link-btn.danger { color: #ff9db0; }
.link-btn.danger:hover { background: rgba(255, 86, 116, 0.14); }

/* ---------------- 首页 hero ---------------- */
.hero {
  position: relative;
  padding: 44px 40px 36px;
  margin-bottom: 16px;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background:
    radial-gradient(600px 300px at 88% -10%, rgba(169, 139, 255, 0.24), transparent 60%),
    radial-gradient(520px 280px at 6% 110%, rgba(255, 154, 213, 0.2), transparent 60%),
    rgba(var(--glass-rgb), var(--hero-alpha));
  backdrop-filter: blur(var(--hero-blur, 20px)) saturate(1.12);
  box-shadow: 0 10px 28px rgba(6, 3, 14, calc(var(--shadow-a) * 0.65)), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: -40% -10% auto auto;
  width: 420px;
  height: 420px;
  background: conic-gradient(from 90deg, color-mix(in srgb, var(--pink) 38%, transparent), color-mix(in srgb, var(--cyan) 30%, transparent), color-mix(in srgb, var(--purple) 38%, transparent), color-mix(in srgb, var(--pink) 38%, transparent));
  filter: blur(80px);
  opacity: 0.55;
  animation: spin 26s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(96deg, rgba(9, 5, 18, 0.72) 0%, rgba(9, 5, 18, 0.48) 40%, rgba(9, 5, 18, 0.18) 72%, rgba(9, 5, 18, 0.02) 100%);
}
.hero > * { position: relative; z-index: 1; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--pink) 45%, transparent);
  background: color-mix(in srgb, var(--pink) 14%, transparent);
  color: color-mix(in srgb, var(--pink) 18%, #ffffff);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.hero-title {
  margin: 16px 0 10px;
  font-size: clamp(28px, 4.4vw, 46px);
  line-height: 1.15;
  font-weight: 900;
  letter-spacing: -0.01em;
  text-shadow: 0 8px 30px rgba(10, 4, 22, 0.6);
}
.grad {
  background: linear-gradient(100deg, #fff6fb 0%, color-mix(in srgb, var(--pink) 78%, #ffffff) 26%, color-mix(in srgb, var(--purple) 82%, #ffffff) 62%, var(--cyan) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 2px rgba(10, 4, 22, 0.55)) drop-shadow(0 6px 20px color-mix(in srgb, var(--pink) 30%, transparent));
}
.hero-sub { margin: 0 0 26px; color: var(--ink-2); font-size: 15.5px; max-width: 620px; text-shadow: 0 1px 2px rgba(8, 3, 18, 0.6); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 0;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px dashed var(--border);
}
.stat { display: inline-flex; align-items: baseline; gap: 7px; }
.stat + .stat { margin-left: 20px; padding-left: 20px; border-left: 1px solid rgba(255, 255, 255, 0.16); }
.stat b { font-size: 21px; font-weight: 900; letter-spacing: -0.01em; line-height: 1; color: #fff; text-shadow: 0 2px 10px rgba(8, 3, 18, 0.45); }
.stat span { font-size: 12.5px; color: #ded6f2; letter-spacing: 0.05em; }

/* ---------------- 首页双栏 ---------------- */
.home-grid { display: grid; grid-template-columns: minmax(0, 1fr) var(--sidebar-w); gap: 26px; align-items: start; }
.home-grid.no-side { grid-template-columns: minmax(0, 1fr); }

.switch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.toggle-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-2);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  font-size: 13px;
  color: var(--ink-2);
  transition: background 0.18s, border-color 0.18s;
}
.toggle-card:has(input:checked) { background: rgba(255, 154, 213, 0.1); border-color: rgba(255, 154, 213, 0.35); color: var(--ink); }
.toggle-card span { font-weight: 600; }
.toggle-card input { width: 16px; height: 16px; accent-color: var(--pink); flex: none; }
.section-head {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  margin: 6px 0 16px;
  padding: 11px 16px;
  border-radius: 14px;
  border: 0;
  background: rgba(9, 5, 17, 0.7);
  backdrop-filter: blur(28px) saturate(1.05);
  -webkit-backdrop-filter: blur(28px) saturate(1.05);
}
.section-head h2 { margin: 0; font-size: 20px; font-weight: 800; }
.section-head h1.page-title { margin: 0; font-size: 26px; font-weight: 800; }
.section-head h2, .section-head h1.page-title { position: relative; padding-left: 13px; }
.section-head h2::before, .section-head h1.page-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 0.92em;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--pink), var(--purple));
  box-shadow: 0 0 10px rgba(255, 154, 213, 0.45);
}
.section-head .tab-spacer { align-self: stretch; }

/* 计数徽章 */
.count-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--pink) 26%, transparent), color-mix(in srgb, var(--purple) 26%, transparent));
  border: 1px solid color-mix(in srgb, var(--pink) 48%, transparent);
  color: color-mix(in srgb, var(--pink) 16%, #ffffff);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.5;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 4px 14px color-mix(in srgb, var(--pink) 20%, transparent);
}
.count-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  box-shadow: 0 0 8px rgba(255, 154, 213, 0.8);
  flex: none;
}
.count-pill.ghost {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border);
  color: var(--ink-2);
  font-weight: 600;
  box-shadow: none;
}
.count-pill.ghost::before { display: none; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.repo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--repo-gap); }

.repo-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: var(--card-min);
  padding: var(--card-pad) var(--card-pad) calc(var(--card-pad) - 3px);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--glass);
  backdrop-filter: blur(18px) saturate(1.1);
  box-shadow: 0 8px 24px rgba(6, 3, 14, calc(var(--shadow-a) * 0.94)), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: transform 0.22s, border-color 0.22s, box-shadow 0.22s, background 0.22s;
  overflow: hidden;
}
.repo-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255, 154, 213, 0.12), transparent 46%);
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
}
.repo-card:hover {
  transform: translateY(calc(var(--hover-lift) * -1));
  border-color: color-mix(in srgb, var(--pink) 60%, transparent);
  box-shadow: 0 18px 40px color-mix(in srgb, var(--pink) 18%, transparent);
}
.repo-card:hover::after { opacity: 1; }

.repo-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.repo-name { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-size: 15.5px; font-weight: 800; min-width: 0; }
.repo-name em { font-style: normal; color: var(--muted); font-weight: 600; }
.repo-name b { color: #fff; }
.repo-name:hover { color: var(--pink); }
.repo-name:hover b { color: var(--pink); }
.repo-ico { font-size: 15px; }
.repo-desc { margin: 9px 0 11px; color: var(--ink-2); font-size: 13.5px; line-height: 1.55; min-height: 40px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.repo-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 12px; min-height: 26px; }
.repo-meta { display: flex; align-items: center; gap: 14px; font-size: 12.5px; color: var(--ink-2); border-top: 1px solid var(--border-2); padding-top: 11px; margin-top: auto; }
.repo-meta .muted { margin-left: auto; }

.vis-pill {
  flex: none;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #bff7d5;
  background: rgba(74, 222, 128, 0.14);
  border: 1px solid rgba(74, 222, 128, 0.32);
}
.vis-pill.private { color: #ffd6a8; background: rgba(255, 190, 92, 0.14); border-color: rgba(255, 190, 92, 0.34); }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 11px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--purple) 24%, transparent);
  border: 1px solid color-mix(in srgb, var(--purple) 46%, transparent);
  color: color-mix(in srgb, var(--purple) 22%, #ffffff);
  font-size: 11.5px;
  font-weight: 600;
}
.tag:hover { background: color-mix(in srgb, var(--purple) 38%, transparent); color: #fff; }
.tag sup { font-size: 9px; opacity: 0.7; }

.col-side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 82px; }
.side-card {
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--glass);
  backdrop-filter: blur(18px);
  box-shadow: 0 8px 24px rgba(6, 3, 14, calc(var(--shadow-a) * 0.88)), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.side-card h3 { margin: 0 0 12px; font-size: 14.5px; font-weight: 800; letter-spacing: 0.02em; }
.trend-list { list-style: none; counter-reset: t; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.trend-list li { display: flex; align-items: center; gap: 10px; font-size: 13px; counter-increment: t; }
.trend-list li::before {
  content: counter(t);
  display: grid;
  place-items: center;
  width: 20px; height: 20px;
  border-radius: 7px;
  font-size: 10.5px;
  font-weight: 800;
  color: #2a0f2f;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  flex: none;
}
.trend-list a { color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trend-list a em { font-style: normal; color: var(--muted); }
.trend-list a:hover { color: var(--pink); }
.trend-list .muted { margin-left: auto; flex: none; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }

.bg-card .bg-status { margin: 10px 0 14px; font-size: 12.5px; color: var(--ink-2); }
.bg-status.ok { color: #a9f5c8; }
.bg-status.err { color: #ffb3c0; }

.side-links { display: flex; flex-direction: column; gap: 8px; }
.side-link {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border-2);
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  font-size: 13px; font-weight: 700;
  transition: background 0.18s, border-color 0.18s;
}
.side-link span { color: var(--muted); font-weight: 500; font-size: 11.5px; }
.side-link:hover { background: rgba(255, 154, 213, 0.14); border-color: rgba(255, 154, 213, 0.4); color: #fff; }

.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.07); border: 1px solid var(--border);
  font-size: 12.5px; color: var(--ink-2);
}
.chip a { color: var(--pink); font-weight: 800; }

.pager-wrap { display: flex; justify-content: center; margin: 18px 0 4px; }
.panel .pager-wrap { margin: 6px 0 0; padding: 6px 18px 18px; }
.pager { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; }
.page-btn {
  min-width: 40px; height: 40px;
  padding: 0 7px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.07);
  color: var(--ink-2); font-size: 13.5px; font-weight: 700;
  transition: background 0.18s, color 0.18s, border-color 0.18s, transform 0.18s;
}
.page-btn.wide { padding: 0 14px; font-weight: 600; font-size: 13px; }
.page-btn:hover { background: rgba(255, 154, 213, 0.2); color: #fff; border-color: rgba(255, 154, 213, 0.45); }
.page-btn.on {
  background: linear-gradient(135deg, var(--pink), var(--purple));
  color: #2a0f2f; border-color: transparent;
  box-shadow: 0 6px 16px color-mix(in srgb, var(--pink) 34%, transparent);
}
.page-btn.disabled { opacity: 0.36; cursor: not-allowed; }
.page-btn.disabled:hover { background: rgba(255, 255, 255, 0.07); color: var(--ink-2); border-color: var(--border); }
.page-ellipsis { color: var(--muted); padding: 0 2px; user-select: none; }
.pager-info { font-size: 12.5px; color: var(--muted); letter-spacing: 0.02em; }

/* ---------------- 公共面板 ---------------- */
.panel {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--glass);
  backdrop-filter: blur(18px) saturate(1.08);
  box-shadow: 0 10px 28px rgba(6, 3, 14, var(--shadow-a)), inset 0 1px 0 rgba(255, 255, 255, 0.055);
  margin-bottom: 18px;
  overflow: hidden;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--border-2);
  background: rgba(255, 255, 255, 0.035);
}
.panel-actions { display: flex; align-items: center; gap: 4px; }
.readme-title { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; }
.readme-title span { font-size: 15px; }

.empty-card { text-align: center; padding: 46px 20px; }
.empty-card.small { padding: 26px 16px; }
.empty-emoji { font-size: 30px; margin-bottom: 8px; opacity: 0.9; }
.empty-card p { margin: 0 0 14px; color: var(--ink-2); }

.flash {
  padding: 12px 18px;
  margin-bottom: 16px;
  border-radius: 14px;
  font-size: 13.5px;
  font-weight: 600;
  border: 1px solid transparent;
  animation: slideDown 0.3s ease;
}
@keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } }
.flash-ok { background: rgba(74, 222, 128, 0.14); border-color: rgba(74, 222, 128, 0.36); color: #bdf8d2; }
.flash-err { background: rgba(255, 86, 116, 0.16); border-color: rgba(255, 86, 116, 0.4); color: #ffc2cd; }
.flash-warn { background: rgba(255, 196, 92, 0.15); border-color: rgba(255, 196, 92, 0.4); color: #ffe1ab; }

/* ---------------- 仓库页 ---------------- */
.repo-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  padding: 18px 20px;
  margin-bottom: 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--glass);
  backdrop-filter: blur(18px) saturate(1.08);
  box-shadow: 0 10px 26px rgba(6, 3, 14, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.repo-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.repo-title h1 { margin: 0; font-size: clamp(20px, 3vw, 26px); font-weight: 800; letter-spacing: -0.01em; }
.repo-title h1 a { color: var(--muted); font-weight: 600; }
.repo-title h1 a:hover { color: var(--pink); }
.repo-title .slash { color: rgba(255, 255, 255, 0.3); }
.repo-big-ico { font-size: 24px; }
.repo-sub { margin: 8px 0 0; color: var(--ink-2); font-size: 14px; max-width: 720px; }
.repo-head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.repo-head-actions form { margin: 0; }
.cnt { opacity: 0.7; font-weight: 600; }

.repo-tabs {
  display: flex; align-items: center; gap: 4px;
  padding: 6px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--glass);
  backdrop-filter: blur(14px);
  margin-bottom: 14px;
  overflow-x: auto;
}
.tab {
  padding: 8px 14px; border-radius: 10px;
  color: var(--ink-2); font-size: 13.5px; font-weight: 700; white-space: nowrap;
}
.tab:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.tab.on { background: color-mix(in srgb, var(--pink) 20%, transparent); color: #fff; }
.tab-cnt { font-size: 11px; opacity: 0.7; }
.tab-spacer { flex: 1; }
.repo-quick-stats { font-size: 12px; color: var(--muted); padding-right: 10px; white-space: nowrap; }

.commit-bar {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 16px;
  margin-bottom: 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--glass);
  backdrop-filter: blur(14px);
  font-size: 13px;
  flex-wrap: wrap;
}
.commit-who { display: flex; align-items: center; gap: 7px; flex: none; }
.commit-msg { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 46%; }
.commit-meta { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.add { color: #7ff0a8; font-weight: 700; }
.del { color: #ff8fa5; font-weight: 700; }

.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 13.5px; flex-wrap: wrap; }
.breadcrumb a { color: var(--cyan); font-weight: 600; }
.breadcrumb a:hover { color: #d6faff; }
.breadcrumb .sep { color: rgba(255, 255, 255, 0.25); }
.crumb-up { margin-left: 10px; color: var(--muted) !important; font-size: 12px; }

.file-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.file-table th {
  text-align: left; padding: 11px 18px;
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--border-2);
  background: rgba(255, 255, 255, 0.035);
}
.file-table td { padding: 0 18px; border-bottom: 1px solid var(--border-2); }
.file-table tbody tr { transition: background 0.15s; }
.file-table tbody tr:hover { background: rgba(255, 154, 213, 0.08); }
.file-table tbody tr:last-child td { border-bottom: 0; }
.file-row { display: flex; align-items: center; gap: 10px; padding: 11px 0; color: var(--ink); font-weight: 600; }
.file-row:hover { color: var(--pink); }
.f-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.f-ico { font-size: 14px; width: 18px; text-align: center; flex: none; }
.file-table th:last-child { text-align: right; }
.file-panel .file-table td:nth-child(2), .file-panel .file-table th:nth-child(2) { text-align: right; font-variant-numeric: tabular-nums; padding-right: 22px; }
.file-panel .file-table td:nth-child(3), .file-panel .file-table th:nth-child(3) { padding-right: 26px; }
.w-act { width: 166px; text-align: right; white-space: nowrap; padding-right: 18px !important; }
.hide-sm { }
.inline { display: inline; }

.clone-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 16px 18px; }
.clone-grid .span-2 { grid-column: 1 / -1; }

/* 仓库信息行 */
.info-list { padding: 4px 18px 12px; }
.info-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px dashed var(--border-2);
}
.info-row:last-child { border-bottom: 0; }
.info-label { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: 0.05em; }
.info-value { min-width: 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.info-value .cmd { flex: 0 1 auto; max-width: 100%; }
.info-value .info-link { color: #b7f3d0; text-decoration: none; }
.info-value .info-link:hover { color: #fff; text-decoration: underline; }
.cmd-input {
  flex: 1 1 auto; min-width: 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.38);
  color: #fff;
  font-family: var(--mono); font-size: 12.2px;
  outline: none;
}
.qq-group {
  font-family: var(--mono);
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--ink);
  padding: 4px 12px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border-2);
}
.clone-box label { display: block; font-size: 11.5px; color: var(--muted); letter-spacing: 0.06em; margin-bottom: 7px; font-weight: 700; }
.clone-input { display: flex; gap: 8px; }
.clone-input input {
  flex: 1; min-width: 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.38);
  color: #fff;
  font-family: var(--mono); font-size: 12.2px;
}
.cmd {
  display: block; padding: 10px 12px; border-radius: 10px;
  background: rgba(0, 0, 0, 0.4); border: 1px solid var(--border);
  font-family: var(--mono); font-size: 11.8px; color: #b7f3d0;
  overflow-x: auto; white-space: nowrap;
}
.danger-zone { padding: 0 18px 16px; }
.danger-zone summary { cursor: pointer; color: #ff9db0; font-size: 12.5px; font-weight: 700; margin-bottom: 10px; }

/* ---------------- README / Markdown ---------------- */
.markdown-body { padding: 22px 24px 28px; font-size: var(--md-fs); line-height: 1.78; color: var(--ink-2); }
.markdown-body .md-h { color: var(--ink); font-weight: 800; margin: 22px 0 10px; line-height: 1.35; }
.markdown-body h1.md-h { font-size: 26px; padding-bottom: 10px; border-bottom: 1px solid var(--border-2); }
.markdown-body h2.md-h { font-size: 21px; padding-bottom: 8px; border-bottom: 1px solid var(--border-2); }
.markdown-body h3.md-h { font-size: 18px; }
.markdown-body h4.md-h, .markdown-body h5.md-h, .markdown-body h6.md-h { font-size: 15.5px; }
.markdown-body p { margin: 0 0 12px; }
.markdown-body a { color: var(--cyan); border-bottom: 1px solid rgba(127, 233, 255, 0.28); }
.markdown-body a:hover { color: #fff; }
.markdown-body strong { color: #fff; }
.markdown-body .inline, .inline-code {
  padding: 2px 6px; border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  font-family: var(--mono); font-size: 0.9em; color: #ffd6ec;
}
.markdown-body blockquote {
  margin: 14px 0; padding: 10px 16px;
  border-left: 3px solid var(--pink);
  background: rgba(255, 154, 213, 0.08);
  border-radius: 0 10px 10px 0;
  color: var(--ink-2);
}
.markdown-body hr { border: 0; border-top: 1px dashed var(--border); margin: 22px 0; }
.markdown-body .md-list { margin: 0 0 14px; padding-left: 22px; }
.markdown-body .md-list li { margin: 5px 0; }
.markdown-body .task { color: var(--muted); font-weight: 800; }
.markdown-body .task.done { color: #7ff0a8; }
.markdown-body .md-img { border-radius: 12px; border: 1px solid var(--border); margin: 8px 0; }
.markdown-body .mention { color: var(--pink); }
.md-table-wrap { overflow-x: auto; margin: 14px 0; }
.md-table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
.md-table th, .md-table td { border: 1px solid var(--border-2); padding: 8px 12px; text-align: left; }
.md-table th { background: rgba(255, 255, 255, 0.05); color: var(--ink); font-weight: 700; }

.md-code { margin: 16px 0; border-radius: 14px; overflow: hidden; border: 1px solid var(--border); background: rgba(6, 3, 12, 0.78); }
.md-code-bar { display: flex; align-items: center; gap: 7px; padding: 9px 14px; background: rgba(255, 255, 255, 0.05); border-bottom: 1px solid var(--border-2); }
.md-code-bar .dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.md-code-bar .d1 { background: #ff6f8a; } .md-code-bar .d2 { background: #ffd479; } .md-code-bar .d3 { background: #7ff0a8; }
.md-code-bar .lang { font-size: 11px; color: var(--muted); margin-left: 4px; font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.1em; }
.md-code-bar .copy-btn { margin-left: auto; }
.md-code pre { margin: 0; padding: 14px 16px; overflow-x: auto; }
.md-code pre code { font-family: var(--mono); font-size: 12.8px; line-height: 1.72; color: #f2edff; white-space: pre-wrap; word-break: break-word; }

/* ---------------- 文件查看 ---------------- */
.crumb-bar {
  display: flex; align-items: center; gap: 7px;
  font-size: 13.5px;
  margin-bottom: 14px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--glass);
  backdrop-filter: blur(14px);
  flex-wrap: wrap;
}
.crumb-bar a { color: var(--cyan); font-weight: 600; }
.crumb-bar .sep { color: rgba(255, 255, 255, 0.32); }
.crumb-bar b { color: var(--ink); }

.file-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 18px; flex-wrap: wrap; }
.file-head-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.file-ico-lg {
  display: grid; place-items: center;
  width: 42px; height: 42px; border-radius: 13px;
  background: rgba(255, 255, 255, 0.08); border: 1px solid var(--border);
  font-size: 19px; flex: none;
}
.file-title { margin: 0; font-size: 17px; font-weight: 800; word-break: break-all; }
.file-sub { font-size: 13px; margin-top: 3px; }
.file-head-actions { display: flex; gap: 8px; }

.code-bar {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-2);
  background: rgba(255, 255, 255, 0.045);
  font-size: 12px;
}
.code-lang {
  padding: 3px 10px; border-radius: 999px;
  background: rgba(255, 154, 213, 0.16); border: 1px solid rgba(255, 154, 213, 0.32);
  color: #ffd6ec; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
}
.copy-btn {
  padding: 4px 11px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink-2);
  font-family: inherit; font-size: 11.5px; font-weight: 600;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
}
.copy-btn:hover { background: rgba(255, 154, 213, 0.18); color: #fff; }

.code-scroll { max-height: 74vh; overflow: auto; background: rgba(7, 4, 15, 0.55); }
.code-pre {
  margin: 0; padding: 16px 0;
  font-family: var(--mono); font-size: var(--code-fs); line-height: var(--code-lh);
  counter-reset: ln;
  color: #f4efff;
  tab-size: 4;
}
.code-pre code { display: block; }
.code-line { display: block; padding: 0 18px 0 0; white-space: pre; }
.code-line::before {
  counter-increment: ln;
  content: counter(ln);
  display: inline-block;
  width: 34px; margin-right: 12px;
  text-align: right;
  color: rgba(255, 255, 255, 0.45);
  font-size: 11.5px;
  user-select: none;
}
.code-panel { background: rgba(15, 10, 26, 0.9); }
.code-pre.wrap .code-line { white-space: pre-wrap; word-break: break-word; }
.code-scroll::-webkit-scrollbar { width: 10px; height: 10px; }
.code-scroll::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--pink) 55%, transparent);
  border-radius: 999px;
  border: 2px solid rgba(7, 4, 15, 0.62);
  background-clip: padding-box;
}
.code-scroll::-webkit-scrollbar-thumb:hover { background: color-mix(in srgb, var(--pink) 85%, transparent); }
.code-scroll::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.32); }

/* 语法着色 */
.tk-com { color: #8d84a8; font-style: italic; }
.tk-str { color: #b4f7d2; }
.tk-num { color: #ffe08f; }
.tk-kw { color: #ffa8dc; font-weight: 600; }
.tk-fn { color: #92f0ff; }
.tk-var { color: #ffcfb8; }
.tk-tag { color: #ffa8dc; }
.tk-attr { color: #ffe08f; }
.tk-op { color: #ddcfff; }

.image-panel { padding: 18px; }
.image-wrap {
  display: grid; place-items: center;
  border-radius: 14px; overflow: hidden;
  background:
    linear-gradient(45deg, rgba(255, 255, 255, 0.04) 25%, transparent 25%) 0 0/24px 24px,
    linear-gradient(-45deg, rgba(255, 255, 255, 0.04) 25%, transparent 25%) 0 0/24px 24px,
    rgba(0, 0, 0, 0.3);
  padding: 14px;
}
.image-wrap img { max-height: 70vh; border-radius: 10px; }

/* ---------------- 提交列表 ---------------- */
.commit-list { list-style: none; margin: 0; padding: 8px 0; }
.commit-item { display: grid; grid-template-columns: 11px minmax(0, 1fr) auto; gap: 14px; padding: 15px 20px; border-bottom: 1px solid var(--border-2); align-items: start; }
.commit-item:last-child { border-bottom: 0; }
.commit-dot {
  width: 11px; height: 11px; border-radius: 50%; margin-top: 6px; flex: none;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  box-shadow: 0 0 0 4px rgba(255, 154, 213, 0.14);
}
.commit-body { min-width: 0; }
.commit-side { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.commit-side .chash { font-family: var(--mono); font-size: 11px; color: var(--ink-2); }
.commit-line1 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.commit-message { font-weight: 700; color: var(--ink); }
.commit-hash { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.commit-line2 { display: flex; align-items: center; gap: 7px; margin-top: 4px; }
.commit-files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.cf {
  padding: 2px 9px; border-radius: 7px;
  font-family: var(--mono); font-size: 11px;
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--border-2); color: var(--ink-2);
}
.cf.added { color: #a6f0c6; border-color: rgba(74, 222, 128, 0.3); background: rgba(74, 222, 128, 0.09); }
.cf.deleted { color: #ffb3c0; border-color: rgba(255, 86, 116, 0.3); background: rgba(255, 86, 116, 0.09); }

/* ---------------- 表单 ---------------- */
.form { display: flex; flex-direction: column; gap: 16px; padding: 20px; }
.panel .form { padding: 18px 20px 22px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field > span { font-size: 12.5px; font-weight: 700; color: var(--ink-2); letter-spacing: 0.03em; }
.field > span i { color: var(--pink); font-style: normal; }
.field input[type=text], .field input[type=email], .field input[type=password], .field input[type=url], .field input[type=number], .field textarea {
  width: 100%;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.24);
  color: var(--ink);
  font-family: inherit; font-size: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.field textarea { resize: vertical; min-height: 84px; line-height: 1.6; }
.field input:focus, .field textarea:focus {
  border-color: rgba(255, 154, 213, 0.6);
  background: rgba(0, 0, 0, 0.32);
  box-shadow: 0 0 0 4px rgba(255, 154, 213, 0.1);
}
.field input::placeholder, .field textarea::placeholder, .commit-input::placeholder {
  color: rgba(236, 230, 250, 0.56);
}
.field .hint, .hint { font-size: 11.5px; color: var(--muted); }
.input-row { display: flex; align-items: center; gap: 0; border-radius: 12px; border: 1px solid var(--border); background: rgba(0, 0, 0, 0.24); overflow: hidden; }
.input-row .prefix { padding: 0 0 0 14px; color: var(--muted); font-size: 13.5px; font-weight: 600; flex: none; }
.input-row input { border: 0 !important; background: transparent !important; box-shadow: none !important; padding-left: 8px !important; }

.radio-row { display: flex; gap: 10px; flex-wrap: wrap; }
.radio {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 15px; border-radius: 12px;
  border: 1px solid var(--border); background: rgba(255, 255, 255, 0.045);
  font-size: 13px; cursor: pointer; color: var(--ink-2);
}
.radio:has(input:checked) { border-color: rgba(255, 154, 213, 0.6); background: rgba(255, 154, 213, 0.13); color: #fff; }
.radio input { accent-color: var(--pink); }

/* ---------------- 登录 / 注册 ---------------- */
.auth-wrap { display: grid; place-items: center; padding: 34px 0 20px; }
.auth-wrap.narrow .auth-card { width: min(456px, 100%); }
.auth-card {
  width: 100%;
  padding: 38px 34px 30px;
  border-radius: 24px;
  border: 1px solid var(--border);
  background:
    radial-gradient(400px 220px at 100% 0%, rgba(169, 139, 255, 0.22), transparent 60%),
    radial-gradient(360px 200px at 0% 100%, rgba(255, 154, 213, 0.2), transparent 60%),
    var(--glass-2);
  backdrop-filter: blur(22px) saturate(1.15);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.07);
}
.auth-emoji { font-size: 30px; margin-bottom: 6px; }
.auth-title { margin: 0 0 6px; font-size: 24px; font-weight: 900; letter-spacing: -0.01em; }
.auth-sub { margin: 0 0 22px; color: var(--muted); font-size: 13px; }
.auth-notice {
  margin: 0 0 18px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 154, 213, 0.34);
  background: rgba(255, 154, 213, 0.12);
  color: #ffe1f1;
  font-size: 12.8px;
  line-height: 1.65;
}
.auth-notice a { color: #fff; font-weight: 700; border-bottom: 1px dashed rgba(255, 255, 255, 0.5); }
.auth-card .form { padding: 0; }
.auth-foot { margin: 18px 0 0; text-align: center; font-size: 13px; color: var(--muted); }
.auth-foot a { font-weight: 700; }

/* ---------------- 上传 ---------------- */
.drop-zone {
  display: grid; place-items: center; gap: 6px;
  padding: 38px 22px;
  border-radius: 18px;
  border: 2px dashed rgba(255, 154, 213, 0.34);
  background: rgba(255, 154, 213, 0.05);
  text-align: center;
  transition: background 0.2s, border-color 0.2s;
}
.drop-zone.drag { background: rgba(255, 154, 213, 0.14); border-color: var(--pink); }
.drop-emoji { font-size: 34px; }
.drop-title { margin: 0; font-weight: 700; }
.file-preview { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 7px; justify-content: center; }
.file-preview li {
  padding: 4px 11px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.08); border: 1px solid var(--border);
  font-size: 11.5px; font-family: var(--mono);
}

/* ---------------- 编辑器 ---------------- */
.editor-panel { padding: 0; }
.editor-form { display: flex; flex-direction: column; }
.editor-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-2);
  background: rgba(255, 255, 255, 0.035);
}
.path-field { display: flex; align-items: center; flex: 1; min-width: 0; border-radius: 11px; border: 1px solid var(--border); background: rgba(0, 0, 0, 0.26); padding-left: 12px; }
.path-field .prefix { color: var(--muted); font-size: 12.5px; font-family: var(--mono); flex: none; }
.path-field input {
  flex: 1; min-width: 0; border: 0; background: transparent; outline: none;
  color: var(--ink); font-family: var(--mono); font-size: 13px; padding: 10px 12px;
}
.editor-area {
  min-height: 50vh;
  padding: 18px;
  border: 0; outline: none; resize: vertical;
  background: rgba(6, 3, 12, 0.82);
  color: #f4efff;
  font-family: var(--mono); font-size: 13.5px; line-height: 1.78;
  tab-size: 4;
}
.editor-foot { display: flex; align-items: center; gap: 16px; padding: 13px 16px; border-top: 1px solid var(--border-2); background: rgba(255, 255, 255, 0.04); }
.commit-input {
  flex: 1; padding: 10px 14px; border-radius: 11px;
  border: 1px solid var(--border); background: rgba(0, 0, 0, 0.26);
  color: var(--ink); font-family: inherit; font-size: 13px; outline: none;
}
.commit-input:focus { border-color: rgba(255, 154, 213, 0.6); }

/* ---------------- 用户主页 ---------------- */
.profile-head {
  display: flex; align-items: flex-start; gap: 22px;
  padding: 26px;
  margin-bottom: 24px;
  border-radius: 24px;
  border: 1px solid var(--border);
  background: var(--glass);
  backdrop-filter: blur(18px);
  flex-wrap: wrap;
}
.profile-avatar .avatar { width: 96px; height: 96px; border-radius: 28px; }
.profile-info { flex: 1; min-width: 220px; }
.profile-info h1 { margin: 0 0 6px; font-size: 26px; font-weight: 900; display: flex; align-items: center; gap: 10px; }
.profile-bio { margin: 0 0 12px; color: var(--ink-2); font-size: 14px; }
.profile-meta { display: flex; flex-wrap: wrap; gap: 16px; font-size: 12.5px; color: var(--muted); }
.profile-actions { display: flex; gap: 8px; align-items: center; }
.profile-actions form { margin: 0; }
.profile-mini { display: flex; align-items: center; gap: 14px; }
.profile-note {
  margin: -6px 0 18px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-2);
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-size: 12.5px;
}

.avatar {
  display: inline-grid; place-items: center;
  border-radius: 50%;
  font-weight: 900;
  color: #1b0d24;
  background: linear-gradient(135deg, hsl(var(--h, 320) 90% 78%), hsl(calc(var(--h, 320) + 46) 88% 72%));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25), 0 4px 14px rgba(0, 0, 0, 0.3);
  flex: none;
  letter-spacing: 0;
  line-height: 1;
}

.badge {
  padding: 2px 9px; border-radius: 999px;
  font-size: 10.5px; font-weight: 800; letter-spacing: 0.05em;
  background: rgba(255, 255, 255, 0.1); border: 1px solid var(--border); color: var(--ink-2);
}
.badge.admin { background: rgba(255, 196, 92, 0.22); border-color: rgba(255, 196, 92, 0.5); color: #ffe9bd; }

/* ---------------- 设置 / 后台 ---------------- */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.settings-grid .panel { margin-bottom: 0; }
.kv-list { list-style: none; margin: 0; padding: 14px 20px 18px; display: flex; flex-direction: column; gap: 10px; }
.kv-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; }
.kv-list li span { color: var(--muted); }
.kv-list li b { font-weight: 700; }
.preview-strip { display: flex; align-items: center; gap: 12px; }
.preview-strip img { width: 96px; height: 58px; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); }

/* ---------------- 404 ---------------- */
.error-wrap { display: grid; place-items: center; min-height: 52vh; }
.error-card { text-align: center; padding: 40px; }
.error-code {
  font-size: 96px; font-weight: 900; line-height: 1;
  background: linear-gradient(135deg, var(--pink), var(--purple), var(--cyan));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 8px 24px rgba(255, 154, 213, 0.3));
}
.error-emoji { font-size: 22px; margin: 8px 0 4px; color: var(--muted); }
.error-card h1 { margin: 6px 0 10px; font-size: 20px; }

/* ---------------- 页脚 ---------------- */
.footer {
  position: relative; z-index: 1;
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(9, 5, 17, 0.76);
  backdrop-filter: blur(16px);
  padding: 18px 0;
}
.footer-in { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; font-size: 12.8px; color: #e2dbf5; }
.foot-left { display: flex; align-items: center; gap: 9px; }
.foot-right { display: flex; align-items: center; gap: 12px; }
.pill {
  padding: 4px 11px; border-radius: 999px;
  background: rgba(255, 154, 213, 0.1); border: 1px solid rgba(255, 154, 213, 0.22);
  color: #ffd6ec; font-size: 11.5px;
}

/* ---------------- 主题设置页 ---------------- */
.theme-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 20px; align-items: start; }
.theme-col { display: flex; flex-direction: column; }
.theme-side { position: sticky; top: 82px; display: flex; flex-direction: column; gap: 16px; }
.preset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; padding: 16px 18px 18px; }
.preset {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s, transform 0.18s;
}
.preset:hover { background: rgba(255, 255, 255, 0.09); transform: translateY(-1px); }
.preset input { position: absolute; opacity: 0; pointer-events: none; }
.preset.on { border-color: var(--pink); background: rgba(255, 255, 255, 0.1); box-shadow: 0 0 0 2px color-mix(in srgb, var(--pink) 30%, transparent); }
.preset-dots { display: inline-flex; gap: 3px; flex: none; }
.preset-dots i { width: 12px; height: 12px; border-radius: 50%; display: inline-block; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.28); }
.preset-name { font-size: 12.8px; font-weight: 700; }

.color-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.color-input { display: flex; align-items: center; gap: 10px; }
.color-input input[type=color] {
  width: 46px; height: 40px; padding: 2px;
  border: 1px solid var(--border); border-radius: 11px;
  background: rgba(0, 0, 0, 0.2); cursor: pointer;
}
.color-hex {
  flex: 1; min-width: 0;
  padding: 10px 12px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.26);
  color: var(--ink); font-family: var(--mono); font-size: 13px;
  outline: none;
}
.field select {
  width: 100%;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.26);
  color: var(--ink);
  font-family: inherit; font-size: 14px;
  outline: none;
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
input[type=range] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%; height: 26px;
  background: transparent;
  cursor: pointer;
}
input[type=range]::-webkit-slider-runnable-track {
  height: 6px; border-radius: 3px;
  background: rgba(255, 255, 255, 0.2);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px; margin-top: -6px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.3);
}
input[type=range]::-moz-range-track { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.2); }
input[type=range]::-moz-range-thumb {
  width: 18px; height: 18px; border: 0; border-radius: 50%;
  background: linear-gradient(135deg, var(--pink), var(--purple));
}
.admin-table .file-row { padding: 9px 0; }
.admin-table td:nth-child(2), .admin-table td:nth-child(3), .admin-table td:nth-child(4) { font-size: 12.8px; }
.field > span b { color: var(--pink); font-family: var(--mono); font-weight: 700; }
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); cursor: pointer; padding: 4px 0; }
.switch input { width: 16px; height: 16px; accent-color: var(--pink); }
.theme-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 4px 0 8px; }

.preview-card {
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--glass);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  overflow: hidden;
}
.preview-head { padding: 10px 14px; font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: 0.06em; border-bottom: 1px solid var(--border-2); background: rgba(255, 255, 255, 0.04); }
.preview-body { padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.pv-card { border-radius: 14px; border: 1px solid var(--border); background: var(--glass-2); padding: 14px; }
.pv-title { display: flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 700; }
.pv-dot { width: 10px; height: 10px; border-radius: 50%; background: linear-gradient(135deg, var(--pink), var(--purple)); }
.pv-desc { margin: 8px 0 10px; font-size: 12px; color: var(--ink-2); line-height: 1.55; }
.pv-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.pv-tags span { padding: 2px 8px; border-radius: 999px; font-size: 10.5px; background: color-mix(in srgb, var(--purple) 24%, transparent); border: 1px solid color-mix(in srgb, var(--purple) 46%, transparent); color: color-mix(in srgb, var(--purple) 20%, #ffffff); }
.pv-meta { display: flex; gap: 10px; font-size: 11px; color: var(--ink-2); border-top: 1px dashed var(--border-2); padding-top: 8px; }
.pv-actions { display: flex; gap: 8px; }
.pv-btn { flex: 1; text-align: center; padding: 8px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.pv-btn.primary { background: linear-gradient(135deg, var(--pink), var(--purple)); color: #290b30; }
.pv-btn.ghost { background: rgba(255, 255, 255, 0.08); border: 1px solid var(--border); color: var(--ink); }
.pv-btn.soft { background: rgba(127, 233, 255, 0.18); border: 1px solid rgba(127, 233, 255, 0.45); color: #dcfaff; }
.pv-code { font-family: var(--mono); font-size: 11.5px; padding: 10px 12px; border-radius: 10px; background: rgba(0, 0, 0, 0.45); border: 1px solid var(--border-2); line-height: 1.7; color: var(--ink-2); }
.side-note { padding: 14px; border-radius: 14px; border: 1px solid var(--border-2); background: rgba(255, 255, 255, 0.04); font-size: 12.5px; color: var(--muted); }
.side-note b { color: var(--ink); display: block; margin-bottom: 4px; }
.side-note p { margin: 0; line-height: 1.65; }

/* ---------------- 后台概览 ---------------- */
.overview-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.overview-card {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--glass);
  backdrop-filter: blur(16px);
  display: flex; flex-direction: column; gap: 2px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.overview-card b { font-size: 20px; font-weight: 800; letter-spacing: -0.01em; }
.overview-card span { font-size: 11.5px; color: var(--muted); letter-spacing: 0.04em; }
.mini-search { display: flex; align-items: center; gap: 8px; }
.mini-search input {
  height: 34px; padding: 0 12px;
  border-radius: 10px; border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.28); color: var(--ink);
  font-family: inherit; font-size: 12.5px; outline: none;
  width: 200px; max-width: 40vw;
}
.mini-search input:focus { border-color: rgba(255, 154, 213, 0.6); }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.brand-logo { padding: 0; overflow: hidden; background: rgba(255, 255, 255, 0.1); }
.brand-logo img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: inherit; }
.avatar-img { object-fit: cover; border-radius: 50%; background: rgba(255, 255, 255, 0.1); box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2); }

.brand-upload {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-2);
  background: rgba(255, 255, 255, 0.04);
}
.brand-preview { display: inline-flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--muted); }
.brand-preview .brand-mark { width: 38px; height: 38px; font-size: 18px; }
.file-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.08);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.18s;
}
.file-btn:hover { background: rgba(255, 154, 213, 0.18); }
.file-btn input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-name { font-size: 11.5px; color: var(--muted); }

/* ---------------- 滚动条 ---------------- */
html {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 154, 213, 0.62) rgba(8, 4, 16, 0.55);
}
::-webkit-scrollbar {
  width: 11px;
  height: 11px;
}
::-webkit-scrollbar-track {
  background: rgba(8, 4, 16, 0.55);
}
::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 154, 213, 0.62), rgba(169, 139, 255, 0.62));
  border: 2px solid rgba(8, 4, 16, 0.55);
  background-clip: padding-box;
  transition: background 0.2s;
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(255, 154, 213, 0.95), rgba(169, 139, 255, 0.95));
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:active {
  background: linear-gradient(180deg, var(--pink), var(--purple));
  background-clip: padding-box;
}
::-webkit-scrollbar-corner {
  background: rgba(8, 4, 16, 0.55);
}
/* 跟随主题色（支持的浏览器会覆盖上面的固定色） */
@supports (background: color-mix(in srgb, red 50%, transparent)) {
  ::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--pink) 58%, transparent);
    border: 2px solid rgba(8, 4, 16, 0.55);
    background-clip: padding-box;
  }
  ::-webkit-scrollbar-thumb:hover {
    background: color-mix(in srgb, var(--pink) 88%, transparent);
  }
  ::-webkit-scrollbar-thumb:active {
    background: linear-gradient(180deg, var(--pink), var(--purple));
    background-clip: padding-box;
  }
  html { scrollbar-color: color-mix(in srgb, var(--pink) 62%, transparent) rgba(8, 4, 16, 0.55); }
}

/* ---------------- 历史版本 / 更新记录 ---------------- */
.version-current {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-2);
  background: rgba(255, 255, 255, 0.03);
}
.vc-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.version-list { list-style: none; margin: 0; padding: 6px 0; }
.version-item {
  display: grid;
  grid-template-columns: 11px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 13px 20px;
  border-bottom: 1px solid var(--border-2);
}
.version-item:last-child { border-bottom: 0; }
.version-dot {
  width: 9px; height: 9px; border-radius: 50%; margin-top: 6px;
  background: rgba(255, 255, 255, 0.28);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.05);
}
.version-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; font-size: 13.5px; }
.version-meta { display: flex; align-items: center; gap: 7px; margin-top: 4px; }
.version-actions { display: flex; align-items: center; gap: 4px; }
.version-head {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 12px 18px;
  flex-wrap: wrap;
}

.release-list { list-style: none; margin: 0; padding: 4px 0; }
.release-item {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-2);
}
.release-item:last-child { border-bottom: 0; }
.release-main { min-width: 0; flex: 1; }
.release-line1 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.release-tag {
  padding: 2px 9px; border-radius: 7px;
  font-family: var(--mono); font-size: 11px;
  background: rgba(255, 154, 213, 0.18);
  border: 1px solid rgba(255, 154, 213, 0.38);
  color: #ffd6ec;
}
.release-title { color: var(--ink); font-size: 14.5px; font-weight: 700; }
.release-title:hover { color: var(--pink); }
.release-excerpt { margin: 7px 0 6px; color: var(--ink-2); font-size: 12.8px; line-height: 1.6; }
.release-meta { display: flex; align-items: center; gap: 7px; }
.release-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; flex: none; }
.release-detail-head {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--border-2);
  flex-wrap: wrap;
}

/* ---------------- 响应式 ---------------- */
@media (max-width: 1000px) {
  .home-grid { grid-template-columns: 1fr; }
  .col-side { position: static; flex-direction: row; flex-wrap: wrap; }
  .col-side .side-card { flex: 1 1 240px; }
  .settings-grid { grid-template-columns: 1fr; }
  .clone-grid { grid-template-columns: 1fr; }
  .theme-layout { grid-template-columns: 1fr; }
  .theme-side { position: static; }
}
@media (max-width: 760px) {
  .wrap, .main-wide { width: calc(100% - 24px); }
  .topbar-in { height: 58px; gap: 10px; flex-wrap: wrap; }
  .top-search { order: 3; flex-basis: 100%; max-width: none; margin-bottom: 8px; }
  .topbar { position: static; background: rgba(13, 8, 24, 0.97); box-shadow: 0 6px 22px rgba(4, 2, 10, 0.5); }
  .nav-link { padding: 7px 9px; font-size: 13px; }
  .hero { padding: 30px 20px 26px; border-radius: 22px; }
  .hero-stats { gap: 8px 0; }
  .stat + .stat { margin-left: 14px; padding-left: 14px; }
  .stat b { font-size: 18px; }
  .repo-grid { grid-template-columns: 1fr; }
  .hide-sm { display: none; }
  .w-act { width: auto; }
  .markdown-body { padding: 16px 14px 20px; }
  .file-table td, .file-table th { padding-left: 12px; padding-right: 12px; }
  .repo-head { gap: 12px; }
  .auth-card { padding: 26px 20px 22px; }
  .commit-msg { max-width: 100%; }
  .commit-item { grid-template-columns: 11px minmax(0, 1fr); }
  .commit-side { grid-column: 2; flex-direction: row; gap: 12px; align-items: center; justify-content: flex-start; }
  .repo-meta { font-size: 13px; gap: 12px; }
  .col-side { flex-direction: column; }
  .field-row { grid-template-columns: 1fr; }
  .color-grid { grid-template-columns: 1fr; }
  .mini-search input { width: 130px; }
  .overview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .info-row { grid-template-columns: 1fr; gap: 6px; align-items: start; }
  .info-label { font-size: 11.5px; }
}

/* ============================================================
   移动端专项优化（<=760px）
   ============================================================ */
@media (max-width: 760px) {
  /* ---------- 顶栏：两行（logo+搜索+头像 / 导航横滚） ---------- */
  .topbar { position: sticky; top: 0; }
  .topbar-in {
    height: auto;
    padding: 9px 0 7px;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
  }
  .brand { order: 1; }
  .brand-mark { width: 32px; height: 32px; border-radius: 10px; font-size: 16px; }
  .brand-text { display: none; }
  .top-search { order: 2; flex: 1 1 120px; max-width: none; margin: 0; }
  .top-search input { height: 38px; font-size: 14px; }
  .user-chip { order: 3; margin-left: 0; }
  .chip-btn { padding: 4px; gap: 0; }
  .chip-btn span, .chip-btn > b, .chip-btn i { display: none; }
  .chip-btn .avatar { width: 32px; height: 32px; }
  .chip-menu { min-width: 160px; }
  .top-nav {
    order: 4;
    width: 100%;
    margin: 0;
    gap: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
  }
  .top-nav::-webkit-scrollbar { display: none; }
  .nav-link {
    padding: 7px 12px;
    font-size: 13px;
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
  }
  .nav-link.on { border-color: rgba(255, 154, 213, 0.45); }

  /* ---------- 触摸目标统一放大 ---------- */
  .btn { height: 44px; padding: 0 18px; font-size: 14.5px; }
  .btn-sm { height: 40px; padding: 0 15px; font-size: 13.5px; }
  .link-btn { padding: 9px 10px; font-size: 13px; line-height: 1; }
  .link-btn.tiny { padding: 8px 8px; font-size: 12.5px; }
  .icon-btn { width: 42px; height: 42px; }
  .page-btn { min-width: 44px; height: 44px; font-size: 14.5px; border-radius: 13px; }
  .page-btn.wide { padding: 0 16px; }
  .pager { gap: 6px; }
  .switch { padding: 8px 0; }
  .switch input { width: 20px; height: 20px; }
  .toggle-card { padding: 13px 14px; }
  .toggle-card input { width: 20px; height: 20px; }
  .preset { padding: 14px; }

  /* ---------- Hero ---------- */
  .hero { padding: 24px 18px 20px; border-radius: 20px; }
  .hero-badge { font-size: 11.5px; padding: 6px 12px; }
  .hero-title { font-size: 26px; margin: 12px 0 8px; }
  .hero-sub { font-size: 13.5px; margin-bottom: 18px; line-height: 1.6; }
  .hero-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
  .hero-actions .btn { width: 100%; padding: 0 10px; font-size: 13.5px; }
  .hero-actions .btn:nth-child(3) { grid-column: 1 / -1; }
  .hero-stats { margin-top: 18px; padding-top: 14px; gap: 10px 0; }
  .stat + .stat { margin-left: 12px; padding-left: 12px; }
  .stat b { font-size: 17px; }
  .stat span { font-size: 11.5px; }

  /* ---------- 区块标题 / 计数 ---------- */
  .section-head { padding: 10px 13px; gap: 9px; flex-wrap: wrap; }
  .section-head h2 { font-size: 17px; }
  .section-head h1.page-title { font-size: 20px; }
  .count-pill { font-size: 11.5px; padding: 3px 10px; }

  /* ---------- 仓库卡片 ---------- */
  .repo-grid { grid-template-columns: 1fr; gap: 12px; }
  .repo-card { min-height: 0; padding: 15px 15px 12px; border-radius: 16px; }
  .repo-name { font-size: 15px; }
  .repo-desc { min-height: 0; font-size: 13px; margin: 8px 0 10px; }
  .repo-tags { margin-bottom: 10px; gap: 6px; }
  .repo-meta { font-size: 12px; gap: 10px; padding-top: 10px; flex-wrap: wrap; }
  .tag { font-size: 11px; padding: 3px 9px; }

  /* ---------- 侧栏卡片（移动端堆到主内容下方） ---------- */
  .col-side { flex-direction: column; gap: 12px; }
  .side-card { padding: 15px; border-radius: 16px; }
  .side-card h3 { font-size: 14px; margin-bottom: 10px; }
  .side-link { padding: 12px 13px; font-size: 13.5px; }

  /* ---------- 面板 / 表单 ---------- */
  .panel { border-radius: 16px; margin-bottom: 14px; }
  .panel-head { padding: 12px 14px; flex-wrap: wrap; }
  .readme-title { font-size: 13.5px; }
  .form, .panel .form { padding: 14px 15px 18px; gap: 14px; }
  .field > span { font-size: 12.5px; }
  .field input[type=text], .field input[type=email], .field input[type=password],
  .field input[type=url], .field input[type=number], .field textarea, .field select {
    padding: 12px 14px;
    font-size: 15px; /* 16px 以下 iOS 会自动放大，保持 15~15.5 触发可接受 */
  }
  .field-row { grid-template-columns: 1fr; gap: 14px; }
  .color-grid { grid-template-columns: 1fr; }
  input[type=range] { height: 34px; }
  input[type=range]::-webkit-slider-thumb { width: 22px; height: 22px; margin-top: -8px; }
  input[type=range]::-moz-range-thumb { width: 22px; height: 22px; }

  /* ---------- 代码 / Markdown ---------- */
  .markdown-body { padding: 16px 14px 20px; font-size: 14px; line-height: 1.75; }
  .markdown-body h1 { font-size: 21px; }
  .markdown-body h2 { font-size: 18px; }
  .markdown-body h3 { font-size: 16px; }
  .markdown-body pre {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    font-size: 12.2px;
    padding: 12px 13px;
    border-radius: 12px;
  }
  .markdown-body table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }
  .markdown-body img { max-width: 100%; height: auto; border-radius: 10px; }
  .markdown-body blockquote { padding-left: 12px; }
  .code-pre { font-size: 12.2px; line-height: 1.68; }
  .code-scroll { -webkit-overflow-scrolling: touch; }
  .code-bar { padding: 9px 12px; font-size: 11.5px; }
  .code-line::before { width: 30px; font-size: 10.5px; }
  .code-line { padding-left: 38px; }

  /* ---------- 仓库信息 ---------- */
  .info-list { padding: 2px 14px 10px; }
  .info-row { padding: 10px 0; }
  .info-label { font-size: 11.5px; }
  .info-value { flex-direction: column; align-items: stretch; gap: 8px; }
  .info-value .cmd { flex: none; width: 100%; white-space: pre-wrap; word-break: break-all; font-size: 11.2px; }
  .cmd-input { width: 100%; flex: none; font-size: 12px; }
  .danger-zone { padding: 0 14px 14px; }
  .danger-zone summary { padding: 6px 0; }

  /* ---------- 文件列表 ---------- */
  .file-head { padding: 13px 14px; gap: 10px; }
  .file-head-actions { gap: 7px; flex-wrap: wrap; }
  .file-table { font-size: 13px; }
  .file-table td, .file-table th { padding-left: 12px; padding-right: 12px; }
  .file-row { padding: 13px 0; }
  .file-panel .file-table td:nth-child(2), .file-panel .file-table th:nth-child(2) { padding-right: 12px; }

  /* ---------- 仓库页头部 ---------- */
  .repo-head { padding: 15px 14px; gap: 12px; border-radius: 16px; }
  .repo-head-actions { gap: 7px; flex-wrap: wrap; width: 100%; }
  .repo-head-actions .btn { flex: 1 1 auto; }
  .repo-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap; gap: 4px; }
  .tab { padding: 8px 12px; font-size: 13px; white-space: nowrap; }
  .repo-quick-stats { display: none; }

  /* ---------- 提交 / 历史 / 更新记录 ---------- */
  .commit-item { grid-template-columns: 11px minmax(0, 1fr); padding: 12px 14px; }
  .version-item { grid-template-columns: 11px minmax(0, 1fr); padding: 12px 14px; gap: 10px; }
  .version-actions { grid-column: 2; justify-content: flex-start; }
  .version-head, .version-current { padding: 11px 14px; flex-wrap: wrap; gap: 8px; }
  .release-item { flex-direction: column; align-items: stretch; gap: 10px; padding: 14px; }
  .release-actions { justify-content: flex-start; }
  .release-detail-head { padding: 12px 14px; }

  /* ---------- 个人主页 ---------- */
  .profile-head { padding: 18px 15px; gap: 14px; border-radius: 18px; flex-direction: column; align-items: flex-start; }
  .profile-avatar .avatar { width: 72px; height: 72px; border-radius: 22px; }
  .profile-info h1 { font-size: 22px; }
  .profile-actions { width: 100%; }
  .profile-actions .btn { flex: 1; }
  .profile-meta { gap: 12px; font-size: 12px; }

  /* ---------- 后台 ---------- */
  .overview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .overview-card { padding: 12px 13px; }
  .overview-card b { font-size: 18px; }
  .mini-search { width: 100%; }
  .mini-search input { width: 100%; max-width: none; height: 38px; font-size: 14px; }
  .row-actions { gap: 10px; }
  .admin-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* ---------- 登录 / 注册 ---------- */
  .auth-wrap { padding: 18px 0 10px; }
  .auth-card { padding: 24px 18px 20px; border-radius: 18px; }
  .auth-title { font-size: 21px; }

  /* ---------- 主题设置 ---------- */
  .theme-side { display: none; }
  .theme-layout { grid-template-columns: 1fr; gap: 14px; }
  .preset-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 13px 14px 15px; gap: 9px; }
  .preset-name { font-size: 12px; }
  .theme-actions { gap: 8px; }
  .theme-actions .btn { flex: 1 1 auto; }
  .brand-upload { flex-direction: column; align-items: flex-start; gap: 10px; }
  .brand-preview { font-size: 12px; }

  /* ---------- 上传 ---------- */
  .drop-zone { padding: 26px 16px; }
  .drop-emoji { font-size: 28px; }
  .editor-area { min-height: 42vh; font-size: 13px; }
  .editor-head { flex-wrap: wrap; gap: 8px; padding: 12px 14px; }
  .editor-foot { flex-direction: column; align-items: stretch; gap: 10px; padding: 12px 14px; }

  /* ---------- 空白占位 / 404 ---------- */
  .empty-card { padding: 32px 16px; }
  .error-code { font-size: 72px; }

  /* ---------- 页脚 ---------- */
  .footer { padding: 14px 0; }
  .footer-in { flex-direction: column; align-items: flex-start; gap: 8px; font-size: 12px; }
  .foot-right { gap: 10px; }
}

/* 超窄屏（<=380px）再收一点 */
@media (max-width: 380px) {
  .hero-title { font-size: 23px; }
  .hero-actions { grid-template-columns: 1fr; }
  .hero-actions .btn:nth-child(3) { grid-column: auto; }
  .preset-grid { grid-template-columns: 1fr; }
  .stat + .stat { margin-left: 8px; padding-left: 8px; }
}

/* ---------------- 访问地址 / 令牌显示（可换行） ---------------- */
.url-box {
  flex: 1 1 auto;
  min-width: 0;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.38);
  color: #fff;
  font-family: var(--mono);
  font-size: 11.8px;
  line-height: 1.5;
  word-break: break-all;
  user-select: all;
  overflow-wrap: anywhere;
}

/* ---------------- 返回顶部 ---------------- */
.to-top {
  position: fixed;
  right: 16px;
  bottom: 18px;
  z-index: 45;
  width: 44px;
  height: 44px;
  display: none;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(20, 13, 36, 0.86);
  backdrop-filter: blur(14px);
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(4, 2, 10, 0.5);
  transition: opacity 0.2s, transform 0.2s;
}
.to-top.show { display: grid; }
.to-top:hover { background: rgba(255, 154, 213, 0.24); transform: translateY(-2px); }

@media (max-width: 760px) {
  .hero-actions .btn:nth-child(3) {
    background: transparent;
    border-color: var(--border);
    box-shadow: none;
    color: var(--ink-2);
    font-weight: 600;
  }
  .hero-actions .btn:nth-child(3):hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
  .url-box { font-size: 11.2px; padding: 10px 11px; }
}

/* ============================================================
   移动端：底部导航 + 顶栏收成一行 + 页脚精简
   ============================================================ */
.bottom-nav { display: none; }

@media (max-width: 760px) {
  /* 顶栏：单行（logo + 站点名 + 搜索 + 头像） */
  .topbar-in {
    height: 56px;
    padding: 0;
    flex-wrap: nowrap;
    gap: 8px;
  }
  .topbar { position: sticky; top: 0; }
  .brand { order: 1; gap: 8px; }
  .brand-mark { width: 30px; height: 30px; border-radius: 9px; font-size: 15px; }
  .brand-text { display: flex; font-size: 14px; gap: 0; white-space: nowrap; }
  .brand-text em { display: none; }
  .top-search { order: 2; flex: 1 1 auto; min-width: 80px; margin: 0; }
  .top-search input { height: 36px; padding: 0 12px 0 34px; font-size: 13.5px; }
  .search-ico { left: 11px; font-size: 12px; }
  .user-chip { order: 3; margin-left: 0; }
  .chip-btn { padding: 3px; }
  .chip-btn .avatar { width: 30px; height: 30px; }
  .top-nav { display: none; }

  /* 底部导航 */
  .bottom-nav {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    padding: 5px 6px calc(5px + env(safe-area-inset-bottom, 0px));
    background: rgba(11, 7, 21, 0.94);
    backdrop-filter: blur(20px) saturate(1.12);
    -webkit-backdrop-filter: blur(20px) saturate(1.12);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 -8px 26px rgba(4, 2, 10, 0.42);
  }
  .bn-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 7px 0 6px;
    border: 0;
    border-radius: 12px;
    background: none;
    color: var(--muted);
    font-family: inherit;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: color 0.16s, background 0.16s;
    -webkit-tap-highlight-color: transparent;
  }
  .bn-item .bn-ico { font-size: 17px; line-height: 1; filter: grayscale(0.35); transition: filter 0.16s, transform 0.16s; }
  .bn-item:active { background: rgba(255, 255, 255, 0.07); }
  .bn-item.on { color: #fff; background: rgba(255, 154, 213, 0.16); }
  .bn-item.on .bn-ico { filter: none; transform: translateY(-1px); }
  .bn-item.spinning .bn-ico { animation: bnSpin 0.6s ease; }
  @keyframes bnSpin { to { transform: rotate(360deg); } }

  /* 给底部导航留出空间 */
  .main { padding-bottom: 78px; }
  .to-top { bottom: calc(74px + env(safe-area-inset-bottom, 0px)); right: 14px; }

  /* 页脚：居中两行、更轻 */
  .footer {
    padding: 16px 0 calc(78px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(9, 5, 17, 0.7);
  }
  .footer-in {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 9px;
    font-size: 11.8px;
  }
  .foot-left { gap: 7px; order: 1; }
  .foot-left .brand-mark { width: 20px; height: 20px; border-radius: 7px; font-size: 10px; }
  .foot-left span { font-size: 11.8px; color: #d8d0ee; }
  .foot-right { order: 2; width: 100%; justify-content: center; flex-wrap: wrap; gap: 8px; }
  .foot-right .pill { font-size: 10.5px; padding: 3px 9px; }
  .foot-right .link-btn { font-size: 11px; padding: 5px 9px; }
}

@media (max-width: 760px) {
  /* 卡片标题区：长仓库名 + 可见性标签不挤在一起 */
  .repo-card-top { flex-wrap: wrap; gap: 6px 8px; align-items: center; }
  .repo-name { font-size: 15px; line-height: 1.35; max-width: 100%; }
  .vis-pill { font-size: 10.5px; padding: 2px 8px; }

  /* 底部导航可读性 */
  .bn-item { color: #d7cfee; }
  .bn-item .bn-ico { filter: none; }
  .bn-item.on { color: #fff; }

  /* 页脚胶囊低调一点 */
  .foot-right .pill {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    color: var(--muted);
  }
}

@media (max-width: 760px) {
  /* 只隐藏用户名文字，头像必须保留 */
  .chip-btn > span:not(.avatar) { display: none; }
  .chip-btn .avatar {
    display: inline-grid !important;
    width: 30px;
    height: 30px;
    font-size: 13px;
  }
  .chip-btn { padding: 3px; gap: 0; }
}

@media (max-width: 760px) {
  /* 顶栏导航：隐藏文字链接，只保留右上角头像（底部导航替代导航功能） */
  .top-nav {
    order: 3;
    width: auto;
    margin-left: auto;
    overflow: visible;
    gap: 6px;
    padding-bottom: 0;
  }
  .top-nav .nav-link,
  .top-nav .btn,
  .top-nav .icon-btn { display: none; }
  .top-nav .user-chip { display: block; }
  .top-nav .chip-menu { right: 0; }
}

@media (max-width: 760px) {
  .top-nav { display: flex; }
}

/* 底部导航：列数随可见项变化 */
@media (max-width: 760px) {
  .bottom-nav { grid-template-columns: repeat(var(--bn-count, 5), minmax(0, 1fr)); }
  /* 关闭底部导航后，底部留白回落到普通页脚 */
  body.no-bottom-nav .main { padding-bottom: 24px; }
  body.no-bottom-nav .footer { padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
  body.no-bottom-nav .to-top { bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
}

/* ---------------- 页脚链接 / 奇妙开关 ---------------- */
.foot-link { color: #e2dbf5; transition: color 0.16s; }
.foot-link:hover { color: var(--pink); }
.pill[href] { text-decoration: none; transition: background 0.16s, border-color 0.16s, color 0.16s; }
.pill[href]:hover { background: rgba(255, 154, 213, 0.18); border-color: rgba(255, 154, 213, 0.4); color: #fff; }
.wonder-btn { color: #c7b8ff; }
.wonder-btn:hover { background: rgba(169, 139, 255, 0.16); color: #fff; }
.wonder-btn.on {
  color: #ffe0a8;
  background: rgba(255, 196, 92, 0.16);
  box-shadow: inset 0 0 0 1px rgba(255, 196, 92, 0.35);
}

/* 页脚交互元素统一：小胶囊 + 链接提示 */
.foot-link {
  color: #e2dbf5;
  padding-bottom: 1px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.28);
  transition: color 0.16s, border-color 0.16s;
}
.foot-link:hover { color: var(--pink); border-bottom-color: var(--pink); }
.foot-right .link-btn {
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  font-size: 11.5px;
  line-height: 1.4;
  transition: background 0.16s, border-color 0.16s, color 0.16s;
}
.foot-right .link-btn:hover { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.22); color: #fff; }
.foot-right .wonder-btn.on {
  background: rgba(255, 196, 92, 0.18);
  border-color: rgba(255, 196, 92, 0.45);
  color: #ffe0a8;
}

/* 页脚三件套统一 + 链接更明显 */
.foot-link {
  color: #b9ecff;
  border-bottom: 1px dashed rgba(185, 236, 255, 0.5);
  padding-bottom: 1px;
}
.foot-link:hover { color: #fff; border-bottom-color: #fff; }
.footer .pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #d9d1ef;
  font-size: 11.5px;
  padding: 5px 11px;
  line-height: 1.4;
}
.footer .pill[href]:hover { background: rgba(255, 154, 213, 0.16); border-color: rgba(255, 154, 213, 0.4); color: #fff; }
.foot-right { gap: 9px; }
.foot-right .link-btn, .footer .pill { font-weight: 600; }

/* 页脚链接：不要下划线 */
.foot-link, .foot-link:hover { border-bottom: 0; padding-bottom: 0; }

/* 自检页步骤列表 */
.health-steps { margin: 0; padding-left: 20px; color: var(--ink-2); font-size: 13px; line-height: 1.9; }
.health-steps code { font-family: var(--mono); font-size: 12px; padding: 1px 6px; border-radius: 6px; background: rgba(255,255,255,.08); }
.mono-sm { font-family: var(--mono); font-size: 11.5px; word-break: break-all; }
