/* ============================================================
   背单词 App 样式
   设计原则：简洁、清晰、大方，让人每天愿意打开
   ============================================================ */

:root {
  --bg: #f4f6fa;
  --card: #ffffff;
  --ink: #1d2233;
  --ink-soft: #6b7280;
  --line: #e8ebf2;
  --main: #4f7cff;
  --main-d: #3a63e8;
  --radius: 18px;
  --shadow: 0 6px 20px rgba(31, 41, 77, 0.06);
  --shadow-hover: 0 10px 28px rgba(31, 41, 77, 0.12);
}

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

body {
  font-family: -apple-system, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

#app {
  max-width: 620px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
}

/* ===== 顶栏 ===== */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar .brand { font-size: 20px; font-weight: 700; color: var(--main); }
.topbar .back {
  background: none; border: none; color: var(--ink-soft);
  font-size: 15px; cursor: pointer; padding: 6px 4px;
}
.topbar .progress-text { font-size: 14px; color: var(--ink-soft); }

.checkin {
  display: flex; align-items: center; gap: 4px;
  background: linear-gradient(135deg, #fff3e0, #ffe0b2);
  padding: 6px 12px; border-radius: 999px; cursor: pointer;
  font-weight: 600; color: #e65100;
}
.checkin .fire { font-size: 16px; }
.checkin small { font-weight: 400; color: #bf6000; font-size: 11px; margin-left: 2px; }

/* ===== 页面容器 ===== */
.page { padding: 20px; }

.hero { text-align: center; padding: 20px 0 24px; }
.hero h2 { font-size: 24px; margin-bottom: 6px; }
.hero p { color: var(--ink-soft); font-size: 14px; }

/* ===== 分类卡片 ===== */
.cat-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
  border-left: 5px solid var(--c);
}
.cat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.cat-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.cat-ico { font-size: 24px; }
.cat-name { font-size: 20px; font-weight: 700; }
.cat-stats { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-soft); }

