/* ============ 全局变量与基础 ============ */
:root {
  --primary: #1f6feb;
  --primary-dark: #1758c4;
  --success: #2da44e;
  --warning: #d4a72c;
  --danger: #cf222e;
  --info: #0969da;
  --bg: #f6f8fa;
  --card: #ffffff;
  --text: #24292f;
  --text-sub: #57606a;
  --border: #d0d7de;
  --sidebar-w: 220px;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(31, 35, 40, .12);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px;
}
.hidden { display: none !important; }
a { color: var(--primary); text-decoration: none; }

/* ============ 布局 ============ */
.app { display: flex; flex-direction: column; height: 100vh; }
.topbar {
  height: 52px; background: #fff; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 16px; gap: 12px; z-index: 20;
}
.brand { font-size: 17px; font-weight: 700; color: var(--text); }
.brand span { color: var(--primary); }
.icon-btn { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--text); display: none; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.user-chip { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-sub); }
.project-select { min-width: 200px; }

.layout { flex: 1; display: flex; overflow: hidden; }
.sidebar {
  width: var(--sidebar-w); background: #fff; border-right: 1px solid var(--border);
  overflow-y: auto; padding: 12px 8px; flex-shrink: 0;
}
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 8px;
  color: var(--text); cursor: pointer; font-size: 14px; margin-bottom: 2px;
}
.nav-item:hover { background: #f0f4fa; }
.nav-item.active { background: #e7effc; color: var(--primary); font-weight: 600; }
.nav-ico { width: 20px; text-align: center; }
.nav-badge {
  margin-left: auto; background: #e5484d; color: #fff; font-size: 11px; font-weight: 600;
  border-radius: 9px; min-width: 18px; height: 18px; line-height: 18px; text-align: center;
  padding: 0 5px; flex-shrink: 0;
}
.content { flex: 1; overflow-y: auto; padding: 20px; }
.sidebar-mask { display: none; }

/* ============ 登录 ============ */
.login-wrap {
  height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0f2b52 0%, #1f6feb 100%);
}
.login-card {
  width: 380px; background: #fff; border-radius: 14px; padding: 36px 32px; box-shadow: 0 10px 40px rgba(0,0,0,.2);
}
.login-logo { font-size: 24px; font-weight: 800; text-align: center; }
.login-logo span { color: var(--primary); }
.login-sub { text-align: center; color: var(--text-sub); margin: 8px 0 26px; font-size: 13px; }

/* ============ 页面标题 ============ */
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.page-title { font-size: 20px; font-weight: 700; }
.page-desc { color: var(--text-sub); font-size: 13px; }

/* ============ 移动端响应式 ============ */
@media (max-width: 768px) {
  .icon-btn { display: block; }
  .brand { font-size: 15px; }
  .sidebar {
    position: fixed; left: 0; top: 52px; bottom: 0; z-index: 30;
    transform: translateX(-100%); transition: transform .25s; box-shadow: 2px 0 10px rgba(0,0,0,.1);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-mask {
    display: block; position: fixed; inset: 52px 0 0 0; background: rgba(0,0,0,.4); z-index: 25;
  }
  .content { padding: 14px; }
  .project-select { max-width: 130px; }
  .topbar { padding: 0 10px; }
}
