/* =============================================================
   用户端样式（手机/平板/电脑全适配）
   ============================================================= */

.user-body {
  background: var(--bg-user);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- 通用容器 ---------- */
.user-page {
  width: 100%;
  max-width: 540px;
  margin: 0 auto;
  padding: 0 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ---------- 首页（密钥入口） ---------- */
.home-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
  padding: 40px 0;
}
.home-logo { width: 120px; height: 40px; object-fit: contain; }
.home-logo-text {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-dark);
  letter-spacing: 1px;
}
.home-subtitle { font-size: 14px; color: var(--text-disabled); margin-top: -6px; }
.home-key-input {
  margin-top: 24px;
  width: 100%;
  max-width: 360px;
  height: 56px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: #fff;
  padding: 0 20px;
  font-size: 16px;
  text-align: center;
  letter-spacing: 2px;
  text-transform: uppercase;
  outline: none;
  box-shadow: var(--shadow-input);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.home-key-input:focus { border-color: var(--brand); box-shadow: var(--shadow-input), 0 0 0 3px rgba(124,58,237,.12); }
.home-key-input.readonly { color: var(--text-disabled); }
.home-btn {
  margin-top: 20px;
  width: 100%;
  max-width: 360px;
  height: 56px;
}
.home-error {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--danger);
  min-height: 20px;
}
.home-error-icon { width: 16px; height: 16px; flex-shrink: 0; }

/* 空状态 */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  color: var(--text-muted);
  padding: 60px 20px;
}
.empty-state img { width: 200px; height: 200px; object-fit: contain; opacity: 0.85; }
.empty-state h3 { font-size: 18px; color: var(--text-dark); }

/* ---------- 欢迎页 ---------- */
.welcome-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding-top: 20px;
  padding-bottom: 20px;
}
.welcome-cover {
  width: 100%;
  height: 140px;
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: var(--brand-gradient);
}
.welcome-cover img { width: 100%; height: 100%; object-fit: cover; }
.welcome-cover .fallback-char {
  font-size: 64px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
}
.welcome-title { text-align: center; font-size: 24px; font-weight: 700; margin-top: 24px; }
.welcome-desc {
  text-align: center;
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-top: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.welcome-meta {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}
.welcome-meta .tag { padding: 6px 12px; }
.welcome-spacer { flex: 1; }
.welcome-btn {
  width: 100%;
  height: 56px;
  margin-bottom: 10px;
}

/* ---------- 答题页 ---------- */
.quiz-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.quiz-top {
  padding-top: 16px;
  padding-bottom: 12px;
}
.quiz-progress-track {
  height: 4px;
  background: #eae6e0;
  border-radius: 4px;
  overflow: hidden;
}
.quiz-progress-bar {
  height: 100%;
  background: var(--brand-gradient);
  border-radius: 4px;
  transition: width 0.3s ease;
}
.quiz-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  font-size: 13px;
  color: var(--text-muted);
}
.quiz-exit { color: var(--text-muted); border: none; background: none; cursor: pointer; font-size: 13px; }
.quiz-exit:hover { color: var(--text-dark); }

.quiz-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding-top: 8px;
}
.quiz-question-img {
  width: 100%;
  border-radius: var(--radius-md);
  object-fit: cover;
  margin-bottom: 16px;
  max-height: 220px;
}
.quiz-question-text {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.8;
  margin-bottom: 28px;
  word-break: break-word;
}
.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: auto;
  padding-bottom: 20px;
}
.quiz-option {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 58px;
  padding: 14px 18px;
  background: #f5f3ef;
  border-radius: var(--radius-md);
  font-size: 15px;
  text-align: left;
  color: var(--text-dark);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.1s ease, transform 0.1s ease;
  border: 1px solid transparent;
  line-height: 1.5;
}
.quiz-option .option-label {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  background: #e8e4de;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: background 0.15s ease, color 0.15s ease;
}
.quiz-option.selected {
  background: var(--brand-gradient);
  color: #fff;
  box-shadow: 0 8px 20px rgba(124, 58, 237, 0.3);
  transform: scale(1.02);
}
.quiz-option.selected .option-label { background: rgba(255, 255, 255, 0.25); color: #fff; }

/* 消失/出现动画 */
.page-fade-out { animation: fade-out-quiz 0.4s forwards; }
.page-fade-in { animation: fade-in-quiz 0.4s forwards; }
@keyframes fade-out-quiz { from { opacity: 1; } to { opacity: 0; transform: translateY(-8px); } }
@keyframes fade-in-quiz { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* 最后一道题白闪 */
.white-flash {
  position: fixed;
  inset: 0;
  background: #fff;
  z-index: 999;
  opacity: 0;
  pointer-events: none;
}
.white-flash.active { animation: white-flash 0.2s ease forwards; }
@keyframes white-flash {
  0% { opacity: 0; }
  50% { opacity: 1; }
  100% { opacity: 0; }
}

/* ---------- 结果页 ---------- */
.result-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 0 30px;
}
.result-inner {
  width: 100%;
  max-width: 540px;
}
.result-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
  flex-wrap: wrap;
}
.result-actions .btn { flex: 1; min-width: 140px; }

/* 结果容器（截图对象，作者通过 data-screenshot 标记） */
.result-card[data-screenshot],
.result-card.result-container {
  position: relative;
}
