/* ==========================================================
   质量根因秒级定位系统 · 设计系统 v1.0
   深空工业风格 · 青珀色系 · 独立实现
   ========================================================== */

:root {
  --bg: #060b16;
  --bg-2: #08101f;
  --bg-3: #0b1526;
  --panel: rgba(15, 26, 45, 0.78);
  --panel-solid: #0e1829;
  --panel-2: rgba(22, 36, 60, 0.55);
  --panel-hi: rgba(30, 48, 78, 0.72);
  --line: rgba(120, 168, 220, 0.14);
  --line-strong: rgba(120, 190, 235, 0.25);
  --txt: #e9f2fb;
  --txt-2: #c3d2e4;
  --muted: #8397b2;
  --muted-2: #5f728c;
  --cyan: #33e2ce;
  --cyan-deep: #14b8a6;
  --blue: #5b8cff;
  --amber: #f7b955;
  --red: #ff5f7e;
  --green: #3ddc97;
  --purple: #a78bfa;
  --pink: #f472b6;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  --radius: 14px;
  --radius-sm: 9px;
  --font: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Helvetica Neue", Arial, sans-serif;
  --num: "Bahnschrift", "DIN Alternate", "Bahnschrift SemiBold", "PingFang SC", sans-serif;
  --sidebar-w: 262px;
  --topbar-h: 66px;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

[data-theme="light"] {
  --bg: #eef3f9;
  --bg-2: #e8eef7;
  --bg-3: #ffffff;
  --panel: rgba(255, 255, 255, 0.86);
  --panel-solid: #ffffff;
  --panel-2: rgba(240, 245, 252, 0.9);
  --panel-hi: rgba(232, 240, 250, 0.95);
  --line: rgba(26, 60, 100, 0.12);
  --line-strong: rgba(26, 100, 150, 0.22);
  --txt: #10233c;
  --txt-2: #2c4666;
  --muted: #607691;
  --muted-2: #8a9bb0;
  --cyan: #0e9f92;
  --cyan-deep: #0b7d73;
  --blue: #2f63d9;
  --amber: #b97708;
  --red: #d93a58;
  --green: #12996b;
  --purple: #7c5cd6;
  --pink: #c2418e;
  --shadow: 0 20px 50px rgba(20, 50, 90, 0.12);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--txt);
  font-family: var(--font);
  font-size: 13.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(1100px 620px at 78% -10%, rgba(51, 226, 206, 0.10), transparent 62%),
    radial-gradient(900px 560px at 8% 8%, rgba(91, 140, 255, 0.10), transparent 60%),
    radial-gradient(760px 600px at 50% 110%, rgba(167, 139, 250, 0.07), transparent 65%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .5;
  background-image:
    linear-gradient(rgba(130, 180, 230, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(130, 180, 230, .035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at 50% 30%, #000 20%, transparent 78%);
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, h5 { margin: 0; font-weight: 600; letter-spacing: .2px; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

::selection { background: rgba(51, 226, 206, .28); }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(51, 226, 206, .3), rgba(91, 140, 255, .28));
  border-radius: 8px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(51, 226, 206, .5); }

.num { font-family: var(--num); font-variant-numeric: tabular-nums; letter-spacing: .3px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.strong { font-weight: 600; color: var(--txt); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.flex { display: flex; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-4 { gap: 4px; }
.gap-6 { gap: 6px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.hidden { display: none !important; }
.w-100 { width: 100%; }

/* ---------------- 应用骨架 ---------------- */
.app-shell {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--sidebar-w);
  z-index: 40;
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(180deg, rgba(10, 19, 34, .96) 0%, rgba(7, 13, 24, .98) 100%);
  border-right: 1px solid var(--line);
  box-shadow: 18px 0 50px rgba(0, 0, 0, .18);
}

[data-theme="light"] .sidebar {
  background: linear-gradient(180deg, rgba(255, 255, 255, .97), rgba(244, 248, 253, .99));
}

.sidebar::after {
  content: "";
  position: absolute;
  top: 0;
  right: -1px;
  width: 1px;
  height: 100%;
  background: linear-gradient(180deg, transparent, rgba(51, 226, 206, .55) 22%, rgba(91, 140, 255, .35) 68%, transparent);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  height: var(--topbar-h);
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  position: relative;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, rgba(51, 226, 206, .22), rgba(91, 140, 255, .18));
  border: 1px solid rgba(51, 226, 206, .35);
  box-shadow: 0 0 24px rgba(51, 226, 206, .18), inset 0 0 14px rgba(51, 226, 206, .08);
  flex: 0 0 auto;
}

.brand-mark svg { width: 22px; height: 22px; }

.brand-text { min-width: 0; }
.brand-name {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .4px;
  white-space: nowrap;
  background: linear-gradient(92deg, #eafcff, #86f0e2);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
[data-theme="light"] .brand-name { background: linear-gradient(92deg, #0d3b52, #0e9f92); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-sub { font-size: 10px; color: var(--muted); letter-spacing: 1.6px; text-transform: uppercase; }

.side-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 14px 12px 18px;
}

.nav-label {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 10px 6px;
  font-size: 10.5px;
  letter-spacing: 1.2px;
  color: var(--muted);
  text-transform: uppercase;
}
.nav-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line), transparent);
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  padding: 0 11px;
  margin: 2px 0;
  border-radius: 9px;
  color: var(--txt-2);
  font-size: 13px;
  transition: background .18s var(--ease), color .18s var(--ease), transform .18s var(--ease);
  white-space: nowrap;
}
.nav-item i { font-size: 15px; color: var(--muted); transition: color .18s; width: 18px; text-align: center; }
.nav-item:hover { background: rgba(91, 140, 255, .09); color: var(--txt); }
.nav-item:hover i { color: var(--cyan); }
.nav-item.active {
  color: #eafffb;
  background: linear-gradient(90deg, rgba(51, 226, 206, .16), rgba(51, 226, 206, .03) 70%, transparent);
  box-shadow: inset 0 0 0 1px rgba(51, 226, 206, .16);
}
.nav-item.active i { color: var(--cyan); }
.nav-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--cyan), var(--blue));
  box-shadow: 0 0 12px rgba(51, 226, 206, .8);
}
[data-theme="light"] .nav-item.active { color: #0b4a45; background: linear-gradient(90deg, rgba(14, 159, 146, .14), rgba(14, 159, 146, .02)); }

.nav-tag {
  margin-left: auto;
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255, 95, 126, .16);
  color: #ff9db1;
  border: 1px solid rgba(255, 95, 126, .28);
  font-family: var(--num);
}

.side-foot {
  flex: 0 0 auto;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 9px;
  background: rgba(6, 12, 22, .4);
}
.system-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
  animation: pulse-dot 2.2s infinite;
}
.side-foot span { font-size: 10.5px; color: var(--muted-2); letter-spacing: .5px; }
.side-foot b { margin-left: auto; font-family: var(--num); font-size: 10px; color: var(--muted); }

/* ---------------- 主区域 ---------------- */
.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-width: 0;
  position: relative;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  background: rgba(7, 13, 24, .72);
  backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
[data-theme="light"] .topbar { background: rgba(255, 255, 255, .78); }

.crumb { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); min-width: 0; }
.crumb i { font-size: 11px; }
.crumb b { color: var(--txt); font-weight: 600; font-size: 13px; }

.top-tools { margin-left: auto; display: flex; align-items: center; gap: 9px; }

.top-clock {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 9px;
  height: 34px;
  border-radius: 8px;
  border: 1px dashed var(--line);
  color: var(--muted);
  font-family: var(--num);
  font-size: 11.5px;
  letter-spacing: .5px;
}
.top-clock i { color: var(--cyan); font-size: 12px; }
@media (max-width: 1180px) { .top-clock { display: none; } }

.search-trigger {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 34px;
  padding: 0 11px;
  min-width: 212px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, .03);
  color: var(--muted);
  font-size: 12px;
  transition: all .2s;
}
.search-trigger:hover { border-color: var(--line-strong); color: var(--txt-2); background: rgba(91, 140, 255, .07); }
.search-trigger kbd {
  margin-left: auto;
  font-family: var(--num);
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid var(--line);
  color: var(--muted-2);
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .03);
  color: var(--txt-2);
  display: grid;
  place-items: center;
  position: relative;
  transition: all .18s;
}
.icon-btn:hover { border-color: var(--line-strong); color: var(--cyan); background: rgba(51, 226, 206, .08); }
.icon-btn .dot {
  position: absolute;
  top: 6px; right: 7px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 8px var(--red);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .03);
  cursor: pointer;
  transition: all .18s;
}
.user-chip:hover { border-color: var(--line-strong); background: rgba(91, 140, 255, .08); }
.avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  color: #04121a;
  background: linear-gradient(140deg, #7ff3e5, #48a9ff);
  box-shadow: 0 0 14px rgba(51, 226, 206, .3);
}
.user-meta { line-height: 1.15; }
.user-meta b { display: block; font-size: 12px; font-weight: 600; }
.user-meta span { font-size: 10px; color: var(--muted); }

