/* ========================================
   你是哪部电影？ - 样式表
   风格：暗色放映厅 · 复古胶片 · 装饰线条
======================================== */

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; -webkit-tap-highlight-color: transparent; }

body {
  font-family: "PingFang SC", "Noto Sans SC", "Source Han Sans SC",
               "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  background: #0d0b0a;
  color: #f0ece6;
  overflow-y: auto;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.noise-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 999; opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.5'/%3E%3C/svg%3E");
  background-repeat: repeat; background-size: 256px 256px;
}

.page {
  display: none;
  width: 100%;
  min-height: 100vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.page.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 20px;
  animation: pageIn 0.5s ease-out;
}

@keyframes pageIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ========================================
   复古装饰元素
======================================== */

.ornament-line {
  display: flex; align-items: center; gap: 14px;
  width: 100%; max-width: 280px; margin: 0 auto;
}

.ornament-line::before,
.ornament-line::after {
  content: ""; flex: 1; height: 1px;
  background: linear-gradient(to right, transparent, rgba(201,169,110,0.7), transparent);
}

.ornament-diamond {
  width: 7px; height: 7px; background: #c9a96e;
  transform: rotate(45deg); flex-shrink: 0;
  box-shadow: 0 0 8px rgba(201,169,110,0.5);
}

.corner {
  position: absolute; width: 22px; height: 22px;
  border-color: #c9a96e; border-style: solid; border-width: 0;
  opacity: 0.7; pointer-events: none;
}

.corner-tl { top: 0; left: 0; border-top-width: 1px; border-left-width: 1px; }
.corner-tr { top: 0; right: 0; border-top-width: 1px; border-right-width: 1px; }
.corner-bl { bottom: 0; left: 0; border-bottom-width: 1px; border-left-width: 1px; }
.corner-br { bottom: 0; right: 0; border-bottom-width: 1px; border-right-width: 1px; }

/* ========================================
   封面页
======================================== */

.cover-frame {
  position: relative; max-width: 480px; width: 100%; padding: 28px;
  border: 1px solid rgba(201,169,110,0.25); background: rgba(10,8,6,0.6);
  margin: auto 0;
}

.cover-frame::after {
  content: ""; position: absolute; top: 6px; left: 6px; right: 6px; bottom: 6px;
  border: 1px solid rgba(201,169,110,0.12); pointer-events: none;
}

.cover-inner {
  text-align: center; width: 100%; padding: 36px 16px;
  position: relative; z-index: 1;
}

.cover-badge {
  font-size: 11px; letter-spacing: 5px; color: #c9a96e;
  margin-bottom: 28px; text-transform: uppercase; font-weight: 400; opacity: 0.7;
}

.cover-title {
  font-family: "Songti SC", "STSong", "SimSun", serif;
  font-size: 38px; font-weight: 600; line-height: 1.3;
  margin: 24px 0; letter-spacing: 2px; color: #f5f0e8;
  text-shadow: 0 2px 30px rgba(201,169,110,0.25);
  white-space: nowrap;
}

.cover-sub {
  font-size: 15px; color: #8a8078; line-height: 2.2;
  margin: 32px 0 44px 0; letter-spacing: 1px;
}

.btn-primary {
  display: inline-block;
  background: linear-gradient(135deg, #c9a96e, #a8875a);
  color: #0d0b0a; border: 1px solid rgba(255,255,255,0.2);
  padding: 16px 56px; font-size: 17px; font-weight: 600;
  letter-spacing: 3px; border-radius: 50px; cursor: pointer;
  transition: all 0.3s ease; font-family: inherit;
  box-shadow: 0 8px 30px rgba(201,169,110,0.25), inset 0 1px 0 rgba(255,255,255,0.2);
  position: relative;
}

.btn-primary::after {
  content: ""; position: absolute; top: -5px; left: -5px; right: -5px; bottom: -5px;
  border: 1px solid rgba(201,169,110,0.3); border-radius: 60px; pointer-events: none;
}

.btn-primary:active {
  transform: scale(0.96);
  box-shadow: 0 4px 15px rgba(201,169,110,0.2), inset 0 1px 0 rgba(255,255,255,0.2);
}

.btn-secondary {
  display: inline-block; background: transparent; color: #c9a96e;
  border: 1px solid #3a332a; padding: 14px 44px; font-size: 15px;
  letter-spacing: 2px; border-radius: 50px; cursor: pointer;
  transition: all 0.3s ease; font-family: inherit;
  margin-top: 32px; position: relative;
}

.btn-secondary::after {
  content: ""; position: absolute; top: -4px; left: -4px; right: -4px; bottom: -4px;
  border: 1px solid rgba(201,169,110,0.15); border-radius: 55px; pointer-events: none;
}

.btn-secondary:active {
  border-color: #c9a96e; background: rgba(201,169,110,0.08);
}

.cover-note {
  font-size: 12px; color: #5a524a; margin-top: 24px; letter-spacing: 1px;
}

/* ========================================
   题目页
======================================== */

.quiz-header {
  width: 100%; max-width: 520px; margin-bottom: 24px;
}

.quiz-progress-track {
  width: 100%; height: 2px; background: #1a1613;
  border-radius: 2px; overflow: hidden; margin-bottom: 8px; position: relative;
}

.quiz-progress-track::before {
  content: ""; position: absolute; top: -3px; left: 0; width: 100%; height: 1px;
  background: linear-gradient(to right, transparent, rgba(201,169,110,0.3), transparent);
}

.quiz-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #c9a96e, #e8d5a8);
  border-radius: 2px; transition: width 0.4s ease; width: 0%;
}