/* ===== 掌握度进度条 ===== */
.mastery { margin-top: 12px; }
.mastery-info { display: flex; justify-content: space-between; align-items: center; font-size: 13px; margin-bottom: 5px; }
.mastery-info b { font-size: 16px; }
.mastery-bar { position: relative; height: 8px; background: #ececec; border-radius: 4px; overflow: visible; }
.mastery-fill { height: 100%; border-radius: 4px; transition: width .4s ease, background .3s; }
.mastery-target { position: absolute; top: -3px; bottom: -3px; width: 2px; background: #333; opacity: .6; }
.mastery-sub { font-size: 12px; color: var(--ink-soft); margin-top: 5px; }

/* ===== 开发计划页 markdown 渲染 ===== */
.devplan-body { text-align: left; font-size: 14px; line-height: 1.7; }
.devplan-body h1, .devplan-body h2, .devplan-body h3 { margin: 18px 0 8px; }
.devplan-body table { border-collapse: collapse; width: 100%; margin: 10px 0; font-size: 13px; }
.devplan-body th, .devplan-body td { border: 1px solid #ddd; padding: 6px 8px; text-align: left; }
.devplan-body th { background: #f5f5f5; }
.devplan-body ul { padding-left: 22px; }
.devplan-body code { background: #f4f4f4; padding: 1px 4px; border-radius: 3px; font-size: 12px; }
.devplan-body hr { border: none; border-top: 1px solid #eee; margin: 16px 0; }

/* ===== 按钮 ===== */
.btn-main {
  width: 100%;
  padding: 15px;
  border: none;
  border-radius: 14px;
  background: var(--main);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.btn-main:hover { background: var(--main-d); }
.btn-ghost {
  width: 100%;
  padding: 13px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  color: var(--ink);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  margin-top: 10px;
}
.btn-ghost:hover { border-color: var(--main); color: var(--main); }

/* ===== 数量选择 ===== */
.section-title { font-size: 14px; color: var(--ink-soft); margin: 20px 0 12px; }
.num-row { display: flex; gap: 10px; margin-bottom: 18px; }
.num-btn {
  flex: 1; padding: 16px 0; border: 1.5px solid var(--line);
  border-radius: 14px; background: var(--card); font-size: 16px;
  font-weight: 600; cursor: pointer; transition: .15s;
}
.num-btn:hover { border-color: var(--main); }
.num-btn.active { background: var(--main); color: #fff; border-color: var(--main); }
.unified-num-row .num-btn {
  background: #fff;
  border-color: #e5e7eb;
  color: #374151;
  box-shadow: none;
}
.unified-num-row .num-btn:hover {
  border-color: #a78bfa;
  color: #6d28d9;
  transform: translateY(-1px);
}
.unified-num-row .num-btn:active {
  transform: translateY(0);
}

/* 加量按钮：100 词（绿色渐变，状态不错冲刺用） */
.num-btn-pro {
  flex: 1; padding: 16px 0; border: none;
  border-radius: 14px; font-size: 16px; font-weight: 700; cursor: pointer;
  color: #fff;
  background: linear-gradient(180deg, #34d399 0%, #059669 100%);
  box-shadow: 0 4px 10px rgba(5, 150, 105, 0.35), inset 0 1px 0 rgba(255,255,255,0.25);
  transition: transform .12s ease, box-shadow .12s ease;
}
.num-btn-pro:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(5, 150, 105, 0.45), inset 0 1px 0 rgba(255,255,255,0.3); }
.num-btn-pro:active { transform: translateY(0); box-shadow: 0 2px 6px rgba(5, 150, 105, 0.35); }
.num-btn-pro.active { background: linear-gradient(180deg, #059669 0%, #047857 100%); box-shadow: 0 6px 14px rgba(5, 150, 105, 0.5), inset 0 1px 0 rgba(255,255,255,0.3); }

/* 爆量按钮：200 词（紫色渐变，状态爆棚专注爆发用） */
.num-btn-max {
  flex: 1; padding: 16px 0; border: none;
  border-radius: 14px; font-size: 16px; font-weight: 700; cursor: pointer;
  color: #fff;
  background: linear-gradient(180deg, #a78bfa 0%, #7c3aed 100%);
  box-shadow: 0 4px 10px rgba(124, 58, 237, 0.4), inset 0 1px 0 rgba(255,255,255,0.25);
  transition: transform .12s ease, box-shadow .12s ease;
}
.num-btn-max:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(124, 58, 237, 0.5), inset 0 1px 0 rgba(255,255,255,0.3); }
.num-btn-max:active { transform: translateY(0); box-shadow: 0 2px 6px rgba(124, 58, 237, 0.4); }
.num-btn-max.active { background: linear-gradient(180deg, #7c3aed 0%, #6d28d9 100%); box-shadow: 0 6px 14px rgba(124, 58, 237, 0.55), inset 0 1px 0 rgba(255,255,255,0.3); }

/* ===== 学习卡片 ===== */
.study { display: flex; flex-direction: column; align-items: center; }
.progress { height: 4px; background: var(--line); position: relative; }
.progress-bar { height: 100%; background: var(--main); transition: width .25s; }

.card {
  background: var(--card);
  border-radius: 24px;
  box-shadow: var(--shadow);
  width: 100%;
  min-height: 340px;
  padding: 40px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  text-align: center;
  animation: pop .25s ease;
}
@keyframes pop { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.card-word { font-size: 40px; font-weight: 800; letter-spacing: .5px; }
.card-word.small { font-size: 26px; color: var(--ink-soft); }
.phonetic { font-size: 16px; color: var(--ink-soft); font-style: italic; }

/* 🔊 发音按钮：圆形小按钮，紧贴音标下方，立体渐变 */
.speak-btn {
  width: 52px; height: 52px; border-radius: 50%;
  border: none; background: linear-gradient(180deg, #60a5fa 0%, #2563eb 100%);
  color: #fff; font-size: 22px; cursor: pointer;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.4), inset 0 1px 0 rgba(255,255,255,0.3);
  transition: transform .12s ease, box-shadow .12s ease;
  margin: 8px auto 16px;
  display: flex; align-items: center; justify-content: center;
}
.speak-btn:hover { transform: translateY(-2px) scale(1.05); box-shadow: 0 8px 18px rgba(37, 99, 235, 0.5), inset 0 1px 0 rgba(255,255,255,0.35); }
.speak-btn:active { transform: translateY(0) scale(0.98); box-shadow: 0 2px 6px rgba(37, 99, 235, 0.4); }

.meaning { font-size: 22px; font-weight: 600; line-height: 1.6; }
.example { font-size: 14px; color: var(--ink-soft); font-style: italic; padding: 0 12px; }

/* ===== 标签按钮 ===== */
.label-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; margin-top: 8px; }
.label-btns {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
  margin-top: 16px;
}
.label-btns .label-btn {
  min-height: 52px;
  padding: 13px 16px;
  font-size: 15px;
  border-radius: 14px;
}
.label-btn {
  padding: 13px; border: none; border-radius: 12px;
  background: var(--c); color: #fff; font-size: 15px;
  font-weight: 600; cursor: pointer; opacity: .92; transition: .15s;
}
.label-btn:hover { opacity: 1; transform: scale(1.02); }
.label-btn.grad-btn { width: 100%; margin-top: 10px; font-size: 15px; }

/* ===== 复习勾选 ===== */
.checks { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.check {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 16px; background: var(--card); border-radius: 14px;
  border: 1.5px solid var(--line); cursor: pointer; font-size: 15px;
}
.check input { width: 18px; height: 18px; accent-color: var(--main); }
.check small { color: var(--ink-soft); margin-left: auto; }
.check:has(input:checked) { border-color: var(--main); background: #f0f4ff; }

/* ===== 学习卡片倒计时 ===== */
.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 10px;
}
.timer-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.timer-circle {
  width: 52px;
  height: 52px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.timer-circle svg {
  transform: rotate(-90deg);
  width: 100%;
  height: 100%;
  overflow: visible;
}
.timer-circle .track {
  fill: none;
  stroke: #e8ecf5;
  stroke-width: 4;
}
.timer-circle .progress {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
  transition: stroke 0.3s, stroke-dashoffset 0.3s linear;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.08));
}
.timer-circle .progress.ok { stroke: #34c759; }     /* >60% 绿 */
.timer-circle .progress.warn { stroke: #f29a3d; }   /* 30-60% 黄 */
.timer-circle .progress.danger { stroke: #e74c3c; animation: pulse 1s infinite alternate; } /* <30% 红 */
@keyframes pulse {
  from { filter: drop-shadow(0 0 0 rgba(231,76,60,0)); }
  to   { filter: drop-shadow(0 0 5px rgba(231,76,60,.55)); }
}
.timer-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.2px;
}
.timer-pause-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  background: var(--card);
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: .15s;
}
.timer-pause-btn:hover { border-color: var(--main); color: var(--main); background: #eef3ff; }

/* ===== 结果页 ===== */
.result { text-align: center; }
.result-ico { font-size: 56px; margin-bottom: 10px; }
.result h2 { font-size: 24px; margin-bottom: 20px; }
.dist { background: var(--card); border-radius: 16px; padding: 16px; margin-bottom: 20px; box-shadow: var(--shadow); }
.dist-row { display: flex; align-items: center; gap: 8px; padding: 8px 4px; font-size: 15px; }
.dist-row b { margin-left: auto; }
.btns { display: flex; flex-direction: column; }

/* ===== 统计页 ===== */
.stat-block { background: var(--card); border-radius: var(--radius); padding: 18px; margin-bottom: 14px; box-shadow: var(--shadow); }
.stat-block h3 { font-size: 16px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; font-size: 14px; }
.stat-grid .v { font-weight: 700; color: var(--ink); }
.stat-grid .l { color: var(--ink-soft); }
.tag-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.tag { font-size: 13px; padding: 4px 10px; border-radius: 999px; color: #fff; font-weight: 500; }

/* ===== 查词 & 查词本 ===== */
.search-box { display: flex; gap: 8px; margin-bottom: 14px; }
.search-box input { flex: 1; padding: 12px 14px; border: 2px solid var(--line); border-radius: 12px; font-size: 15px; outline: none; transition: border-color .2s; }
.search-box input:focus { border-color: var(--main); }
.search-btn { padding: 12px 20px; background: var(--main); color: #fff; border: none; border-radius: 12px; font-size: 15px; cursor: pointer; font-weight: 600; }
.search-btn:hover { background: var(--main-d); }

#search-result { margin-bottom: 18px; }
.search-card { background: var(--card); border-radius: 16px; padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow); border-left: 4px solid var(--main); }
.search-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.search-head b { font-size: 20px; }
.search-head .tag { font-size: 12px; padding: 2px 8px; }
.lookup-cat { font-size: 13px; font-weight: 600; }
.lookup-cnt { font-size: 12px; color: var(--ink-soft); margin-left: auto; }
.search-meaning { font-size: 15px; color: var(--ink); margin-bottom: 10px; }
.search-label-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.search-empty { background: #fff3f3; color: #e74c3c; padding: 12px 16px; border-radius: 12px; font-size: 14px; }

.lookup-card { border-left: 4px solid #6c5ce7; }
.lookup-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.lookup-row { background: var(--card); border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow); }
.lookup-row.lookup-done { opacity: 0.5; }
.lookup-word { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
.lookup-word b { font-size: 17px; }
.lookup-word .tag { font-size: 11px; padding: 2px 8px; }
.lookup-ph { color: var(--ink-soft); font-size: 13px; }
.lookup-meaning { font-size: 14px; color: var(--ink-soft); }
.lookup-meta { font-size: 12px; color: var(--ink-soft); margin-top: 4px; }
.lookup-meta b { color: #e67e22; }
.lookup-info { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 10px 0; font-size: 13px; }
.lookup-info .tag { font-size: 12px; padding: 2px 8px; }
.hint { font-size: 13px; color: var(--ink-soft); margin-top: 8px; }
.empty { text-align: center; color: var(--ink-soft); padding: 24px; }
.btn-ghost.danger { color: #e74c3c; border-color: #e74c3c; }

/* ===== 短语本 ===== */
.level-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.level-tag { font-size: 12px; padding: 3px 10px; border-radius: 999px; background: #f0f0f5; color: var(--ink-soft); }

/* ===== 多用户档案 ===== */
.profile-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  background: rgba(255,255,255,0.4);    /* 提高对比度：0.15 → 0.4 */
  color: #047857;                       /* 深绿色文字，对比绿底 */
  border-radius: 16px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  border: none;
  user-select: none;
}
.profile-chip:active { background: rgba(255,255,255,0.55); }
.profile-name { max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-caret { font-size: 9px; opacity: 0.75; }

.back-btn {
  background: none;
  border: none;
  color: #374151;
  font-size: 14px;
  cursor: pointer;
  padding: 6px 8px;
}

.profile-intro {
  background: #ecfdf5;
  border-radius: 10px;
  padding: 12px 16px;
  margin: 12px 0;
  font-size: 13px;
  color: #065f46;
}
.profile-intro p { margin: 0; }

.profile-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 12px 0;
}
.profile-item {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.profile-item.active {
  border-color: #059669;
  background: #f0fdf4;
}
.profile-item-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: flex-start;
}
.profile-item-name {
  font-weight: 600;
  font-size: 16px;
  color: #111827;
}
.profile-badge {
  display: inline-block;
  background: #059669;
  color: white;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 8px;
  margin-top: 4px;
}
.profile-item-date {
  color: #9ca3af;
  font-size: 12px;
}
.profile-item-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: white;
  cursor: pointer;
  color: #374151;
}
.btn-sm:active { background: #f3f4f6; }
.btn-sm.primary {
  background: #059669;
  color: white;
  border-color: #059669;
}
.btn-sm.danger {
  color: #dc2626;
  border-color: #fecaca;
}

.btn-primary {
  width: 100%;
  padding: 12px;
  background: #059669;
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  margin-top: 16px;
}
.btn-primary:active { background: #047857; }

.contact-footer {
  margin-top: 24px;
  padding: 16px 12px;
  text-align: center;
  color: #6b7280;
  font-size: 13px;
  border-top: 1px solid #e5e7eb;
}
.contact-footer a {
  color: #059669;
  text-decoration: none;
}

/* ===== 版本号徽章 + 刷新按钮（header） ===== */
.version-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(255,255,255,0.5);   /* 提高对比度 */
  color: #047857;                      /* 深绿色，对比绿底 */
  border-radius: 10px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  user-select: none;
  cursor: help;
}

.refresh-app-btn {
  background: rgba(255,255,255,0.15);
  border: none;
  color: white;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: all 0.2s ease;
}
.refresh-app-btn:hover { background: rgba(255,255,255,0.28); }
.refresh-app-btn:active { transform: scale(0.92); }
.refresh-app-btn:disabled { opacity: 0.6; cursor: wait; }

/* ===== 分类卡 2 列网格 + 紧凑版式 ===== */
.cats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 12px 0;
}

.cat-card {
  padding: 12px 14px !important;  /* 比原来更紧凑 */
}

.cat-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.cat-pct-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  color: white;
  margin-left: auto;
  min-width: 40px;
  text-align: center;
}

.mastery-bar-wrap {
  margin: 6px 0;
}

.mastery-bar-wrap .mastery-bar {
  margin: 0;
  height: 6px;  /* 比原来更细 */
}

.cat-foot {
  font-size: 12px;
  color: #6b7280;
  margin-top: 6px;
}

/* 小屏：依然 2 列（用户确认：手机也是点进去学习，不是光看）*/
@media (max-width: 360px) {
  .cats-grid { gap: 8px; }
  .cat-card { padding: 10px 12px !important; }
}

/* ===== 行内改名输入框 ===== */
.profile-item.editing {
  border-color: #059669;
  background: #f0fdf4;
}

.profile-rename-input {
  font-size: 16px;
  font-weight: 600;
  padding: 5px 10px;
  border: 1.5px solid #059669;
  border-radius: 6px;
  outline: none;
  width: 100%;
  max-width: 240px;
  background: white;
  color: #111827;
  font-family: inherit;
}

.profile-rename-input:focus {
  border-color: #047857;
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
}

.profile-rename-input::placeholder {
  color: #9ca3af;
  font-weight: 400;
}

/* ===== 区块分组标题 ===== */
.section-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #6b7280;
  margin: 18px 0 8px;
  letter-spacing: 0.3px;
}
.section-header span:first-child {
  font-size: 15px;
}

/* ===== 系统卡（区别于学习卡）===== */
.cat-card.system-card {
  background: #f9fafb;
  border: 1.5px dashed #d1d5db;
  border-left: 3px solid currentColor;
}
.cat-card.system-card:hover {
  background: white;
  border-color: #9ca3af;
  border-style: solid;
}
.cat-card.system-card .cat-foot {
  color: #4b5563;
}

/* ===== 词缀页面 ===== */
.affix-intro {
  background: linear-gradient(135deg, #f3e8ff 0%, #ede9fe 100%);
  border-radius: 12px;
  padding: 16px 18px;
  margin: 16px 0 20px;
}
.affix-intro h3 {
  margin: 0 0 8px;
  font-size: 16px;
  color: #6b21a8;
}
.affix-intro p {
  margin: 4px 0;
  font-size: 13px;
  color: #4c1d95;
  line-height: 1.5;
}

.affix-stats {
  background: white;
  border-radius: 10px;
  padding: 14px 16px;
  margin: 12px 0;
  border: 1px solid #e5e7eb;
}
.affix-stats div {
  margin: 4px 0;
  font-size: 13px;
  color: #4b5563;
}

/* ===== 词缀批量整理 ===== */
.batch-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: white;
  border: 1px solid #e9d5ff;
  border-radius: 14px;
  box-shadow: 0 3px 12px rgba(124, 58, 237, 0.08);
}
.batch-toolbar > div:first-child {
  font-size: 15px;
  color: #581c87;
}
.batch-toolbar small {
  display: block;
  margin-top: 2px;
  color: #7c3aed;
  font-weight: 600;
}
.batch-tools {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.tool-btn {
  padding: 8px 12px;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  background: white;
  color: #4b5563;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s ease;
}
.tool-btn:hover {
  border-color: #c4b5fd;
  color: #6d28d9;
  background: #faf5ff;
}
.affix-mode-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
  padding: 5px;
  background: rgba(255, 255, 255, .86);
  border: 1px solid #e9d5ff;
  border-radius: 14px;
  box-shadow: 0 3px 12px rgba(124, 58, 237, .08);
}
.mode-tab {
  padding: 10px 8px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #7c3aed;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.mode-tab.active {
  background: linear-gradient(135deg, #8b5cf6, #a855f7);
  color: white;
  box-shadow: 0 4px 12px rgba(139, 92, 246, .22);
}
.filter-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0;
}
.filter-row .tool-btn.active {
  border-color: #8b5cf6;
  background: #ede9fe;
  color: #5b21b6;
}
.batch-word {
  font-size: 18px;
  line-height: 1.3;
  color: #4c1d95;
}
.batch-word-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.word-source {
  padding: 3px 8px;
  border-radius: 999px;
  background: #ede9fe;
  color: #6d28d9;
  font-size: 11px;
  font-weight: 700;
}
.word-source.new {
  background: #dcfce7;
  color: #15803d;
}
.word-affix {
  padding: 3px 8px;
  border-radius: 999px;
  background: #f3f4f6;
  color: #6b7280;
  font-size: 11px;
  font-weight: 700;
}
.affix-words-entry {
  margin-top: 14px;
  text-align: center;
}
.batch-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 14px 0 18px;
}
.batch-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  padding: 13px 14px;
  background: white;
  border: 1.5px solid #ede9fe;
  border-radius: 14px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.batch-item:has(.batch-check:checked) {
  border-color: #a78bfa;
  background: #faf5ff;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.10);
}
.batch-check {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: #7c3aed;
  cursor: pointer;
}
.batch-item-body {
  min-width: 0;
}
.batch-item-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.batch-affix {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 19px;
  color: #6b21a8;
}
.batch-type {
  padding: 2px 8px;
  border-radius: 999px;
  background: #f3f4f6;
  color: #6b7280;
  font-size: 11px;
  font-weight: 600;
}
.batch-label {
  padding: 2px 8px;
  border-radius: 999px;
  color: white;
  font-size: 11px;
  font-weight: 600;
}
.batch-label.unlabeled {
  background: #f3f4f6;
  color: #9ca3af;
}
.batch-no {
  margin-left: auto;
  color: #c4b5fd;
  font-size: 11px;
}
.batch-meaning {
  margin: 5px 0 2px;
  color: #4b5563;
  font-size: 13px;
  font-weight: 600;
}
.batch-item .affix-examples {
  margin-top: 6px;
}
.batch-item .affix-ex {
  font-size: 12px;
  padding: 5px 8px;
}
.batch-actions {
  position: sticky;
  bottom: 10px;
  z-index: 20;
  padding: 10px;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(10px);
  border: 1px solid #e9d5ff;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(76, 29, 149, .14);
}
.btn-secondary {
  width: 100%;
  margin-top: 10px;
  padding: 13px;
  border: 1.5px solid #ddd6fe;
  border-radius: 12px;
  background: white;
  color: #7c3aed;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s ease;
}
.btn-secondary:hover {
  background: #faf5ff;
  border-color: #a78bfa;
}

.affix-intro + h4,
.affix-stats + h4 {
  font-size: 14px;
  color: #6b7280;
  font-weight: 500;
  margin: 16px 0 10px;
}

/* 词缀学习卡（翻面动画）*/
.affix-card {
  background: white;
  border-radius: 16px;
  padding: 32px 20px;
  margin: 20px 0;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  box-shadow: 0 4px 16px rgba(155, 89, 182, 0.1);
  border: 1.5px solid #e9d5ff;
}
.affix-card:active {
  transform: scale(0.98);
}
.affix-card .affix-type {
  font-size: 12px;
  color: #9b59b6;
  font-weight: 600;
  letter-spacing: 1px;
  margin-bottom: 16px;
}
.affix-card .affix-text {
  font-size: 64px;
  font-weight: 700;
  color: #6b21a8;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  letter-spacing: 2px;
}
.affix-card .affix-hint {
  margin-top: 16px;
  font-size: 12px;
  color: #9ca3af;
}
.affix-card.back .affix-type-badge {
  font-size: 12px;
  color: #9b59b6;
  font-weight: 600;
  margin-bottom: 12px;
}
.affix-card .affix-meaning {
  font-size: 16px;
  font-weight: 600;
  color: #1f2937;
  text-align: center;
  margin-bottom: 12px;
  line-height: 1.5;
}
.affix-examples {
  margin-top: 12px;
  width: 100%;
}
.affix-ex {
  font-size: 13px;
  color: #4b5563;
  padding: 6px 10px;
  margin: 4px 0;
  background: #faf5ff;
  border-radius: 6px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

.result-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  margin: 20px 0;
  text-align: center;
  border: 1px solid #e5e7eb;
}
.result-card h2 {
  color: #6b21a8;
  margin: 0 0 16px;
}
.result-card div {
  margin: 8px 0;
  color: #4b5563;
  font-size: 14px;
}

/* 备份区按钮组（占满整列 + 主/次区分） */
.backup-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}
.backup-actions .btn-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 16px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .12s, box-shadow .15s, background .15s;
  border: 1.5px solid transparent;
}
.backup-actions .btn-action .btn-ico {
  font-size: 18px;
  line-height: 1;
}
.backup-actions .btn-action.primary {
  background: linear-gradient(135deg, #6366f1, #818cf8);
  color: #fff;
  box-shadow: 0 2px 6px rgba(99, 102, 241, 0.25);
}
.backup-actions .btn-action.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.35);
}
.backup-actions .btn-action.primary:active {
  transform: translateY(0);
}
.backup-actions .btn-action.primary:disabled {
  background: #e5e7eb;
  color: #9ca3af;
  box-shadow: none;
  cursor: not-allowed;
}
.backup-actions .btn-action.secondary {
  background: #fff;
  color: #6366f1;
  border-color: #c7d2fe;
}
.backup-actions .btn-action.danger {
  background: #fff1f2;
  color: #b91c1c;
  border-color: #fecaca;
}
.backup-actions .btn-action.danger:hover {
  background: #ffe4e6;
}
.backup-actions .btn-action.secondary:hover {
  background: #eef2ff;
  border-color: #6366f1;
}

/* 词缀例词中文对照（挂在英文下方） */
.affix-ex-word {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.affix-ex-en {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.affix-speak-btn {
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 50%;
  background: #ede9fe;
  color: #7c3aed;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform .12s ease, background .15s ease, box-shadow .15s ease;
}
.affix-speak-btn:hover {
  background: #ddd6fe;
  transform: translateY(-1px) scale(1.05);
  box-shadow: 0 2px 6px rgba(124, 58, 237, .22);
}
.affix-speak-btn:active {
  transform: translateY(0) scale(.98);
}
/* ===== 例词快捷标签 ===== */
.affix-word-tag {
  position: relative;
  display: inline-flex;
  margin-left: 4px;
  vertical-align: middle;
}
.affix-word-tag summary {
  list-style: none;
  padding: 2px 7px;
  border: 1px solid color-mix(in srgb, var(--c) 28%, #e2e8f0);
  border-radius: 999px;
  background: color-mix(in srgb, var(--c) 8%, white);
  color: var(--c);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.3;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.affix-word-tag summary::-webkit-details-marker {
  display: none;
}
.affix-tag-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  min-width: 126px;
  padding: 8px;
  background: white;
  border: 1px solid #e9d5ff;
  border-radius: 12px;
  box-shadow: 0 10px 26px rgba(76, 29, 149, .16);
}
.affix-tag-option {
  padding: 6px 7px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: white;
  color: #374151;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.affix-tag-option:hover {
  border-color: #a78bfa;
  background: #faf5ff;
}
.affix-tag-option.active {
  border-color: #7c3aed;
  background: #ede9fe;
  color: #5b21b6;
}
.affix-tag-option.clear {
  grid-column: 1 / -1;
  color: #64748b;
}
.affix-words-review-btn {
  width: 100%;
  margin: 12px 0;
}

.affix-ex-cn {
  font-size: 11px;
  color: #6b7280;
  font-weight: 400;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif;
}


/* ===== Toast 通知（右下角浮动，自动消失）===== */
.toast-wrap {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.5;
  color: #fff;
  background: #374151;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  word-break: break-word;
}
.toast.show {
  opacity: 1;
  transform: translateY(0);
}
.toast-success { background: #059669; }
.toast-error   { background: #dc2626; }
.toast-info    { background: #2563eb; }


/* ===== 初中标签词表管理（v1.2.4 先仅 junior） ===== */
.tag-btn {
  border: none;
  cursor: pointer;
  font-family: inherit;
}
.label-book-searchbar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.label-book-searchbar input {
  flex: 1;
  min-width: 0;
  padding: 11px 13px;
  border: 1.5px solid #e5e7eb;
  border-radius: 12px;
  background: white;
  font-size: 14px;
}
.label-book-searchbar input:focus {
  outline: none;
  border-color: #a78bfa;
  box-shadow: 0 0 0 3px rgba(167, 139, 250, .12);
}
.label-book-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0 16px;
}
.label-book-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  background: white;
  border: 1.5px solid #ede9fe;
  border-radius: 13px;
}
.label-book-check {
  width: 20px;
  height: 20px;
  accent-color: #7c3aed;
  cursor: pointer;
}
.label-book-word {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.label-book-word b {
  color: #4c1d95;
  font-size: 16px;
}
.label-book-word small {
  color: #6b7280;
  font-size: 12px;
}
.label-book-select {
  min-width: 82px;
  padding: 7px 8px;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  background: white;
  color: #374151;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.label-book-select:focus {
  outline: none;
  border-color: #8b5cf6;
}
.label-book-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 14px;
  color: #6b7280;
  font-size: 13px;
  font-weight: 600;
}

/* ===== 解锁页：价格与收款码 ===== */
.price-line { text-align: center; margin: 12px 0 4px; }
.price-line del { color: #999; font-size: 16px; margin-right: 8px; }
.price-now { color: #e65100; font-size: 30px; font-weight: 700; }
.price-badge { background: #ff6b35; color: #fff; font-size: 11px; border-radius: 4px; padding: 2px 6px; margin-left: 8px; vertical-align: 6px; }
.pay-qr { display: block; margin: 10px auto 4px; width: 230px; max-width: 72%; border-radius: 12px; box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12); }
