:root {
  --bg: #f5f7fa;
  --surface: #ffffff;
  --ink: #1a2332;
  --muted: #6b7785;
  --line: #e6ebf1;
  --brand: #2f6fed;
  --brand-soft: #eaf1ff;
  --ok: #1a9f6b;
  --ok-soft: #e8f8f0;
  --warn: #c47a12;
  --radius: 14px;
  --shadow: 0 8px 28px rgba(26, 35, 50, 0.06);
  --max: 880px;
  --font: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.55;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 28px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.brand strong { font-size: 16px; letter-spacing: 0.02em; }
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12px;
  font-weight: 600;
}
.muted-inline { color: var(--muted); font-size: 13px; }

.stepbar {
  position: sticky;
  top: 57px;
  z-index: 19;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  max-width: var(--max);
  width: calc(100% - 48px);
  margin: 18px auto 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.step {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 16px 18px 16px 20px;
  background: transparent;
  border: 0;
  text-align: left;
  cursor: default;
  color: var(--muted);
  min-height: 78px;
}
.step + .step::before {
  content: "";
  position: absolute;
  left: 0;
  top: 18px;
  bottom: 18px;
  width: 1px;
  background: var(--line);
}
.step .num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  border: 1.5px solid #c9d2de;
  color: var(--muted);
  background: #fff;
}
.step .label { font-size: 14px; font-weight: 600; color: inherit; }
.step .sub { font-size: 12px; color: #98a2b0; }
.step.is-done { color: var(--ok); }
.step.is-done .num {
  border-color: var(--ok);
  background: var(--ok-soft);
  color: var(--ok);
}
.step.is-done .num::after { content: "✓"; font-size: 12px; }
.step.is-done .num span { display: none; }
.step.is-current {
  color: var(--brand);
  background: linear-gradient(180deg, #f8fbff 0%, #fff 100%);
}
.step.is-current .num {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}
.step.is-current .label { color: var(--brand); }
.step.is-clickable { cursor: pointer; }
.step.is-clickable:hover { background: #fafbfd; }

.stage {
  flex: 1;
  width: calc(100% - 48px);
  max-width: var(--max);
  margin: 22px auto 28px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 2px);
  box-shadow: var(--shadow);
  padding: 28px 32px 30px;
}
.card h1 {
  margin: 0 0 8px;
  font-size: 24px;
  letter-spacing: 0.01em;
}
.lead {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 14px;
}
.section-title {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.role-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}
.role {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 14px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.role:hover { border-color: #b9c9ef; }
.role.is-selected {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: 0 0 0 3px rgba(47,111,237,0.12);
}
.role input { margin-top: 3px; accent-color: var(--brand); }
.role .meta strong { display: block; font-size: 15px; margin-bottom: 2px; }
.role .meta span { font-size: 12px; color: var(--muted); }

.panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
  background: #fbfcfe;
  margin-bottom: 18px;
}
.panel h3 { margin: 0 0 8px; font-size: 15px; }
.kv {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 8px 12px;
  font-size: 14px;
}
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; }

.task-list { display: grid; gap: 10px; margin: 0 0 20px; }
.task {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.task .left { display: flex; flex-direction: column; gap: 2px; }
.task .left strong { font-size: 14px; }
.task .left span { font-size: 12px; color: var(--muted); }
.task.done {
  background: var(--ok-soft);
  border-color: #bfe8d3;
}
.chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: #eef2f7;
  color: var(--muted);
}
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: #fff4e5; color: var(--warn); }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 8px;
}
.spacer { flex: 1; }

button, .btn {
  appearance: none;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 10px;
  padding: 10px 16px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
button:hover, .btn:hover { background: #f7f9fc; }
button.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
button.primary:hover { filter: brightness(0.96); }
button.primary:disabled,
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: none;
}
button.ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
  padding: 8px 10px;
}
button.ghost:hover { color: var(--ink); background: #f0f3f7; }
button.ok {
  background: var(--ok);
  border-color: var(--ok);
  color: #fff;
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}
.timeline li {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 12px;
  align-items: start;
}
.dot {
  width: 10px;
  height: 10px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 4px var(--ok-soft);
}
.timeline .when { font-size: 12px; color: var(--muted); }
.timeline .what { font-size: 14px; font-weight: 600; }
.timeline .detail { font-size: 13px; color: var(--muted); margin-top: 2px; }

.empty-note {
  padding: 18px;
  border-radius: 12px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.foot {
  padding: 12px 28px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  background: #1a2332;
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13px;
  z-index: 50;
  box-shadow: 0 10px 30px rgba(0,0,0,.18);
}

@media (max-width: 720px) {
  .topbar { padding: 12px 16px; }
  .stepbar {
    width: calc(100% - 24px);
    top: 53px;
    grid-template-columns: 1fr 1fr;
  }
  .step { min-height: 70px; padding: 12px 14px; }
  .step:nth-child(3)::before,
  .step:nth-child(odd)::before { display: none; }
  .step:nth-child(even)::before {
    display: block;
    left: 0; top: 14px; bottom: 14px;
  }
  .stage { width: calc(100% - 24px); margin-top: 16px; }
  .card { padding: 22px 18px; }
  .role-grid { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 80px 1fr; }
}

.topbar { position: relative; }
.stepbar { top: 0; }
button:focus-visible,input:focus-visible { outline: 3px solid #2f6fed; outline-offset: 3px; }
