:root {
  --bg: #f7f5ef;
  --paper: #ffffff;
  --ink: #1f2a2e;
  --muted: #6a7275;
  --line: #d9ddd8;
  --green: #176b5b;
  --green-soft: #e5f1ed;
  --gold: #b97a19;
  --red: #b64335;
  --shadow: 0 18px 40px rgba(35, 45, 48, 0.11);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.55;
}

button,
input,
textarea,
select {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 32px;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 245, 239, 0.95);
  backdrop-filter: blur(12px);
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  color: #fff;
  background: var(--green);
  font-weight: 800;
}

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

.brand span {
  color: var(--muted);
  font-size: 13px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.top-actions a {
  color: var(--ink);
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 6px;
}

.top-actions a:hover {
  background: var(--green-soft);
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 28px;
  align-items: stretch;
  min-height: 560px;
  padding: 58px 0 34px;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 700;
}

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

h1 {
  max-width: 760px;
  margin-bottom: 18px;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.08;
  letter-spacing: 0;
}

h2 {
  font-size: 28px;
  line-height: 1.2;
}

.lead {
  max-width: 680px;
  color: var(--muted);
  font-size: 18px;
}

.hero-actions,
.form-actions,
.result-actions,
.admin-toolbar,
.tab-row,
.next-step-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-proof {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.hero-proof span {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--green);
  background: rgba(255, 255, 255, 0.62);
  font-size: 13px;
  font-weight: 700;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 7px;
  cursor: pointer;
  text-decoration: none;
  font-weight: 700;
  transition: transform 0.15s ease, background 0.15s ease, border 0.15s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button.primary {
  color: #fff;
  background: var(--green);
}

.button.secondary {
  color: var(--green);
  border-color: var(--green);
  background: #fff;
}

.button.ghost {
  color: var(--ink);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.58);
}

.button.danger {
  color: var(--red);
  border-color: rgba(182, 67, 53, 0.35);
  background: #fff;
}

.button.active {
  outline: 3px solid rgba(23, 107, 91, 0.16);
}

.status-board {
  display: grid;
  gap: 12px;
  align-content: center;
}

.status-board div {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.status-board span {
  color: var(--gold);
  font-weight: 800;
}

.status-board strong {
  display: block;
  margin: 8px 0 4px;
  font-size: 19px;
}

.status-board p,
.plan-card p,
.section-heading p,
.form-note,
footer p {
  color: var(--muted);
}

.plans,
.value-section,
.learning-path,
.diagnose,
.admin-panel {
  padding: 46px 0;
}

.section-heading {
  max-width: 720px;
  margin-bottom: 20px;
}

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

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

.pain-grid article,
.result-preview-grid article,
.path-grid article {
  min-height: 154px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.result-preview-grid span {
  display: inline-block;
  margin-bottom: 10px;
  color: var(--gold);
  font-weight: 800;
}

.pain-grid strong,
.result-preview-grid strong,
.path-grid strong {
  display: block;
  margin-bottom: 8px;
  font-size: 18px;
}

.pain-grid p,
.result-preview-grid p,
.path-grid p {
  margin-bottom: 0;
  color: var(--muted);
}

.plan-card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.plan-card.featured {
  border-color: rgba(23, 107, 91, 0.55);
  box-shadow: var(--shadow);
}

.plan-price {
  display: inline-block;
  margin-bottom: 14px;
  color: var(--green);
  font-size: 24px;
  font-weight: 800;
}

.plan-card ul {
  padding-left: 18px;
  margin-bottom: 22px;
}

.diagnose {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 24px;
  align-items: start;
}

.form-shell,
.result-panel,
.admin-login,
.lead-list,
.lead-detail {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.form-shell,
.result-panel,
.admin-panel {
  padding: 24px;
}

.result-panel {
  position: sticky;
  top: 88px;
  max-height: calc(100vh - 108px);
  overflow: auto;
  box-shadow: var(--shadow);
}

.intake-form {
  display: grid;
  gap: 18px;
}

.selected-plan {
  padding: 12px 14px;
  border-radius: 7px;
  color: var(--green);
  background: var(--green-soft);
  font-weight: 800;
}

fieldset {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

legend {
  padding: 0 8px;
  color: var(--green);
  font-weight: 800;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

label.wide {
  grid-column: 1 / -1;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
}

textarea {
  min-height: 88px;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  outline: 3px solid rgba(23, 107, 91, 0.14);
  border-color: var(--green);
}

.result-head,
.detail-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.lead-badge,
.public-badge {
  flex: none;
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--green);
  background: var(--green-soft);
  font-size: 12px;
  font-weight: 800;
}

pre {
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0 0 18px;
  padding: 16px;
  border-radius: 8px;
  color: #243033;
  background: #f4f4ef;
  font-size: 14px;
}

.upgrade-box {
  margin-bottom: 14px;
  padding: 14px;
  border-left: 4px solid var(--gold);
  background: #fff7e6;
}

.next-step-grid {
  margin-bottom: 14px;
}

.poster-cta {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(150px, 0.72fr);
  gap: 14px;
  align-items: start;
  margin: 0 0 16px;
  padding: 14px;
  border: 1px solid rgba(23, 107, 91, 0.22);
  border-radius: 8px;
  background: #f8fbf8;
}

.poster-copy h3 {
  margin-bottom: 8px;
  font-size: 20px;
  line-height: 1.25;
}

.poster-copy p {
  color: var(--muted);
}

.poster-frame {
  display: block;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(35, 45, 48, 0.12);
}

.poster-frame img {
  display: block;
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  object-position: top center;
}

.error-list {
  color: var(--red);
}

.admin-panel {
  margin-bottom: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
}

.admin-login {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
  padding: 18px;
}

.admin-login label {
  min-width: 240px;
}

.admin-login p {
  margin: 0;
  color: var(--muted);
}

.admin-workspace {
  display: grid;
  gap: 14px;
}

.lead-layout {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 14px;
}

.lead-list,
.lead-detail {
  min-height: 360px;
  padding: 14px;
}

.lead-list {
  display: grid;
  align-content: start;
  gap: 10px;
  max-height: 720px;
  overflow: auto;
}

.lead-item {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.lead-item:hover {
  border-color: var(--green);
}

.lead-item small {
  color: var(--muted);
}

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

.meta-grid div {
  padding: 10px;
  border-radius: 7px;
  background: #f4f4ef;
}

.meta-grid dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.meta-grid dd {
  margin: 2px 0 0;
}

.empty-state {
  color: var(--muted);
}

.hidden {
  display: none !important;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 40;
  padding: 10px 14px;
  border-radius: 7px;
  color: #fff;
  background: var(--green);
  box-shadow: var(--shadow);
}

footer {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 38px;
  border-top: 1px solid var(--line);
}

@media (max-width: 920px) {
  .topbar,
  .hero,
  .diagnose,
  .lead-layout {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
    align-items: start;
    padding: 14px 16px;
  }

  .top-actions {
    overflow-x: auto;
  }

  .hero {
    min-height: auto;
    padding-top: 34px;
  }

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

  .pain-grid,
  .result-preview-grid,
  .path-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .result-panel {
    position: static;
    max-height: none;
  }

  .poster-cta {
    grid-template-columns: minmax(0, 1fr) minmax(140px, 220px);
  }
}

@media (max-width: 620px) {
  main,
  footer {
    width: min(100% - 20px, 1180px);
  }

  fieldset,
  .meta-grid,
  .pain-grid,
  .result-preview-grid,
  .path-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 34px;
  }

  .poster-cta {
    grid-template-columns: 1fr;
  }

  .poster-frame {
    max-width: 280px;
  }
}
