:root {
  --bg0: #eceff3;
  --ink: #0e1218;
  --muted: #6a7382;
  --line: rgba(14, 18, 24, 0.08);
  --line2: rgba(14, 18, 24, 0.14);
  --glass: rgba(255, 255, 255, 0.55);
  --accent: #151a22;
  --steel: #8b93a1;
  --max: 1480px;
  --blur: 28px;
  --shadow-sm: 0 12px 32px rgba(18, 24, 36, 0.08);
  --font: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --display: "Segoe UI Semibold", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  background:
    radial-gradient(1100px 520px at 12% -8%, rgba(255,255,255,0.9), transparent 58%),
    radial-gradient(900px 480px at 100% 0%, rgba(170, 184, 206, 0.22), transparent 52%),
    linear-gradient(168deg, #f7f8fb 0%, #e9edf3 48%, #e2e7ef 100%);
  color: var(--ink);
  font-family: var(--font);
}
.hidden { display: none !important; }
.muted { color: var(--muted); }

/* —— 统一登录（壳 SSOT） —— */
.hub-login {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(900px 420px at 50% 0%, rgba(20,28,40,.08), transparent 55%),
    linear-gradient(180deg, #f4f6f9, #e4e9f0);
}
.hub-login-box {
  width: min(360px, 92vw);
  padding: 28px 24px 22px;
  border-radius: 18px;
  background: #fffcf8;
  border: 1px solid rgba(20,24,31,.1);
  box-shadow: 0 18px 40px -28px rgba(20,24,31,.4);
  display: grid;
  gap: 12px;
}
.hub-login-logo {
  display: block;
  width: 160px;
  height: auto;
  margin: 0 auto 8px;
}
.hub-login-box label {
  display: grid;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
.hub-login-box input {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(20,24,31,.12);
  font: inherit;
  background: #fff;
}
.hub-login-btn {
  width: 100%;
  margin-top: 4px;
  border: 0;
  border-radius: 10px;
  padding: 11px 14px;
  font: inherit;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(180deg, #2d3442 0%, #12161e 100%);
  cursor: pointer;
}
.hub-login-err { min-height: 1.2em; margin: 0; text-align: center; font-size: 12px; }

/* —— 顶栏：大 Logo 锚定 + 一体钢化玻璃条 —— */
.hub {
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr;
}
.hub-top {
  padding: 18px 0 10px;
}
.hub-top-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 28px;
}
.hub-chrome {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px 32px;
  min-width: 0;
  padding: 8px 10px 8px 10px;
  border-radius: 28px;
  border: 1px solid rgba(255,255,255,0.78);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.96) 0%, rgba(244,247,252,0.78) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,1),
    inset 0 -1px 0 rgba(18, 24, 36, 0.04),
    0 18px 40px -20px rgba(18, 24, 36, 0.28);
  overflow: hidden;
}
.hub-chrome::before {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(180, 190, 205, 0.9), transparent);
  pointer-events: none;
}
.hub-brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  line-height: 0;
  flex-shrink: 0;
  padding: 4px 8px 4px 14px;
}
.hub-brand img {
  display: block;
  height: 72px;
  width: auto;
  max-width: 260px;
  object-fit: contain;
  filter: contrast(1.08) saturate(1.05);
}

.hub-nav {
  display: inline-flex;
  justify-self: center;
  gap: 2px;
  min-width: 0;
  padding: 4px;
  border-radius: 999px;
  background: rgba(18, 24, 36, 0.045);
  border: 1px solid rgba(18, 24, 36, 0.05);
  overflow-x: auto;
}
.hub-item {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 12px 26px;
  border-radius: 999px;
  font-family: var(--display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  cursor: pointer;
  transition: color .16s ease, background .16s ease, box-shadow .16s ease;
}
.hub-item:hover { color: var(--ink); background: rgba(255,255,255,0.7); }
body.role-man-calc .hub-nav { display: none !important; }
body.role-man-calc .hub-chrome {
  grid-template-columns: auto 1fr;
}
body.role-man-calc .hub-tools { justify-self: end; }

.hub-item.active {
  color: #f5f7fb;
  background: linear-gradient(180deg, #2a3140 0%, #12161e 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.18),
    0 8px 18px rgba(12, 16, 24, 0.28);
}

.hub-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px 0 4px;
  flex-shrink: 0;
}
.hub-tools .muted {
  font-size: 12px;
  letter-spacing: 0.06em;
  font-weight: 600;
}
.hub-logout {
  appearance: none;
  border: 1px solid rgba(18, 24, 36, 0.12);
  background: rgba(255,255,255,0.88);
  color: var(--ink);
  border-radius: 999px;
  padding: 10px 18px;
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.hub-logout:hover {
  border-color: rgba(18, 24, 36, 0.22);
  background: #fff;
}

.lane-stage {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background:
    radial-gradient(900px 420px at 50% 0%, rgba(255,255,255,0.85), transparent 55%),
    linear-gradient(180deg, #f4f6f9, #e8edf4);
}
.lane-stage.lane-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(900px 420px at 50% 0%, rgba(255,255,255,0.9), transparent 55%),
    linear-gradient(180deg, #f4f6f9, #e8edf4);
}
.lane-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #f4f6f9; /* 禁浏览器默认白/黑闪 */
  color-scheme: light;
}
.lane-frame[hidden] {
  display: none !important;
  visibility: hidden;
  pointer-events: none;
}

@media (max-width: 860px) {
  .hub-top-inner { padding: 0 14px; }
  .hub-chrome {
    grid-template-columns: 1fr;
    border-radius: 24px;
    padding: 12px;
    gap: 12px;
  }
  .hub-brand { justify-content: center; padding: 0; }
  .hub-brand img { height: 56px; }
  .hub-nav { justify-self: stretch; }
  .hub-tools { justify-content: flex-end; }
}
