* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

:root {
  --bg: #f4f1fb;
  --card: #ffffff;
  --line: #e7e1f5;
  --soft: #f6f3fd;
  --primary: #6f5bc4;
  --primary-2: #8b78d8;
  --text: #251f45;
  --text-2: #5d5780;
  --text-3: #9690b3;
  --radius: 20px;
}

html, body {
  background: linear-gradient(180deg, #f7f5fd 0%, var(--bg) 40%, #ece6f8 100%);
  background-attachment: fixed;
  color: var(--text);
  font-family: -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100%;
}

#app { max-width: 520px; margin: 0 auto; padding: 0 16px; }

.screen {
  display: none;
  flex-direction: column;
  gap: 14px;
  min-height: 100vh;
  min-height: 100dvh;
  padding: calc(20px + env(safe-area-inset-top)) 0 calc(24px + env(safe-area-inset-bottom));
  animation: fade 0.35s ease;
}
.screen.active { display: flex; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 4px 18px rgba(111, 91, 196, 0.06);
}

.eyebrow { color: var(--primary); font-size: 14px; font-weight: 600; letter-spacing: 1px; }
.muted { color: var(--text-3); }
.footnote { text-align: center; color: var(--text-3); font-size: 12px; margin-top: 6px; }

.seal {
  width: 56px; height: 56px; margin: 14px auto 6px;
  display: flex; align-items: center; justify-content: center;
  font-family: "Songti SC", "STSong", serif;
  font-size: 28px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--primary-2), var(--primary));
  border-radius: 14px;
  box-shadow: 0 6px 16px rgba(111, 91, 196, 0.3);
}

/* 按钮 */
.btn-primary {
  width: 100%; padding: 15px;
  font-size: 17px; font-weight: 600; letter-spacing: 2px; color: #fff;
  background: linear-gradient(135deg, var(--primary-2), var(--primary));
  border: none; border-radius: 999px;
  box-shadow: 0 8px 20px rgba(111, 91, 196, 0.28);
  cursor: pointer; font-family: inherit;
  transition: transform 0.15s;
}
.btn-primary:active { transform: scale(0.97); }
.btn-ghost {
  background: var(--card); border: 1px solid var(--line); color: var(--text-2);
  padding: 9px 20px; border-radius: 999px; font-size: 14px; cursor: pointer; font-family: inherit;
}

