:root {
  --blue: #0a84ff;
  --blue-d: #0b63d6;
  --teal: #34c759;
  --orange: #ff9f0a;
  --ink: #1c2430;
  --ink2: #6b7684;
  --bg: #eef3fb;
  --card: #ffffff;
  --radius: 22px;
  --shadow: 0 10px 30px rgba(20, 60, 120, .10);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink); background: linear-gradient(180deg, #dfeaff, var(--bg) 40%);
  min-height: 100vh;
}
.app {
  max-width: 480px; margin: 0 auto; min-height: 100vh; position: relative;
  padding: 16px 16px 92px;
}

/* 视图切换 */
.view { display: none; animation: fade .25s ease; }
.view.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.topbar { display: flex; align-items: center; justify-content: space-between; margin: 6px 2px 14px; }
.title { font-size: 22px; margin: 0; }
.count { color: var(--ink2); font-size: 14px; font-weight: 500; }

.chip {
  border: 0; background: var(--blue); color: #fff; font-size: 15px; font-weight: 600;
  padding: 10px 18px; border-radius: 999px; box-shadow: 0 6px 16px rgba(10,132,255,.3);
}
.chip--ghost { background: #fff; color: var(--blue); box-shadow: var(--shadow); }

/* 进度 */
.progress { height: 6px; background: rgba(10,132,255,.15); border-radius: 99px; overflow: hidden; }
.progress__bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--blue), var(--teal)); transition: width .3s; }
.progress__txt { text-align: right; color: var(--ink2); font-size: 13px; margin: 6px 2px 14px; }

