:root {
  --ink: #3c5164;
  --muted: rgba(60, 81, 100, 0.66);
  --paper: #fff8ee;
  --surface: rgba(255, 252, 246, 0.86);
  --line: rgba(60, 81, 100, 0.14);
  --deep: #33556b;
  --deep-2: #2a4658;
  --sky: #bfddeb;
  --sky-2: #e4f1f6;
  --butter: #f4d88a;
  --sage: #c8d8c0;
  --peach: #f8ddd1;
  --shadow: 0 22px 44px -30px rgba(51, 85, 107, 0.35);
  color: var(--ink);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, var(--sky-2) 0%, #f5f5ec 46%, var(--paper) 100%);
}

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

button {
  cursor: pointer;
}

.app-shell {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0 64px;
}

.hero {
  min-height: 82vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 34px;
  padding: 0 0 42px;
}

.brand-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 68px;
  color: var(--deep);
  font-size: 15px;
  font-weight: 750;
}

.brand-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.hero-content {
  width: min(780px, 100%);
  margin: auto;
  padding: 64px 0 120px;
  display: grid;
  justify-items: center;
  gap: 24px;
  text-align: center;
}

.eyebrow {
  margin: 0;
  color: var(--deep);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1.32;
  color: var(--deep);
  letter-spacing: 0;
  font-weight: 760;
}

h2 {
  font-size: 29px;
  line-height: 1.28;
  letter-spacing: 0;
}

h3 {
  font-size: 20px;
  line-height: 1.32;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 560px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.9;
}

.hero-actions,
.experiment-actions,
.nav-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.primary-btn,
.ghost-btn {
  min-height: 52px;
  border: 0;
  border-radius: 999px;
  padding: 0 28px;
  font-weight: 760;
}

.primary-btn {
  background: var(--deep);
  color: var(--paper);
  box-shadow: 0 14px 26px -14px rgba(51, 85, 107, 0.45);
}

.primary-btn:disabled {
  background: rgba(60, 81, 100, 0.36);
  cursor: not-allowed;
  box-shadow: none;
}

.ghost-btn {
  background: rgba(255, 255, 255, 0.42);
  color: var(--deep);
  border: 1px solid var(--line);
}

.compact {
  min-height: 42px;
  padding: 0 18px;
}

.hero-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  max-width: 880px;
  margin: 0 auto;
}

.hero-strip span {
  min-height: 54px;
  display: grid;
  place-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.42);
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

.panel,
.result,
.baseline,
.family-info,
.logic-panel,
.survey-layout {
  margin-top: 24px;
}

.intro-panel,
.result,
.baseline,
.family-info,
.logic-panel {
  background: rgba(255, 252, 246, 0.72);
  border: 1px solid var(--line);
  border-radius: 26px;
  box-shadow: var(--shadow);
  padding: 34px;
  backdrop-filter: blur(10px);
}

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

.note-grid article,
.logic-grid article,
.result-card {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  padding: 24px;
}

.note-grid strong,
.note-grid span {
  display: block;
}

.note-grid strong {
  margin-bottom: 8px;
  color: var(--deep);
}

.note-grid span,
.result-card p,
.experiment-panel p,
.baseline-header p,
.logic-grid p,
.gentle-warning span {
  color: var(--muted);
  line-height: 1.75;
}

.survey-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.progress-card,
.question-card {
  border: 1px solid var(--line);
  border-radius: 26px;
  background: rgba(255, 252, 246, 0.82);
  box-shadow: var(--shadow);
  padding: 28px;
  backdrop-filter: blur(10px);
}

.progress-card {
  position: sticky;
  top: 20px;
}

.progress-ring {
  width: 120px;
  height: 120px;
  display: grid;
  place-items: center;
  margin: 12px auto 20px;
  border-radius: 50%;
  background: conic-gradient(var(--deep) var(--progress, 8%), rgba(60, 81, 100, 0.12) 0);
}

.progress-ring span {
  width: 88px;
  height: 88px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  font-weight: 900;
}

.progress-bar {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(60, 81, 100, 0.12);
  margin-bottom: 18px;
}

.progress-bar span {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--deep);
  border-radius: inherit;
}

.question-kicker {
  margin-bottom: 10px;
  color: var(--deep);
  font-weight: 760;
}

.options {
  display: grid;
  gap: 12px;
  margin: 24px 0;
}

.option-btn {
  width: 100%;
  min-height: 74px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  padding: 17px 20px;
  color: var(--ink);
  text-align: left;
  line-height: 1.55;
}

