/* ============================================================
   管理后台左侧侧边栏（所有 admin-*.html 共用）
   由 /js/admin-sidebar.js 注入，按管理员权限显示/隐藏项目
   ============================================================ */

/* 桌面端：固定左侧，内容右移 */
.admin-sidebar {
  position: fixed; top: 58px; left: 0; bottom: 0; width: 232px;
  background: var(--bg-card); border-right: 1px solid var(--border);
  box-shadow: 2px 0 12px rgba(92, 74, 56, 0.06); z-index: 900;
  display: flex; flex-direction: column; overflow-y: auto;
  padding: 12px 12px 14px;
}
.admin-sidebar::-webkit-scrollbar { width: 5px; }
.admin-sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
body.as-ready { padding-left: 232px; }

/* 头部 */
.as-head { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px 12px; border-bottom: 1px solid var(--border); margin-bottom: 10px; text-decoration: none; }
.as-head .t { font-weight: 800; font-size: 1rem; font-family: var(--font-title); color: var(--text); display: flex; align-items: center; gap: 7px; }
.as-head .sub { font-size: 0.68rem; color: var(--text-dim); }
.as-head:hover .t { color: var(--primary); }
.as-head.active .t { color: var(--primary); }

/* 分组 */
.as-group { margin-bottom: 10px; }
.as-group-title { font-size: 0.68rem; font-weight: 700; color: var(--text-dim); letter-spacing: 1px; padding: 6px 10px 4px; }
.as-group-title::before { content: ''; display: inline-block; width: 4px; height: 4px; border-radius: 2px; background: var(--gold); margin-right: 6px; vertical-align: 2px; }
.as-group.is-hidden { display: none; }

/* 项目 */
.as-item {
  display: flex; align-items: center; gap: 9px; padding: 8px 10px;
  border-radius: 10px; font-size: 0.84rem; font-weight: 500;
  color: var(--text-soft); text-decoration: none; transition: all 0.18s;
}
.as-item .ic { width: 1.3em; text-align: center; flex-shrink: 0; }
.as-item:hover { background: var(--primary-soft); color: var(--primary); }
.as-item.active {
  background: linear-gradient(135deg, var(--primary), #e88a4a); color: #fff;
  font-weight: 700; box-shadow: 0 3px 10px rgba(224, 93, 68, 0.3);
}
.as-item.is-hidden { display: none; }
.as-badge {
  margin-left: auto; background: var(--danger); color: #fff;
  font-size: 0.66rem; font-weight: 700; min-width: 18px; height: 18px;
  line-height: 18px; text-align: center; border-radius: 9px; padding: 0 5px; flex-shrink: 0;
}
.as-item.active .as-badge { background: #fff; color: var(--primary); }

/* 底部 */
.as-foot { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--border); }
.as-foot a {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  border-radius: 10px; font-size: 0.8rem; color: var(--text-dim); text-decoration: none; transition: all 0.18s;
}
.as-foot a:hover { color: var(--primary); background: var(--primary-soft); }

/* 遮罩 + 移动端开关 */
.as-scrim { position: fixed; inset: 0; background: rgba(51, 36, 23, 0.45); z-index: 940; display: none; }
.as-toggle {
  position: fixed; left: 16px; bottom: 18px; z-index: 950; display: none;
  width: 46px; height: 46px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--bg-card); color: var(--text);
  font-size: 1.1rem; cursor: pointer; box-shadow: var(--shadow-lg);
  align-items: center; justify-content: center;
}
.as-toggle:hover { color: var(--primary); border-color: var(--primary); }

/* ===== 移动端（≤768px）：侧边栏变为抽屉 ===== */
@media (max-width: 768px) {
  body.as-ready { padding-left: 0; }
  .admin-sidebar {
    transform: translateX(-100%); transition: transform 0.25s ease;
    top: 54px; width: 250px; z-index: 1200;
    box-shadow: none; padding-bottom: 20px;
  }
  .admin-sidebar.open { transform: translateX(0); box-shadow: 8px 0 30px rgba(51, 36, 23, 0.18); }
  body.as-drawer-open { overflow: hidden; }
  body.as-drawer-open .as-scrim { display: block; }
  .as-toggle { display: flex; }
}
