/* =========================================================
   layout.css — 整体布局：侧边栏 / 顶栏 / 主区域 / 登录页
   ========================================================= */

/* 整体布局 */
.layout { display: flex; min-height: 100vh; }

/* ── 侧边栏 ─────────────────────────────── */
.sidebar {
  width: 220px;
  background: #1a2332;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  transition: .3s;
}

.brand          { padding: 20px 18px 16px; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand-name     { color: #fff; font-size: 15px; font-weight: 600; letter-spacing: .5px; }
.brand-sub      { color: rgba(255,255,255,.38); font-size: 12px; margin-top: 4px; }

.nav            { padding: 10px 8px; flex: 1; overflow-y: auto; }
.nav-section    {
  color: rgba(255,255,255,.3);
  font-size: 11px; font-weight: 600;
  letter-spacing: .8px;
  padding: 14px 10px 6px;
  text-transform: uppercase;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  color: rgba(255,255,255,.6);
  margin-bottom: 2px;
  transition: .15s;
  user-select: none;
}
.nav-item:hover  { background: rgba(255,255,255,.07); color: rgba(255,255,255,.9); }
.nav-item.active { background: var(--g); color: #fff; }
.nav-icon        { font-size: 15px; width: 20px; text-align: center; flex-shrink: 0; }

.sidebar-foot {
  padding: 14px 18px;
  border-top: 1px solid rgba(255,255,255,.08);
  font-size: 11px;
  color: rgba(255,255,255,.25);
}

/* ── 主区域 ─────────────────────────────── */
.main    { margin-left: 220px; flex: 1; display: flex; flex-direction: column; min-height: 100vh; }
.content { padding: 24px; flex: 1; }

/* ── 顶栏 ───────────────────────────────── */
.topbar {
  background: var(--card);
  height: 56px;
  padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  position: sticky; top: 0; z-index: 50;
}
.page-title   { font-size: 16px; font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 12px; }

.status-dot {
  width: 7px; height: 7px;
  background: var(--g);
  border-radius: 50%;
  animation: blink 2s infinite;
  flex-shrink: 0;
}
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: .3; } }

.status-pill {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 12px;
  background: #f0faf4;
  border-radius: 20px;
  font-size: 13px;
  color: var(--g);
}

/* ── 页面切换 ───────────────────────────── */
.page        { display: none; }
.page.active { display: block; }

/* ── 登录遮罩 ───────────────────────────── */
#login-mask {
  display: none;
  position: fixed; inset: 0;
  background: rgba(20,28,40,.82);
  z-index: 9000;
  align-items: center; justify-content: center;
}
#login-mask.show { display: flex; }

.login-box {
  background: #fff;
  border-radius: 16px;
  padding: 44px 40px 36px;
  width: 360px;
  box-shadow: 0 16px 60px rgba(0,0,0,.22);
  text-align: center;
}
.login-logo  { font-size: 44px; margin-bottom: 10px; }
.login-title { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.login-sub   { font-size: 13px; color: var(--muted); margin-bottom: 28px; }

.login-box input {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  outline: none;
  transition: .2s;
  margin-bottom: 14px;
  font-family: inherit;
}
.login-box input:focus {
  border-color: var(--g);
  box-shadow: 0 0 0 3px rgba(7,193,96,.12);
}
.login-btn {
  width: 100%; padding: 12px;
  background: var(--g); color: #fff;
  border: none; border-radius: 8px;
  font-size: 15px; font-weight: 600;
  cursor: pointer; transition: .15s;
}
.login-btn:hover     { background: var(--gd); }
.login-btn:disabled  { opacity: .6; cursor: not-allowed; }
.login-err           { color: var(--danger); font-size: 13px; min-height: 20px; margin-top: 8px; }

/* ── 响应式 ─────────────────────────────── */
@media (max-width: 900px) {
  .sidebar       { transform: translateX(-100%); }
  .sidebar.open  { transform: translateX(0); }
  .main          { margin-left: 0; }
}