/* 封面 */
.intro-card { padding: 32px 20px 22px; text-align: center; }
.app-icon {
  width: 76px; height: 76px; margin: 0 auto 20px;
  display: flex; align-items: center; justify-content: center;
  font-family: "Songti SC", "STSong", serif; font-size: 38px; font-weight: 900; color: #f3dfa8;
  background: linear-gradient(145deg, #7d68d3, #5a45ad);
  border-radius: 22px;
  box-shadow: 0 12px 28px rgba(90, 69, 173, 0.35);
}
.intro-title { font-size: 28px; line-height: 1.4; font-weight: 800; letter-spacing: 1px; }
.intro-title em { font-style: normal; color: var(--primary-2); }
.intro-en { margin: 10px 0 16px; font-size: 11px; letter-spacing: 3px; font-weight: 600; color: var(--primary-2); }
.intro-sub { color: var(--text-2); font-size: 14px; line-height: 1.9; margin-bottom: 20px; }
.intro-sub b { color: var(--primary); }

.feature-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.feature {
  display: flex; flex-direction: column; gap: 4px; padding: 16px 8px;
  background: #fff; border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 4px 14px rgba(111, 91, 196, 0.06);
}
.feature b { font-size: 18px; color: var(--primary); }
.feature > span { font-size: 12px; color: var(--text-3); }

.notice {
  text-align: left; padding: 14px 16px; margin-bottom: 16px;
  background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--primary);
  border-radius: 14px;
}
.notice-title { font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.notice ul { list-style: none; }
.notice li { font-size: 13px; line-height: 1.8; color: var(--text-2); padding-left: 12px; position: relative; }
.notice li::before { content: "·"; position: absolute; left: 0; color: var(--primary); font-weight: 700; }

.btn-outline {
  width: 100%; margin-top: 10px; padding: 14px;
  font-size: 15px; font-weight: 600; color: var(--text-2); font-family: inherit;
  background: #fff; border: 1.5px solid var(--line); border-radius: 999px; cursor: pointer;
}
.btn-outline:active { background: var(--soft); }

.panel .dim-chips { margin: 12px 0; }
.how-list { padding-left: 20px; color: var(--text-2); font-size: 14px; line-height: 1.9; margin-bottom: 8px; }
.how-list b { color: var(--text); }
.small { font-size: 12px; color: var(--text-3); }


/* 访问验证页 */
.lock-screen { justify-content: center; }
.lock-card { padding: 40px 24px 36px; text-align: center; border-radius: 28px; box-shadow: 0 20px 50px rgba(111, 91, 196, 0.12); }
.lock-icon {
  width: 84px; height: 84px; margin: 0 auto 22px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(145deg, #7d68d3, #5a45ad);
  border-radius: 24px;
  box-shadow: 0 14px 30px rgba(90, 69, 173, 0.35);
}
.lock-en { font-size: 11px; font-weight: 700; letter-spacing: 3px; color: #8b84b8; margin-bottom: 18px; }
.lock-title { font-size: 26px; font-weight: 800; letter-spacing: 2px; margin-bottom: 12px; }
.lock-sub { font-size: 13px; line-height: 1.7; color: var(--text-3); margin-bottom: 24px; }
.lock-input {
  width: 100%; height: 64px; text-align: center;
  font-size: 26px; letter-spacing: 12px; text-indent: 12px; font-family: inherit; color: var(--text);
  background: #fff; border: 1.5px solid var(--line); border-radius: 18px; outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.lock-input::placeholder { color: #b5b0cc; letter-spacing: 8px; font-size: 20px; }
.lock-input:focus { border-color: var(--primary-2); box-shadow: 0 0 0 4px rgba(139, 120, 216, 0.15); }
.lock-input.error { border-color: #e06c75; animation: shake 0.35s; }
@keyframes shake { 0%, 100% { transform: none; } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.lock-msg { min-height: 20px; margin: 10px 0 6px; font-size: 13px; color: #d9534f; }
.lock-btn { border-radius: 18px; padding: 18px; font-size: 18px; }
.lock-btn:disabled { opacity: 0.7; }

.dim-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 26px; }
.chip, .tag {
  padding: 5px 14px; font-size: 13px; font-weight: 600; color: var(--primary);
  background: var(--soft); border: 1px solid var(--line); border-radius: 999px;
}
.intro-tip { margin-top: 14px; font-size: 12px; color: var(--text-3); }

/* 答题：整页铺满，顶部进度卡 + 下方题目卡 */
#screen-quiz { gap: 16px; }
.quiz-head { padding: 16px 18px 18px; border-radius: 22px; }
.progress-info { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.q-cat { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; color: var(--primary); }
.q-cat-icon {
  width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center;
  font-style: normal; font-size: 12px; font-weight: 800; color: #fff;
  font-family: "Songti SC", "STSong", serif;
  background: linear-gradient(135deg, var(--primary-2), var(--primary)); border-radius: 7px;
}
.q-count { font-size: 15px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.q-count b { color: var(--primary); margin-left: 6px; }
.progress-bar { height: 10px; background: #e6e0f5; border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; width: 0; min-width: 10px; background: linear-gradient(90deg, var(--primary-2), var(--primary)); border-radius: 999px; transition: width 0.35s ease; }

.quiz-card {
  flex: 1; display: flex; flex-direction: column;
  padding: 24px 18px 20px; border-radius: 26px;
}
.q-cat-sm { font-size: 14px; margin-bottom: 14px; }
.question-text { font-size: 21px; line-height: 1.6; font-weight: 800; margin-bottom: 24px; }

/* 选项：无论 3 个还是 4 个，都是整行横条，并撑满剩余高度 */
.options { flex: 1; display: flex; flex-direction: column; gap: 14px; }
.option {
  flex: 1; display: flex; align-items: center; gap: 16px;
  width: 100%; min-height: 76px; max-height: 120px; text-align: left; padding: 16px 20px;
  background: #f8f6fe; border: 1.5px solid var(--line); border-radius: 20px;
  color: var(--text); font-family: inherit; cursor: pointer;
  transition: background 0.18s, border-color 0.18s, box-shadow 0.18s, transform 0.12s;
}
.option:active { transform: scale(0.985); }
.option-radio {
  flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid #c9bfee; background: #fff; position: relative; transition: all 0.18s;
}
.option-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.option-text { font-size: 16px; font-weight: 700; line-height: 1.45; }
.option-sub { font-size: 13px; color: var(--text-3); }
.option.selected { background: #efeafc; border-color: var(--primary); box-shadow: 0 6px 16px rgba(111, 91, 196, 0.16); }
.option.selected .option-radio { border-color: var(--primary); }
.option.selected .option-radio::after {
  content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--primary);
}

.options.layout-4 { gap: 12px; }

.quiz-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 22px; }
.quiz-hint { font-size: 13px; color: var(--text-3); text-align: center; }
.btn-nav {
  flex-shrink: 0; padding: 12px 18px; font-size: 15px; font-weight: 600; font-family: inherit;
  color: var(--text-2); background: #fff; border: 1.5px solid var(--line); border-radius: 16px; cursor: pointer;
}
.btn-nav:disabled { color: #cfc9e3; border-color: #efebf8; cursor: default; }
.btn-nav:not(:disabled):active { background: var(--soft); }

/* 结果页 */
.hero { padding: 26px 18px 18px; text-align: center; }
.hero-pct { font-size: 56px; font-weight: 800; color: var(--primary); line-height: 1.1; margin-top: 4px; }
.hero-pct span { font-variant-numeric: tabular-nums; }
.hero-name { font-family: "Songti SC", "STSong", serif; font-size: 36px; font-weight: 900; letter-spacing: 4px; margin-top: 2px; }
.hero-dyn { color: var(--text-2); font-size: 14px; margin: 6px 0 14px; }
.tags { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.pill {
  display: inline-block; padding: 6px 16px; font-size: 13px; font-weight: 600; color: var(--primary);
  background: #efeafc; border-radius: 999px; margin-bottom: 16px;
}
.box { text-align: left; background: var(--soft); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; }
.box-title { color: var(--primary); font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.box-text { font-size: 15px; line-height: 1.7; }

.section { padding: 20px 18px; }
.sec-title { font-size: 18px; font-weight: 700; margin-bottom: 14px; }
.sec-text { color: var(--text-2); font-size: 15px; line-height: 1.9; text-align: justify; }
.sec-works { margin-top: 12px; font-size: 13px; color: var(--text-2); display: flex; gap: 10px; }
.sec-works span:first-child { color: var(--primary); font-weight: 700; flex-shrink: 0; }

.legend { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-3); margin: -4px 0 12px; }
.lg { display: inline-block; width: 14px; height: 6px; border-radius: 3px; }
.lg-you { background: var(--primary); }
.lg-poet { width: 3px; height: 12px; background: #e0a43a; margin-left: 10px; }
.bars { display: flex; flex-direction: column; gap: 14px; }
.bar-row { display: grid; grid-template-columns: 40px 1fr 32px; align-items: center; gap: 12px; font-size: 14px; color: var(--text-2); }
.bar-track { position: relative; height: 10px; background: #efeafc; border-radius: 999px; }
.bar-fill { height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--primary-2), var(--primary)); transition: width 0.8s ease; }
.bar-mark { position: absolute; top: -3px; width: 3px; height: 16px; background: #e0a43a; border-radius: 2px; transform: translateX(-50%); }
.bar-val { text-align: right; font-weight: 700; color: var(--primary); font-variant-numeric: tabular-nums; }

.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mini {
  background: var(--soft); border: 1px solid var(--line); border-radius: 14px; padding: 12px;
}
.mini-title { font-size: 13px; font-weight: 700; margin-bottom: 6px; color: var(--text); }
.mini-text { font-size: 13px; line-height: 1.7; color: var(--text-2); }
.stack { display: flex; flex-direction: column; gap: 10px; }

.other-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  background: var(--soft); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 10px;
}
.other-item:last-child { margin-bottom: 0; }
.other-seal {
  width: 36px; height: 36px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  font-family: "Songti SC", "STSong", serif; font-weight: 700; color: var(--primary);
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
}
.other-info { flex: 1; min-width: 0; }
.other-name { font-size: 15px; font-weight: 700; }
.other-dyn { font-size: 12px; color: var(--text-3); }
.other-pct { font-size: 16px; font-weight: 800; color: var(--primary); }

.poem-card { text-align: center; background: linear-gradient(180deg, #fff, #f6f2ff); }
.poem-card .sec-title { text-align: left; }
.poem {
  font-family: "Songti SC", "STSong", "Noto Serif SC", serif;
  font-size: 22px; line-height: 1.8; font-weight: 700; letter-spacing: 2px;
  padding: 10px 6px 6px;
}
.poem-src { color: var(--text-3); font-size: 13px; margin-top: 6px; }

/* 窄屏：三列卡片改单列 */
@media (max-width: 420px) {
  .grid3 { grid-template-columns: 1fr; }
}
@media (max-height: 680px) {
  .question-text { font-size: 18px; }
  .options.layout-4 .option { min-height: 96px; }
}
