/* ========== Reset & Variables ========== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #1a1a1f;
  --bg-card: #24242b;
  --bg-sidebar: #1e1e24;
  --border: #333340;
  --text: #c8c8d0;
  --text-muted: #888896;
  --accent: #d4956b;
  --accent-dim: #a07050;
  --red: #c0392b;
  --green: #4a9;
  --blue: #5a9fd4;
  --yellow: #d4b65a;
  --radius: 6px;
  --transition: 0.2s ease;
}
html { scroll-behavior: smooth; }

/* ========== Base Layout ========== */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  display: flex;
  min-height: 100vh;
}
body:lang(zh-CN) { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; }

/* ========== Sidebar ========== */
nav.sidebar {
  width: 260px; min-width: 260px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  padding: 24px 0;
  position: sticky; top: 0;
  height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column;
  z-index: 10;
}
.sidebar-logo { padding: 0 20px 20px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.sidebar-logo h1 { font-size: 1.3rem; color: var(--accent); letter-spacing: 0.5px; }
.sidebar-logo p { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }
.lang-switcher { padding: 0 20px 12px; border-bottom: 1px solid var(--border); margin-bottom: 12px; font-size: 0.78rem; display: flex; gap: 6px; align-items: center; }
.lang-switcher a { color: var(--accent); text-decoration: none; }
.lang-switcher a:hover { text-decoration: underline; }
.lang-switcher .active { color: var(--text-muted); cursor: default; }
.lang-link { font-size: 0.78rem; margin-left: auto; }
.lang-link a { color: var(--accent); text-decoration: none; }
.lang-link a:hover { text-decoration: underline; }
.nav-section { padding: 8px 20px 4px; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); margin-top: 8px; }
.nav-item { display: block; padding: 8px 20px; color: var(--text); text-decoration: none; font-size: 0.9rem; border-left: 3px solid transparent; transition: var(--transition); }
.nav-item:hover { background: rgba(255,255,255,0.04); color: #fff; }
.nav-item.active { border-left-color: var(--accent); background: rgba(212,149,107,0.08); color: var(--accent); }
.nav-item .icon { margin-right: 8px; }
.nav-badge { float: right; font-size: 0.65rem; background: var(--accent-dim); color: #fff; padding: 1px 6px; border-radius: 10px; margin-top: 2px; }
.nav-footer { margin-top: auto; padding: 16px 20px 0; border-top: 1px solid var(--border); font-size: 0.72rem; color: var(--text-muted); }
.nav-feedback { color: var(--accent-dim); text-decoration: none; transition: color var(--transition); }
.nav-feedback:hover { color: var(--accent); }
.nav-footer a { color: var(--accent); text-decoration: none; }
.nav-footer a:hover { text-decoration: underline; }

/* ========== Mobile Nav ========== */
.mobile-nav-toggle { display: none; position: fixed; top: 12px; left: 12px; z-index: 100; background: var(--bg-card); border: 1px solid var(--border); color: var(--text); padding: 8px 12px; border-radius: var(--radius); cursor: pointer; font-size: 1.2rem; }
.sidebar-overlay { display: none; }

/* ========== Main Content Area (dimensions set per page) ========== */
main { flex: 1; overflow-y: auto; }

/* ========== Responsive Sidebar ========== */
@media (max-width: 768px) {
  body { flex-direction: column; }
  nav.sidebar { position: fixed; left: -280px; top: 0; width: 280px; height: 100vh; transition: left var(--transition); }
  nav.sidebar.open { left: 0; }
  .sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 9; }
  .sidebar-overlay.open { display: block; }
  .mobile-nav-toggle { display: block; }
}

/* ========== Print ========== */
@media print { nav.sidebar, .mobile-nav-toggle { display: none; } }
