/* 字体为 SIL OFL 1.1 开源可商用：Noto Sans SC / Noto Serif SC / Cormorant Garamond / JetBrains Mono，已子集化自托管 */
@font-face { font-family: "Noto Sans SC"; font-style: normal; font-weight: 400; font-display: swap; src: url("./fonts/noto-sans-sc-400.woff2") format("woff2"); }
@font-face { font-family: "Noto Sans SC"; font-style: normal; font-weight: 500; font-display: swap; src: url("./fonts/noto-sans-sc-500.woff2") format("woff2"); }
@font-face { font-family: "Noto Sans SC"; font-style: normal; font-weight: 600; font-display: swap; src: url("./fonts/noto-sans-sc-600.woff2") format("woff2"); }
@font-face { font-family: "Noto Sans SC"; font-style: normal; font-weight: 700; font-display: swap; src: url("./fonts/noto-sans-sc-700.woff2") format("woff2"); }
@font-face { font-family: "Noto Serif SC"; font-style: normal; font-weight: 400; font-display: swap; src: url("./fonts/noto-serif-sc-400.woff2") format("woff2"); }
@font-face { font-family: "Noto Serif SC"; font-style: normal; font-weight: 600; font-display: swap; src: url("./fonts/noto-serif-sc-600.woff2") format("woff2"); }
@font-face { font-family: "Noto Serif SC"; font-style: normal; font-weight: 700; font-display: swap; src: url("./fonts/noto-serif-sc-700.woff2") format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-style: normal; font-weight: 400; font-display: swap; src: url("./fonts/cormorant-garamond-400.woff2") format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-style: normal; font-weight: 500; font-display: swap; src: url("./fonts/cormorant-garamond-500.woff2") format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-style: normal; font-weight: 600; font-display: swap; src: url("./fonts/cormorant-garamond-600.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("./fonts/jetbrains-mono-400.woff2") format("woff2"); }

:root {
  --bg-outer: #E4E9EA;
  --paper: #EDF0F2;
  --paper-pure: #F4F6F6;
  --teal-deep: #1F6E6C;
  --teal-mid: #2E8B88;
  --teal-ink: #0A2233;
  --teal-soft: #73C2BE;
  --teal-tint: #DCE8E7;

  --ink: #161C1E;
  --ink-soft: #435258;
  --ink-mute: #7A888C;
  --hairline: rgba(22, 28, 30, 0.12);
  --hairline-strong: rgba(22, 28, 30, 0.65);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg-outer);
  color: var(--ink);
  font-family: "Noto Sans SC", sans-serif;
  font-size: 14.5px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

.hidden {
  display: none !important;
}

#posterSourceImg {
  position: fixed;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.shell {
  max-width: 468px;
  margin: 0 auto;
  padding: 20px 14px 64px;
}

.sheet {
  background: var(--paper);
  border: 1px solid var(--c-sheet-border, rgba(22, 28, 30, 0.18));
  box-shadow: 0 18px 48px rgba(10, 34, 51, 0.06);
  overflow: hidden;
}

/* ---------- Cover & redemption ---------- */
.hero-cover {
  position: relative;
  min-height: 440px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 40px 32px 24px;
  overflow: hidden;
  background: var(--c-hero-band, var(--paper));
}

.hero-cover-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center bottom;
  z-index: 0;
}

.hero-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    var(--c-hero-shade-28, rgba(10, 34, 51, 0.28)) 0%,
    var(--c-hero-shade-14, rgba(10, 34, 51, 0.14)) 44%,
    var(--c-paper-alpha-78, rgba(237, 240, 242, 0.78)) 80%,
    var(--paper) 100%
  );
  z-index: 1;
  pointer-events: none;
}

.hero-top {
  position: relative;
  z-index: 2;
  padding-top: 22px;
}

.hero-kicker {
  display: inline-block;
  font-size: 11.5px;
  letter-spacing: 0.16em;
  color: rgba(244, 247, 247, 0.84);
  margin-bottom: 18px;
}

.hero-title {
  margin: 0;
  font-family: "Noto Serif SC", serif;
  font-size: 32px;
  font-weight: 600;
  line-height: 1.32;
  letter-spacing: 0.02em;
  color: #F6F8F8;
  text-shadow: 0 2px 24px rgba(10, 34, 51, 0.28);
}

