* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg-image: url('');
  --bg-color: #eef2f7;
  /* ★ 关键：去掉全局遮罩，完全不遮挡背景图 */
  --bg-overlay: transparent; 
}

body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-color);
  background-image: var(--bg-image);
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-repeat: no-repeat;
  font-family: system-ui, -apple-system, sans-serif;
  padding: 20px;
  position: relative;
  transition: background-image 0.4s ease;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  pointer-events: none;
  z-index: 0;
}

/* ★ 主窗口：改为 40% 不透明度 */
.window {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 640px;
  background: rgba(255, 255, 255, 0.4); /* 40% 不透明 */
  backdrop-filter: blur(4px); /* 降低模糊，让背景图透出来更清晰 */
  -webkit-backdrop-filter: blur(4px);
  border-radius: 24px;
  padding: 40px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15);
  /* 给整个卡片加一个微弱的白色描边，提升立体感 */
  border: 1px solid rgba(255, 255, 255, 0.5);
}

h1 { font-size: 1.6rem; color: #0b1b33; margin-bottom: 8px; }
.tip, .subtip { color: #475569; font-size: 0.9rem; margin-bottom: 20px; }

/* ★ 增强文字在透明背景下的可读性 */
.window h1, 
.window p, 
.window .intro-body,
.window .question p,
.window .option,
.window .survey-card .name,
.window .survey-card .desc,
.window .status-bar,
.window .bank-tab,
.window .tip,
.window .subtip {
  /* 白色描边 + 发光，防止背景图干扰文字 */
  text-shadow: 0 1px 3px rgba(255, 255, 255, 0.9), 
               0 0 10px rgba(255, 255, 255, 0.8);
}

input[type="password"] {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid #cbd5e1;
  border-radius: 12px;
  font-size: 1rem;
  margin-bottom: 12px;
  outline: none;
  transition: 0.2s;
  background: rgba(255, 255, 255, 0.7); /* 输入框微透明 */
}
input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
  background: rgba(255, 255, 255, 0.9);
}

button {
  width: 100%;
  padding: 14px;
  background: #0b1b33;
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s;
  text-shadow: none; /* 按钮文字不需要阴影 */
}
button:hover { background: #1a2f4e; }
button:active { transform: scale(0.98); }
button:disabled { background: #94a3b8; cursor: not-allowed; transform: none; }

.back-btn {
  width: auto;
  padding: 8px 16px;
  font-size: 0.85rem;
  background: #f1f5f9;
  color: #475569;
  font-weight: 500;
  margin-bottom: 20px;
  box-shadow: none;
}
.back-btn:hover { background: #e2e8f0; color: #0b1b33; }

.submit-btn {
  margin-top: 24px;
  background: #3b82f6;
  font-size: 1.05rem;
  padding: 16px;
  box-shadow: 0 10px 25px -8px rgba(59,130,246,0.6);
}
.submit-btn:hover { background: #2563eb; }

.reset-btn {
  margin-top: 20px;
  background: transparent;
  color: #94a3b8;
  font-size: 0.8rem;
  font-weight: 400;
  padding: 8px;
  box-shadow: none;
}
.reset-btn:hover { background: #f1f5f9; color: #64748b; }

/* ===== 简介页 ===== */
.intro-body {
  font-size: 1rem;
  line-height: 1.8;
  color: #334155;
  white-space: pre-line;
  padding: 4px 0;
}

/* ===== 题库浏览页 ===== */
.bank-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.bank-tab {
  padding: 10px 18px;
  background: rgba(241, 245, 249, 0.7);
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #475569;
  cursor: pointer;
  transition: 0.2s;
}
.bank-tab:hover { background: rgba(226, 232, 240, 0.9); }
.bank-tab.active {
  background: #0b1b33;
  color: #fff;
  border-color: #0b1b33;
  text-shadow: none;
}

.bank-content {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 60vh;
  overflow-y: auto;
  padding-right: 6px;
}
.bank-content::-webkit-scrollbar { width: 6px; }
.bank-content::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 8px; }

.bank-question {
  background: rgba(248, 250, 252, 0.7);
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: 14px;
  padding: 16px 18px;
}
.bank-question .q-title {
  font-weight: 600;
  color: #0b1b33;
  margin-bottom: 10px;
}
.bank-option {
  padding: 8px 12px;
  border-radius: 8px;
  color: #475569;
  font-size: 0.92rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.bank-option.correct {
  background: rgba(220, 252, 231, 0.8);
  color: #166534;
  font-weight: 500;
}
.bank-option .score-tag {
  font-size: 0.78rem;
  background: rgba(255, 255, 255, 0.8);
  padding: 2px 8px;
  border-radius: 6px;
  color: #64748b;
}
.bank-option.correct .score-tag {
  background: #22c55e;
  color: #fff;
}
.bank-empty {
  text-align: center;
  color: #94a3b8;
  padding: 30px;
  font-style: italic;
}

/* ===== 问卷列表 ===== */
.survey-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 8px;
}
.survey-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px;
  background: rgba(248, 250, 252, 0.6);
  border: 1.5px solid rgba(226, 232, 240, 0.8);
  border-radius: 16px;
  cursor: pointer;
  transition: 0.2s;
}
.survey-card:hover:not(.locked) {
  border-color: #3b82f6;
  background: rgba(239, 246, 255, 0.8);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -6px rgba(59,130,246,0.25);
}
.survey-card .info { flex: 1; }
.survey-card .name {
  font-size: 1.05rem;
  font-weight: 600;
  color: #0b1b33;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.survey-card .desc {
  font-size: 0.85rem;
  color: #475569;
}
.survey-card .arrow {
  color: #94a3b8;
  font-size: 1.2rem;
  margin-left: 12px;
}
.survey-card.locked {
  cursor: not-allowed;
  opacity: 0.6;
  background: rgba(241, 245, 249, 0.5);
}
.survey-card.locked .name,
.survey-card.locked .desc {
  color: #94a3b8;
}

.badge {
  display: inline-block;
  font-size: 0.72rem;
  padding: 3px 9px;
  border-radius: 6px;
  font-weight: 500;
}
.badge-lock { background: rgba(241, 245, 249, 0.8); color: #64748b; }
.badge-pass { background: rgba(220, 252, 231, 0.9); color: #166534; }
.badge-current { background: rgba(219, 234, 254, 0.9); color: #1e40af; }

.error {
  display: none;
  color: #dc2626;
  font-size: 0.9rem;
  margin-top: 10px;
  padding: 10px;
  background: rgba(254, 226, 226, 0.8);
  border-radius: 10px;
  text-shadow: none;
}
.error.show { display: block; }

.question {
  background: rgba(248, 250, 252, 0.6);
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: 14px;
  padding: 18px;
  margin: 16px 0;
}
.question p { font-weight: 600; color: #0b1b33; margin-bottom: 12px; }

.option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: 0.15s;
}
.option:hover { background: rgba(238, 242, 247, 0.7); }
.option input { accent-color: #0b1b33; }

.status-bar {
  margin-top: 20px;
  padding: 14px 16px;
  background: rgba(241, 245, 249, 0.6);
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: #475569;
}

.dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #22c55e;
  animation: pulse 1.8s infinite;
  flex-shrink: 0;
}
.dot.loading { background: #f59e0b; }
.dot.success { background: #22c55e; }
.dot.fail    { background: #dc2626; animation: none; }

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

/* ===== 弹窗通用（也改为 40% 不透明）===== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4); /* 弹窗背景遮罩稍微淡一点 */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  animation: fadeIn 0.3s;
}
.modal-box {
  background: rgba(255, 255, 255, 0.4); /* ★ 40% 不透明 */
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 20px;
  padding: 40px;
  max-width: 460px;
  width: 90%;
  text-align: center;
  box-shadow: 0 30px 80px rgba(0,0,0,0.2);
  animation: pop 0.3s;
}
.modal-box h2 { font-size: 1.5rem; color: #0b1b33; margin-bottom: 12px; text-shadow: 0 1px 3px rgba(255,255,255,0.9); }
.score {
  font-size: 3rem;
  font-weight: 800;
  color: #3b82f6;
  margin: 16px 0 8px;
  text-shadow: 0 1px 3px rgba(255,255,255,0.9);
}
.score.warn { color: #dc2626; }

.score.perfect {
  background: linear-gradient(135deg, #fbbf24, #f59e0b, #d97706);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 20px rgba(251, 191, 36, 0.6));
  animation: shine 2s infinite;
}
@keyframes shine {
  0%, 100% { filter: drop-shadow(0 4px 20px rgba(251, 191, 36, 0.6)); }
  50%      { filter: drop-shadow(0 4px 30px rgba(251, 191, 36, 0.9)); }
}

.comment {
  font-size: 1.15rem;
  font-weight: 600;
  color: #0b1b33;
  line-height: 1.6;
  padding: 14px 18px;
  background: rgba(239, 246, 255, 0.7);
  border-radius: 12px;
  border-left: 4px solid #3b82f6;
  margin: 12px 0 18px;
  text-align: left;
  text-shadow: 0 1px 3px rgba(255,255,255,0.9);
}
.comment.warn {
  background: rgba(254, 242, 242, 0.7);
  border-left-color: #dc2626;
  color: #7f1d1d;
}

.msg {
  color: #475569;
  margin-bottom: 24px;
  line-height: 1.6;
  font-size: 0.95rem;
  text-shadow: 0 1px 3px rgba(255,255,255,0.9);
}
.modal-box > button {
  width: auto;
  padding: 12px 36px;
  margin: 0 auto;
  display: inline-block;
}

.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 12px;
}
.modal-actions button { flex: 1; }
.btn-secondary {
  background: rgba(241, 245, 249, 0.8);
  color: #475569;
  box-shadow: none;
}
.btn-secondary:hover { background: rgba(226, 232, 240, 0.9); color: #0b1b33; }

.study-text {
  font-size: 1.05rem;
  color: #0b1b33;
  line-height: 1.7;
  padding: 18px 20px;
  background: rgba(240, 249, 255, 0.7);
  border-radius: 12px;
  border-left: 4px solid #0ea5e9;
  margin: 8px 0 20px;
  text-align: left;
  white-space: pre-line;
  text-shadow: 0 1px 3px rgba(255,255,255,0.9);
}

.modal-reward { max-width: 520px; }
.reward-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}
.reward-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 18px 12px;
  background: rgba(248, 250, 252, 0.6);
  border: 2px solid rgba(226, 232, 240, 0.8);
  border-radius: 14px;
  cursor: pointer;
  transition: 0.25s;
  text-align: center;
}
.reward-item:hover {
  border-color: #fbbf24;
  background: rgba(255, 251, 235, 0.8);
  transform: translateY(-3px);
  box-shadow: 0 12px 30px -8px rgba(251, 191, 36, 0.5);
}
.reward-icon {
  font-size: 2.2rem;
  line-height: 1;
}
.reward-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: #0b1b33;
  text-shadow: 0 1px 3px rgba(255,255,255,0.9);
}
.reward-desc {
  font-size: 0.75rem;
  color: #475569;
  line-height: 1.3;
  text-shadow: 0 1px 3px rgba(255,255,255,0.9);
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop {
  from { transform: scale(0.9); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

.hidden { display: none !important; }
/* ★ 奖励文案区 */
.reward-text {
  font-size: 1.05rem;
  color: #0b1b33;
  line-height: 1.8;
  padding: 20px 22px;
  background: rgba(255, 251, 235, 0.7);
  border-radius: 12px;
  border-left: 4px solid #fbbf24;
  margin: 8px 0 20px;
  text-align: left;
  white-space: pre-line;
  text-shadow: 0 1px 3px rgba(255, 255, 255, 0.9);
}