@charset "utf-8";
/* 基础框架：布局 / 顶栏 / 侧栏 / 排版 */

:root {
  --fs-base: 15px;
  --radius: 12px;
  --radius-sm: 8px;
  --gap: 16px;
  --sidebar-w: 248px;
  --topbar-h: 60px;
  --shadow-1: 0 1px 2px rgba(15, 23, 42, .05), 0 2px 8px rgba(15, 23, 42, .05);
  --shadow-2: 0 2px 4px rgba(15, 23, 42, .05), 0 10px 24px rgba(15, 23, 42, .10);
  --shadow-3: 0 8px 16px rgba(15, 23, 42, .10), 0 24px 56px rgba(15, 23, 42, .18);
  --font: "MiSans", "HarmonyOS Sans SC", "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Source Han Sans SC", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Cascadia Mono", Consolas, "Courier New", monospace;
  /* 深色导航壳（浅色模式下也保持深色侧栏，形成稳定的框架感） */
  --side-bg-1: #17293f;
  --side-bg-2: #102033;
  --side-text: #d5e2f2;
  --side-dim: #8ba3bd;
  --side-faint: #64798f;
  --side-line: rgba(255, 255, 255, .09);
  --side-hover: rgba(255, 255, 255, .07);
}

html[data-fs="m"] { --fs-base: 13.5px; }
html[data-fs="L"] { --fs-base: 15px; }
html[data-fs="XL"] { --fs-base: 17px; }

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--brand-soft); color: var(--brand-strong); }

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 4px;
}

#app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--topbar-h) 1fr;
  grid-template-areas:
    "top top"
    "side main";
  height: 100vh;
  overflow: hidden;
}

/* ---------- 顶栏 ---------- */
#topbar {
  grid-area: top;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 20px;
  background: var(--top-bg);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(15, 23, 42, .02), 0 2px 10px rgba(15, 23, 42, .03);
  position: relative;
  z-index: 20;
  backdrop-filter: saturate(150%) blur(10px);
}

.brand { display: flex; align-items: center; gap: 11px; min-width: 200px; }
.brand-mark {
  display: inline-grid;
  place-items: center;
  height: 34px;
  padding: 0 11px;
  border-radius: 9px;
  font-weight: 800;
  font-size: .95em;
  letter-spacing: 2px;
  color: #fff;
  background: linear-gradient(140deg, var(--brand), var(--brand-strong));
  box-shadow: 0 3px 10px var(--brand-soft), inset 0 1px 0 rgba(255, 255, 255, .25);
  text-shadow: 0 1px 2px rgba(0, 0, 0, .18);
}
.brand-title { font-weight: 650; color: var(--text); letter-spacing: 1px; font-size: 1.02em; }

.topbar-search { flex: 1; max-width: 640px; }
.topbar-search input {
  width: 100%;
  height: 38px;
  padding: 0 14px 0 38px;
  font-size: .93em;
  font-family: inherit;
  color: var(--text);
  background:
    url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='%237b8794' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.8-3.8'/%3E%3C/svg%3E") no-repeat 13px center,
    var(--input-bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  outline: none;
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}
.topbar-search input::placeholder { color: var(--text-faint); }
.topbar-search input:focus {
  border-color: var(--brand);
  background-color: var(--panel);
  box-shadow: 0 0 0 4px var(--brand-soft);
}

.topbar-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }

.icon-btn {
  height: 36px;
  padding: 0 15px;
  font-size: .92em;
  font-family: inherit;
  font-weight: 550;
  color: var(--text-dim);
  background: var(--input-bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}
.icon-btn:hover {
  border-color: var(--brand);
  color: var(--brand-strong);
  background: var(--brand-soft);
}
.icon-btn.lock { padding: 0 13px; white-space: nowrap; font-size: .88em; }
.icon-btn.is-admin {
  background: linear-gradient(140deg, var(--brand), var(--brand-strong));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 3px 10px var(--brand-soft);
}

/* ---------- 侧栏（深色导航壳） ---------- */
#sidebar {
  grid-area: side;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--side-bg-1), var(--side-bg-2));
  overflow: hidden;
  position: relative;
}
#sidebar::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 46% at 0% 0%, var(--brand-soft), transparent 62%),
    linear-gradient(180deg, transparent 62%, rgba(0, 0, 0, .16));
  pointer-events: none;
}
#sidebar > * { position: relative; z-index: 1; }

