/* NingGit 私人代码平台 — 预览版样式（GitHub 式仓库界面） */

* { -webkit-tap-highlight-color: transparent; }
a, button, .btn, .nav-link { outline: none; }

:root {
  --accent: #e6a35c;
  --accent-soft: rgba(230, 163, 92, 0.12);
  --accent-glow: rgba(230, 163, 92, 0.26);
  --bg: #0c0e13;
  --bg-2: #10141b;
  --surface: #161a23;
  --surface-2: #1c2230;
  --text: #e7ebf2;
  --text-2: #9aa4b4;
  --text-3: #67707f;
  --border: #222936;
  --border-2: #2f3849;
  --success: #2fbf71;
  --danger: #e05656;
  --teal: #63d0bb;
  --font: 'Inter', 'PingFang SC', 'Microsoft YaHei', -apple-system, sans-serif;
  --mono: 'Cascadia Code', 'JetBrains Mono', Consolas, 'Courier New', monospace;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow: 0 12px 34px rgba(0, 0, 0, 0.45);
  --shadow-accent: 0 8px 22px rgba(230, 163, 92, 0.22);
  --nav-h: 60px;
  --transition: 0.2s ease;
}

[data-theme="light"] {
  --bg: #f4f5f7;
  --bg-2: #ffffff;
  --surface: #ffffff;
  --surface-2: #eceef2;
  --text: #1a1d24;
  --text-2: #57606f;
  --text-3: #8a92a3;
  --border: #e2e5ec;
  --border-2: #cdd2dd;
  --shadow-sm: 0 1px 4px rgba(26, 29, 36, 0.06);
  --shadow: 0 12px 34px rgba(26, 29, 36, 0.10);
  --shadow-accent: 0 8px 22px rgba(176, 122, 47, 0.18);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 15px;
  overflow-x: hidden;
  transition: background var(--transition), color var(--transition);
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input { font-family: inherit; color: inherit; }
::selection { background-color: var(--accent); color: #10141b; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background-color: var(--accent); }
.container { max-width: 1280px; margin: 0 auto; padding: 0 20px; }
.accent { color: var(--accent); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* 加载 */
.loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: var(--bg);
  transition: opacity 0.4s ease, visibility 0.4s ease;
}
.loader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.loader__name { font-size: 26px; font-weight: 800; letter-spacing: -0.5px; }
.loader__name b { color: var(--accent); }
.loader__bar { width: 140px; height: 3px; border-radius: 3px; background: var(--border); overflow: hidden; }
.loader__bar span { display: block; height: 100%; width: 40%; border-radius: 3px; background-color: var(--accent); animation: loadbar 1.1s ease-in-out infinite; }
@keyframes loadbar { 0% { transform: translateX(-120%); } 100% { transform: translateX(300%); } }

/* 导航 */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.navbar__inner { height: 100%; display: flex; align-items: center; gap: 18px; }
.brand { display: flex; align-items: center; gap: 9px; flex: none; }
.brand__mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
}
.brand__mark svg { width: 18px; height: 18px; }
.brand__text { font-weight: 700; font-size: 17px; letter-spacing: 0.1px; white-space: nowrap; }
.brand__text b { color: var(--accent); }
.nav-search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  max-width: 420px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-2);
  background: var(--bg);
  color: var(--text-3);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.nav-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.nav-search svg { width: 16px; height: 16px; flex: none; }
