:root {
  /* 全站统一：深色电影大厂风 × 立体乐高积木体系 */
  --bg-dark: #080d0d;
  --bg-2: #0d1515;
  --bg-card: #111b1a;
  --bg-card-2: #162422;
  --bg-hover: #1b2c2a;
  --text-primary: #f1f6f5;
  --text-secondary: #9fb3af;
  --text-muted: #768a86;
  --border-color: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.17);
  --accent-green: #14b8a6;
  --accent-teal-hi: #5eead4;
  --accent-yellow: #f59e0b;
  --accent-red: #f43f5e;
  --accent-blue: #38bdf8;
  --brand: #14b8a6;
  --brand-deep: #0b6b62;
  --brand-soft: rgba(20, 184, 166, 0.15);
  --sidebar-bg: #0b1312;
  --sidebar-text: #9fb3af;
  --sidebar-active: rgba(20, 184, 166, 0.18);
  --shadow-card: 0 4px 0 rgba(0, 0, 0, 0.4);
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  font-family: var(--sans);
  background: var(--bg-dark);
  color: var(--text-primary);
  height: 100%;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }

/* === 统一 64px 曜石黑顶栏（零 backdrop-filter，丝滑滚屏） === */
.titlebar {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 64px;
  padding: 0 28px;
  background: #090f0f;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
  contain: layout style paint;
}

.tb-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-size: 17px;
  letter-spacing: -0.02em;
}
.tb-mark {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--brand);
  color: #041412;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 14px;
  box-shadow: 0 3px 0 var(--brand-deep);
}
.titlebar b {
  font-weight: 700;
  font-size: 17px;
  color: #fff;
}
.crumb {
  font: 500 11px var(--mono);
  color: var(--text-muted);
  letter-spacing: 0.08em;
}
.crumb .sep { margin-right: 10px; color: var(--border-strong); }

.spacer { flex: 1; }

.tb-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.nav-link {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  padding: 7px 12px;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: background-color 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}
.nav-link.active {
  color: var(--accent-teal-hi);
  background: var(--brand-soft);
  border-color: rgba(20, 184, 166, 0.35);
  font-weight: 600;
}

.logout {
  color: #fda4af;
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid rgba(244, 63, 94, 0.32);
  background: rgba(244, 63, 94, 0.1);
  margin-left: 4px;
  transition: background-color 0.12s ease, color 0.12s ease;
}
.logout:hover {
  background: var(--accent-red);
  color: #fff;
}

/* === 布局容器（空侧栏自动隐藏，释放完整画布） === */
.wrap {
  display: flex;
  height: calc(100vh - 64px);
  overflow: hidden;
}
.sidebar {
  width: 216px;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  border-right: 1px solid var(--border-color);
  overflow-y: auto;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}
.sidebar:empty { display: none; }

.sidebar-section {
  padding: 16px 14px;
  border-bottom: 1px solid var(--border-color);
}
.sidebar-section h4 {
  font: 700 10.5px var(--mono);
  text-transform: uppercase;
  color: var(--accent-teal-hi);
  margin-bottom: 10px;
  letter-spacing: 0.1em;
}
.sidebar-section a {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 7px;
  color: var(--text-secondary);
  font-size: 12.5px;
}
.sidebar-section a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.main {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  background: var(--bg-dark);
}

/* === 后端状态机深色徽标 === */
.status-badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--mono);
  border: 1px solid transparent;
}
.status-badge.draft        { background: rgba(148, 163, 184, 0.15); color: #cbd5e1; border-color: rgba(148, 163, 184, 0.25); }
.status-badge.assigned     { background: rgba(56, 189, 248, 0.15); color: #7dd3fc; border-color: rgba(56, 189, 248, 0.3); }
.status-badge.developing   { background: rgba(52, 211, 153, 0.16); color: #6ee7b7; border-color: rgba(52, 211, 153, 0.35); }
.status-badge.self_review  { background: rgba(52, 211, 153, 0.16); color: #6ee7b7; border-color: rgba(52, 211, 153, 0.35); }
.status-badge.code_review  { background: rgba(34, 211, 238, 0.16); color: #67e8f9; border-color: rgba(34, 211, 238, 0.35); }
.status-badge.awaiting_approval,
.status-badge.awaiting_pm  { background: rgba(245, 158, 11, 0.18); color: #fde68a; border-color: rgba(245, 158, 11, 0.38); }
.status-badge.done         { background: rgba(20, 184, 166, 0.18); color: #5eead4; border-color: rgba(20, 184, 166, 0.38); }
.status-badge.blocked      { background: rgba(244, 63, 94, 0.2); color: #fda4af; border-color: rgba(244, 63, 94, 0.42); }
.status-badge.note         { background: rgba(20, 184, 166, 0.15); color: #5eead4; border-color: rgba(20, 184, 166, 0.3); }

/* === 通用深色表单控件与滚动条 === */
button {
  padding: 8px 14px;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.12s ease, border-color 0.12s ease;
}
button:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.11);
  border-color: rgba(255, 255, 255, 0.3);
}
button:disabled { opacity: 0.5; cursor: not-allowed; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.14); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.28); }

@media (max-width: 960px) {
  .titlebar { padding: 0 16px; }
  .crumb { display: none; }
  .sidebar { display: none; }
}
@media (max-width: 680px) {
  .titlebar { height: auto; min-height: 58px; flex-wrap: wrap; padding: 10px 14px; }
  .wrap { height: calc(100vh - 96px); }
}