/* 卡片 */
.deck { position: relative; }
.card {
  background: var(--card); border-radius: var(--radius); padding: 26px 22px; box-shadow: var(--shadow);
  position: relative; margin-bottom: 18px;
}
.card--center { text-align: center; }
.badge {
  display: inline-block; background: linear-gradient(135deg, #7c5cff, #4f2fb8);
  color: #fff; font-size: 12px; font-weight: 600; padding: 5px 12px; border-radius: 999px;
}
.fav {
  position: absolute; top: 16px; right: 18px; border: 0; background: none;
  font-size: 30px; color: #d5dce6; cursor: pointer; line-height: 1;
}
.fav.on { color: var(--orange); }
.word { font-size: 40px; font-weight: 800; margin: 14px 0 6px; letter-spacing: .5px; }
.word--lg { font-size: 46px; }
.phonetic { color: var(--blue); font-size: 18px; margin: 0 0 14px; }
.speak {
  border: 0; cursor: pointer; background: rgba(52,199,89,.14); color: #1d9a45;
  font-size: 16px; font-weight: 700; padding: 10px 22px; border-radius: 999px; margin-bottom: 16px;
}
.homo { font-size: 22px; font-weight: 800; color: var(--orange); margin: 6px 0 10px; }
.tag {
  display: inline-block; font-size: 12px; background: rgba(255,159,10,.16); color: #c97a00;
  border-radius: 6px; padding: 2px 8px; margin-right: 8px; font-weight: 700; vertical-align: middle;
}
.desc { color: #39424e; font-size: 16px; line-height: 1.6; margin: 0; }

/* 按钮 */
.navrow { display: flex; gap: 12px; }
.btn {
  flex: 1; border: 0; cursor: pointer; font-size: 16px; font-weight: 700; padding: 15px 0;
  border-radius: 16px; background: #fff; color: var(--ink2); box-shadow: var(--shadow);
}
.btn--primary { background: linear-gradient(135deg, var(--blue), var(--teal)); color: #fff; flex: 1.4; }
.btn--soft { width: 100%; background: rgba(52,199,89,.14); color: #1d9a45; box-shadow: none; margin-bottom: 12px; }
.btn--danger { width: 100%; margin-top: 12px; background: rgba(255,59,48,.1); color: #ff3b30; box-shadow: none; }
.hint { text-align: center; color: var(--ink2); font-size: 13px; margin-top: 14px; }

/* 跟读 */
.feedback {
  background: #fff; border-radius: 16px; padding: 16px 18px; font-size: 16px; font-weight: 600;
  color: var(--ink2); box-shadow: var(--shadow); margin-bottom: 18px; line-height: 1.5; min-height: 56px;
}
.feedback.ok { background: rgba(52,199,89,.14); color: #1d9a45; }
.feedback.bad { background: rgba(255,149,0,.14); color: #d17e00; }
.feedback.listen { background: rgba(10,132,255,.1); color: var(--blue); }
.micwrap { text-align: center; margin: 6px 0 16px; }
.mic {
  width: 96px; height: 96px; border-radius: 50%; border: 0; cursor: pointer; font-size: 40px;
  background: linear-gradient(135deg, var(--blue), var(--teal)); color: #fff;
  box-shadow: 0 14px 34px rgba(10,132,255,.4); transition: transform .15s;
}
.mic:active { transform: scale(.94); }
.mic.on { background: linear-gradient(135deg, #ff453a, #ff9f0a); animation: pulse 1.1s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255,69,58,.45); }
  70% { box-shadow: 0 0 0 22px rgba(255,69,58,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,69,58,0); }
}
.mictip { color: var(--ink2); font-size: 14px; margin-top: 10px; }

/* 列表 */
.list { display: flex; flex-direction: column; gap: 12px; }
.item { background: #fff; border-radius: 18px; padding: 16px 18px; box-shadow: var(--shadow); }
.item__head { display: flex; justify-content: space-between; align-items: center; }
.item__word { font-size: 22px; font-weight: 800; }
.item__ph { color: var(--blue); font-size: 14px; margin: 4px 0; }
.item__homo { color: var(--orange); font-weight: 700; margin: 4px 0; }
.item__desc { color: #39424e; font-size: 15px; line-height: 1.5; margin: 0; }
.item__act { display: flex; gap: 22px; margin-top: 10px; }
.mini { border: 0; background: none; color: var(--blue); font-size: 15px; font-weight: 700; cursor: pointer; padding: 0; }
.mini.del { color: #ff3b30; }
.mini.on { color: var(--orange); }

/* 搜索 */
.searchbox {
  display: flex; align-items: center; gap: 8px; background: #fff; border-radius: 16px;
  padding: 14px 18px; box-shadow: var(--shadow); margin-bottom: 16px;
}
.searchbox input { border: 0; outline: 0; flex: 1; font-size: 16px; }

/* 空状态 / 设置 */
.empty { text-align: center; color: var(--ink2); padding-top: 70px; }
.empty__ico { font-size: 56px; opacity: .25; }
.empty p { font-size: 18px; font-weight: 700; color: var(--ink); margin: 12px 0 4px; }
.empty span { font-size: 14px; }
.group { background: #fff; border-radius: 18px; padding: 18px; box-shadow: var(--shadow); margin-bottom: 16px; }
.group__t { color: var(--ink2); font-size: 13px; margin: 0 0 8px; }
.row { display: flex; justify-content: space-between; align-items: center; font-size: 16px; padding: 8px 0; }
.seg { display: inline-flex; background: #eef1f6; border-radius: 999px; padding: 3px; }
.seg button {
  border: 0; background: none; padding: 6px 16px; font-size: 14px; font-weight: 700;
  color: var(--ink2); border-radius: 999px; cursor: pointer;
}
.seg button.on { background: var(--blue); color: #fff; box-shadow: 0 4px 10px rgba(10,132,255,.3); }
.tut { margin: 0; padding-left: 20px; line-height: 2; font-size: 15px; }
.about { color: var(--ink2); font-size: 14px; line-height: 1.7; margin: 0; }

/* 底部导航 */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; background: rgba(255,255,255,.94); backdrop-filter: blur(12px);
  border-top: 1px solid rgba(0,0,0,.06); display: flex; z-index: 20;
  padding-bottom: env(safe-area-inset-bottom);
}
.tab {
  flex: 1; border: 0; background: none; padding: 8px 0 10px; cursor: pointer;
  color: var(--ink2); font-size: 12px; display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.tab span { font-size: 20px; filter: grayscale(1); opacity: .7; }
.tab.active { color: var(--blue); font-weight: 700; }
.tab.active span { filter: none; opacity: 1; }

/* 备案号 */
.icp { text-align: center; padding: 18px 0 8px; }
.icp a { color: var(--ink2); font-size: 12px; text-decoration: none; }

@media (min-width: 520px) {
  .app { padding-top: 28px; }
}