.nav-search input { flex: 1; min-width: 0; border: none; background: none; font-size: 14px; color: var(--text); }
.nav-search input::placeholder { color: var(--text-3); }
.nav-search input:focus { outline: none; }
.navbar__tools { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.preview-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: var(--accent);
  background-color: var(--accent-soft);
  white-space: nowrap;
}
.preview-badge .dot { width: 7px; height: 7px; border-radius: 50%; background-color: var(--success); box-shadow: 0 0 8px rgba(47, 191, 113, 0.8); }
.theme-toggle {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-2);
  transition: all var(--transition);
}
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-moon { display: none; }
body[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
body[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), color var(--transition), border-color var(--transition);
}
.btn--primary { background-color: var(--accent); color: #10141b; box-shadow: var(--shadow-accent); }
.btn--primary:hover { transform: translateY(-1px); box-shadow: 0 10px 24px var(--accent-glow); }
.btn--ghost { border: 1.5px solid var(--border-2); color: var(--text); background: transparent; }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn--sm { padding: 7px 14px; font-size: 12.5px; border-radius: 7px; }

/* 布局 */
.layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 0;
  min-height: calc(100vh - var(--nav-h));
  padding-top: var(--nav-h);
}
.sidebar {
  border-right: 1px solid var(--border);
  background: var(--bg-2);
  padding: 18px 14px;
  position: sticky;
  top: var(--nav-h);
  height: calc(100vh - var(--nav-h));
  overflow-y: auto;
}
.sidebar__head { display: flex; align-items: center; justify-content: space-between; padding: 0 8px 10px; }
.sidebar__title { font-size: 12px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; color: var(--text-3); }
.sidebar__count { font-size: 11.5px; font-weight: 600; color: var(--text-3); padding: 1px 8px; border-radius: 999px; border: 1px solid var(--border); }
.side-list { display: flex; flex-direction: column; gap: 2px; }
.side-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-2);
  text-align: left;
  transition: background var(--transition), color var(--transition);
}
.side-item svg { width: 15px; height: 15px; flex: none; color: var(--text-3); }
.side-item:hover { background: var(--surface); color: var(--text); }
.side-item.active { background: var(--accent-soft); color: var(--accent); }
.side-item.active svg { color: var(--accent); }
.side-item__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-item__lock { color: var(--text-3); }
.side-item.active .side-item__lock { color: var(--accent); }
.sidebar__tip { margin-top: 16px; padding: 10px 12px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); font-size: 12px; line-height: 1.6; }

.main { padding: 28px 26px 60px; min-width: 0; }
.view { display: none; }
.view.active { display: block; animation: viewIn 0.22s ease; }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* 仓库列表页 */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 22px; font-weight: 800; letter-spacing: -0.5px; }
.page-head__actions { display: flex; gap: 10px; align-items: center; }
.repo-filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.filter-tab {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: all var(--transition);
}
.filter-tab:hover { border-color: var(--accent); color: var(--accent); }
.filter-tab.active { background-color: var(--accent); color: #10141b; border-color: var(--accent); }

.repo-table { width: 100%; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); }
.repo-row {
  display: grid;
  grid-template-columns: 1fr 130px 90px 130px;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 15px 18px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  transition: background var(--transition);
}
.repo-row:last-child { border-bottom: none; }
.repo-row:hover { background: var(--surface-2); }
.repo-row__name { font-weight: 700; color: var(--accent); font-size: 15px; word-break: break-all; }
.repo-row__name svg { width: 14px; height: 14px; display: inline; vertical-align: -2px; }
.repo-row__desc { color: var(--text-2); font-size: 13px; margin-top: 2px; word-break: break-all; }
.repo-row__lang { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); }
.lang-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--lang, var(--accent)); flex: none; }
.repo-row__meta { font-size: 12.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.repo-row__updated { font-size: 12.5px; color: var(--text-3); text-align: right; }
.empty { padding: 40px; text-align: center; color: var(--text-3); font-size: 14px; }

/* 仓库详情 */
.repo-head { margin-bottom: 18px; }
.repo-head__name { font-size: 24px; font-weight: 800; letter-spacing: -0.5px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.repo-head__desc { color: var(--text-2); font-size: 14.5px; margin-top: 6px; max-width: 760px; }
.repo-head__meta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 12px; font-size: 13px; color: var(--text-3); }
.repo-head__meta span { display: inline-flex; align-items: center; gap: 6px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  border: 1px solid var(--border-2);
  background: var(--surface);
}
.chip svg { width: 13px; height: 13px; }
.chip--accent { color: var(--accent); border-color: var(--accent); background-color: var(--accent-soft); }

.repo-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.repo-tab {
  position: relative;
  padding: 9px 16px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-2);
  border-radius: 8px 8px 0 0;
  transition: color var(--transition);
}
.repo-tab:hover { color: var(--text); }
.repo-tab.active { color: var(--accent); }
.repo-tab.active::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; border-radius: 2px; background-color: var(--accent); }

