:root {
  --bg: #f7f3f0;
  --surface: #fffdfb;
  --surface-soft: #f1e8e1;
  --ink: #2d2926;
  --muted: #766d67;
  --line: #e4d8cf;
  --accent: #9f5d58;
  --accent-dark: #74413f;
  --focus: rgba(159, 93, 88, 0.22);
  --shadow: 0 18px 45px rgba(70, 47, 39, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.72), rgba(247,243,240,0.92)),
    var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

button,
input {
  font: inherit;
}

.app-shell {
  width: min(100%, 760px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 18px 40px;
  display: flex;
  align-items: center;
}

.view {
  display: none;
  width: 100%;
}

.view-active {
  display: block;
}

#homeView,
.question-panel,
.report-card,
.developer-panel {
  background: rgba(255, 253, 251, 0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

#homeView {
  padding: 34px 22px 28px;
}

.brand-mark,
.dimension-label,
.progress-text {
  margin: 0 0 12px;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.25;
}

h1 {
  font-size: 34px;
}

h2 {
  font-size: 22px;
}

h3 {
  margin-top: 26px;
  font-size: 18px;
}

.subtitle {
  margin: 14px 0 22px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.75;
}

.intro-copy {
  margin: 0 0 26px;
  padding: 16px;
  background: var(--surface-soft);
  border-radius: 8px;
  color: #4b423d;
  line-height: 1.7;
}

.intro-copy p {
  margin: 0;
}

.intro-copy p + p {
  margin-top: 8px;
}

.type-preview,
.dimension-preview {
  margin: 22px 0;
}

.type-preview h2 {
  margin-bottom: 12px;
  font-size: 18px;
}

.type-tags,
.keyword-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.type-tags span,
.keyword-list span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #574b45;
  font-size: 13px;
  font-weight: 700;
}

.type-preview p,
.dimension-preview p {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.dimension-preview {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf7;
}

.dimension-preview div {
  display: grid;
  gap: 3px;
}

.dimension-preview strong {
  color: var(--accent-dark);
}

.dimension-preview span {
  color: #5d534d;
}

.field-label {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-weight: 700;
}

.text-input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  outline: none;
}

.text-input:focus,
.option-button:focus-visible,
button:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--focus);
  outline: none;
}

.primary-button,
.secondary-button {
  min-height: 48px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 18px;
  cursor: pointer;
  font-weight: 700;
}

.primary-button {
  width: 100%;
  color: #fff;
  background: var(--accent-dark);
}

.primary-button:hover {
  background: #633634;
}

.developer-entry {
  display: block;
  margin: 16px auto 0;
  border: 0;
  background: transparent;
  color: #9b8e86;
  cursor: pointer;
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.developer-entry:hover {
  color: var(--accent-dark);
}

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

.secondary-button:disabled {
  color: #b7aaa2;
  background: #f5eeea;
  cursor: not-allowed;
}

.error-text {
  min-height: 22px;
  margin: 8px 0 12px;
  color: #a63838;
  font-size: 14px;
}

.quiz-header {
  margin-bottom: 14px;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #eadfd8;
}

.progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 180ms ease;
}

.question-panel {
  padding: 24px 18px;
}

.options-list {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.option-button {
  width: 100%;
  min-height: 58px;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  text-align: left;
  cursor: pointer;
  line-height: 1.55;
}

.option-button.is-selected {
  border-color: var(--accent);
  background: #fbf1ef;
  box-shadow: inset 4px 0 0 var(--accent);
}

.quiz-actions,
.result-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}

.result-heading {
  margin-bottom: 14px;
}

.developer-panel {
  padding: 24px 18px;
}

.developer-panel .field-label {
  margin-top: 16px;
}

.developer-actions {
  display: grid;
  gap: 12px;
}

.batch-reports {
  margin-top: 18px;
}

.batch-item {
  padding: 22px 0;
  border-top: 1px solid var(--line);
}

.batch-item:first-child {
  border-top: 0;
}

.batch-item .report-card {
  margin-top: 12px;
}

.batch-copy {
  width: 100%;
  margin-top: 12px;
}

.report-card {
  padding: 24px 18px;
  line-height: 1.82;
}

.report-card {
  background: #f8fafc;
}

.share-card {
  margin: 0 0 22px;
  padding: 24px 18px;
  border: 1px solid #d8dee8;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.08);
}

.share-eyebrow {
  margin: 0 0 12px;
  color: #1f3a5f;
  font-size: 13px;
  font-weight: 800;
}

.share-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
}

.share-card h2 {
  margin-top: 18px;
  color: #0f172a;
  font-size: 32px;
}

.share-formula {
  margin: 10px 0 16px;
  color: #3f3834;
  font-size: 16px;
  font-weight: 700;
}

.share-card .keyword-list span {
  background: #eef4fb;
  color: #1f3a5f;
  border-color: #d6e1ef;
}

.structure-panel,
.structure-explain,
.intervention-card,
.conversion-card {
  margin: 0 0 22px;
  padding: 18px;
  border: 1px solid #d8dee8;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.06);
}