.quiz-counter {
  font-size: 11px; color: #5a524a; letter-spacing: 2px; text-align: right;
}

.quiz-body {
  width: 100%; max-width: 520px; animation: questionIn 0.35s ease-out;
}

@keyframes questionIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.question-ornament { margin-bottom: 28px; }

.question-text {
  font-family: "Songti SC", "STSong", "SimSun", serif;
  font-size: 22px; line-height: 1.6; margin-bottom: 36px;
  color: #f0ece6; letter-spacing: 0.5px; min-height: 70px; text-align: center;
}

.options-container {
  display: flex; flex-direction: column; gap: 14px;
}

.option-btn {
  display: flex; align-items: flex-start; gap: 14px;
  background: #1a1613; border: 1px solid #2e2721; border-radius: 4px;
  padding: 18px 20px; cursor: pointer; transition: all 0.25s ease;
  text-align: left; width: 100%; font-family: inherit; position: relative;
}

.option-btn::before {
  content: ""; position: absolute; left: -1px; top: 8px; bottom: 8px;
  width: 2px; background: transparent; transition: background 0.25s ease;
}

.option-btn:active {
  border-color: #c9a96e; background: #211b15; transform: scale(0.98);
}

.option-btn:active::before { background: #c9a96e; }

.option-letter {
  font-size: 13px; font-weight: 700; color: #c9a96e;
  min-width: 24px; padding-top: 2px; letter-spacing: 1px; flex-shrink: 0;
}

.option-text {
  font-size: 15px; color: #c9c4bc; line-height: 1.6; letter-spacing: 0.5px;
}

/* ========================================
   结果页
======================================== */

#page-result { padding: 0; }

.result-inner {
  width: 100%; max-width: 480px;
  display: flex; flex-direction: column; align-items: center;
  text-align: center; padding: 32px 20px;
  position: relative; overflow: hidden;
  animation: resultReveal 1.2s ease-out;
  margin: auto 0;
}

@keyframes resultReveal {
  0% { opacity: 0; }
  20% { opacity: 0; }
  100% { opacity: 1; }
}

.result-frame {
  position: relative; width: 100%; padding: 24px;
  border: 1px solid rgba(201,169,110,0.25); background: rgba(10,8,6,0.5);
}

.result-frame::after {
  content: ""; position: absolute; top: 5px; left: 5px; right: 5px; bottom: 5px;
  border: 1px solid rgba(201,169,110,0.12); pointer-events: none;
}

.result-content {
  position: relative; z-index: 1; padding: 24px 10px;
  display: flex; flex-direction: column; align-items: center;
}

.result-label {
  font-size: 12px; letter-spacing: 4px; color: rgba(240,236,230,0.6);
  margin-bottom: 20px; font-weight: 400; text-transform: uppercase;
}

.result-movie {
  font-family: "Songti SC", "STSong", "SimSun", serif;
  font-size: 32px; font-weight: 700; color: #f5f0e8;
  margin: 20px 0 14px 0; letter-spacing: 2px; line-height: 1.4;
  text-shadow: 0 2px 30px rgba(255,255,255,0.15);
}

.result-slogan {
  font-family: "Songti SC", "STSong", "SimSun", serif;
  font-size: 15px; color: #c9a96e; margin: 0 0 28px 0;
  letter-spacing: 1px; font-style: italic; line-height: 1.6;
}

/* ---- 雷达图 ---- */
.result-radar {
  width: 100%; max-width: 320px;
  margin: 8px 0 28px 0;
  display: flex; align-items: center; justify-content: center;
}

.result-radar svg { width: 100%; height: auto; }

.radar-grid {
  fill: none; stroke: rgba(201,169,110,0.25); stroke-width: 0.8;
}

.radar-axis {
  stroke: rgba(201,169,110,0.18); stroke-width: 0.6;
}

.radar-data {
  fill: rgba(201,169,110,0.18);
  stroke: rgba(232,213,168,0.9); stroke-width: 1.5;
}

.radar-point {
  fill: #e8d5a8; stroke: #c9a96e; stroke-width: 1;
}

.radar-label {
  font-size: 11px; fill: #8a8078; letter-spacing: 1px;
  font-family: "PingFang SC", "Noto Sans SC", "Source Han Sans SC", sans-serif;
}

/* ---- 四属性 ---- */
.result-attributes {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  width: 100%; max-width: 340px; margin: 0 0 28px 0;
}

.attribute-item {
  border: 1px solid rgba(201,169,110,0.2); border-radius: 3px;
  padding: 10px 12px; background: rgba(26,22,19,0.6);
  display: flex; flex-direction: column; gap: 4px;
}

.attribute-label {
  font-size: 10px; letter-spacing: 2px; color: #5a524a; text-transform: uppercase;
}

.attribute-value {
  font-family: "Songti SC", "STSong", "SimSun", serif;
  font-size: 15px; color: #e8d5a8; letter-spacing: 1px;
}

/* =========================================
   人物小传 - 古书信札风格
========================================= */
.result-portrait {
  font-family: "Songti SC", "STSong", "SimSun", serif;
  font-size: 15px; color: #d4c9b8; line-height: 2;
  letter-spacing: 0.5px; text-align: left; max-width: 360px;
  border-left: 3px double #c9a96e;   /* 双线加强复古感 */
  padding: 16px 20px;
  margin: 0 0 24px 0;
  background: rgba(201,169,110,0.05);
  position: relative;
  font-style: italic;
}

/* 左上角小装饰 */
.result-portrait::before {
  content: "❝";
  font-size: 28px;
  color: #c9a96e;
  position: absolute;
  top: -6px;
  left: 6px;
  opacity: 0.6;
  font-style: normal;
}

/* 右下角小装饰 */
.result-portrait::after {
  content: "❞";
  font-size: 28px;
  color: #c9a96e;
  position: absolute;
  bottom: -12px;
  right: 6px;
  opacity: 0.6;
  font-style: normal;
}

/* =========================================
   描述段落 - 古籍注疏风格
========================================= */
.result-desc {
  font-size: 14px; color: #b0a89e; line-height: 2;
  letter-spacing: 0.5px; margin: 20px 0; text-align: justify;
  max-width: 360px;
  padding: 16px 20px;
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(201,169,110,0.2);
  border-radius: 2px;
  position: relative;
}

/* 顶部细线装饰 */
.result-desc::before {
  content: "";
  position: absolute;
  top: -6px; left: 20px; right: 20px;
  height: 1px;
  background: linear-gradient(to right, transparent, #c9a96e, transparent);
}

/* 底部细线装饰 */
.result-desc::after {
  content: "";
  position: absolute;
  bottom: -6px; left: 20px; right: 20px;
  height: 1px;
  background: linear-gradient(to right, transparent, #c9a96e, transparent);
}

/* 软肋 - 保持原有样式但略加装饰 */
.result-weakness {
  font-size: 13px; color: #8a8078; line-height: 1.8;
  letter-spacing: 0.5px; text-align: left; max-width: 360px;
  border-top: 1px dashed rgba(201,169,110,0.4); /* 改成虚线，更古典 */
  padding-top: 20px; margin-top: 8px;
  padding-left: 16px;
  position: relative;
}

.result-weakness::before {
  content: "※";
  color: #c9a96e;
  position: absolute;
  left: 0;
  top: 20px;
  font-size: 14px;
}

/* =========================================
   心理学侧写报告 - 羊皮纸卷宗风格
========================================= */
.result-report {
  font-size: 14px; color: #d4c9b8; line-height: 2;
  letter-spacing: 0.3px; text-align: left; max-width: 360px;
  padding: 18px 20px 18px 24px;
  margin: 24px 0;
  position: relative;
  border: 1px solid rgba(201,169,110,0.3);
  background: 
    linear-gradient(135deg, rgba(201,169,110,0.06) 25%, transparent 25%) 0 0 / 16px 16px,
    linear-gradient(225deg, rgba(201,169,110,0.06) 25%, transparent 25%) 0 0 / 16px 16px,
    rgba(20,16,12,0.7);
  box-shadow: inset 0 0 15px rgba(0,0,0,0.4), 0 2px 8px rgba(0,0,0,0.3);
}

/* 左侧竖条，像档案标签 */
.result-report::before {
  display: block;
  font-size: 10px; letter-spacing: 4px;
  color: #c9a96e; margin-bottom: 10px;
  text-transform: uppercase; font-weight: 600;
  border-bottom: 1px solid rgba(201,169,110,0.3);
  padding-bottom: 6px;
  content: attr(data-title);
}

#result-strength::before { content: "优势侧写"; }
#result-shadow::before { content: "阴影侧写"; }

/* 阴影侧写用暗红色调 */
#result-shadow {
  border-color: rgba(138, 80, 60, 0.5);
  background:
    linear-gradient(135deg, rgba(120, 60, 40, 0.1) 25%, transparent 25%) 0 0 / 16px 16px,
    linear-gradient(225deg, rgba(120, 60, 40, 0.1) 25%, transparent 25%) 0 0 / 16px 16px,
    rgba(20,16,12,0.7);
  box-shadow: inset 0 0 15px rgba(0,0,0,0.4), 0 2px 8px rgba(0,0,0,0.3);
}
#result-shadow::before {
  color: #b07d5a;
  border-bottom-color: rgba(138, 80, 60, 0.5);
}

/* 伪元素添加卷角效果 */
.result-report::after {
  content: "";
  position: absolute;
  bottom: 0; right: 0;
  width: 0; height: 0;
  border-style: solid;
  border-width: 0 0 16px 16px;
  border-color: transparent transparent #c9a96e transparent;
  opacity: 0.5;
}

/* =========================================
   导演批注
========================================= */
.result-note {
  font-size: 14px; color: #e8d5a8; line-height: 1.8;
  letter-spacing: 0.5px; text-align: left; max-width: 360px;
  background: rgba(201,169,110,0.08); border: 1px solid rgba(201,169,110,0.25);
  border-radius: 3px; padding: 16px 18px; margin: 24px 0;
  position: relative;
}

.result-note::before {
  content: "导演批注"; display: block; font-size: 10px;
  letter-spacing: 3px; color: #5a524a; margin-bottom: 8px;
  text-transform: uppercase;
}

/* =========================================
   片尾彩蛋
========================================= */
.result-easter {
  font-family: "Songti SC", "STSong", "SimSun", serif;
  font-size: 15px; color: #f0ece6; line-height: 1.8;
  letter-spacing: 1px; text-align: center; max-width: 360px;
  border-top: 1px solid rgba(201,169,110,0.3); border-bottom: 1px solid rgba(201,169,110,0.3);
  padding: 16px 8px; margin: 8px 0 28px 0; font-style: italic;
}

/* 按钮组 */
.result-actions {
  display: flex; gap: 12px; margin: 28px 0 4px 0;
  flex-wrap: wrap; justify-content: center;
}

.btn-action {
  display: inline-block; background: transparent; color: #c9a96e;
  border: 1px solid rgba(201,169,110,0.4); padding: 12px 24px;
  font-size: 14px; letter-spacing: 2px; border-radius: 50px;
  cursor: pointer; transition: all 0.3s ease; font-family: inherit;
}

.btn-action:active {
  background: rgba(201,169,110,0.15); border-color: #c9a96e;
}

.save-hint {
  font-size: 12px; color: #8a8078; letter-spacing: 1px;
  min-height: 20px; margin-bottom: 8px; transition: all 0.3s ease;
}

.save-hint.success { color: #c9a96e; }

.result-theme {
  background: linear-gradient(180deg, var(--color-top) 0%, var(--color-bottom) 100%);
}

.result-theme .ornament-diamond {
  background: #c9a96e; box-shadow: 0 0 10px rgba(201,169,110,0.6);
}

/* =========================================
   响应式
========================================= */
@media (max-width: 480px) {
  .cover-frame { padding: 18px; }
  .cover-title { font-size: 28px; letter-spacing: 1px; }
  .question-text { font-size: 19px; min-height: 60px; }
  .result-movie { font-size: 26px; }
  .option-btn { padding: 15px 16px; border-radius: 3px; }
  .option-text { font-size: 14px; }
  .result-frame { padding: 16px; }
  .result-attributes { gap: 8px; }
  .attribute-item { padding: 8px 10px; }
  .attribute-value { font-size: 14px; }
  .radar-label { font-size: 10px; }
  .btn-action { padding: 10px 18px; font-size: 13px; }
  .result-portrait::before,
  .result-portrait::after { font-size: 22px; }
}

@media (min-width: 768px) {
  .cover-title { font-size: 46px; letter-spacing: 3px; }
  .question-text { font-size: 26px; }
  .option-btn:hover { border-color: #5a4a35; background: #211b15; }
  .option-btn:hover::before { background: #5a4a35; }
  .btn-action:hover { background: rgba(201,169,110,0.1); border-color: #c9a96e; }
}

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2e2721; border-radius: 4px; }