* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --green: #1e9e6a;
  --green-dark: #168a5b;
  --bg: #f4f7f6;
  --card: #ffffff;
  --text: #21302a;
  --muted: #7b8b83;
  --line: #e6ece8;
  --red: #d9534f;
  --amber: #f0a500;
}
html, body { height: 100%; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}
#app {
  max-width: 640px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 0 14px 92px;
}

/* 顶栏 */
.header { padding: 18px 0 12px; }
.header-top { display: flex; align-items: baseline; justify-content: space-between; }
.header h1 { font-size: 24px; color: var(--green); }
.date { color: var(--muted); font-size: 14px; }
.progress {
  margin-top: 10px; background: #e6ece8; border-radius: 12px; height: 10px; overflow: hidden;
}
.progress > i {
  display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--green), #4cc38d);
  transition: width .4s ease; border-radius: 12px;
}

/* 底部导航 */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0;
  display: flex; max-width: 640px; margin: 0 auto;
  background: var(--card); border-top: 1px solid var(--line);
  padding: 8px 10px calc(10px + env(safe-area-inset-bottom));
  z-index: 20;
}
.tab {
  flex: 1; border: none; background: none; padding: 10px 0;
  font-size: 15px; color: var(--muted); cursor: pointer; border-radius: 10px;
}
.tab.is-active { color: var(--green); font-weight: 700; background: rgba(30,158,106,.10); }
.badge {
  display: inline-block; min-width: 18px; padding: 1px 6px; border-radius: 10px;
  background: var(--amber); color: #fff; font-size: 12px; margin-left: 2px;
}
.badge:empty { display: none; }

