﻿:root {
  --primary: #1677ff;
  --primary-soft: #e6f4ff;
  --page: #f5f7fa;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --sidebar: #111827;
  --sidebar-text: #b9c4d4;
  --text: #1f2937;
  --muted: #64748b;
  --border: #e5e7eb;
  --border-soft: #eef1f5;
  --success: #389e0d;
  --success-bg: #f6ffed;
  --warning: #d46b08;
  --warning-bg: #fff7e6;
  --danger: #cf1322;
  --danger-bg: #fff1f0;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--page);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 256px;
  padding: 20px 16px;
  background: var(--sidebar);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

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

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--sidebar);
  font-weight: 700;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  color: #ffffff;
  font-size: 15px;
}

.brand small {
  margin-top: 2px;
  color: var(--sidebar-text);
  font-size: 12px;
}

nav {
  display: grid;
  gap: 6px;
}

nav a {
  min-height: 40px;
  padding: 10px 12px;
  color: var(--sidebar-text);
  text-decoration: none;
  border-radius: var(--radius);
  transition: background 160ms ease, color 160ms ease;
}

nav a:hover,
nav a:focus-visible {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  outline: none;
}

nav a.active {
  color: var(--sidebar);
  background: #ffffff;
  font-weight: 600;
}

.boundary {
  margin-top: auto;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.05);
}

.boundary span,
.boundary strong {
  display: block;
}

.boundary span {
  color: #dbeafe;
  font-size: 12px;
}

.boundary strong {
  margin-top: 4px;
  color: #ffffff;
  line-height: 1.35;
}

.app {
  margin-left: 256px;
  padding: 24px 32px 40px;
}

.topbar {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.topbar h1,
.section h2,
.panel h2,
.hero-panel h2,
.module-card h3 {
  margin: 0;
  letter-spacing: 0;
}

.topbar h1 {
  font-size: 24px;
}

.eyebrow,
.section-label {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.icon-button {
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid #91caff;
  border-radius: 999px;
  color: #0958d9;
  background: #e6f4ff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.icon-button:disabled {
  opacity: 0.7;
  cursor: wait;
}

.panel,
.module-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel {
  padding: 20px;
}

.program-overview-panel {
  overflow: hidden;
}

.program-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.program-summary .list-item {
  display: grid;
  gap: 4px;
  min-height: 64px;
  padding: 12px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.program-table-wrap {
  overflow-x: auto;
}

.program-table {
  width: 100%;
  min-width: 960px;
  border-collapse: collapse;
  font-size: 13px;
}

.program-table th,
.program-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--border-soft);
  text-align: left;
  vertical-align: top;
}

.program-table thead th {
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 12px;
  font-weight: 700;
}

.program-table tbody th {
  min-width: 150px;
}

.program-table tbody th span,
.program-table tbody td span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-weight: 400;
  line-height: 1.4;
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(240px, 0.75fr) minmax(360px, 1.25fr);
  gap: 24px;
  margin-bottom: 24px;
}

.hero-panel h2 {
  font-size: 22px;
}

.muted {
  color: var(--muted);
  line-height: 1.6;
}

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

.status-grid div {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

dt {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

dd {
  margin: 0;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.section {
  margin-bottom: 24px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.section-heading.compact {
  margin-bottom: 16px;
}

.section-heading h2,
.panel h2 {
  font-size: 17px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.tag-blue {
  color: #0958d9;
  border-color: #91caff;
  background: var(--primary-soft);
}

.tag-green {
  color: var(--success);
  border-color: #b7eb8f;
  background: var(--success-bg);
}

.tag-orange {
  color: var(--warning);
  border-color: #ffd591;
  background: var(--warning-bg);
}

.tag-red {
  color: var(--danger);
  border-color: #ffa39e;
  background: var(--danger-bg);
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.module-card {
  min-width: 0;
  padding: 16px;
}

.module-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.module-id {
  color: var(--primary);
  font-weight: 700;
}

.module-card h3 {
  font-size: 16px;
}

.module-card p {
  min-height: 40px;
  margin: 6px 0 14px;
  color: var(--muted);
}

.module-progress {
  margin-bottom: 12px;
}

.inline-progress-head {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
}

.inline-progress-head strong {
  min-height: auto;
  font-size: 13px;
}

.progress-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.progress-summary dt {
  margin-bottom: 4px;
}

.progress-summary dd {
  font-weight: 600;
}

.progress-wrap {
  overflow: hidden;
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: #e5e7eb;
}

.progress-wrap .progress-fill {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1677ff, #52c41a);
  transition: width 260ms ease;
}

.module-card .progress-wrap {
  height: 8px;
  margin-top: 8px;
}

.progress-panel {
  padding-top: 6px;
}

.progress-panel .progress-wrap {
  height: 14px;
}

.alert-panel {
  border-color: #ffd8bf;
  background: linear-gradient(180deg, #fffaf6 0%, #ffffff 100%);
}

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

.alert-summary h3,
.alert-card h3 {
  margin: 0;
  font-size: 18px;
}

.alert-empty p {
  margin: 8px 0 0;
}

.alert-list {
  display: grid;
  gap: 14px;
}

.alert-card {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.alert-card.alert-red {
  border-color: #ffccc7;
  background: #fff8f6;
}

.alert-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.alert-topic {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 600;
}

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

.alert-grid div {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--surface-soft);
}
.module-card dl {
  display: grid;
  gap: 10px;
  margin: 0;
}

.grid-two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.lead {
  margin: 0 0 14px;
  font-size: 16px;
  font-weight: 600;
}

.list {
  display: grid;
  gap: 10px;
}

.list.dense {
  gap: 8px;
}

.list-item {
  display: grid;
  grid-template-columns: minmax(120px, 0.4fr) minmax(0, 1fr);
  gap: 12px;
  min-height: 42px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-soft);
}

.list-item:last-child {
  border-bottom: 0;
}

.list-item span {
  color: var(--muted);
}

.list-item strong {
  font-weight: 600;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.check-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.check-list li {
  padding: 10px 12px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--surface-soft);
  line-height: 1.45;
}

.danger-panel {
  border-color: #ffccc7;
}

@media (max-width: 1180px) {
  .module-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .alert-grid,
  .hero-panel,
  .grid-two {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .sidebar {
    position: static;
    width: auto;
    min-height: auto;
  }

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

  .app {
    margin-left: 0;
    padding: 20px 16px 32px;
  }

  .topbar,
  .section-heading,
  .module-card-head,
  .alert-card-head,
  .alert-summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .status-grid,
  .alert-grid,
  .module-grid,
  .list-item,
  .program-summary {
    grid-template-columns: 1fr;
  }
}

