/* ============ 顶栏 ============ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(233, 242, 255, .86);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid rgba(201, 221, 255, .7);
}

.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  height: 64px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 700;
  color: var(--primary-deep);
  letter-spacing: .01em;
  white-space: nowrap;
}
.brand-mark {
  width: 26px;
  height: 26px;
  color: var(--primary);
  stroke-width: 1.6;
}
.brand-text { font-size: 16px; }

.tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 4px;
}

.tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 16px;
  border-radius: var(--r-pill);
  font-size: 14px;
  color: var(--muted);
  transition: color var(--t-mid) var(--ease), background-color var(--t-mid) var(--ease);
}
.tab:hover { color: var(--primary-deep); background: rgba(255, 255, 255, .6); }
.tab.is-active { color: var(--primary-deep); background: #fff; box-shadow: var(--shadow-1); }
.tab.is-active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -1px;
  width: 22px;
  height: 3px;
  margin-left: -11px;
  border-radius: 2px;
  background: var(--accent);
}
.tab .ic { width: 18px; height: 18px; }

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

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 6px 0 6px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .8);
  transition: border-color var(--t-mid) var(--ease);
}
.user-chip:hover { border-color: var(--primary); }
.user-chip .avatar-sm { width: 26px; height: 26px; border-radius: 50%; overflow: hidden; }
.user-chip .avatar-sm svg { width: 100%; height: 100%; display: block; }
.user-chip .name { font-size: 13px; color: var(--primary-deep); max-width: 84px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ============ 主容器 ============ */
.app {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 72px;
  min-height: calc(100vh - 64px);
}

@media (max-width: 1023px) {
  .app { padding: 24px 20px 64px; }
}

@media (max-width: 767px) {
  .topbar-inner { height: 56px; padding: 0 16px; gap: 12px; }
  .tabs { display: none; }
  .brand-text { font-size: 15px; }
  .topbar-user { margin-left: auto; }
  .app {
    padding: 20px 16px calc(84px + env(safe-area-inset-bottom));
    min-height: calc(100vh - 56px);
  }
}

/* ============ 底部导航（移动端） ============ */
.tabbar {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 45;
  height: calc(64px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(140%) blur(14px);
  border-top: 1px solid var(--line);
}

.tabbar-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 64px;
  color: var(--muted);
  font-size: 11px;
  transition: color var(--t-mid) var(--ease);
}
.tabbar-item .ic { width: 22px; height: 22px; }
.tabbar-item.is-active { color: var(--primary); }
.tabbar-item.is-active .ic { stroke-width: 1.9; }

@media (max-width: 767px) {
  .tabbar { display: flex; }
}

/* ============ 通用区块 ============ */
.block { margin-top: 48px; }
@media (max-width: 767px) { .block { margin-top: 32px; } }

.page-head { margin-bottom: 24px; }
.page-head h1 { font-size: 26px; color: var(--primary-deep); }
.page-head p { margin-top: 6px; font-size: 13px; color: var(--muted); }
@media (max-width: 767px) { .page-head h1 { font-size: 22px; } }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