#nav { flex: 1; overflow-y: auto; padding: 10px 12px 16px; }
#nav::-webkit-scrollbar { width: 6px; }
#nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .14); border-radius: 3px; }
#nav::-webkit-scrollbar-track { background: transparent; }

.nav-group-title {
  font-size: .72em;
  color: var(--side-faint);
  letter-spacing: .22em;
  padding: 16px 12px 7px;
  font-weight: 650;
}
.nav-group-title:first-child { padding-top: 10px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  margin: 2px 0;
  border-radius: 9px;
  color: var(--side-dim);
  font-size: .95em;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  position: relative;
  transition: background .14s, color .14s;
}
.nav-item:hover { background: var(--side-hover); color: var(--side-text); }
.nav-item.active {
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  color: #fff;
  font-weight: 650;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .22), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.nav-item .nav-ico {
  width: 20px;
  text-align: center;
  font-size: .92em;
  opacity: .8;
  flex: none;
}
.nav-item.active .nav-ico { opacity: 1; }
.nav-item .nav-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item .nav-badge {
  min-width: 20px;
  padding: 0 6px;
  height: 18px;
  line-height: 18px;
  font-size: .74em;
  text-align: center;
  border-radius: 9px;
  background: #e5484d;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(229, 72, 77, .4);
}
.nav-item .nav-badge.zero { background: rgba(255, 255, 255, .10); color: var(--side-faint); box-shadow: none; }
.nav-item:not(.active):has(.nav-badge:not(.zero)) { color: var(--side-text); }

.sidebar-foot {
  padding: 12px 16px 16px;
  border-top: 1px solid var(--side-line);
  font-size: .8em;
  color: var(--side-faint);
  line-height: 1.55;
}
.sidebar-foot a { color: #9cc3ee; }
.mode-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .09);
  color: var(--side-dim);
  font-size: .95em;
  font-weight: 550;
  border: 1px solid var(--side-line);
}
.mode-chip.admin {
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  color: #fff;
  border-color: transparent;
}

/* ---------- 主区 ---------- */
#view {
  grid-area: main;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 26px 30px 64px;
  outline: none;
}
#view::-webkit-scrollbar { width: 9px; }
#view::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 5px;
  border: 2px solid transparent;
  background-clip: content-box;
}
#view::-webkit-scrollbar-track { background: transparent; }

.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-title {
  margin: 0;
  font-size: 1.46em;
  font-weight: 750;
  letter-spacing: .5px;
  display: flex;
  align-items: center;
  gap: 11px;
}
.page-title::before {
  content: "";
  width: 5px;
  height: 1.05em;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--brand), var(--brand-strong));
  box-shadow: 0 2px 6px var(--brand-soft);
}
.page-sub { color: var(--text-faint); font-size: .9em; }

.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.muted { color: var(--text-faint); }
.small { font-size: .86em; }
.mono { font-family: var(--mono); }

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

.section { margin: 30px 0 12px; display: flex; align-items: center; gap: 10px; }
.section h2 {
  margin: 0;
  font-size: 1.1em;
  font-weight: 700;
  letter-spacing: .4px;
  display: flex;
  align-items: center;
  gap: 9px;
}
.section h2::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 3px;
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  transform: rotate(45deg);
  box-shadow: 0 1px 4px var(--brand-soft);
}
.section .rule { flex: 1; height: 1px; background: linear-gradient(90deg, var(--line), transparent); }

.empty {
  padding: 48px 20px;
  text-align: center;
  color: var(--text-faint);
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--panel-2);
  font-size: .95em;
}

.loading { padding: 60px; text-align: center; color: var(--text-faint); }
