:root {
  --primary: #e11d48;
  --primary-hover: #be123c;
  --primary-light: #ffe4e6;
  --accent: #fb7185;
  --ink: #1e1b4b;
  --muted: #64748b;
  --paper: #fff5f6;
  --card-bg: #ffffff;
  --line: #fecdd3;
  --shadow: 0 10px 30px rgba(225, 29, 72, 0.06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.7 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { opacity: 0.45; cursor: not-allowed; }
a { color: inherit; text-decoration: none; }

header {
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  font-weight: 800;
  font-size: 1.15rem;
  display: flex;
  gap: 10px;
  align-items: center;
  color: #881337;
}

.mark {
  background: linear-gradient(135deg, #e11d48, #fb7185);
  color: white;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 20px;
  box-shadow: 0 4px 12px rgba(225, 29, 72, 0.25);
}

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

.edition {
  font-size: 13px;
  color: #9f1239;
  background: #ffe4e6;
  border: 1px solid #fecdd3;
  padding: 4px 14px;
  border-radius: 99px;
  font-weight: 600;
}

main {
  max-width: 960px;
  width: 100%;
  margin: 16px auto 60px;
  padding: 0 20px;
  flex: 1;
}

/* 按钮通用 */
.primary {
  background: linear-gradient(135deg, #e11d48, #f43f5e);
  color: white;
  border: 0;
  border-radius: 16px;
  padding: 14px 28px;
  font-weight: 700;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 6px 20px rgba(225, 29, 72, 0.3);
  transition: all 0.2s;
}

.primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(225, 29, 72, 0.4);
}

.primary:active:not(:disabled) { transform: translateY(0); }

.ghost {
  border: 1px solid var(--line);
  background: white;
  border-radius: 14px;
  padding: 12px 22px;
  color: var(--ink);
  font-weight: 600;
  transition: all 0.2s;
}

.ghost:hover { background: #fff1f2; border-color: #fda4af; }

/* 首页 Intro */
.intro {
  text-align: center;
  padding: 40px 16px 20px;
}

.pill {
  display: inline-block;
  background: #ffe4e6;
  color: #be123c;
  border: 1px solid #fecdd3;
  border-radius: 99px;
  padding: 6px 18px;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 20px;
}

.intro h1 {
  font-size: clamp(38px, 6vw, 64px);
  line-height: 1.25;
  letter-spacing: -0.03em;
  margin: 12px 0 20px;
  color: #4c0519;
  font-weight: 800;
}

.intro h1 em {
  font-style: normal;
  background: linear-gradient(135deg, #e11d48, #fb7185);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.intro p {
  font-size: 18px;
  color: #475569;
  max-width: 620px;
  margin: 0 auto 28px;
  line-height: 1.6;
}

.feature-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 32px 0 36px;
  text-align: left;
}

.feat-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.feat-card .num {
  font-size: 13px;
  font-weight: 700;
  color: #e11d48;
  background: #ffe4e6;
  padding: 2px 8px;
  border-radius: 6px;
  display: inline-block;
  margin-bottom: 8px;
}

.feat-card h3 { font-size: 16px; margin: 0 0 6px; color: #881337; font-weight: 700; }
.feat-card p { font-size: 13px; color: var(--muted); margin: 0; line-height: 1.5; }

.intro-note {
  font-size: 13px;
  color: var(--muted);
  margin-top: 20px;
}

/* 答题卡片 */
.quiz { max-width: 720px; margin: 0 auto; }

.stephead {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: var(--muted);
  margin: 12px 0 10px;
  font-weight: 600;
}

progress {
  width: 100%;
  height: 8px;
  border: 0;
  display: block;
  border-radius: 10px;
  overflow: hidden;
  background: #fecdd3;
  margin-bottom: 24px;
}

progress::-webkit-progress-bar { background: #fecdd3; }
progress::-webkit-progress-value {
  background: linear-gradient(90deg, #e11d48, #fb7185);
  border-radius: 10px;
}

.question-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 34px 30px;
  box-shadow: var(--shadow);
}

.eyebrow {
  color: #e11d48;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.question-title {
  font-size: 22px;
  font-weight: 700;
  color: #4c0519;
  line-height: 1.5;
  margin: 12px 0 24px;
}

.options {
  display: grid;
  gap: 12px;
}

.option {
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1.5px solid var(--line);
  border-radius: 16px;
  padding: 14px 18px;
  cursor: pointer;
  background: white;
  transition: all 0.15s ease;
  font-weight: 500;
}

.option:hover {
  border-color: #fda4af;
  background: #fff5f6;
  transform: translateX(2px);
}

.option.selected {
  background: #ffe4e6;
  border-color: #e11d48;
  color: #881337;
  font-weight: 700;
}

.option input {
  accent-color: #e11d48;
  width: 18px;
  height: 18px;
}

.option span { flex: 1; }

.option-key {
  font-size: 11px;
  color: #9f1239;
  background: #fecdd3;
  padding: 2px 7px;
  border-radius: 6px;
  font-weight: 700;
}

.controls {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 28px;
}

/* 结果页 */
.result-hero {
  background: linear-gradient(135deg, #be123c, #e11d48);
  color: white;
  border-radius: 28px;
  padding: 36px 32px;
  box-shadow: 0 15px 35px rgba(190, 18, 60, 0.35);
  margin-bottom: 28px;
}

.result-hero .saved-badge {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.result-hero h1 {
  font-size: clamp(28px, 4vw, 42px);
  margin: 12px 0 14px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.result-hero p {
  color: #ffe4e6;
  font-size: 16px;
  line-height: 1.6;
  margin: 0;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 32px 0 16px;
}

.section-head h2 { font-size: 20px; font-weight: 800; color: #4c0519; }

/* 本命神剧卡片 */
.primary-drama-card {
  background: white;
  border: 2px solid #e11d48;
  border-radius: 24px;
  padding: 30px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.badge-match {
  background: #ffe4e6;
  color: #be123c;
  padding: 4px 12px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 700;
  display: inline-block;
  margin-bottom: 12px;
}

.drama-title {
  font-size: 28px;
  font-weight: 800;
  color: #4c0519;
  margin: 0 0 8px;
}

.drama-meta {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 16px;
}

.reasons-box {
  background: #fff5f6;
  border-radius: 16px;
  padding: 18px 20px;
  margin-top: 16px;
  border-left: 4px solid #e11d48;
}

.reasons-box h4 {
  font-size: 14px;
  color: #881337;
  margin-bottom: 8px;
}

.reasons-box ul {
  padding-left: 20px;
  margin: 0;
}

.reasons-box li {
  font-size: 14px;
  color: #475569;
  margin-bottom: 6px;
  line-height: 1.6;
}

/* 网格推荐卡片 */
.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.sub-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 22px;
  box-shadow: var(--shadow);
}

.sub-card h3 { font-size: 18px; margin: 8px 0 4px; color: #4c0519; font-weight: 700; }
.sub-card .tagline { font-size: 13px; color: var(--muted); margin-bottom: 12px; }

/* 维度条形图 */
.dimension-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 30px;
}

.dim-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 22px;
  box-shadow: var(--shadow);
}

.bar-row {
  margin: 14px 0;
}

.bar-head {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}

.bar-track {
  height: 8px;
  background: #ffe4e6;
  border-radius: 8px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #e11d48, #fb7185);
  border-radius: 8px;
}

/* 鉴权徽章与遮罩 */
.auth-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  background: #ffe4e6;
  color: #be123c;
  padding: 4px 12px;
  border-radius: 99px;
  font-weight: 600;
  border: 1px solid #fecdd3;
}

.auth-badge .dot {
  width: 7px;
  height: 7px;
  background: #10b981;
  border-radius: 50%;
  display: inline-block;
}

.auth-badge .text-btn {
  background: none;
  border: none;
  color: #e11d48;
  font-size: 12px;
  padding: 0 4px;
  cursor: pointer;
  text-decoration: underline;
}

.saved-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
  padding: 5px 14px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 14px;
}

/* 激活弹窗 */
.gate-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

.gate-card {
  background: #ffffff;
  border-radius: 24px;
  padding: 36px 30px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 25px 50px -12px rgba(225, 29, 72, 0.25);
  border: 1px solid var(--line);
  text-align: center;
  animation: gatePopIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes gatePopIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.gate-icon {
  width: 54px;
  height: 54px;
  background: linear-gradient(135deg, #e11d48, #fb7185);
  color: #fff;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  margin-bottom: 14px;
  box-shadow: 0 8px 16px -4px rgba(225, 29, 72, 0.4);
}

.gate-title { font-size: 22px; font-weight: 750; color: #4c0519; margin: 0 0 6px; }
.gate-subtitle { font-size: 14px; color: var(--muted); margin: 0 0 22px; line-height: 1.5; }

.gate-input-wrapper { margin-bottom: 14px; text-align: left; }

.gate-input {
  width: 100%;
  padding: 13px 16px;
  font-size: 18px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 700;
  letter-spacing: 2px;
  text-align: center;
  text-transform: uppercase;
  border: 2px solid #fca5a5;
  border-radius: 14px;
  outline: none;
  background: #fff5f5;
  color: #9f1239;
  transition: all 0.2s;
}

.gate-input:focus {
  border-color: #e11d48;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(225, 29, 72, 0.15);
}

.gate-input::placeholder { font-size: 14px; font-weight: 400; letter-spacing: normal; color: #f87171; }
.gate-error { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; padding: 8px 12px; border-radius: 10px; font-size: 13px; margin-bottom: 14px; display: none; }
.gate-btn { width: 100%; padding: 13px; font-size: 16px; border-radius: 14px; margin-bottom: 18px; }

.gate-tips {
  font-size: 12px;
  color: var(--muted);
  background: #fff5f6;
  padding: 12px 14px;
  border-radius: 12px;
  text-align: left;
  line-height: 1.6;
  border: 1px dashed var(--line);
}
.gate-tips p { margin: 2px 0; }

footer {
  text-align: center;
  padding: 24px;
  font-size: 13px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

@media (max-width: 650px) {
  header { padding: 16px 20px; }
  .edition { display: none; }
  main { padding: 0 16px; margin-top: 10px; }
  .intro h1 { font-size: 32px; }
  .question-card { padding: 24px 20px; border-radius: 20px; }
  .question-title { font-size: 19px; }
  .dimension-grid { grid-template-columns: 1fr; }
  .grid-cards { grid-template-columns: 1fr; }
  .primary-drama-card { padding: 22px; }
  .drama-title { font-size: 22px; }
}
