:root {
  --vs-card-bg: transparent;
  --vs-timer-bg: rgba(255,255,255,0.08);
  --vs-timer-fg: #4caf50;
  --vs-timer-text: var(--text-primary);
}

/* 继承 pepWG 视觉：容器、按钮等来自 common.css，这里只做卡片区的补充 */
.vs-card {
  width: 100%;
  max-width: 800px;
  min-height: 240px;
  margin: 20px auto;
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius-xl);
  padding: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background-color: var(--vs-card-bg);
}

.vs-word {
  font-size: 3rem;
  font-weight: bold;
  color: var(--text-primary);
  text-align: center;
}

.vs-meaning {
  font-size: 1.4rem;
  color: var(--text-secondary);
  text-align: center;
}

/* 序号标签 */
.sequence-label {
  font-size: 0.95rem;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 4px;
}

/* 听写倒计时圆环 */
.vs-timer { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.vs-timer-ring {
  --progress: 0%; /* 0% ~ 100% */
  width: 96px; height: 96px; border-radius: 50%;
  background: conic-gradient(var(--vs-timer-fg) var(--progress), rgba(255,255,255,0.14) 0);
  box-shadow: 0 2px 10px rgba(0,0,0,0.35);
  display: grid; place-items: center;
}
.vs-timer-text { color: var(--vs-timer-text); font-weight: 600; }
.hidden { display: none !important; }

/* 按钮区：全宽居中 */
.actions {
  display: flex;
  gap: 20px;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin-top: 16px;
}

/* 选择范围表单：横向排布，间距更友好 */
.selection-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center; /* 居中该行 */
  gap: 16px;
  margin: 8px 0 12px;
}
.selection-form label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.selection-form select {
  padding: 6px 10px;
  border-radius: var(--border-radius);
  border: 2px solid var(--border-light);
  background-color: var(--bg-primary); /* 固定深色背景 */
  color: var(--text-primary);
  font-size: 16px; /* 防止缩放 */
}
.selection-form select option {
  background-color: var(--bg-primary); /* 下拉选项背景统一深色 */
  color: var(--text-primary);
}

#summary-text {
  margin: 12px 0 8px;
}

#mistake-list {
  list-style: none;
  padding-left: 0;
}

#mistake-list li {
  margin: 6px 0;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 6px;
}

/* 听写小结列表样式与冲刺小结保持一致 */
#dictation-list,
#dictation-mistake-list {
  list-style: none;
  padding-left: 0;
}
#dictation-list li,
#dictation-mistake-list li {
  margin: 6px 0;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 6px;
}

/* 打印样式：只打印小结页与错词列表 */
@media print {
  html, body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 12pt;
  }
  .game-header,
  #selection-screen,
  #sprint-screen,
  .actions { /* 不打印按钮 */
    display: none !important;
  }
  #summary-screen {
    display: block !important;
  }
  #summary-screen .level-title {
    color: #000000;
    margin-bottom: 12px;
  }
  #summary-text {
    color: #000000;
    margin-bottom: 8px;
  }
  #mistake-list {
    color: #000000;
  }
  #mistake-list li {
    border: none;
    padding: 2px 0;
  }
  .game-container {
    max-width: none;
    padding: 0;
    margin: 0;
  }
}

/* 移动端响应式优化 */
@media (orientation: portrait) {
  .vs-word {
    font-size: clamp(2.2rem, 6vw, 3.4rem); /* 自适应大字 */
  }
  .vs-meaning {
    font-size: clamp(1.2rem, 4vw, 1.8rem); /* 自适应释义 */
  }
  .vs-card {
    /* 原为 50vh，竖屏占比过大；改为更紧凑的自适应高度 */
    min-height: clamp(200px, 38vh, 360px);
    padding: 20px 16px;
  }
  .actions {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100vw; /* 强制占满视口宽度，避免某些浏览器内层限制 */
    max-width: 100vw;
    padding: 12px 16px calc(env(safe-area-inset-bottom, 0) + 20px);
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    margin: 0;
    z-index: 10;
    justify-content: space-evenly;
    gap: 12px;
    box-sizing: border-box;
  }
  .btn {
    min-height: 48px;
    /* 让按钮按可用空间自适应，不强制44%宽度 */
    min-width: 0;
    flex: 1 1 0;
    padding: 14px 20px;
    touch-action: manipulation;
  }
  .game-container {
    padding-bottom: 100px; /* 避免固定按钮遮挡 */
  }
  .selection-form {
    flex-wrap: wrap;
    justify-content: center;
  }
  .selection-form select {
    font-size: 16px; /* 防止iOS缩放 */
  }
}

/* 超窄屏分档优化，避免溢出 */
@media (orientation: portrait) and (max-width: 380px) {
  .actions { gap: 8px; }
  .btn { padding: 12px 14px; font-size: 1rem; }
}

/* Fallback：若浏览器不支持 fixed，使用 sticky 兜底 */
@supports not (position: fixed) {
  @media (orientation: portrait) {
    .actions { position: sticky; bottom: 0; width: 100%; }
  }
}