/* =========================================================
 * 词族对打 · style.css
 * iPad / 手机优先，按钮大、字大、少干扰
 * ========================================================= */
:root{
  --blue:#2b7fff; --blue-d:#1a5fd8;
  --ink:#1f2430; --sub:#6b7280; --line:#e7ebf2; --bg:#f5f8fd;
  --green:#16a34a; --amber:#f5961d; --purple:#8b5cf6;
  --r:20px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
*{box-sizing:border-box; margin:0; padding:0; -webkit-tap-highlight-color:transparent;}
html,body{height:100%; max-width:100%; overflow-x:hidden;}
body{
  font-family:"Segoe UI","PingFang SC","Microsoft YaHei",-apple-system,system-ui,sans-serif;
  background:var(--bg); color:var(--ink);
  -webkit-text-size-adjust:100%;
  overscroll-behavior-y:none;
}
button{font-family:inherit; cursor:pointer; border:0; background:none; color:inherit;
  touch-action:manipulation;}
[hidden]{display:none !important;}

.app{
  max-width:820px; margin:0 auto;
  min-height:100vh; min-height:100dvh;
  display:flex; flex-direction:column;
  padding:0 16px calc(14px + var(--safe-b));
}
.view{flex:1 1 auto; display:flex; flex-direction:column; min-height:0;}

/* ---------- 顶栏 ---------- */
.hd{
  display:flex; align-items:center; gap:10px;
  padding:16px 2px 12px;
}
.hd-l{flex:1 1 0; min-width:0;}
.hd h1{font-size:22px; font-weight:800; letter-spacing:.3px; color:#2b3a66;}
.hd .sub{font-size:13px; color:var(--sub); margin-top:3px; font-weight:600;}
.hd-duel{padding:14px 2px 6px;}
.hd-c{flex:1 1 0; text-align:center; font-size:17px; font-weight:800; color:#2b3a66;}
.btn-ico{
  flex:0 0 auto; width:44px; height:44px; border-radius:14px;
  background:#fff; border:1px solid var(--line);
  font-size:18px; font-weight:800; color:#4a5568;
  display:flex; align-items:center; justify-content:center;
  transition:transform .12s;
}
.btn-ico:active{transform:scale(.93);}
.btn-ico.chip{
  width:auto; min-width:44px; padding:0 12px;
  font-size:15px; color:var(--blue); border-color:#dbe7ff; background:#eef4ff;
}

/* ---------- 难度段选 ---------- */
.modeRow{
  display:flex; align-items:center; gap:10px; margin:2px 0 14px;
}
.modeRow + .modeRow{margin-top:-6px;}
.modeTxt{font-size:13px; font-weight:800; color:var(--sub); flex:0 0 auto;}
.seg{
  flex:1 1 0; display:flex; gap:4px; padding:4px;
  background:#eaf0f9; border-radius:14px;
}
.seg button{
  flex:1 1 0; padding:9px 4px; border-radius:11px;
  font-size:13.5px; font-weight:800; color:#64748b;
  transition:background .15s, color .15s;
  white-space:nowrap;
}
.seg button.on{background:#fff; color:var(--blue); box-shadow:0 1px 3px rgba(30,60,120,.12);}

/* ---------- 词族卡 ---------- */
.famList{display:flex; flex-direction:column; gap:12px;}
.famCard{
  display:block; width:100%; text-align:left;
  background:#fff; border:1px solid var(--line); border-radius:var(--r);
  padding:16px 18px 15px;
  border-left:6px solid var(--c,var(--blue));
  transition:transform .12s, box-shadow .15s;
  box-shadow:0 2px 10px rgba(30,60,120,.04);
}
.famCard:active{transform:scale(.985);}
.fcTop{display:flex; align-items:center; justify-content:space-between; gap:10px;}
.fcTag{font-size:20px; font-weight:800; color:var(--c,var(--blue)); letter-spacing:.3px;}
.fcGo{font-size:13px; font-weight:800; color:var(--sub);}
.fcWords{display:flex; flex-wrap:wrap; gap:7px; margin-top:11px;}
.fcWords span{
  font-size:15px; font-weight:700; color:#3d4a63;
  background:#f3f6fb; border:1px solid #e8eef8;
  padding:5px 11px; border-radius:9px;
}

.foot{
  margin-top:auto; padding:18px 4px 6px;
  font-size:12.5px; color:#94a3b8; text-align:center; line-height:1.6;
}

/* 4 招流程 */
.flow{
  margin-top:16px; padding:14px 16px;
  background:#eef3fb; border-radius:16px;
}
.flowT{font-size:12.5px; font-weight:800; color:#8598b5; letter-spacing:.5px;}
.flowList{display:flex; flex-wrap:wrap; gap:8px; margin-top:9px;}
.flowList span{
  font-size:13.5px; font-weight:700; color:#4a5d7a;
  background:#fff; border-radius:9px; padding:6px 11px;
}
.flowList b{color:var(--blue); font-weight:800; margin-right:3px;}
.flowList + .flowList{margin-top:6px;}

/* ---------- 进度点 ---------- */
.steps{display:flex; align-items:center; justify-content:center; gap:7px; padding:4px 0 10px;}
.steps i{
  flex:0 1 26px; width:26px; min-width:4px; height:5px; border-radius:99px; background:#dde5f0;
  transition:background .2s, width .2s;
}
.steps i.on{background:var(--c,var(--blue)); flex:0 1 34px; width:34px;}
.steps i.done{background:#b7cbe6;}
.roundTag{
  text-align:center; font-size:13px; font-weight:800;
  color:#94a3b8; letter-spacing:.6px; padding:2px 0 10px;
}
.roundTag b{color:var(--c,var(--blue));}

/* ---------- 对打舞台 ---------- */
.stage{
  flex:1 1 auto; display:flex; flex-direction:column; justify-content:center;
  gap:10px; min-height:0; padding:6px 0;
  max-width:660px; width:100%; margin:0 auto;
}

.sayCard{
  position:relative;
  display:flex; flex-direction:column; justify-content:center;
  flex:0 0 auto; min-height:clamp(118px,15vh,160px);
  background:#fff; border:1px solid var(--line); border-radius:var(--r);
  padding:20px 22px 20px 58px;
  box-shadow:0 2px 12px rgba(30,60,120,.05);
  transition:opacity .2s;
}
.sayCard .lbl{
  position:absolute; left:14px; top:15px;
  width:26px; height:26px; border-radius:9px;
  background:#eef4ff; color:var(--blue);
  font-size:14px; font-weight:800;
  display:flex; align-items:center; justify-content:center;
}
.sayCard.a .lbl{background:#eaf7ef; color:var(--green);}
.sayCard.dim{opacity:.45;}

.line{
  font-size:clamp(22px,3.9vw,34px);
  line-height:1.55; font-weight:700; letter-spacing:.2px;
  color:#22293a; word-break:break-word;
}
.parse .w{
  border-bottom:2px dashed #c7d6ea;
  padding-bottom:1px; cursor:pointer;
  white-space:nowrap;              /* -ob 这类词尾不能从连字符处断开 */
  transition:background .12s, border-color .12s;
  border-radius:3px;
}
.parse .w:active{background:#eef4ff; border-color:var(--blue);}
.parse .ph{white-space:nowrap;}
.parse .nt{white-space:nowrap;}

.lock{display:flex; flex-direction:column; align-items:center; gap:10px; padding:4px 0;}
.lock .ic{
  width:58px; height:58px; border-radius:50%;
  background:#eef4ff; color:var(--blue);
  display:flex; align-items:center; justify-content:center;
  font-size:26px; line-height:1;
}
.lock.on .ic{animation:pulse 1.7s infinite;}
@keyframes pulse{
  0%{box-shadow:0 0 0 0 rgba(43,127,255,.30);}
  70%{box-shadow:0 0 0 18px rgba(43,127,255,0);}
  100%{box-shadow:0 0 0 0 rgba(43,127,255,0);}
}
.lock .tx{font-size:14.5px; font-weight:800; color:#94a3b8; letter-spacing:.4px;}

/* 单词卡（第 1 题） */
.wc{margin-bottom:10px;}
.wcCard{
  display:inline-flex; align-items:center; gap:12px;
  padding:10px 20px; border-radius:14px;
  background:#fff; border:2px solid var(--c,var(--amber));
}
.wcEmoji{font-size:clamp(30px,5.6vw,42px); line-height:1;}
.wcCard b{font-size:clamp(26px,5vw,38px); font-weight:800; color:#2b3448; letter-spacing:1px;}
.wcCard b:empty{display:none;}
.wcCard em{font-size:13px; color:#94a3b8; font-style:normal; font-weight:700;}

/* ---------- 读一读（句子卡） ---------- */
.storyCard{
  flex:0 1 auto; min-height:0;
  background:#fff; border:1px solid var(--line); border-radius:var(--r);
  padding:16px 18px 16px; box-shadow:0 2px 12px rgba(30,60,120,.05);
  overflow:auto;
}
.stHd{
  font-size:12.5px; font-weight:800; color:#8598b5; letter-spacing:.5px;
  margin-bottom:10px;
}
.stIc{margin-right:5px;}
.stLine{display:flex; align-items:flex-start; gap:10px; padding:8px 0;}
.stLine + .stLine{border-top:1px dashed #eef2f8;}
.stBtn{
  flex:0 0 auto; width:38px; height:38px; border-radius:12px;
  background:#eef4ff; color:var(--blue); font-size:16px;
  display:flex; align-items:center; justify-content:center;
  transition:transform .12s, background .15s;
}
.stBtn:active{transform:scale(.9); background:#dfeaff;}
.stLine .line{flex:1 1 auto; font-size:clamp(18px,3vw,25px); line-height:1.5;}

/* 收工直通车（只在读一读那一步出现） */
.skip{
  align-self:center; margin:6px 0 2px;
  font-size:13px; font-weight:800; color:#94a3b8;
  padding:8px 14px; border-radius:12px;
}
.skip:active{background:#eaf0f9;}

/* 中文释义行 */
.cn{
  margin-top:10px; padding-top:10px; border-top:1px dashed #e4ebf5;
  font-size:15px; line-height:1.6; color:#5a6b85; font-weight:600;
}
.alt{
  margin-top:6px; font-size:12.5px; color:#94a3b8; font-weight:600;
}

/* 回合间的小节拍 */
.ball{display:flex; align-items:center; justify-content:center; gap:5px; height:14px;
  pointer-events:none;}
.ball span{
  width:5px; height:5px; border-radius:99px; background:#cfdcee;
  animation:none;
}
.ball.play span{animation:bounce .9s infinite ease-in-out;}
.ball.play span:nth-child(2){animation-delay:.15s;}
.ball.play span:nth-child(3){animation-delay:.3s;}
@keyframes bounce{
  0%,80%,100%{transform:translateY(0); opacity:.4;}
  40%{transform:translateY(-5px); opacity:1;}
}

/* ---------- 录音条 ---------- */
.recBar{display:flex; gap:8px; align-items:stretch; padding:0 0 8px;}
.recBtn{
  flex:1 1 auto; min-height:52px; border-radius:16px;
  background:#fff; border:1.5px dashed #cfdcee; color:#5a6b85;
  font-size:16px; font-weight:800;
  display:flex; align-items:center; justify-content:center; gap:9px;
  transition:background .15s, border-color .15s, color .15s, transform .12s;
}
.recBtn:active{transform:scale(.985);}
.recBtn .rdot{
  width:12px; height:12px; border-radius:50%; background:#c9d6e8;
  flex:0 0 auto; transition:background .15s;
}
.recBtn.on{
  background:#fff2f1; border-style:solid; border-color:#f0b4ae; color:#c0392b;
}
.recBtn.on .rdot{background:#e74c3c; animation:recPulse 1.05s infinite;}
@keyframes recPulse{
  0%,100%{opacity:1; transform:scale(1);}
  50%{opacity:.3; transform:scale(.72);}
}
.recBtn.has{
  background:#eef4ff; border-style:solid; border-color:#cbdcfb; color:var(--blue);
}
.recBtn.has .rdot{background:var(--blue);}
.recPlay{
  flex:0 0 auto; min-width:104px; min-height:52px; border-radius:16px;
  background:var(--green); color:#fff; font-size:15.5px; font-weight:800;
  box-shadow:0 4px 12px rgba(22,163,74,.24);
  transition:transform .12s;
}
.recPlay:active{transform:scale(.96);}

/* ---------- 轻提示 ---------- */
.toast{
  position:fixed; left:50%; bottom:calc(104px + var(--safe-b));
  transform:translateX(-50%);
  max-width:86vw; padding:12px 18px; border-radius:14px;
  background:rgba(28,38,58,.93); color:#fff;
  font-size:14.5px; font-weight:700; line-height:1.5; text-align:center;
  z-index:120; transition:opacity .4s;
  pointer-events:none;                 /* 提示条不吃点击，免得平板点不动下面的按钮 */
  animation:toastIn .18s ease-out;
}
@keyframes toastIn{from{opacity:0; transform:translate(-50%,8px);}to{opacity:1; transform:translate(-50%,0);}}
.toast.out{opacity:0;}

/* ---------- 底部操作 ---------- */
.dock{
  display:flex; gap:9px; padding:12px 0 4px;
  align-items:stretch;
}
.btn{
  border-radius:16px; font-weight:800;
  display:flex; align-items:center; justify-content:center; gap:6px;
  transition:transform .12s, background .15s;
  min-height:58px; padding:0 18px;
}
.btn:active{transform:scale(.97);}
.btn.g{
  background:#fff; border:1px solid var(--line); color:#4a5568;
  font-size:15px; flex:0 0 auto;
}
.btn.g i{font-style:normal;}
.btn.p{
  flex:1 1 0; background:var(--blue); color:#fff; font-size:17.5px;
  box-shadow:0 6px 16px rgba(43,127,255,.28);
}
.btn.p.ready{background:var(--green); box-shadow:0 6px 16px rgba(22,163,74,.28);}

/* ---------- 收工页 ---------- */
.doneLead{
  text-align:center; font-size:16px; font-weight:800; color:#2b3a66;
  padding:6px 0 18px;
}
.houseWrap{flex:1 1 auto; display:flex; align-items:center; justify-content:center; min-height:0; padding:10px 0;}
.house{
  width:min(360px,88vw);
  display:flex; flex-direction:column; align-items:center;
}
.roof{
  width:100%; height:84px;
  background:var(--c,var(--blue));
  clip-path:polygon(50% 0, 100% 100%, 0 100%);
}
.house .body{
  width:100%; padding:18px 14px 20px;
  background:#fff; border:3px solid var(--c,var(--blue));
  border-top:0; border-radius:0 0 16px 16px;
}
.slots{display:flex; flex-wrap:wrap; gap:8px; justify-content:center;}
.slots .sc{
  padding:8px 12px; border-radius:11px;
  background:#f6f9fd; border:1px solid #e6edf7;
  font-size:16.5px; font-weight:800; color:#3d4a63;
  opacity:0; transform:translateY(10px) scale(.9);
  transition:opacity .3s, transform .35s cubic-bezier(.2,1.4,.5,1);
}
.slots .sc.in{opacity:1; transform:translateY(0) scale(1);}
.slots .sc b{color:var(--c,var(--blue));}
.doneBtns{display:flex; gap:10px; padding:20px 0 6px;}
.doneBtns .btn{flex:1 1 0;}

/* ---------- 释义弹卡 ---------- */
.sheet{
  position:fixed; inset:0; z-index:90;
  background:rgba(20,30,50,.32);
  display:flex; align-items:center; justify-content:center;
  padding:16px; padding-bottom:calc(16px + var(--safe-b));
  animation:fadeIn .16s ease-out;
}
@keyframes fadeIn{from{opacity:0}to{opacity:1}}
.sheetCard{
  width:100%; max-width:420px;
  background:#fff; border-radius:22px; padding:20px 20px 16px;
  animation:pop .22s cubic-bezier(.2,1.3,.5,1);
}
@keyframes pop{from{transform:translateY(16px) scale(.97); opacity:.6}to{transform:none; opacity:1}}
.scTop{display:flex; align-items:center; gap:12px;}
.scEmoji{font-size:34px; line-height:1;}
.scWord{font-size:26px; font-weight:800; color:#22293a; letter-spacing:.3px;}
.scCn{font-size:19px; font-weight:800; color:var(--blue); margin-top:12px;}
.scTip{font-size:14px; color:var(--sub); line-height:1.6; margin-top:6px; font-weight:600;}
.scBar{display:flex; gap:9px; margin-top:16px;}
.scBar .btn{flex:1 1 0; min-height:50px; font-size:15px;}

@media (max-width:560px){
  .hd h1{font-size:20px;}
  .line{font-size:20px;}
  .btn.g i{display:none;}
  .btn.g{padding:0 15px; font-size:19px;}
  .seg button{font-size:12px; padding:9px 2px;}
  .modeTxt{display:none;}
  .recBtn{min-height:48px; font-size:15px;}
  .recPlay{min-height:48px; min-width:86px; font-size:14.5px;}
  .dock .btn{min-height:54px;}
  .sayCard{min-height:clamp(104px,13vh,140px);}
  .storyCard{padding:14px 14px 12px;}
  .stLine .line{font-size:17px;}
  .stBtn{width:34px; height:34px; font-size:14px;}
  .flowList span{font-size:12.5px; padding:5px 9px;}
}
