:root {
  --bg: #eef2f7;
  --surface: #ffffff;
  --ink: #101b2d;
  --muted: #5c6c82;
  --faint: #8a99ad;
  --line: #dbe3ee;
  --brand: #174a7c;
  --brand-strong: #0f3a64;
  --brand-soft: #e8f0fa;
  --accent: #c19a3f;
  --danger: #b3261e;
  --ok: #1f7a4d;
  --radius: 16px;
  --shadow: 0 24px 60px -38px rgba(15, 40, 70, 0.5);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(900px 420px at 12% -10%, rgba(23, 74, 124, 0.09), transparent 62%),
    radial-gradient(700px 380px at 96% 8%, rgba(193, 154, 63, 0.1), transparent 60%),
    var(--bg);
  color: var(--ink);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans SC", sans-serif;
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
p,
ol {
  margin: 0;
}

ol {
  padding: 0;
  list-style: none;
}

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

.page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---------- 顶部 ---------- */

.masthead {
  position: relative;
  overflow: hidden;
  background: linear-gradient(118deg, #0b2745 0%, #154878 58%, #1d5b94 100%);
  color: #fff;
}

.masthead::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 3px;
  background: linear-gradient(90deg, rgba(193, 154, 63, 0) 0%, var(--accent) 22%, var(--accent) 78%, rgba(193, 154, 63, 0) 100%);
}

.masthead::before {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  right: -120px;
  top: -260px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 0 0 46px rgba(255, 255, 255, 0.045);
  pointer-events: none;
}

.masthead-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  max-width: 980px;
  margin: 0 auto;
  padding: 22px 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex: none;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.09);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.45;
  min-width: 0;
}

.brand-text strong {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.brand-text span {
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.72);
  letter-spacing: 0.08em;
}

.masthead-meta {
  flex: none;
  font-size: 12.5px;
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  padding: 6px 14px;
  white-space: nowrap;
}

/* ---------- 布局 ---------- */

.main {
  flex: 1;
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: 40px 24px 64px;
}

.view {
  animation: rise 0.32s ease both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

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

/* ---------- 登录 ---------- */

.login-wrap {
  display: grid;
  place-items: center;
  padding: 10px 0 20px;
}

.login-card {
  width: 100%;
  max-width: 430px;
  padding: 32px 32px 28px;
}

.login-head h1 {
  font-size: 24px;
  letter-spacing: 0.03em;
  font-weight: 650;
}

.login-head p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13.5px;
}

/* ---------- 表单 ---------- */

.field {
  display: block;
  margin-top: 16px;
}

.field-label {
  display: block;
  margin-bottom: 6px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.04em;
}