.today-stats { display:flex; align-items:center; justify-content:space-between; margin-top:12px; background:#eafaf2; border:1px solid #cdeede; border-radius:10px; padding:8px 12px; font-size:14px; color:var(--green-dark); }
.today-stats b { font-size:16px; }
.ts-time { color:var(--muted); font-size:13px; }

/* 区块标题 */
.section-title { margin: 8px 0 12px; color: var(--text); font-size: 16px; font-weight: 700; }
.section-title .count { color: var(--muted); font-weight: 400; font-size: 13px; }
.welcome { color: var(--muted); font-size: 14px; margin: 4px 0 14px; }
.resume-banner {
  background: #eafaf2; border: 1px solid #cdeede; color: var(--green-dark);
  border-radius: 10px; padding: 8px 12px; font-size: 13px; margin: 0 0 12px;
}

.add-more-card {
  background: var(--card); border: 1px dashed var(--green); border-radius: 14px;
  padding: 18px 16px; margin-top: 18px; text-align: center;
}
.add-more-card .am-title { font-size: 16px; font-weight: 700; color: var(--green-dark); margin-bottom: 6px; }
.add-more-card .am-hint { color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.add-more-card .am-controls { display: flex; gap: 10px; justify-content: center; align-items: center; }
.add-more-card input[type="number"] { width: 96px; padding: 9px 10px; font-size: 16px; border: 1px solid var(--line); border-radius: 10px; text-align: center; }

/* 单词卡片 */
.word-card {
  background: var(--card); border-radius: 16px; padding: 16px 16px 14px;
  margin-bottom: 14px; border: 1px solid var(--line); box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.word-card.resume { outline: 2px solid var(--green); }
.word-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.word { font-size: 30px; font-weight: 800; color: var(--text); letter-spacing: .5px; }
.phonetic { color: var(--muted); font-size: 15px; font-family: "Segoe UI", sans-serif; }
.pos-tag {
  background: #eef4f0; color: var(--green-dark); font-size: 12px; padding: 2px 8px; border-radius: 8px;
}
.speak {
  margin-left: auto; border: none; background: var(--green); color: #fff;
  width: 34px; height: 34px; border-radius: 50%; font-size: 16px; cursor: pointer; line-height: 1;
}

/* 中文释义：默认隐藏，点卡片才显示 */
.meaning { margin-top: 12px; cursor: pointer; }
.blur {
  color: var(--muted); font-size: 15px; filter: blur(6px); user-select: none; transition: filter .2s ease;
}
.word-card.is-open .blur { filter: none; color: var(--text); }
.hint { color: var(--muted); font-size: 12px; margin-top: 4px; }

/* 动词形态 / 搭配 */
.forms-row { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.form-item {
  background: #f2f5f4; border-radius: 8px; padding: 4px 10px; font-size: 13px; color: var(--text);
}
.form-item .form-label { color: var(--muted); margin-right: 6px; }
.colls { margin-top: 10px; }
.colls-title { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.coll-chip {
  display: inline-block; background: #f6faf8; border: 1px solid var(--line);
  border-radius: 8px; padding: 4px 10px; font-size: 13px; margin: 0 6px 6px 0;
}
.coll-chip b { margin-right: 6px; }

/* 例句 */
.example { margin-top: 10px; padding: 8px 10px; background: #fafbfa; border-radius: 8px; }
.example-en { color: var(--text); font-size: 14px; line-height: 1.5; }
.example-cn { color: var(--muted); font-size: 13px; margin-top: 4px; display: block; }

/* 按钮区 */
.card-actions { margin-top: 14px; display: flex; gap: 10px; }
.btn {
  flex: 1; border: none; border-radius: 12px; padding: 12px 10px; font-size: 15px; cursor: pointer;
}
.btn-primary { background: var(--green); color: #fff; }
.btn-danger { background: #fdeceb; color: var(--red); }

/* 空状态 */
.empty { text-align: center; color: var(--muted); padding: 60px 10px; font-size: 15px; line-height: 2; }
.empty .big { font-size: 40px; }

/* 设置 */
.setting-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px; margin-bottom: 14px; }
.setting-card h3 { font-size: 16px; margin-bottom: 12px; }
.setting-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.setting-row label { flex: 0 0 96px; color: var(--muted); font-size: 14px; }
.setting-row input {
  flex: 1; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 15px; color: var(--text);
}
.stat-line { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.stat-line span { color: var(--muted); }
.hint { color: var(--muted); font-size: 12px; margin-top: 6px; line-height: 1.6; }

/* 遮罩提示 toast */
.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%);
  background: rgba(33,48,42,.92); color: #fff; padding: 10px 18px; border-radius: 24px;
  font-size: 14px; z-index: 50; animation: fade .3s;
}
@keyframes fade { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }
/* 顶部一键显示/遮挡 */
.header-right { display: flex; align-items: center; gap: 10px; }
.mask-btn {
  border: 1px solid var(--green); background: #fff; color: var(--green);
  border-radius: 18px; padding: 6px 12px; font-size: 13px; cursor: pointer; white-space: nowrap;
}
.mask-btn:active { background: var(--green); color: #fff; }
/* 开启“显示全部中文”时，所有遮罩内容直接显示 */
body.show-all .blur { filter: none; color: var(--text); }
/* 已掌握 · 按记忆时间分组 */
.day-group {
  margin: 14px 0 8px; padding: 4px 0 8px; border-bottom: 1px solid var(--line);
  color: var(--green-dark); font-size: 13px; font-weight: 700;
}


/* 听单词 */
.listen-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.listen-toggle {
  border: none; background: var(--green); color: #fff; border-radius: 20px;
  padding: 9px 18px; font-size: 14px; cursor: pointer; flex: 0 0 auto; white-space: nowrap;
}
.listen-toggle.playing { background: var(--red); }
.listen-status { color: var(--muted); font-size: 13px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; flex: 1; }
.word-card.is-playing { outline: 2px solid var(--green); box-shadow: 0 0 0 3px rgba(30,158,106,.25); }

.btn-plain { background: #eef4f0; color: var(--green-dark); }

.btn-small { flex: 0 0 auto; padding: 6px 10px; font-size: 12px; border-radius: 9px; white-space: nowrap; }

/* 近义词 */
.sim { margin-top: 10px; }
.sim-toggle { border: 1px solid var(--line); background: #f6faf8; color: var(--green-dark); border-radius: 9px; padding: 6px 12px; font-size: 13px; cursor: pointer; }
.sim-list { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.sim-item { border: 1px solid var(--line); background: #fff; border-radius: 9px; padding: 5px 10px; font-size: 14px; cursor: pointer; display: inline-block; }
.sim-item b { margin-right: 6px; }
.sim-item i { font-style: normal; color: var(--muted); font-size: 12px; }
.sim-none { color: var(--muted); font-size: 13px; }

.sim-item-wrap { display: flex; flex-direction: column; }
.sim-item.open { background: #eef4f0; }
.sim-item-detail { margin-top: 6px; padding: 8px 10px; background: #fafbfa; border: 1px solid var(--line); border-radius: 9px; line-height: 1.6; }
.sim-item-mean { color: var(--text); font-size: 13px; }
/* 账号同步 */
.sync-status { font-size: 13px; color: var(--muted); margin: 8px 0; min-height: 18px; }


.loading-splash{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:40vh;color:#8a8f98;font-size:15px;gap:14px}
.spinner{width:38px;height:38px;border:4px solid #e4f4ec;border-top-color:#1e9e6a;border-radius:50%;animation:spin 0.9s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