/* 文件浏览 */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: var(--surface);
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-2);
}
.breadcrumb a { color: var(--accent); }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb__sep { color: var(--text-3); }
.file-table { border: 1px solid var(--border); border-radius: 0 0 var(--radius-lg) var(--radius-lg); background: var(--surface); overflow: hidden; }
.file-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  transition: background var(--transition);
}
.file-row:last-child { border-bottom: none; }
.file-row:hover { background: var(--surface-2); }
.file-row svg { width: 16px; height: 16px; flex: none; color: var(--text-3); }
.file-row--dir svg { color: var(--accent); }
.file-row--dir .file-row__name { color: var(--accent); font-weight: 600; }
.file-row__name { font-size: 14px; font-weight: 500; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; word-break: break-all; }
.file-row__commit { flex: 1.4; font-size: 12.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row__date { font-size: 12.5px; color: var(--text-3); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* 代码查看 */
.code-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: var(--surface);
  flex-wrap: wrap;
}
.code-head__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  padding: 6px 12px;
  border-radius: 7px;
  border: 1px solid var(--border);
  transition: all var(--transition);
}
.code-head__back:hover { color: var(--accent); border-color: var(--accent); }
.code-head__back svg { width: 14px; height: 14px; }
.code-head__file { font-family: var(--mono); font-size: 13.5px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.code-head__lang { margin-left: auto; font-size: 11.5px; font-weight: 600; color: var(--text-3); padding: 2px 9px; border-radius: 999px; border: 1px solid var(--border); }
.code-wrap { background: #0c0f16; border: 1px solid var(--border-2); border-top: none; border-radius: 0 0 var(--radius-lg) var(--radius-lg); overflow: hidden; }
[data-theme="light"] .code-wrap { background: #eef0f4; }
.code-view { padding: 16px 18px; overflow: auto; font-family: var(--mono); font-size: 13px; line-height: 1.7; color: var(--text); white-space: pre; }
[data-theme="light"] .code-view { color: #1a1d24; }
.tok-com { color: var(--text-3); }
.tok-str { color: #63d0bb; }
[data-theme="light"] .tok-str { color: #0b8f6d; }
.tok-kw { color: var(--accent); font-weight: 600; }
[data-theme="light"] .tok-kw { color: #b06a1f; }

/* README */
.readme-block {
  margin-top: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 22px 24px;
}
.readme-block h4 { font-size: 15px; font-weight: 700; margin: 16px 0 8px; color: var(--text); }
.readme-block h4:first-child { margin-top: 0; }
.readme-block p { color: var(--text-2); font-size: 14px; margin-bottom: 8px; line-height: 1.7; }
.readme-block code { font-family: var(--mono); font-size: 12.5px; background: var(--surface-2); padding: 2px 6px; border-radius: 5px; color: var(--accent); }
.readme-block ul { list-style: disc; padding-left: 20px; color: var(--text-2); font-size: 14px; margin-bottom: 8px; }
.readme-block ul li { margin-bottom: 4px; }

/* 提交记录 */
.commit-list { display: flex; flex-direction: column; gap: 8px; }
.commit-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); transition: transform var(--transition), border-color var(--transition); }
.commit-item:hover { transform: translateX(4px); border-color: var(--accent); }
.commit-item__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent-glow); flex: none; margin-top: 6px; }
.commit-item__body { flex: 1; min-width: 0; }
.commit-item__msg { font-size: 13.5px; font-weight: 600; color: var(--text); word-break: break-all; }
.commit-item__meta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 2px; font-size: 12px; color: var(--text-3); }
.commit-item__hash { font-family: var(--mono); color: var(--accent); }

/* Issue */
.issue-list { display: flex; flex-direction: column; gap: 8px; }
.issue-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 16px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  text-align: left;
  transition: transform var(--transition), border-color var(--transition);
}
.issue-item:hover { transform: translateX(3px); border-color: var(--accent); }
.issue-item__state { width: 10px; height: 10px; border-radius: 50%; flex: none; margin-top: 6px; }
.issue-item__state--open { background: var(--success); box-shadow: 0 0 8px rgba(47, 191, 113, 0.7); }
.issue-item__state--closed { background: var(--text-3); }
.issue-item__body { flex: 1; min-width: 0; }
.issue-item__title { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 4px; word-break: break-all; }
.issue-item__meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--text-3); }
.label-pill { padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.label-pill--bug { background: rgba(224, 86, 86, 0.14); color: var(--danger); }
.label-pill--enhancement { background: var(--accent-soft); color: var(--accent); }
.label-pill--suggestion { background: rgba(99, 208, 187, 0.14); color: var(--teal); }

/* 提示条 */
.page-toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translate(-50%, 16px);
  z-index: 3000;
  padding: 11px 20px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border-2);
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 500;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  max-width: 86vw;
  text-align: center;
}
.page-toast.show { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.page-toast.err { border-color: var(--danger); color: var(--danger); }

/* 响应式 */
@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; border-right: none; border-bottom: 1px solid var(--border); }
  .side-list { flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
  .side-item { flex: none; }
  .sidebar__tip { display: none; }
  .repo-row { grid-template-columns: 1fr 90px; }
  .repo-row__meta { display: none; }
  .repo-row__updated { display: none; }
  .file-row__commit { display: none; }
  .nav-search { max-width: none; }
}
@media (max-width: 640px) {
  .preview-badge { display: none; }
  .page-head { flex-direction: column; align-items: flex-start; }
  .main { padding: 20px 14px 50px; }
  .repo-head__name { font-size: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001s !important; transition-duration: 0.001s !important; }
}