.option-btn.selected {
  border-color: rgba(51, 85, 107, 0.36);
  background: #eaf3f7;
  box-shadow: inset 5px 0 0 var(--deep);
}

.nav-row {
  justify-content: space-between;
}

.result-header {
  max-width: 820px;
}

.result-for {
  margin: 8px 0 4px;
  color: var(--muted);
  font-weight: 700;
}

.goal-banner {
  display: grid;
  gap: 8px;
  margin-top: 20px;
  border-left: 5px solid var(--butter);
  border-radius: 0 18px 18px 0;
  background: rgba(255, 255, 255, 0.58);
  padding: 16px 18px;
}

.goal-banner span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.result-grid {
  margin: 22px 0;
}

.result-card.main {
  border-color: rgba(51, 85, 107, 0.2);
  background: #eaf3f7;
}

.card-label {
  display: inline-block;
  margin-bottom: 14px;
  color: var(--deep);
  font-weight: 800;
}

.experiment-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(280px, 1fr);
  gap: 22px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: linear-gradient(135deg, var(--sky-2), rgba(255, 252, 246, 0.86));
  padding: 28px;
}

.experiment-panel ol {
  margin: 0;
  padding-left: 22px;
  color: #41575c;
  line-height: 1.8;
}

.experiment-actions {
  grid-column: 1 / -1;
}

.gentle-warning {
  display: flex;
  gap: 12px;
  border-left: 5px solid var(--butter);
  background: rgba(255, 252, 246, 0.72);
  padding: 18px;
  border-radius: 22px;
}

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

.form-heading {
  max-width: 720px;
}

.form-heading p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.75;
}

.family-info-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.family-info-form label {
  display: grid;
  gap: 8px;
  font-weight: 760;
}

.family-info-form input:not([type="checkbox"]),
.family-info-form textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  padding: 12px 14px;
}

.family-info-form textarea {
  resize: vertical;
}

.wide-field,
.consent-field,
.form-actions {
  grid-column: 1 / -1;
}

.consent-field {
  grid-template-columns: 20px 1fr !important;
  align-items: start;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600 !important;
  line-height: 1.6;
}

.consent-field input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
}

.form-actions,
.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.save-status {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--deep);
  font-size: 14px;
  font-weight: 700;
}

.baseline-form label {
  display: grid;
  gap: 8px;
  color: #3d5054;
  font-weight: 800;
}

.baseline-form input,
.baseline-form select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  padding: 0 12px;
}

.baseline-form button {
  align-self: end;
}

.saved-box {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f5fbf8;
  padding: 16px;
  color: #41575c;
  line-height: 1.7;
}

.logic-header {
  max-width: 700px;
}

.logic-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 18px;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 42px 4px 0;
  color: var(--muted);
  font-size: 13px;
}

.site-footer a {
  color: var(--deep);
}

.admin-shell {
  width: min(1320px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0 64px;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
  margin-bottom: 24px;
}

.admin-header h1 {
  font-size: clamp(30px, 4vw, 46px);
}

.admin-header p:last-child {
  color: var(--muted);
}

.admin-card {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 252, 246, 0.82);
  box-shadow: var(--shadow);
  padding: 24px;
}

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

.admin-table {
  width: 100%;
  min-width: 1040px;
  border-collapse: collapse;
  font-size: 14px;
}

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

.admin-table th {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .04em;
}

.admin-table td span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.5;
}

.goal-cell {
  max-width: 280px;
  line-height: 1.6;
}

.link-btn {
  display: inline-grid;
  place-items: center;
  text-decoration: none;
}

.hidden {
  display: none !important;
}

@media (max-width: 820px) {
  .app-shell {
    width: min(100% - 24px, 1120px);
  }

  .hero {
    min-height: auto;
    padding-bottom: 28px;
  }

  .hero-content {
    padding: 42px 0 72px;
  }

  h1 {
    font-size: 34px;
  }

  .brand-logo {
    width: 38px;
    height: 38px;
  }

  .hero-copy {
    font-size: 18px;
  }

  .hero-strip,
  .note-grid,
  .result-grid,
  .logic-grid,
  .survey-layout,
  .experiment-panel,
  .baseline-form {
    grid-template-columns: 1fr;
  }

  .progress-card {
    position: static;
  }

  .progress-ring {
    width: 94px;
    height: 94px;
    margin-left: 0;
  }

  .progress-ring span {
    width: 68px;
    height: 68px;
  }

  .intro-panel,
  .result,
  .baseline,
  .family-info,
  .logic-panel,
  .progress-card,
  .question-card {
    padding: 20px;
  }

  .family-info-form {
    grid-template-columns: 1fr;
  }

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