.hero-bottom {
  position: relative;
  z-index: 2;
  padding-top: 104px;
}

.hero-lead {
  margin: 0;
  font-size: 14px;
  line-height: 1.85;
  color: var(--ink-soft);
}

.gate-body {
  padding: 20px 32px 32px;
  background: var(--paper);
}

.input-group {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.code-input {
  flex: 1;
  border: none;
  border-bottom: 1px solid var(--hairline-strong);
  background: transparent;
  padding: 11px 2px;
  color: var(--ink);
  font-family: "JetBrains Mono", "Noto Sans SC", monospace;
  font-size: 14px;
  letter-spacing: 0.06em;
  outline: none;
  border-radius: 0;
}

.code-input::placeholder {
  color: var(--ink-mute);
  letter-spacing: 0.02em;
  font-family: "Noto Sans SC", sans-serif;
  font-size: 13px;
}

.code-input:focus {
  border-bottom-color: var(--teal-deep);
}

.btn-text-mini {
  border: none;
  background: transparent;
  color: var(--teal-deep);
  font-family: inherit;
  font-size: 12.5px;
  padding: 0 4px;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.16s ease;
}

.btn-text-mini:hover {
  opacity: 0.68;
}

.err-msg {
  margin: 0 0 18px;
  font-size: 12px;
  color: #9A3B42;
  min-height: 18px;
}

.btn-primary {
  width: 100%;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper-pure);
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  padding: 14px 18px;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.btn-primary:hover {
  background: var(--teal-ink);
  border-color: var(--teal-ink);
}

.btn-primary:disabled,
.btn-secondary:disabled {
  opacity: 0.55;
  cursor: default;
}

.btn-secondary {
  width: 100%;
  border: 1px solid rgba(22, 28, 30, 0.28);
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  font-size: 13.5px;
  letter-spacing: 0.04em;
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.18s ease;
}

.btn-secondary:hover {
  background: rgba(22, 28, 30, 0.05);
}

.gate-meta-links {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 22px;
  font-size: 12px;
  color: var(--ink-mute);
}

.gate-footnote {
  padding: 0 32px 28px;
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--ink-mute);
}

/* ---------- Quiz ---------- */
.quiz-head {
  padding: 28px 32px 0;
}

.quiz-progress-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
}

.quiz-count {
  font-family: "Cormorant Garamond", serif;
  font-size: 24px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: 0.04em;
}

.quiz-count-total {
  font-size: 14px;
  color: var(--ink-mute);
}

.progress-track {
  width: 100%;
  height: 1.5px;
  background: var(--hairline);
}

.progress-fill {
  height: 100%;
  width: 6%;
  background: var(--teal-deep);
  transition: width 0.28s ease;
}

.quiz-body {
  padding: 46px 32px 36px;
}

.q-prompt {
  margin: 0 0 42px;
  font-family: "Noto Serif SC", serif;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.68;
  color: var(--ink);
  min-height: 96px;
}

.opt-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.opt-btn {
  width: 100%;
  text-align: left;
  padding: 15px 18px;
  border: 1px solid var(--hairline);
  background: var(--c-opt-bg, rgba(255, 255, 255, 0.45));
  color: var(--ink);
  font-family: inherit;
  font-size: 14.5px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.opt-btn:hover {
  background: var(--teal-tint);
  border-color: rgba(31, 110, 108, 0.42);
}

.opt-btn.selected {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper-pure);
}

.opt-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1px solid var(--ink-mute);
  flex-shrink: 0;
}

.opt-btn .opt-key {
  font-family: "Cormorant Garamond", serif;
  font-weight: 600;
  color: var(--teal-deep);
  margin-right: 8px;
}

.summary-text {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.9;
  color: var(--ink-soft);
}

.opt-btn.selected .opt-dot {
  background: var(--paper-pure);
  border-color: var(--paper-pure);
}

.quiz-foot {
  padding: 16px 32px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ---------- Report ---------- */
.report-hero {
  position: relative;
  padding: 44px 32px 20px;
  overflow: hidden;
  background: var(--c-hero-band, var(--paper));
}

.report-hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 24%;
  z-index: 0;
}

