/* ===================== 背单词 📚 =====================
   仿「不背单词」:一张大卡居中、信息层级清楚。配色全走 --v-* 变量,
   默认皮肤 = 纸白+墨色+薄荷绿;动森皮肤(html[data-theme="island"])换奶油卡+木纹边+青绿。 */
.vocab-fab { right: 16px; top: calc(env(safe-area-inset-top, 0px) + 114px); }

.voc-app {
  --v-bg: #f5f4ef;
  --v-bg2: #f5f4ef;
  --v-card: #ffffff;
  --v-line: rgba(31, 35, 40, .07);
  --v-ink: #1f2a24;
  --v-sub: #7c847d;
  --v-faint: #b5bab3;
  --v-track: #ebe9e1;
  --v-accent: #3bb48a;
  --v-accent-soft: rgba(59, 180, 138, .12);
  --v-ta: #7d93c4;
  --v-warm: #f08a3c;
  --v-no: #e8735a;
  --v-shadow: 0 1px 2px rgba(31, 42, 36, .04), 0 8px 24px rgba(31, 42, 36, .07);
  --v-shadow-lg: 0 2px 6px rgba(31, 42, 36, .05), 0 18px 40px rgba(31, 42, 36, .12);
  --v-radius: 22px;
  --v-word-font: ui-rounded, 'SF Pro Rounded', -apple-system, 'PingFang SC', sans-serif;
  position: fixed; inset: 0; z-index: 10520;
  background: linear-gradient(180deg, var(--v-bg) 0%, var(--v-bg2) 100%);
  color: var(--v-ink);
  display: flex; flex-direction: column;
  padding-top: env(safe-area-inset-top, 0px);
  -webkit-tap-highlight-color: transparent;
}
.voc-app.hidden { display: none; }

html[data-theme="island"] .voc-app {
  --v-bg: #bfe6f2;
  --v-bg2: #f3ecd2;
  --v-card: rgb(250, 246, 228);
  --v-line: #e2d3b2;
  --v-ink: #6b5536;
  --v-sub: #9a8664;
  --v-faint: #c7b892;
  --v-track: #ece2c6;
  --v-accent: #19c8b9;
  --v-accent-soft: rgba(25, 200, 185, .14);
  --v-ta: #f29bb0;
  --v-warm: #f2a03d;
  --v-no: #ef8c6b;
  --v-shadow: 0 3px 0 #e2d3b2, 0 8px 18px rgba(120, 96, 50, .10);
  --v-shadow-lg: 0 4px 0 #e2d3b2, 0 16px 34px rgba(120, 96, 50, .16);
  --v-word-font: 'Nunito', ui-rounded, 'PingFang SC', sans-serif;
  font-family: 'Nunito', 'PingFang SC', -apple-system, sans-serif;
}