.section-head {
  display: grid;
  gap: 4px;
  margin-bottom: 14px;
}

.section-head h3 {
  margin: 0;
  color: #0f172a;
  font-size: 19px;
}

.metric-list {
  display: grid;
  gap: 14px;
}

.metric-row {
  display: grid;
  gap: 7px;
}

.metric-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #334155;
  font-size: 14px;
  font-weight: 800;
}

.metric-meta strong {
  color: #0f172a;
}

.metric-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5eaf1;
}

.metric-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1f3a5f, #48739f);
}

.metric-row p {
  margin: 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.55;
}

.structure-explain {
  display: grid;
  gap: 12px;
}

.structure-explain article {
  padding-top: 12px;
  border-top: 1px solid #e5eaf1;
}

.structure-explain article:first-of-type {
  padding-top: 0;
  border-top: 0;
}

.structure-explain h4 {
  margin: 0 0 5px;
  color: #1f3a5f;
  font-size: 14px;
}

.structure-explain p {
  margin: 0;
  color: #334155;
}

.report-card .formula-label {
  margin: 4px 0 6px;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 800;
}

.report-card h2.formula-title {
  margin-top: 0;
  font-size: 24px;
  color: var(--accent-dark);
}

.report-card p {
  margin: 8px 0 0;
  color: #4a423e;
}

.report-card .report-meta {
  display: grid;
  gap: 8px;
  margin: 0 0 18px;
  padding: 14px;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--ink);
}

.formula-strip {
  display: grid;
  gap: 8px;
  margin: 14px 0 18px;
}

.formula-strip span {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #594d47;
  font-weight: 700;
}

.core-card {
  margin: 22px 0 24px;
  padding: 18px;
  border: 1px solid #cfd9e6;
  border-radius: 8px;
  background: #f4f7fb;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.07);
}

.core-card .core-eyebrow {
  margin: 0 0 8px;
  color: #1f3a5f;
  font-size: 15px;
  font-weight: 800;
}

.core-card p:last-child {
  margin: 0;
  color: #3d3430;
  font-size: 17px;
  line-height: 1.82;
}

.insight-card,
.upgrade-note {
  margin: 18px 0;
  padding: 17px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
}

.insight-card h3 {
  margin: 4px 0 8px;
  color: var(--accent-dark);
  font-size: 22px;
}

.insight-card p,
.upgrade-note p {
  margin: 0;
}

.card-label {
  color: #1f3a5f;
  font-size: 13px;
  font-weight: 800;
}

.pattern-card {
  border-color: #d8dee8;
  background: #ffffff;
}

.conclusion-card {
  border-color: #b8c7d9;
  background: #f8fbff;
}

.conclusion-card h3 {
  font-size: 20px;
}

.conclusion-card p:last-child {
  color: #0f172a;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.7;
}

.reality-card {
  border-color: #cfd9e6;
  background: #fbfcfe;
}

.reality-card ol {
  margin: 8px 0 0;
  padding-left: 22px;
}

.reality-card li {
  margin: 10px 0;
  color: #334155;
  line-height: 1.78;
}

.suitable-card {
  border-color: rgba(91, 123, 103, 0.28);
  background: #f7fbf7;
}

.unsuitable-card {
  border-color: rgba(138, 83, 74, 0.25);
  background: #fff7f5;
}

.upgrade-note {
  background: #eef4fb;
  color: #26374d;
  font-weight: 700;
}

.intervention-card {
  background: #0f172a;
  border-color: #0f172a;
  color: #eef4fb;
}

.intervention-card .card-label,
.intervention-card h3 {
  color: #ffffff;
}

.intervention-card ol {
  margin: 0;
  padding-left: 22px;
}

.intervention-card li {
  margin: 10px 0;
  color: #dbeafe;
  line-height: 1.75;
}

.conversion-card {
  background: #ffffff;
  border-color: #cfd9e6;
}

.conversion-card .primary-button {
  background: #0f172a;
}

.conversion-card .primary-button:hover {
  background: #1f3a5f;
}

.consultation-note {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #d8dee8;
  border-radius: 8px;
  background: #f8fafc;
}

.consultation-note h3 {
  margin: 0 0 10px;
  color: #0f172a;
  font-size: 18px;
}

.consultation-note p {
  margin: 0;
  color: #334155;
  font-weight: 700;
}

.consultation-note p + p {
  margin-top: 8px;
}

.consultation-note .wechat-id,
.consultation-note .wechat-note {
  display: inline-block;
  margin-top: 8px;
  padding: 6px 10px;
  border-radius: 6px;
  background: #e8eef6;
  color: #0f172a;
  font-size: 16px;
  letter-spacing: 0;
}

.consultation-note small {
  display: block;
  margin-top: 12px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.6;
}

.core-preview-card {
  position: relative;
  overflow: hidden;
  padding-bottom: 16px;
}

.core-preview-copy {
  position: relative;
  max-height: 108px;
  overflow: hidden;
}