.report-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    var(--c-hero-shade-28, rgba(10, 34, 51, 0.28)) 0%,
    var(--c-hero-shade-14, rgba(10, 34, 51, 0.14)) 40%,
    var(--c-paper-alpha-86, rgba(237, 240, 242, 0.86)) 76%,
    var(--paper) 100%
  );
  z-index: 1;
  pointer-events: none;
}

.report-hero-inner {
  position: relative;
  z-index: 2;
}

.report-eyebrow {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: rgba(244, 247, 247, 0.86);
  margin-bottom: 30px;
}

.archetype-title {
  margin: 0 0 12px;
  font-family: "Noto Serif SC", serif;
  font-size: 36px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.2;
  color: #F7F9F9;
  text-shadow: 0 2px 20px rgba(10, 34, 51, 0.30);
}

.score-inline {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 48px;
  color: rgba(244, 247, 247, 0.92);
}

.score-big {
  font-family: "Cormorant Garamond", serif;
  font-size: 46px;
  font-weight: 600;
  line-height: 1;
}

.score-sub {
  font-size: 12.5px;
  letter-spacing: 0.04em;
  opacity: 0.9;
}

.report-quote {
  margin: 0;
  padding-left: 14px;
  border-left: 2px solid var(--teal-deep);
  font-family: "Noto Serif SC", serif;
  font-size: 14.5px;
  line-height: 1.88;
  color: var(--ink);
}

.tag-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.soft-tag {
  font-size: 12px;
  color: var(--ink-mute);
  letter-spacing: 0.04em;
}

.flow-block {
  padding: 48px 32px 0;
  background: var(--paper);
}

.flow-heading {
  margin: 0 0 8px;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--ink-mute);
  text-align: center;
}

.flow-heading-left {
  margin: 0 0 22px;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--ink-mute);
}

.halo-wrap {
  width: 100%;
  max-width: 404px;
  margin: 6px auto 0;
}

.halo-wrap svg {
  width: 100%;
  height: auto;
  display: block;
}

.eq-wrap {
  width: 100%;
  margin: 12px 0 24px;
}

.eq-wrap svg {
  width: 100%;
  height: auto;
  display: block;
}

.dim-notes {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 8px;
}

.dim-note-row {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  align-items: baseline;
  padding: 6px 8px;
  border-radius: 4px;
}

.dim-note-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
}

.dim-note-text {
  font-size: 12.5px;
  color: var(--ink-soft);
  line-height: 1.65;
}

.remedy-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.remedy-item {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  align-items: start;
}

.remedy-num {
  font-family: "Cormorant Garamond", serif;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.1;
  color: var(--teal-deep);
}

.remedy-item strong {
  display: block;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 4px;
}

.remedy-item p {
  margin: 0;
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.78;
}

.report-actions {
  padding: 48px 32px 24px;
  background: var(--paper);
}

.action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

.report-footnote {
  padding: 12px 32px 36px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 11.5px;
  color: var(--ink-mute);
  line-height: 1.65;
}

/* ---------- Modals ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 22, 30, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
}

.modal-card {
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--paper-pure);
  border: 1px solid var(--hairline-strong);
  padding: 24px 22px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

.modal-title {
  margin: 0 0 10px;
  font-family: "Noto Serif SC", serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
}

.modal-desc {
  margin: 0 0 18px;
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--ink-soft);
}

.modal-img-wrap {
  width: 100%;
  border: 1px solid var(--hairline);
  background: #FFFFFF;
  margin-bottom: 14px;
  overflow: hidden;
}

.modal-img-wrap img {
  width: 100%;
  height: auto;
  display: block;
}

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

.modal-actions button {
  flex: 1;
}

.save-tip-banner {
  margin-bottom: 14px;
  padding: 10px 14px;
  background: var(--c-accent-tint, rgba(31, 110, 108, 0.08));
  border-left: 2px solid var(--teal-deep);
  font-size: 12.5px;
  color: var(--ink-soft);
  line-height: 1.6;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: var(--ink);
  color: var(--paper-pure);
  font-size: 12.5px;
  padding: 10px 18px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.22s ease;
  z-index: 100;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
