/* ============================================================
   前端公共样式 · 英语启蒙（幼儿产品）
   规范：Flex/Grid、禁用 Table、深度分离、响应式
   原则：大、少、卡、夸 —— 大按钮大字号、元素随屏幕放大
   ============================================================ */
:root {
  --bg: #FFF8EC;
  --card: #FFFFFF;
  --main: #5B8DEF;
  --main-dark: #3E6FD0;
  --warm: #F8B84E;
  --warm-dark: #E09E2A;
  --green: #52C41A;
  --red: #EA6668;
  --text: #2B2B2B;
  --text2: #8A8578;
  --radius-lg: 28px;
  --radius-md: 20px;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { font-size: 16px; }
body {
  font-family: 'PingFang SC', 'Roboto', 'Segoe UI', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }

.page {
  max-width: 900px;
  margin: 0 auto;
  padding: 18px 20px 40px;
  min-height: 100vh;
}

/* ---------- 通用组件 ---------- */

/* 大圆按钮（幼儿手指友好，≥ 60px） */
.btn-round {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 60px;
  padding: 14px 34px;
  border-radius: 40px;
  font-size: 20px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: transform .12s ease;
  color: #fff;
}
.btn-round:active { transform: scale(0.95); }

.btn-again { background: var(--warm); color: #fff; }
.btn-next { background: var(--main); color: #fff; }

/* 空状态 */
.empty-tip {
  text-align: center;
  color: var(--text2);
  font-size: 16px;
  padding: 40px 20px;
}

/* ---------- 通用工具类 ---------- */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }

/* ---------- 自定义弹窗（替代 alert/confirm，儿童风格） ---------- */
.dlg-overlay {
  position: fixed;
  inset: 0;
  background: rgba(43, 43, 43, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 24px;
}
.dlg-box {
  background: #fff;
  border-radius: 28px;
  max-width: 420px;
  width: 100%;
  padding: 30px 26px 24px;
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.22);
  border: 4px solid #FDE7B8;
  animation: dlgIn .25s ease;
}
@keyframes dlgIn {
  from { transform: scale(0.88); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.dlg-title {
  font-size: 21px;
  font-weight: 800;
  color: var(--text);
  text-align: center;
}
.dlg-body {
  font-size: 17px;
  color: #555;
  line-height: 1.7;
  text-align: center;
  margin-top: 12px;
  word-break: break-all;
  white-space: pre-line;
}
.dlg-actions {
  display: flex;
  gap: 14px;
  margin-top: 24px;
}
.dlg-btn {
  flex: 1;
  min-height: 54px;
  border: none;
  border-radius: 30px;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  background: #F0EDE4;
  color: #555;
  transition: transform .12s ease;
}
.dlg-btn:active { transform: scale(0.96); }
.dlg-btn.dlg-primary { background: var(--main); color: #fff; }
.dlg-btn.dlg-danger { background: var(--red); color: #fff; }
