/* ============================================================================
   骨架：侧栏 + 顶栏 + 内容区 + 抽屉层
   ========================================================================== */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
}

/* ---------------- 侧栏 ---------------- */
.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: var(--s-6);
  padding: var(--s-5) var(--s-4);
  background: var(--surface);
  border-right: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-1) var(--s-2);
}

.brand__mark {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: linear-gradient(140deg, var(--tiffany-300), var(--tiffany-600));
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 6px 16px rgba(10, 186, 181, 0.24);
}

.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.brand__name {
  font-size: 14.5px;
  font-weight: 650;
  color: var(--ink-900);
  letter-spacing: -0.01em;
}

.brand__sub {
  font-size: 11.5px;
  color: var(--ink-400);
  letter-spacing: 0.04em;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: var(--s-5);
  overflow-y: auto;
  margin: 0 calc(var(--s-2) * -1);
  padding: 0 var(--s-2);
  flex: 1 1 auto;
}

.nav__group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav__label {
  padding: 0 var(--s-3) var(--s-1);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--ink-300);
  text-transform: uppercase;
}

.nav__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px var(--s-3);
  border-radius: 10px;
  font-size: 13.5px;
  color: var(--ink-600, var(--ink-500));
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
  text-align: left;
}

.nav__item svg {
  color: var(--ink-400);
  transition: color var(--dur) var(--ease);
}

.nav__item:hover {
  background: var(--surface-sunken);
  color: var(--ink-900);
}

.nav__item:hover svg {
  color: var(--ink-500);
}

.nav__item.is-active {
  background: var(--tiffany-050);
  color: var(--tiffany-700);
  font-weight: 600;
}

.nav__item.is-active svg {
  color: var(--tiffany-600);
}

.nav__count {
  margin-left: auto;
  min-width: 20px;
  padding: 0 6px;
  height: 18px;
  border-radius: var(--r-pill);
  background: var(--ink-100);
  color: var(--ink-500);
  font-size: 11px;
  font-weight: 600;
  display: grid;
  place-items: center;
  font-variant-numeric: tabular-nums;
}

.nav__item.is-active .nav__count {
  background: var(--tiffany-100);
  color: var(--tiffany-700);
}

.sidebar__foot {
  border-top: 1px solid var(--line);
  padding-top: var(--s-4);
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}

.who {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-1) var(--s-2);
}

.who__avatar {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: var(--tiffany-050);
  color: var(--tiffany-700);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
}

.who__name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-900);
}

.who__role {
  font-size: 11.5px;
  color: var(--ink-400);
}

/* 预览模式（SKIP_AUTH=1）：这一行必须是警告色，不能让人忘了它还开着 */
.who__role--warn {
  color: var(--warn);
  font-weight: 600;
}

/* ---------------- 主区 ---------------- */
.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  height: var(--topbar-h);
  padding: 0 var(--s-7);
  background: rgba(247, 250, 250, 0.82);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}

.topbar.is-stuck {
  border-bottom-color: var(--line);
  background: rgba(247, 250, 250, 0.94);
}

.topbar__title {
  display: flex;
  align-items: baseline;
  gap: var(--s-3);
  min-width: 0;
}

.topbar__hint {
  font-size: 12.5px;
  color: var(--ink-400);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  flex: none;
}

.viewport {
  flex: 1 1 auto;
  width: 100%;
  max-width: var(--content-max);
  padding: var(--s-5) var(--s-7) var(--s-9);
  margin: 0 auto;
}

/* ---------------- 抽屉 / 遮罩层 ---------------- */
.layer {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  justify-content: flex-end;
  background: rgba(13, 27, 26, 0.28);
  backdrop-filter: blur(2px);
  animation: layer-in var(--dur) var(--ease);
}

.layer--center {
  justify-content: center;
  align-items: center;
  padding: var(--s-6);
}

@keyframes layer-in {
  from {
    opacity: 0;
  }
}

/* ---------------- 登录 ---------------- */
.login {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  background: var(--surface);
}

.login__aside {
  position: relative;
  overflow: hidden;
  padding: var(--s-9);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: linear-gradient(155deg, #f2fbfa 0%, #e7f7f5 46%, #d8f2ef 100%);
}

/* 两团极淡的绿雾，避免大面积纯色的呆板 */
.login__aside::before,
.login__aside::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.55;
  pointer-events: none;
}

.login__aside::before {
  width: 380px;
  height: 380px;
  right: -110px;
  top: -90px;
  background: radial-gradient(circle, rgba(10, 186, 181, 0.45), transparent 70%);
}

.login__aside::after {
  width: 320px;
  height: 320px;
  left: -80px;
  bottom: -120px;
  background: radial-gradient(circle, rgba(42, 196, 189, 0.35), transparent 70%);
}

.login__quote {
  position: relative;
  max-width: 400px;
}

.login__title {
  font-size: 30px;
  line-height: 1.28;
  font-weight: 650;
  letter-spacing: -0.03em;
  color: var(--ink-900);
}

.login__desc {
  margin-top: var(--s-4);
  font-size: 14px;
  color: var(--ink-500);
  line-height: 1.75;
}

.login__points {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}

.login__panel {
  display: grid;
  place-items: center;
  padding: var(--s-7);
}

.login__card {
  width: 100%;
  max-width: 352px;
  display: flex;
  flex-direction: column;
  gap: var(--s-5);
}

.login__head {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}

/* ---------------- 响应式 ---------------- */
@media (max-width: 1080px) {
  :root {
    --sidebar-w: 76px;
  }

  .brand__text,
  .nav__label,
  .nav__item span,
  .nav__count,
  .who__name,
  .who__role {
    display: none;
  }

  .nav__item {
    justify-content: center;
    padding: 11px 0;
  }

  .brand {
    justify-content: center;
  }

  .sidebar {
    padding: var(--s-5) var(--s-3);
    align-items: stretch;
  }

  .who {
    justify-content: center;
  }

  .topbar {
    padding: 0 var(--s-5);
  }

  .viewport {
    padding: var(--s-4) var(--s-5) var(--s-8);
  }
}

@media (max-width: 720px) {
  .app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 0;
    border-right: 0;
    border-top: 1px solid var(--line);
    padding: var(--s-2) var(--s-3);
    z-index: 40;
  }

  .brand,
  .sidebar__foot,
  .nav__label {
    display: none;
  }

  .nav {
    flex-direction: row;
    gap: var(--s-1);
    overflow-x: auto;
    width: 100%;
    margin: 0;
    padding: 0;
  }

  .nav__group {
    flex-direction: row;
    gap: var(--s-1);
  }

  .nav__item {
    flex-direction: column;
    gap: 2px;
    padding: var(--s-2);
    font-size: 10px;
  }

  .viewport {
    padding: var(--s-4) var(--s-4) 96px;
  }

  .topbar {
    padding: 0 var(--s-4);
  }

  .login {
    grid-template-columns: 1fr;
  }

  .login__aside {
    display: none;
  }
}