/* 头像 */
.avatar-nav { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--border-2); overflow: hidden; flex: none; }
.avatar-nav img { width: 100%; height: 100%; object-fit: cover; }
.loader__avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
  box-shadow: 0 0 18px var(--accent-glow);
  animation: loaderPulse 1.4s ease-in-out infinite;
}
@keyframes loaderPulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.06); opacity: 0.85; } }

/* 克隆 / 下载 */
.clone-box {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  max-width: 600px;
  padding: 4px 4px 4px 14px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--bg);
}
.clone-box code { font-family: var(--mono); font-size: 12.5px; color: var(--text-2); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clone-box .btn--sm { flex: none; }
.repo-head__actions { display: flex; gap: 10px; align-items: center; margin-top: 14px; flex-wrap: wrap; }
.file-dl {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  color: var(--text-3);
  border: 1px solid transparent;
  flex: none;
  transition: all var(--transition);
}
.file-dl:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.file-dl svg { width: 15px; height: 15px; }

/* 管理后台 */
.notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-lg);
  background: var(--accent-soft);
  color: var(--text-2);
  font-size: 13.5px;
  line-height: 1.65;
  margin-bottom: 22px;
}
.notice svg { width: 18px; height: 18px; flex: none; color: var(--accent); margin-top: 2px; }
.notice b { color: var(--accent); }
.dropzone {
  border: 2px dashed var(--border-2);
  border-radius: var(--radius-lg);
  padding: 38px 20px;
  text-align: center;
  color: var(--text-3);
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
  margin-bottom: 26px;
}
.dropzone:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.dropzone svg { width: 34px; height: 34px; margin-bottom: 10px; }
.dropzone__title { font-size: 15px; font-weight: 700; color: var(--text-2); }
.dropzone:hover .dropzone__title { color: var(--accent); }
.dropzone__sub { font-size: 12.5px; margin-top: 4px; }
.admin-sub { font-size: 15px; font-weight: 700; margin-bottom: 12px; }
.repo-row--admin { grid-template-columns: 1fr 110px 150px; }
.row-actions { display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.btn--danger { border-color: rgba(224, 86, 86, 0.5); color: var(--danger); background: transparent; }
.btn--danger:hover { border-color: var(--danger); background: rgba(224, 86, 86, 0.12); }
.btn--sm svg { width: 13px; height: 13px; }
.repo-row__name { display: flex; align-items: center; gap: 6px; }
.repo-row__name svg { width: 14px; height: 14px; flex: none; }
@media (max-width: 720px) {
  .repo-row--admin { grid-template-columns: 1fr; }
  .row-actions { justify-content: flex-start; }
}

/* 文件行：主按钮 + 下载按钮 */
.file-row { padding: 0 16px; }
.file-row__main {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
  padding: 11px 0;
  text-align: left;
}
.file-row__main:hover .file-row__name { color: var(--text); }
.file-row__main:hover svg { color: var(--accent); }
.file-dl { margin-left: 4px; }

/* 仓库页顶部返回栏 */
.repo-back { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.repo-back__btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: 8px;
  background: var(--accent);
  color: #10141b;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: var(--shadow-accent);
  transition: transform var(--transition), box-shadow var(--transition);
}
.repo-back__btn:hover { transform: translateY(-1px); box-shadow: 0 10px 24px var(--accent-glow); }
.repo-back__btn svg { width: 15px; height: 15px; }
.repo-back__path { font-size: 13.5px; color: var(--text-3); }
.repo-back__path b { color: var(--text-2); font-weight: 600; }

/* 管理后台独立页 */
.admin-wrap { padding: calc(var(--nav-h) + 28px) 20px 60px; max-width: 980px; margin: 0 auto; }
.admin-breadcrumb { font-size: 13px; color: var(--text-3); margin-bottom: 8px; font-family: var(--mono); }
.admin-breadcrumb b { color: var(--text-2); font-weight: 600; }
.repo-row--admin { grid-template-columns: 1fr 110px 110px 170px; }
.row-actions { display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.btn--danger { border-color: rgba(224, 86, 86, 0.5); color: var(--danger); background: transparent; }
.btn--danger:hover { border-color: var(--danger); background: rgba(224, 86, 86, 0.12); }

/* 导航品牌：头像 + 名称 */
.avatar-nav--brand { width: 34px; height: 34px; }
.brand__suffix { font-size: 12px; color: var(--text-3); margin-left: 6px; font-weight: 600; }

/* 仓库头部：信息左、下载右 */
.repo-head__top { display: flex; gap: 24px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.repo-head__main { flex: 1; min-width: 280px; }
.repo-head__actions { display: flex; gap: 10px; align-items: center; margin-top: 6px; flex-wrap: wrap; }

/* 下载悬停弹窗 */
.dl-wrap { position: relative; display: inline-flex; }
.dl-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 6px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
  z-index: 30;
}
.dl-wrap:hover .dl-menu, .dl-wrap.dl-open .dl-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.dl-menu__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--text-2);
  text-align: left;
  transition: background 0.15s, color 0.15s;
}
.dl-menu__item svg { width: 16px; height: 16px; flex: none; color: var(--text-3); transition: color 0.15s; }
.dl-menu__item:hover { background: var(--accent-soft); color: var(--text); }
.dl-menu__item:hover svg { color: var(--accent); }

