/* 侧栏、主区、内容区 —— 由 index.html 拆分而来，加载顺序见 index.html */
/* ─── SIDEBAR ─── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform .2s ease;
}

.sidebar-logo {
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--border);
  position: relative;
  padding-right: 48px;
}
.sidebar-logo .brand {
  font-size: 18px;
  line-height: 1.3;
  overflow-wrap: anywhere;
  font-weight: 700;
  background: linear-gradient(135deg, var(--rose), var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.sidebar-logo .sub {
  font-size: 11px;
  color: var(--text2);
  margin-top: 2px;
}
.sidebar-collapse-btn,
.sidebar-expand-btn {
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: rgba(255,255,255,.05);
  color: var(--text2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
  transition: background .15s, color .15s;
}
.sidebar-collapse-btn:hover,
.sidebar-expand-btn:hover { background: rgba(255,255,255,.1); color: var(--text); }
.sidebar-collapse-btn {
  position: absolute;
  top: 26px;
  right: 12px;
}
.sidebar-expand-btn {
  position: fixed;
  top: 14px;
  left: 0;
  z-index: 110;
  display: none;
  border-left: 0;
  border-radius: 0 7px 7px 0;
  background: var(--sidebar-bg);
}

.sidebar-nav {
  flex: 1;
  padding: 10px 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.28) transparent;
}
/* 入口放不下时给出明确的滚动提示，避免最后一项被裁掉却看不出来 */
.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.22); border-radius: 3px; }
.sidebar-nav::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.35); }

.nav-section {
  padding: 8px 20px 3px;
  font-size: 10px;
  color: var(--text2);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 20px;
  cursor: pointer;
  color: var(--text2);
  transition: all .15s;
  border-left: 3px solid transparent;
  margin: 1px 0;
}
.nav-item:hover { color: var(--text); background: rgba(255,255,255,.03); }
.nav-item.active {
  color: var(--rose);
  background: rgba(224,66,105,.08);
  border-left-color: var(--rose);
}
.nav-item .icon { font-size: 16px; width: 20px; text-align: center; }
.nav-item .label { font-size: 13px; }
.nav-item .badge {
  margin-left: auto;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 10px;
  font-weight: 600;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  position: relative;
}
/* 入口列表滚动到底之前，用渐隐提示上面还有内容 */
.sidebar-footer::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  height: 22px;
  background: linear-gradient(to top, var(--sidebar-bg), rgba(15,16,23,0));
  pointer-events: none;
}
.admin-info {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  border-radius: 10px;
  padding: 8px;
  margin: -8px;
  transition: background .15s;
}
.admin-info:hover { background: rgba(255,255,255,.06); }
.admin-av {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--rose), var(--gold));
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}
.admin-name { font-size: 13px; font-weight: 600; }
.admin-role { font-size: 11px; color: var(--text2); }
.admin-logout-hint { font-size: 10px; color: rgba(224,66,105,.85); margin-top:2px; display:none; }
.admin-info:hover .admin-logout-hint { display:block; }

/* ─── MAIN ─── */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
  transition: margin-left .2s ease;
}

body.sidebar-collapsed .sidebar { transform: translateX(-100%); }
body.sidebar-collapsed .main { margin-left: 0; }
body.sidebar-collapsed .sidebar-expand-btn { display: flex; }

.topbar {
  background: var(--sidebar-bg);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.page-title { font-size: 16px; font-weight: 600; }
.breadcrumb { color: var(--text2); font-size: 12px; }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.top-btn {
  background: rgba(255,255,255,.06);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  transition: all .15s;
}
.top-btn:hover { background: rgba(255,255,255,.1); }
.sync-status {
  color: var(--text2);
  font-size: 12px;
  white-space: nowrap;
}
.sync-status strong {
  color: var(--green);
  font-weight: 800;
}
.top-search {
  background: rgba(255,255,255,.06);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 7px 14px 7px 36px;
  border-radius: 8px;
  font-size: 13px;
  width: 220px;
  outline: none;
}
.search-wrap { position: relative; }
.search-wrap::before {
  content: '🔍';
  position: absolute;
  left: 11px; top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  pointer-events: none;
}
.notif-dot {
  position: relative;
  cursor: pointer;
  font-size: 20px;
}
.notif-dot::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 8px; height: 8px;
  background: var(--red);
  border-radius: 50%;
  border: 2px solid var(--sidebar-bg);
}

/* ─── CONTENT AREA ─── */
.content {
  padding: 24px 28px;
  flex: 1;
}

.page-section { display: none; }
.page-section.active { display: block; }