.user-menu {
  position: absolute;
  right: 24px;
  top: 60px;
  width: 230px;
  padding: 8px;
  border-radius: 12px;
  background: var(--panel-solid);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
  z-index: 80;
  animation: pop .18s var(--ease);
}
.user-menu a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 12.5px;
  color: var(--txt-2);
}
.user-menu a:hover { background: rgba(91, 140, 255, .1); color: var(--txt); }
.user-menu .divider { height: 1px; background: var(--line); margin: 6px 4px; }

.page-wrap {
  position: relative;
  padding: 20px 24px 42px;
  max-width: 1780px;
  margin: 0 auto;
}

.page-loading {
  position: fixed;
  left: var(--sidebar-w);
  right: 0;
  top: var(--topbar-h);
  height: 2px;
  z-index: 90;
  background: transparent;
  overflow: hidden;
  display: none;
}
.page-loading.active { display: block; }
.page-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 34%;
  background: linear-gradient(90deg, transparent, var(--cyan), var(--blue), transparent);
  animation: loading-bar 1s infinite linear;
}

.reveal { animation: rise .42s var(--ease) both; }
.reveal-2 { animation: rise .42s .06s var(--ease) both; }
.reveal-3 { animation: rise .42s .12s var(--ease) both; }
.reveal-4 { animation: rise .42s .18s var(--ease) both; }

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
@keyframes pop {
  from { opacity: 0; transform: translateY(-6px) scale(.98); }
  to { opacity: 1; transform: none; }
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; }
}
@keyframes loading-bar {
  from { transform: translateX(-100%); }
  to { transform: translateX(400%); }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(51, 226, 206, .35); }
  50% { box-shadow: 0 0 0 8px rgba(51, 226, 206, 0); }
}

@media (max-width: 1180px) {
  :root { --sidebar-w: 226px; }
  .page-wrap { padding: 16px 16px 36px; }
  .search-trigger { min-width: 160px; }
}

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s var(--ease); }
  .sidebar.open { transform: none; }
  .main { margin-left: 0; }
  .page-loading { left: 0; }
  .user-meta { display: none; }
  .search-trigger { min-width: 0; width: 34px; padding: 0; justify-content: center; }
  .search-trigger span, .search-trigger kbd { display: none; }
}

#sidebarToggle { display: none; }
@media (max-width: 900px) {
  #sidebarToggle { display: grid; }
}