/* 发行版 */
.releases { margin-top: 26px; }
.releases__title { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; margin-bottom: 12px; }
.releases__title svg { width: 17px; height: 17px; color: var(--accent); }
.release {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  margin-bottom: 10px;
  transition: border-color var(--transition);
}
.release:hover { border-color: var(--accent); }
.release__tag {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 700;
  margin-top: 2px;
}
.release__body { flex: 1; min-width: 0; }
.release__name { font-size: 14.5px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.release__notes { font-size: 13px; color: var(--text-2); line-height: 1.6; word-break: break-word; }
.release__date { font-size: 12px; color: var(--text-3); margin-top: 6px; }
.release__dl { flex: none; align-self: center; }

/* 弹窗 */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 10, 14, 0.66);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal-overlay.show { display: flex; }
.modal {
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 60px);
  overflow-y: auto;
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  animation: modalIn 0.22s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal__head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 12px; border-bottom: 1px solid var(--border); }
.modal__title { font-size: 15.5px; font-weight: 700; }
.modal__close { width: 28px; height: 28px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; color: var(--text-3); }
.modal__close:hover { color: var(--text); background: var(--surface-2); }
.modal__close svg { width: 16px; height: 16px; }
.modal__body { padding: 18px 20px 6px; }
.modal__foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px 18px; }
.form-field { margin-bottom: 14px; }
.form-field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.form-input, .form-select, .form-textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 13.5px;
  color: var(--text);
  font-family: var(--font);
  transition: border-color 0.15s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus { outline: none; border-color: var(--accent); }
