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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  background-color: #E0F7FA;
  color: #333;
  -webkit-font-smoothing: antialiased;
}

#app {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px;
}

#game {
  width: 100%;
  max-width: 480px;
  height: 100%;
  max-height: 800px;
  background: #ffffff;
  border-radius: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* 屏幕切换 */
.screen {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: #ffffff;
  z-index: 1;
}

.screen.active {
  display: flex;
  z-index: 2;
}

/* 开始界面 */
.title-main {
  font-size: 2.2rem;
  color: #FF9800;
  text-align: center;
  margin-bottom: 12px;
  font-weight: 800;
  letter-spacing: 1px;
}

.title-sub {
  font-size: 1rem;
  color: #666;
  text-align: center;
  margin-bottom: 40px;
  line-height: 1.6;
  max-width: 90%;
}

/* 按钮通用样式 */
.btn {
  border: none;
  cursor: pointer;
  font-weight: bold;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  border-radius: 16px;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  outline: none;
}

.btn:active {
  transform: scale(0.96);
}

.btn-lg {
  padding: 16px 32px;
  font-size: 1.4rem;
  width: 85%;
  max-width: 300px;
}

.btn-sm {
  padding: 10px 20px;
  font-size: 1rem;
}

.btn-accent {
  background: #FF9800;
  color: #fff;
  box-shadow: 0 5px 0 #E65100;
}

.btn-accent:active {
  box-shadow: 0 2px 0 #E65100;
  transform: translateY(3px) scale(0.98);
}

.btn-outline {
  background: transparent;
  border: 2px solid #ccc;
  color: #666;
}

.btn-outline:active {
  background: #f5f5f5;
}

/* 游戏主界面 */
#screen-play {
  justify-content: flex-start;
  padding-top: 16px;
}

.hud {
  display: flex;
  justify-content: space-between;
  width: 100%;
  padding: 0 16px;
  margin-bottom: 12px;
}

.hud-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #f0f4f8;
  padding: 8px 16px;
  border-radius: 12px;
  min-width: 80px;
}

.hud-label {
  font-size: 0.8rem;
  color: #888;
  margin-bottom: 2px;
}

.hud-num {
  font-size: 1.5rem;
  font-weight: bold;
  color: #333;
}

/* 倒计时条 */
.timer-track {
  width: 100%;
  height: 12px;
  background: #e0e0e0;
  border-radius: 6px;
  margin-bottom: 20px;
  overflow: hidden;
}

.timer-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #4CAF50, #8BC34A);
  border-radius: 6px;
  transition: width 0.1s linear;
}

/* 答题区域 */
.play-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0 16px;
  gap: 24px;
}

.question-card {
  text-align: center;
}

.q-hint {
  font-size: 1rem;
  color: #666;
  margin-bottom: 10px;
}

.q-char {
  font-size: 4rem;
  font-weight: bold;
  color: #FF9800;
  background: #FFF3E0;
  width: 100px;
  height: 100px;
  line-height: 100px;
  border-radius: 20px;
  margin: 0 auto;
  box-shadow: 0 6px 16px rgba(255, 152, 0, 0.25);
  border: 3px solid #FFE0B2;
}

/* 选项网格 */
.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  width: 100%;
}

.options-grid button {
  background: #fff;
  border: 2px solid #E0E0E0;
  border-radius: 16px;
  padding: 16px 8px;
  font-size: 1.1rem;
  color: #333;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.06);
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-weight: 500;
  touch-action: manipulation;
}

.options-grid button:hover {
  border-color: #FF9800;
  background: #FFF8E1;
}

.options-grid button:active {
  transform: scale(0.97);
  background: #FFE0B2;
}

.options-grid button.correct {
  background: #C8E6C9;
  border-color: #4CAF50;
  color: #2E7D32;
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.3);
}

.options-grid button.wrong {
  background: #FFCDD2;
  border-color: #F44336;
  color: #C62828;
  box-shadow: 0 0 0 3px rgba(244, 67, 54, 0.3);
}

.play-footer {
  width: 100%;
  padding: 16px;
  display: flex;
  justify-content: center;
  margin-top: auto;
}

/* 结算界面 */
.result-title {
  font-size: 2rem;
  color: #333;
  margin-bottom: 24px;
  font-weight: 800;
}

.result-panel {
  background: #f8f9fa;
  border-radius: 20px;
  padding: 24px;
  width: 100%;
  margin-bottom: 32px;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.05);
}

.res-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px dashed #ddd;
}

.res-row:last-child {
  border-bottom: none;
}

.res-label {
  font-size: 1.1rem;
  color: #666;
}

.res-val {
  font-size: 1.8rem;
  font-weight: bold;
  color: #FF9800;
}

/* 响应式适配 */
@media (max-width: 480px) {
  #app { padding: 0; }
  #game {
    max-width: 100%;
    max-height: 100%;
    border-radius: 0;
    box-shadow: none;
  }
  .q-char {
    font-size: 3.5rem;
    width: 85px;
    height: 85px;
    line-height: 85px;
  }
  .options-grid button {
    font-size: 1rem;
    padding: 14px 6px;
    min-height: 56px;
  }
  .title-main { font-size: 1.8rem; }
}