/* ---- 顶栏 ---- */
.voc-head {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 14px; min-height: 52px; flex: 0 0 auto;
}
.voc-back {
  width: 38px; height: 38px; flex: 0 0 auto; border-radius: 50%;
  border: none; cursor: pointer; display: grid; place-items: center;
  background: var(--v-card); color: var(--v-ink); box-shadow: var(--v-shadow);
  transition: transform .15s;
}
.voc-back:active { transform: scale(.92); }
.voc-back svg { display: block; }
.voc-htitle { flex: 1; text-align: center; font-size: 17px; font-weight: 800; letter-spacing: .5px; color: var(--v-ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.voc-head-side { width: 38px; flex: 0 0 auto; }

.voc-scroll {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 6px 16px calc(env(safe-area-inset-bottom, 0px) + 24px);
}
.voc-scroll:has(> .voc-study) { display: flex; flex-direction: column; }
.voc-scroll > .voc-study { flex: 1; }
.voc-loading { text-align: center; color: var(--v-sub); padding: 64px 0; font-size: 14px; }

/* ---- 首页 ---- */
.voc-home { display: flex; flex-direction: column; gap: 14px; animation: vocIn .35s cubic-bezier(.22, 1, .36, 1); }
.voc-panel { background: var(--v-card); border-radius: var(--v-radius); box-shadow: var(--v-shadow); }
html[data-theme="island"] .voc-panel { border: 1.5px solid var(--v-line); }

.voc-hero { padding: 18px 18px 16px; display: flex; flex-direction: column; gap: 16px; }
.voc-hero-top { display: flex; align-items: center; gap: 16px; }
.voc-ring { position: relative; width: 92px; height: 92px; flex: 0 0 auto; }
.voc-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); display: block; }
.voc-ring .trk { stroke: var(--v-track); }
.voc-ring .val { stroke: var(--v-accent); transition: stroke-dashoffset .8s cubic-bezier(.22, 1, .36, 1); }
.voc-ring-num { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.voc-ring-num b { font-family: var(--v-word-font); font-size: 28px; font-weight: 900; color: var(--v-ink); }
.voc-ring-num span { font-size: 11px; color: var(--v-sub); margin-top: 4px; font-weight: 600; }
.voc-hero-side { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.voc-hello { font-size: 13px; color: var(--v-sub); font-weight: 600; }
.voc-goal { font-size: 19px; font-weight: 800; color: var(--v-ink); line-height: 1.3; }
.voc-streak {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 700; color: var(--v-warm);
  background: color-mix(in srgb, var(--v-warm) 13%, transparent); border-radius: 999px; padding: 4px 10px;
}
.voc-streak b { font-size: 14px; }
.voc-cta {
  width: 100%; border: none; cursor: pointer; border-radius: 16px; padding: 15px 16px;
  background: var(--v-accent); color: #fff; font-size: 16px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 8px 20px color-mix(in srgb, var(--v-accent) 35%, transparent);
  transition: transform .15s;
}
.voc-cta:active { transform: scale(.97); }
.voc-cta small { font-size: 12px; font-weight: 600; opacity: .85; }
html[data-theme="island"] .voc-cta { box-shadow: 0 4px 0 #11a497, 0 8px 18px rgba(25, 200, 185, .25); }

/* PK:左右对垒 + 一根比例条 */
.voc-pk { padding: 16px 18px; }
.voc-pk-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.voc-pk-title { font-size: 14px; font-weight: 800; color: var(--v-ink); }
.voc-pk-total { font-size: 11px; color: var(--v-sub); font-weight: 600; }
.voc-vs { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.voc-vs-side { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.voc-vs-side.ta { align-items: flex-end; text-align: right; }
.voc-vs-name { font-size: 12px; font-weight: 700; color: var(--v-accent); }
.voc-vs-side.ta .voc-vs-name { color: var(--v-ta); }
.voc-vs-num { font-family: var(--v-word-font); font-size: 26px; font-weight: 900; color: var(--v-ink); line-height: 1.1; }
.voc-vs-today { font-size: 11px; color: var(--v-sub); }
.voc-vs-mid { font-size: 12px; font-weight: 900; color: var(--v-faint); letter-spacing: 1px; }
.voc-split { display: flex; height: 8px; border-radius: 999px; overflow: hidden; margin-top: 12px; background: var(--v-track); gap: 2px; }
.voc-split i { display: block; height: 100%; transition: flex-grow .6s cubic-bezier(.22, 1, .36, 1); }
.voc-split .me { background: var(--v-accent); border-radius: 999px 0 0 999px; }
.voc-split .ta { background: var(--v-ta); border-radius: 0 999px 999px 0; }

/* 章节 */
.voc-sec-title { display: flex; justify-content: space-between; align-items: baseline; margin: 6px 4px -2px; }
.voc-sec-title b { font-size: 15px; font-weight: 800; color: var(--v-ink); }
.voc-sec-title span { font-size: 11px; color: var(--v-sub); }
.voc-chapters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.voc-ch {
  border: none; cursor: pointer; text-align: left; font: inherit; color: inherit;
  background: var(--v-card); border-radius: 18px; padding: 13px 14px 12px; box-shadow: var(--v-shadow);
  display: flex; flex-direction: column; gap: 9px; position: relative; overflow: hidden;
  transition: transform .15s;
}
html[data-theme="island"] .voc-ch { border: 1.5px solid var(--v-line); }
.voc-ch:active { transform: scale(.96); }
.voc-ch-top { display: flex; align-items: center; gap: 8px; }
.voc-ch-no {
  flex: 0 0 auto; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center;
  font-family: var(--v-word-font); font-size: 12px; font-weight: 900;
  background: var(--v-accent-soft); color: var(--v-accent);
}
.voc-ch-name { font-size: 14px; font-weight: 700; color: var(--v-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.voc-ch-bar { height: 5px; border-radius: 999px; background: var(--v-track); overflow: hidden; }
.voc-ch-bar i { display: block; height: 100%; border-radius: 999px; background: var(--v-accent); }
.voc-ch-meta { display: flex; justify-content: space-between; font-size: 11px; color: var(--v-sub); font-weight: 600; }
.voc-ch.done .voc-ch-no { background: var(--v-accent); color: #fff; }
.voc-ch.last { box-shadow: 0 0 0 2px var(--v-accent), var(--v-shadow); }

/* ---- 学习卡 ---- */
.voc-study { display: flex; flex-direction: column; gap: 16px; height: 100%; }
.voc-progress { display: flex; align-items: center; gap: 10px; }
.voc-bar { flex: 1; height: 6px; background: var(--v-track); border-radius: 999px; overflow: hidden; }
.voc-bar i { display: block; height: 100%; background: var(--v-accent); border-radius: 999px; transition: width .35s cubic-bezier(.22, 1, .36, 1); }
.voc-count { font-family: var(--v-word-font); font-size: 13px; font-weight: 800; color: var(--v-sub); flex: 0 0 auto; }
.voc-count b { color: var(--v-ink); }

.voc-stage { perspective: 1400px; flex: 1 1 auto; min-height: 300px; display: flex; }
.voc-card {
  width: 100%; height: 100%; margin: 0 auto;
  position: relative; transform-style: preserve-3d;
  transition: transform .5s cubic-bezier(.3, .7, .2, 1); cursor: pointer;
}
.voc-card.enter { animation: vocCardIn .38s cubic-bezier(.22, 1, .36, 1); }
.voc-card.flip { transform: rotateY(180deg); }
.voc-card-face {
  position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  border-radius: 28px; background: var(--v-card); box-shadow: var(--v-shadow-lg);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 28px 24px; text-align: center; overflow: hidden;
}
html[data-theme="island"] .voc-card-face { border: 2px solid var(--v-line); }
.voc-back2 { transform: rotateY(180deg); justify-content: flex-start; overflow-y: auto; -webkit-overflow-scrolling: touch; }
/* 背面安全居中:内容短时上下居中,长了从顶部开始可滚动(不会像 justify-content:center 那样把顶部裁掉) */
.voc-back2 > :first-child { margin-top: auto; }
.voc-back2 > :last-child { margin-bottom: auto; }

.voc-word {
  font-family: var(--v-word-font); font-size: clamp(30px, 10vw, 44px); font-weight: 900;
  color: var(--v-ink); line-height: 1.15; word-break: break-word; letter-spacing: .2px;
}
.voc-pos {
  margin-top: 12px; display: inline-block; font-size: 13px; font-style: italic; font-weight: 700;
  color: var(--v-sub); background: var(--v-track); border-radius: 8px; padding: 3px 9px;
}
.voc-tts {
  margin-top: 26px; width: 52px; height: 52px; border-radius: 50%; border: none; cursor: pointer;
  display: grid; place-items: center; background: var(--v-accent-soft); color: var(--v-accent);
  transition: transform .15s;
}
.voc-tts:active { transform: scale(.9); }
.voc-tts svg { pointer-events: none; display: block; }
.voc-tap-hint {
  position: absolute; bottom: 18px; left: 0; right: 0; font-size: 12px; color: var(--v-faint);
  display: flex; align-items: center; justify-content: center; gap: 5px;
}
.voc-back-top { display: flex; align-items: baseline; justify-content: center; gap: 8px; flex-wrap: wrap; }
.voc-word.sm { font-size: 24px; }
.voc-back-top .voc-pos { margin-top: 0; }
.voc-zh {
  margin-top: 22px; font-size: clamp(20px, 6vw, 25px); font-weight: 800; color: var(--v-ink); line-height: 1.45;
}
.voc-divider { width: 36px; height: 3px; border-radius: 3px; background: var(--v-track); margin: 22px auto 18px; }
.voc-eg {
  width: 100%; text-align: left; font-size: 15px; color: var(--v-sub); line-height: 1.65;
  background: color-mix(in srgb, var(--v-track) 55%, transparent); border-radius: 16px; padding: 13px 15px;
  position: relative;
}
.voc-eg em { color: var(--v-accent); font-style: normal; font-weight: 800; }
.voc-eg-label { display: block; font-size: 11px; font-weight: 800; color: var(--v-faint); letter-spacing: 1px; margin-bottom: 4px; }

.voc-actions { display: flex; gap: 12px; padding-bottom: 4px; }
.voc-btn {
  flex: 1; border: none; cursor: pointer; font: inherit; font-size: 16px; font-weight: 800;
  border-radius: 18px; padding: 16px 0; display: flex; align-items: center; justify-content: center; gap: 7px;
  transition: transform .15s;
}
.voc-btn:active { transform: scale(.96); }
.voc-btn svg { display: block; pointer-events: none; }
.voc-btn.yes { background: var(--v-accent); color: #fff; box-shadow: 0 8px 20px color-mix(in srgb, var(--v-accent) 32%, transparent); }
.voc-btn.no { background: var(--v-card); color: var(--v-no); box-shadow: var(--v-shadow); }
.voc-btn.ghost { background: var(--v-card); color: var(--v-ink); box-shadow: var(--v-shadow); }
html[data-theme="island"] .voc-btn.yes { box-shadow: 0 4px 0 #11a497, 0 8px 16px rgba(25, 200, 185, .22); }
html[data-theme="island"] .voc-btn.no,
html[data-theme="island"] .voc-btn.ghost { border: 1.5px solid var(--v-line); box-shadow: 0 3px 0 #e2d3b2; }

/* ---- 完成 ---- */
.voc-finish { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 40px 4px 20px; position: relative; animation: vocIn .4s cubic-bezier(.22, 1, .36, 1); }
.vf-emoji { font-size: 60px; width: 108px; height: 108px; border-radius: 50%; display: grid; place-items: center; background: var(--v-card); box-shadow: var(--v-shadow-lg); margin-bottom: 8px; }
.vf-title { font-size: 23px; font-weight: 900; color: var(--v-ink); }
.vf-sub { font-size: 13px; color: var(--v-sub); }
.vf-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; margin-top: 14px; }
.vf-stat { background: var(--v-card); border-radius: 18px; padding: 14px 6px; box-shadow: var(--v-shadow); }
html[data-theme="island"] .vf-stat { border: 1.5px solid var(--v-line); }
.vf-stat b { display: block; font-family: var(--v-word-font); font-size: 26px; font-weight: 900; color: var(--v-ink); line-height: 1.1; }
.vf-stat span { font-size: 11px; color: var(--v-sub); font-weight: 600; }
.vf-stat.hot b { color: var(--v-warm); }
.vf-actions { display: flex; gap: 12px; width: 100%; margin-top: 18px; }
.voc-confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.voc-confetti i { position: absolute; top: -20px; font-size: 18px; font-style: normal; background: none !important; animation: vocFall 2.4s ease-in forwards; }

@keyframes vocFall { to { transform: translateY(120vh) rotate(360deg); opacity: .3; } }
@keyframes vocIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes vocCardIn { from { opacity: 0; transform: translateX(36px) scale(.97); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .voc-home, .voc-finish, .voc-card.enter { animation: none; }
  .voc-card { transition: none; }
  .voc-confetti { display: none; }
}