.core-preview-copy::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 52px;
  background: linear-gradient(180deg, rgba(244, 247, 251, 0), #f4f7fb 82%);
  pointer-events: none;
}

.core-preview-hint {
  position: relative;
  margin-top: 10px !important;
  color: #64748b !important;
  font-size: 13px !important;
  font-weight: 800;
  text-align: center;
}

.paywall-card {
  margin: 22px 0;
  padding: 22px 18px;
  border: 1px solid #b8c7d9;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.1);
  text-align: center;
}

.paywall-eyebrow {
  margin: 0 !important;
  color: #1f3a5f !important;
  font-size: 13px;
  font-weight: 800;
}

.paywall-card h3 {
  margin: 6px 0 8px;
  color: #0f172a;
  font-size: 22px;
}

.paywall-card p:not(.paywall-eyebrow) {
  margin: 0 auto;
  max-width: 520px;
  color: #475569;
}

.paywall-card .paywall-benefits-title {
  margin-top: 14px;
  font-weight: 750;
}

.paywall-benefits {
  max-width: 520px;
  margin: 10px auto 0;
  padding-left: 22px;
  color: #334155;
  line-height: 1.7;
  text-align: left;
}

.paywall-benefits li + li {
  margin-top: 3px;
}

.paywall-card .primary-button {
  width: 100%;
  margin-top: 18px;
  background: #0f172a;
}

.paywall-card .paywall-caption {
  margin-top: 9px;
  color: #7a8798;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
}

.locked-report-preview {
  display: grid;
  gap: 12px;
  margin: 0 0 22px;
}

.locked-preview-item {
  overflow: hidden;
  padding: 16px;
  border: 1px solid #d8dee8;
  border-radius: 8px;
  background: #ffffff;
}

.locked-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.locked-preview-head h3 {
  min-width: 0;
  margin: 0;
  color: #1e293b;
  font-size: 17px;
  line-height: 1.45;
}

.locked-preview-head span {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef2f7;
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
}

.locked-preview-copy {
  position: relative;
  max-height: 54px;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
}

.locked-preview-clear {
  color: #475569;
  font-weight: 650;
}

.locked-preview-faded {
  color: #718096;
  filter: blur(2.6px);
  opacity: 0.48;
}

.locked-preview-copy::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 42%;
  height: 100%;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), #ffffff 90%);
  pointer-events: none;
}

.payment-test-modal[hidden] {
  display: none;
}

.payment-test-modal {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
}

.payment-test-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.58);
}

.payment-test-dialog {
  position: relative;
  width: min(100%, 420px);
  padding: 24px;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.3);
}

.payment-test-dialog h3 {
  margin: 4px 0 10px;
  color: #0f172a;
  font-size: 22px;
}

.payment-test-dialog p {
  margin: 0;
  color: #475569;
}

.payment-close-button {
  width: 100%;
  margin-top: 18px;
}

.detail-section {
  margin-top: 24px;
  padding-top: 4px;
}

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

.report-card .code {
  font-weight: 800;
  color: var(--accent-dark);
}

.copy-status {
  min-height: 24px;
  color: var(--accent-dark);
  text-align: center;
}

.report-watermark {
  margin: 0 0 18px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
}

.report-watermark p {
  margin: 0;
  font-size: 14px;
}

.admin-shell {
  align-items: flex-start;
}

.admin-panel {
  width: 100%;
}

.admin-warning {
  margin: 12px 0 20px;
  padding: 12px 14px;
  border-radius: 8px;
  background: #fff3ef;
  color: #88433d;
  font-weight: 700;
}

.admin-content {
  display: grid;
  gap: 22px;
}

.admin-section {
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.admin-section h2 {
  margin-bottom: 12px;
  font-size: 22px;
}

.admin-secondary {
  width: 100%;
  margin-top: 10px;
}

.admin-inline {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.admin-list,
.admin-table {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.admin-row,
.admin-record {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.admin-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.admin-record p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.admin-record span {
  display: inline-flex;
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
}

.status-used {
  border-color: rgba(136, 67, 61, 0.32);
  background: #fff8f6;
}

.status-disabled {
  opacity: 0.72;
  background: #f2efec;
}

@media (max-width: 520px) {
  .app-shell {
    align-items: flex-start;
    padding: 18px 14px 28px;
  }

  h1 {
    font-size: 29px;
  }

  h2 {
    font-size: 20px;
  }

  .result-heading h1 {
    font-size: 23px;
    line-height: 1.35;
  }

  #homeView,
  .question-panel,
  .report-card,
  .developer-panel {
    padding: 22px 16px;
  }

  .share-card {
    padding: 22px 16px;
  }

  .share-card h2 {
    font-size: 29px;
  }

  .locked-preview-head {
    align-items: flex-start;
  }

  .locked-preview-head h3 {
    font-size: 16px;
  }

  .quiz-actions,
  .result-actions {
    grid-template-columns: 1fr;
  }

  .admin-inline,
  .admin-row {
    grid-template-columns: 1fr;
  }
}