.form-textarea { min-height: 96px; resize: vertical; line-height: 1.6; }
.form-hint { font-size: 12px; color: var(--text-3); margin-top: 5px; }
.form-row { display: flex; gap: 12px; }
.form-row .form-field { flex: 1; }
/* ---- 上传记录（可折叠） ---- */
.collapsible { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--bg-2); }
.collapsible__head { display: flex; align-items: center; gap: 8px; width: 100%; padding: 12px 14px; background: transparent; border: none; cursor: pointer; color: var(--text); font-size: 13.5px; font-weight: 600; font-family: inherit; }
.collapsible__head:hover { background: var(--surface); }
.collapsible__title { flex: 1; text-align: left; }
.collapsible__count { font-size: 12px; color: var(--text-3); font-weight: 400; }
.collapsible__arrow { width: 16px; height: 16px; transition: transform .2s; color: var(--text-3); }
.collapsible.open .collapsible__arrow { transform: rotate(180deg); }
.collapsible__body { display: none; padding: 14px; border-top: 1px solid var(--border); }
.collapsible.open .collapsible__body { display: block; }
.rec-block { margin-bottom: 16px; }
.rec-block:last-child { margin-bottom: 0; }
.rec-block__title { font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 8px; }
.rec-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.rec-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; font-size: 13px; }
.rec-row__date { color: var(--text-3); font-size: 12px; white-space: nowrap; }
.rec-row__msg { flex: 1; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec-row__del { display: inline-flex; border: none; background: none; color: var(--text-3); cursor: pointer; padding: 2px; flex: none; }
.rec-row__del:hover { color: var(--danger); }
.rec-row__del svg { width: 14px; height: 14px; }
.rec-empty { font-size: 12.5px; color: var(--text-3); padding: 8px 2px; }
.rec-add { display: flex; gap: 8px; }
.rec-add .form-input { flex: 1; }
.rec-rel { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.rec-rel .form-input { flex: 1; min-width: 0; padding: 8px 10px; font-size: 13px; }
.rec-rel .rec-rel__tag { flex: 0 0 100px; }
.rec-rel .rec-rel__name { flex: 0 0 120px; }
.vis-toggle { display: inline-flex; gap: 6px; }
.vis-toggle button {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border-2);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-3);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
}
.vis-toggle button svg { width: 13px; height: 13px; }
.vis-toggle button.active { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.file-pick { display: flex; align-items: center; gap: 10px; }
.file-pick__name { font-family: var(--mono); font-size: 12.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 后台表格 */
.repo-row--admin { grid-template-columns: 1fr 110px 96px 150px 196px; }
.repo-row__cell { min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.repo-row__cell-desc { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.repo-row__name { display: flex; align-items: center; gap: 6px; }
.repo-row__name svg { width: 14px; height: 14px; flex: none; }
.admin-foot { margin-top: 18px; display: flex; justify-content: flex-end; }
.admin-foot .btn--sm { display: inline-flex; align-items: center; gap: 6px; }
.admin-foot .btn--sm svg { width: 13px; height: 13px; }

/* 克隆命令展示 */
.clone-code {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--border-2);
  border-radius: 10px;
  background: var(--surface);
  margin-bottom: 16px;
}
.clone-code code {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text);
  word-break: break-all;
}

/* ================= 后台：页签 / 设置 / 公告 / 账号安全 ================= */
.admin-tabs { display: flex; gap: 8px; margin-bottom: 22px; border-bottom: 1px solid var(--border); padding-bottom: 12px; flex-wrap: wrap; }
.admin-tabs button { background: transparent; border: 1px solid var(--border-2); color: var(--text-2); padding: 8px 16px; border-radius: 999px; font-size: 13.5px; font-weight: 600; cursor: pointer; transition: all .15s; }
.admin-tabs button:hover { border-color: var(--accent); color: var(--accent); }
.admin-tabs button.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.admin-panel { animation: fadeUp .25s ease; }
.settings-card { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; max-width: 620px; }
.settings-card .form-field { max-width: 560px; }
.admin-hint { font-size: 12.5px; color: var(--text-3); line-height: 1.7; margin: 10px 0 14px; }
.switch-row { display: flex; align-items: center; gap: 10px; }
.switch { width: 46px; height: 26px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border-2); position: relative; cursor: pointer; transition: background .18s, border-color .18s; padding: 0; }
.switch span { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--text-3); transition: transform .18s, background .18s; }
.switch[data-on="1"] { background: var(--accent-soft); border-color: var(--accent); }
.switch[data-on="1"] span { transform: translateX(20px); background: var(--accent); }
.switch-label { font-size: 13px; color: var(--text-2); font-weight: 600; }
.avatar-upload { display: flex; align-items: center; gap: 14px; }
.avatar-upload img { width: 64px; height: 64px; border-radius: 50%; border: 1px solid var(--border-2); object-fit: cover; background: var(--surface); }
.avatar-upload > div { display: flex; gap: 8px; }

/* ================= 前台：公告弹窗 ================= */
.announcement-box { padding: 2px 0; }
.announcement__title { font-size: 16px; font-weight: 800; color: var(--accent); margin-bottom: 12px; }
.announcement__content { max-height: 46vh; overflow: auto; font-size: 13.5px; line-height: 1.85; color: var(--text); }
.announcement__content h4 { font-size: 14px; margin: 10px 0 4px; color: var(--text); }
.announcement__content ul { margin: 4px 0 8px; padding-left: 18px; }
.announcement__content li { margin: 3px 0; }
.announcement__content p { margin: 6px 0; }
.announcement__date { margin-top: 14px; font-size: 12px; color: var(--text-3); }