/* 基础重置与全局变量 */
:root {
  --bg-color: #F0F8FF;
  --accent: #FF9800;
  --accent-hover: #e68900;
  --success: #4caf50;
  --success-hover: #388e3c;
  --text-primary: #2c3e50;
  --text-secondary: #607d8b;
  --white: #ffffff;
  --border-light: #e0e0e0;
  --shadow-card: 0 6px 16px rgba(0, 0, 0, 0.08);
  --shadow-btn: 0 4px 12px rgba(255, 152, 0, 0.3);
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

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

body {
  font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#app {
  width: 100vw;
  height: 100vh;
  position: relative;
  overflow: hidden;
}

/* 顶部状态栏 */
#top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 68px;
  background: var(--white);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  z-index: 100;
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 18px;
}

.btn-icon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #f5f5f5;
  border: none;
  font-size: 24px;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.1s;
  flex-shrink: 0;
}

.btn-icon:hover { background: #e8e8e8; }
.btn-icon:active { transform: scale(0.94); }

.progress-wrap {
  flex: 1;
  height: 16px;
  background: #e8e8e8;
  border-radius: 8px;
  overflow: hidden;
}

.progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  border-radius: 8px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.stats-row {
  display: flex;
  gap: 18px;
  font-weight: 700;
  color: var(--text-primary);
  font-size: 17px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* 主游戏区域 */
#game {
  width: 100%;
  height: 100%;
  padding-top: 68px;
  position: relative;
}

.screen {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px;
  position: absolute;
  top: 0;
  left: 0;
  transition: opacity 0.3s ease;
}

.hidden {
  display: none !important;
}

/* 卡片与内容区 */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-card);
  width: 100%;
  max-width: 760px;
  text-align: center;
  margin-bottom: 32px;
  border: 2px solid transparent;
}

.q-text {
  font-size: 26px;
  line-height: 1.6;
  color: var(--text-primary);
  font-weight: 600;
}

.options-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  width: 100%;
  max-width: 760px;
}

.feedback-panel {
  margin-top: 28px;
  padding: 22px;
  background: #fff3e0;
  border-radius: 16px;
  width: 100%;
  max-width: 760px;
  text-align: center;
  border: 2px solid #ffe0b2;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 按钮样式 */
.btn, .btn-opt {
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-weight: 700;
  transition: all 0.15s ease;
  font-family: inherit;
  outline: none;
  user-select: none;
}

.btn:active, .btn-opt:active {
  transform: scale(0.97);
}

.btn-lg {
  padding: 20px 60px;
  background: var(--accent);
  color: var(--white);
  font-size: 26px;
  box-shadow: var(--shadow-btn);
}

.btn-lg:hover {
  background: var(--accent-hover);
  box-shadow: 0 6px 18px rgba(255, 152, 0, 0.4);
}

.btn-md {
  padding: 16px 40px;
  background: var(--success);
  color: var(--white);
  font-size: 20px;
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.btn-md:hover { background: var(--success-hover); }

.btn-opt {
  padding: 22px 18px;
  background: var(--white);
  color: var(--text-primary);
  border: 2px solid var(--border-light);
  font-size: 22px;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-opt:hover {
  border-color: var(--accent);
  background: #fff8e1;
  transform: translateY(-3px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.btn-opt.correct {
  background: #e8f5e9;
  border-color: var(--success);
  color: #2e7d32;
}

.btn-opt.wrong {
  background: #ffebee;
  border-color: #ef5350;
  color: #c62828;
}

/* 排版与装饰 */
.title-main {
  color: var(--text-primary);
  font-size: 44px;
  margin-bottom: 18px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.04);
}

.desc-text {
  color: var(--text-secondary);
  font-size: 20px;
  margin-bottom: 44px;
  text-align: center;
  max-width: 500px;
  line-height: 1.5;
}

.title-end {
  color: var(--text-primary);
  font-size: 38px;
  margin-bottom: 24px;
}

.score-big {
  color: var(--accent);
  font-size: 60px;
  font-weight: 800;
  margin-bottom: 18px;
}

.stars {
  font-size: 52px;
  margin-bottom: 24px;
  letter-spacing: 6px;
}

.msg-encourage {
  color: var(--success);
  font-size: 24px;
  margin-bottom: 40px;
  font-weight: 600;
}

/* 响应式适配（课堂大屏 & 移动端） */
@media (min-width: 1200px) {
  .options-grid { gap: 24px; }
  .btn-opt { font-size: 24px; padding: 26px; }
  .q-text { font-size: 30px; }
  .title-main { font-size: 52px; }
  .card { padding: 40px; }
}

@media (max-width: 768px) {
  #top-bar { height: 58px; padding: 0 14px; gap: 12px; }
  .stats-row { font-size: 14px; gap: 12px; }
  .progress-wrap { height: 12px; }
  .screen { padding: 18px; }
  .card { padding: 22px; border-radius: 16px; margin-bottom: 24px; }
  .options-grid { grid-template-columns: 1fr; gap: 14px; }
  .btn-opt { font-size: 19px; padding: 18px; min-height: 60px; }
  .title-main { font-size: 34px; }
  .desc-text { font-size: 17px; margin-bottom: 32px; }
  .btn-lg { padding: 16px 44px; font-size: 22px; }
  .q-text { font-size: 22px; }
}