:root {
  --bg: #edf3f7;
  --panel: #ffffff;
  --panel-soft: #f7fbfd;
  --line: #d4e1ea;
  --text: #183145;
  --muted: #657a8b;
  --brand: #1170a6;
  --brand-2: #0d4973;
  --brand-soft: #e7f5fd;
  --success: #198754;
  --warn: #cc7a00;
  --danger: #b33939;
  --shadow: 0 18px 50px rgba(20, 54, 82, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(56, 171, 218, 0.18), transparent 24%),
    radial-gradient(circle at bottom right, rgba(14, 109, 164, 0.08), transparent 28%),
    linear-gradient(180deg, #f8fbfd 0%, var(--bg) 100%);
  color: var(--text);
}

body {
  min-height: 100vh;
}

a {
  color: var(--brand-2);
}

code {
  padding: 2px 6px;
  border-radius: 8px;
  background: #eaf4fb;
}

.app-shell {
  display: grid;
  grid-template-columns: 270px 1fr;
  min-height: 100vh;
}

.sidebar {
  padding: 22px 18px;
  background:
    radial-gradient(circle at top right, rgba(95, 196, 255, 0.16), transparent 18%),
    linear-gradient(180deg, #17344a 0%, #102535 100%);
  color: #e8f0f7;
  display: flex;
  flex-direction: column;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 10px 20px;
}

.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, #23a5d8 0%, #74d4e8 100%);
  color: #fff;
  font-weight: 800;
}

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

.brand-sub {
  font-size: 13px;
  color: rgba(232, 240, 247, 0.72);
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.nav-item {
  border: 0;
  background: transparent;
  color: rgba(232, 240, 247, 0.82);
  font-size: 16px;
  text-align: left;
  padding: 14px 14px;
  border-radius: 14px;
  cursor: pointer;
}

.nav-item:hover,
.nav-item.is-active {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.sidebar-foot {
  margin-top: auto;
  padding: 18px 10px 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-foot a {
  color: #a8d1ff;
  text-decoration: none;
  font-size: 14px;
}

.mini-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(232, 240, 247, 0.5);
}

.main {
  padding: 26px;
}

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

.topbar h1,
.section-head h2,
.hero h2 {
  margin: 0;
}

.topbar-sub {
  margin: 10px 0 0;
  max-width: 760px;
  color: var(--muted);
  line-height: 1.7;
}

.topbar-right {
  display: flex;
  flex-direction: column;
  align-items: end;
  gap: 12px;
}

.eyebrow,
.hero-label {
  margin: 0 0 8px;
  color: var(--brand-2);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status-pill,
.active-case {
  padding: 12px 16px;
  border-radius: 999px;
  font-weight: 700;
}

.status-pill {
  background: var(--brand-soft);
  color: var(--brand-2);
}

.active-case {
  background: rgba(17, 112, 166, 0.08);
  color: var(--brand-2);
  max-width: 320px;
}

.panel {
  display: none;
}

.panel.is-active {
  display: block;
}

.hero,
.workspace-card,
.stat-card,
.feature-card {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.hero {
  border-radius: 28px;
  padding: 32px;
  display: grid;
  grid-template-columns: 1.35fr 0.85fr;
  gap: 24px;
}

.hero p {
  color: var(--muted);
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
}

.stats-grid,
.cards-grid,
.workspace-grid {
  display: grid;
  gap: 18px;
  margin-top: 20px;
}

.stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.cards-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

.compact-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 0;
}

.stat-card,
.feature-card,
.workspace-card {
  border-radius: 22px;
  padding: 22px;
}

.stat-card span {
  display: block;
  color: var(--muted);
  margin-bottom: 14px;
}

.stat-card strong {
  font-size: 34px;
}

.feature-card h3,
.workspace-card h3 {
  margin: 0 0 10px;
}

.feature-card p,
.workspace-card p,
.placeholder-text {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.section-head {
  margin-bottom: 16px;
}

.stack-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.stack-form label,
.toggle-line {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--text);
  font-weight: 600;
}

.toggle-line {
  flex-direction: row;
  align-items: center;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fbfdff;
  border-radius: 14px;
  padding: 13px 14px;
  font: inherit;
  color: var(--text);
}

textarea {
  resize: vertical;
}

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

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: #f2fafc;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
}

.primary-btn,
.ghost-btn,
.table-action,
.link-btn {
  border: 0;
  border-radius: 14px;
  padding: 14px 18px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.primary-btn {
  background: linear-gradient(135deg, var(--brand) 0%, #20a0d4 100%);
  color: #fff;
  box-shadow: 0 14px 28px rgba(17, 112, 166, 0.22);
}

.ghost-btn,
.table-action,
.link-btn {
  background: #fff;
  color: var(--brand-2);
  border: 1px solid var(--line);
}

.small-btn,
.table-action,
.link-btn {
  padding: 10px 12px;
  font-size: 14px;
}

.link-btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.card-head,
.head-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.head-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.full-width {
  margin-top: 20px;
}

.table-shell {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 14px 10px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

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

.status-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.status-item {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  background: #fbfdff;
}

.status-item strong {
  display: block;
  margin-bottom: 6px;
}

.status-meta {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.status-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.result-board,
.empty-shell {
  min-height: 180px;
  border-radius: 20px;
  border: 1px dashed var(--line);
  padding: 20px;
  background: var(--panel-soft);
}

.result-board.empty,
.empty-shell {
  color: var(--muted);
  display: grid;
  place-items: center;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.result-card,
.mini-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  background: #fff;
}

.result-card h4,
.mini-card h4 {
  margin: 0 0 8px;
}

.result-score {
  font-size: 32px;
  font-weight: 800;
  color: var(--brand-2);
}

.result-label {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.7;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.detail-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  background: #fff;
}

.detail-card h4 {
  margin: 0 0 12px;
}

.detail-card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.8;
}

.metric-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
}

.metric-row:last-child {
  border-bottom: 0;
}

.metric-row span:last-child {
  color: var(--muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 70px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.badge.success {
  background: rgba(25, 135, 84, 0.12);
  color: var(--success);
}

.badge.warn {
  background: rgba(204, 122, 0, 0.12);
  color: var(--warn);
}

.badge.danger {
  background: rgba(179, 57, 57, 0.12);
  color: var(--danger);
}

.badge.info {
  background: rgba(17, 112, 166, 0.12);
  color: var(--brand-2);
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  min-width: 260px;
  max-width: 420px;
  border-radius: 16px;
  padding: 14px 16px;
  background: rgba(18, 40, 58, 0.96);
  color: #fff;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.18);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: 0.22s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1280px) {
  .stats-grid,
  .cards-grid,
  .detail-grid,
  .result-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 10;
    gap: 12px;
  }

  .nav {
    flex-direction: row;
    overflow: auto;
  }

  .sidebar-foot {
    display: none;
  }

  .topbar,
  .hero,
  .workspace-grid,
  .detail-grid,
  .stats-grid,
  .cards-grid,
  .result-grid,
  .compact-grid,
  .inline-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: block;
  }

  .topbar-right {
    align-items: start;
    margin-top: 14px;
  }
}
