:root {
  --bg: #f4f6f3;
  --surface: #ffffff;
  --surface-soft: #eef3ef;
  --ink: #1d2521;
  --muted: #65716a;
  --line: #dbe2dc;
  --accent: #207a59;
  --accent-dark: #14563e;
  --warning: #b46a25;
  --danger: #a94442;
  --blue: #3267a8;
  --shadow: 0 16px 40px rgba(29, 37, 33, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
}

button {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 22px 18px;
  background: #18231d;
  color: #f7faf8;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: #2d7a5b;
  font-weight: 800;
}

.brand-title {
  font-size: 17px;
  font-weight: 800;
}

.brand-subtitle {
  margin-top: 3px;
  color: #b6c3bd;
  font-size: 12px;
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-button {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #dce5e0;
  cursor: pointer;
  text-align: left;
}

.nav-button:hover,
.nav-button.active {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.nav-icon {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  color: #d7e3dc;
}

.sidebar-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  color: #c1cdc7;
  font-size: 13px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #61c38a;
}

.main {
  min-width: 0;
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 26px;
  line-height: 1.25;
}

h2 {
  margin-bottom: 0;
  font-size: 18px;
  line-height: 1.3;
}

h3 {
  margin-bottom: 8px;
  font-size: 15px;
  line-height: 1.35;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.icon-button,
.primary-button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}

.icon-button {
  width: 42px;
  font-size: 20px;
}

.primary-button {
  padding: 0 16px;
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  font-weight: 700;
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.metric-card {
  min-height: 112px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.metric-label,
.metric-note,
.updated {
  color: var(--muted);
  font-size: 13px;
}

.metric-card strong {
  display: block;
  margin: 8px 0 5px;
  font-size: 30px;
  line-height: 1;
}

.progress-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #dfe7e1;
}

.progress-track div {
  width: 0;
  height: 100%;
  background: var(--accent);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 14px;
  align-items: start;
}

.workspace-panel,
.rail-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel-header,
.rail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.view-root {
  min-height: 520px;
  padding: 16px;
}

.right-rail {
  display: grid;
  gap: 14px;
}

.rail-header h2 {
  font-size: 16px;
}

.rail-header span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
}

.stack-list {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.item-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.item-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 700;
}

.chip.warning {
  background: #f7eadc;
  color: var(--warning);
}

.chip.danger {
  background: #f8e6e4;
  color: var(--danger);
}

.chip.blue {
  background: #e4edf9;
  color: var(--blue);
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.wide-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.section-title {
  margin: 18px 0 10px;
  font-size: 15px;
}

.project-progress {
  display: grid;
  gap: 7px;
  margin-top: 12px;
}

.project-progress span {
  color: var(--muted);
  font-size: 12px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.data-table th,
.data-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 13px;
  line-height: 1.45;
}

.data-table th {
  color: var(--muted);
  font-weight: 700;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 260px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
}

@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .content-grid {
    grid-template-columns: 1fr;
  }

  .right-rail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .nav-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .main {
    padding: 16px;
  }

  .topbar,
  .panel-header {
    flex-direction: column;
  }

  .overview-grid,
  .cards-grid,
  .wide-grid,
  .right-rail {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  h1 {
    font-size: 22px;
  }

  .nav-list {
    grid-template-columns: 1fr;
  }

  .topbar-actions {
    width: 100%;
  }

  .primary-button {
    flex: 1;
  }
}