input {
  width: 100%;
  height: 44px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfe;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

input::placeholder {
  color: #a5b1c2;
}

input:focus {
  outline: none;
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(23, 74, 124, 0.13);
}

.form-error {
  min-height: 20px;
  margin-top: 10px;
  color: var(--danger);
  font-size: 13px;
  line-height: 1.5;
}

.form-error:empty {
  margin-top: 0;
  min-height: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 10px;
  font: inherit;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.62;
  cursor: not-allowed;
  transform: none;
}

.btn-block {
  width: 100%;
  margin-top: 6px;
}

.btn-primary {
  background: linear-gradient(180deg, #1c568c, #164a7c);
  color: #fff;
  box-shadow: 0 10px 22px -14px rgba(15, 58, 100, 0.85);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #1f5f99, #174a7c);
}

.btn-secondary {
  background: var(--brand-soft);
  border-color: #cfdff2;
  color: var(--brand);
}

.btn-secondary:hover:not(:disabled) {
  background: #dfeaf8;
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--muted);
  min-height: 38px;
  padding: 0 16px;
  font-size: 13.5px;
  font-weight: 500;
}

.btn-ghost:hover {
  border-color: #c2cfe0;
  color: var(--ink);
}

.btn-sm {
  min-height: 36px;
  padding: 0 18px;
  font-size: 13.5px;
}

.login-foot {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
  color: var(--faint);
  font-size: 12.5px;
  line-height: 1.8;
}

.login-foot strong {
  color: var(--muted);
  font-weight: 600;
}

/* ---------- 工作台 ---------- */

.welcome {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.eyebrow {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--accent);
}

.welcome h1 {
  margin-top: 4px;
  font-size: 27px;
  font-weight: 650;
  letter-spacing: 0.02em;
}

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

.chip {
  padding: 3px 12px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12.5px;
  letter-spacing: 0.03em;
}

.project-card {
  padding: 22px 26px 24px;
  border-left: 4px solid var(--accent);
  background: linear-gradient(180deg, #fbfdff, #ffffff);
}

.project-card h2 {
  margin-top: 8px;
  font-size: 19px;
  font-weight: 600;
  line-height: 1.72;
  letter-spacing: 0.01em;
}

.stages {
  margin-top: 32px;
}

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

.section-head h2 {
  font-size: 17px;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.section-note {
  color: var(--faint);
  font-size: 12.5px;
}

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

.stage {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.stage.is-open:hover {
  border-color: #b9cde4;
  box-shadow: 0 16px 34px -28px rgba(15, 40, 70, 0.55);
}

.stage.is-locked {
  background: #fafbfd;
  border-style: dashed;
}

.stage-index {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f6f8fc;
  color: var(--faint);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.stage.is-open .stage-index {
  border-color: #c9d9ec;
  background: var(--brand-soft);
  color: var(--brand);
}

.stage-body {
  min-width: 0;
}

.stage-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.stage-title h3 {
  font-size: 15.5px;
  font-weight: 600;
}

.stage-body p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.stage-meta {
  display: inline-block;
  margin-top: 6px;
  color: var(--faint);
  font-size: 12px;
  letter-spacing: 0.02em;
}

.pill {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.pill-open {
  background: #e7f4ee;
  color: var(--ok);
}

.pill-locked {
  background: #f1f4f9;
  color: var(--faint);
  border: 1px solid var(--line);
}

.stage-action {
  justify-self: end;
}

.is-locked .stage-title h3 {
  color: var(--muted);
}

.is-locked .stage-body p {
  color: var(--faint);
}

/* ---------- 提示与弹窗 ---------- */

.welcome-actions {
  display: flex;
  flex: none;
  gap: 10px;
}

.notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
  padding: 14px 18px;
  border: 1px solid #ecd9a8;
  border-radius: 12px;
  background: #fdf8ec;
}

.notice strong {
  font-size: 14px;
  font-weight: 600;
  color: #7a5a12;
}

.notice p {
  margin-top: 2px;
  color: #8a6d2f;
  font-size: 12.5px;
}

.notice .btn {
  flex: none;
}

.modal {
  width: min(430px, calc(100vw - 32px));
  padding: 26px 26px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 30px 80px -30px rgba(10, 25, 45, 0.55);
  color: var(--ink);
}

.modal::backdrop {
  background: rgba(10, 25, 45, 0.45);
  backdrop-filter: blur(2px);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.modal-head h2 {
  font-size: 19px;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.modal-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12.5px;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f7f9fc;
  color: var(--muted);
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.16s ease, border-color 0.16s ease;
}

.icon-btn:hover {
  color: var(--ink);
  border-color: #c2cfe0;
}

.modal .field {
  margin-top: 14px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

/* ---------- 页脚与提示 ---------- */

.site-foot {
  padding: 0 24px 40px;
  text-align: center;
  color: #82909f;
  font-size: 12px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  z-index: 30;
  transform: translateX(-50%);
  max-width: calc(100vw - 40px);
  padding: 11px 18px;
  border-radius: 10px;
  background: #10243b;
  color: #fff;
  font-size: 13.5px;
  box-shadow: 0 18px 40px -18px rgba(10, 25, 45, 0.8);
  animation: toast-in 0.24s ease both;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, 8px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

/* ---------- 响应式 ---------- */

@media (max-width: 640px) {
  .masthead-inner {
    padding: 18px 18px;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }

  .brand-text strong {
    font-size: 15.5px;
  }

  .brand-text span {
    font-size: 11.5px;
    letter-spacing: 0.04em;
  }

  .masthead-meta {
    display: none;
  }

  .main {
    padding: 26px 16px 52px;
  }

  .login-card,
  .modal {
    padding: 24px 20px;
  }

  .welcome {
    align-items: flex-start;
    flex-direction: column;
  }

  .welcome-actions {
    width: 100%;
  }

  .notice {
    align-items: flex-start;
    flex-direction: column;
  }

  .welcome h1 {
    font-size: 23px;
  }

  .project-card {
    padding: 18px 20px 20px;
  }

  .project-card h2 {
    font-size: 17px;
  }

  .stage {
    grid-template-columns: 34px minmax(0, 1fr) auto;
    gap: 12px;
    padding: 14px 15px;
  }

  .stage-index {
    width: 32px;
    height: 32px;
  }

  .stage-body p {
    font-size: 12.5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
