/* 英语教练 · 设计系统 v2
   参考：Eric 的英语学习工具版式（衬线标题 / 字段色块 / 极细线 / 大留白）
   规则：英文标题用衬线，中文用无衬线；边框永远 0.5px 且极淡；不用阴影堆层次 */

:root {
  --bg: #FAF7F1;
  --card: #FFFFFF;
  --line: #EDE7DD;
  --line-strong: #E0D8CB;

  --text: #23211E;
  --text-2: #6E675E;
  --text-3: #A39A8E;

  --accent: #1F6B52;
  --accent-soft: #E7F0EA;

  --f-meaning: #5B7FD4;
  --f-example: #2F9E6E;
  --f-original: #C97B3C;
  --f-usage: #8B6BB1;
  --f-rule: #8B6BB1;
  --f-wrong: #B0453A;
  --f-ok: #2F7A55;

  --note-bg: #FBF3E2;
  --note-line: #F0E4C9;

  --serif: Georgia, "Times New Roman", "Songti SC", serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;

  --radius: 16px;
  --pad: 22px;
  --gap: 38px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  padding-bottom: 92px;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 520px;
  margin: 0 auto;
  padding: 0 var(--pad);
}

/* ---------- 顶部 ---------- */

.topbar { padding: 40px 0 0; }

.topbar .kicker {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 8px;
}

.topbar .date {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.topbar .sub {
  font-size: 13px;
  color: var(--text-3);
  margin-top: 6px;
}

.back {
  font-size: 12px;
  color: var(--text-3);
  text-decoration: none;
  display: inline-block;
  margin-bottom: 16px;
  letter-spacing: 0.02em;
}

.back:hover { color: var(--text-2); }

/* ---------- 区块 ---------- */

.sec-title {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-3);
  margin: var(--gap) 0 14px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.sec-title .cnt {
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: 0;
  color: var(--text-2);
}

/* ---------- 卡片 ---------- */

.card {
  background: var(--card);
  border: 0.5px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 12px;
}

/* ---------- 书架（横滑，无卡片背景，用细线分隔） ---------- */

.shelf {
  display: flex;
  gap: 0;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  margin: 0 calc(var(--pad) * -1);
  padding: 0 var(--pad);
}

.shelf::-webkit-scrollbar { display: none; }

.book {
  flex: 0 0 auto;
  width: 86%;
  scroll-snap-align: start;
  display: flex;
  gap: 16px;
  padding: 4px 24px 4px 0;
  border-right: 0.5px solid var(--line);
  margin-right: 20px;
}

.book:last-child { border-right: none; }

.cover {
  flex: 0 0 58px;
  width: 58px;
  height: 78px;
  border-radius: 3px;
  padding: 7px 6px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  color: #fff;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.14);
}

.cover.amber { background: #C1741A; }
.cover.brick { background: #A3442F; }
.cover.green { background: #1F6B52; }
.cover.navy  { background: #2E3F5B; }

.cover .ct {
  font-family: var(--serif);
  font-size: 9px;
  line-height: 1.25;
  letter-spacing: 0.02em;
}

.cover .ca { font-size: 8px; opacity: 0.8; margin-top: 4px; }

.book-meta { flex: 1 1 auto; min-width: 0; padding-top: 2px; }

.book-meta .name {
  font-size: 17px;
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.book-meta .author {
  font-family: var(--serif);
  font-size: 12px;
  color: var(--text-2);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bar {
  height: 3px;
  background: var(--line);
  border-radius: 2px;
  margin: 14px 0 8px;
  overflow: hidden;
}

.bar > i {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
}

.book-meta .stat {
  font-size: 11px;
  color: var(--text-3);
  letter-spacing: 0.02em;
}

/* ---------- 按钮 ---------- */

.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  padding: 0 20px;
  height: 34px;
  line-height: 34px;
  border-radius: 17px;
  text-decoration: none;
  margin-top: 14px;
  letter-spacing: 0.02em;
}

.btn.ghost {
  background: transparent;
  color: var(--accent);
  border: 0.5px solid var(--accent);
}

.btn.big {
  display: block;
  width: 100%;
  height: 52px;
  line-height: 52px;
  text-align: center;
  font-size: 15px;
  border-radius: 26px;
  margin-top: 28px;
  letter-spacing: 0.04em;
}

/* ---------- 任务行 ---------- */

.task-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 14px 0;
}

.task-row + .task-row { border-top: 0.5px solid var(--line); }
.task-row .t { font-size: 15px; }

.task-row .n {
  font-family: var(--serif);
  font-size: 14px;
  color: var(--text-3);
  letter-spacing: 0.04em;
}

/* ---------- 教练提示 ---------- */

.coach-tip {
  background: var(--note-bg);
  border: 0.5px solid var(--note-line);
  border-radius: var(--radius);
  padding: 18px 20px;
}

.coach-tip .label {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #A9834A;
}

.coach-tip .body {
  font-size: 14px;
  color: #5E4A28;
  margin-top: 6px;
  line-height: 1.65;
}

/* ---------- 字段标签（小色块 + 大写小字） ---------- */

.f-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-2);
}

.f-label::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 2.5px;
  background: var(--text-3);
}

.f-label.meaning::before  { background: var(--f-meaning); }
.f-label.example::before  { background: var(--f-example); }
.f-label.original::before { background: var(--f-original); }
.f-label.usage::before    { background: var(--f-usage); }
.f-label.rule::before     { background: var(--f-rule); }
.f-label.wrong::before    { background: var(--f-wrong); }
.f-label.ok::before       { background: var(--f-ok); }

.src {
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-left: 8px;
}

/* ---------- 词条详情（四段式） ---------- */

.term {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin-top: 10px;
  word-break: break-word;
}

.term.sm { font-size: 19px; }

.phon {
  font-family: var(--serif);
  font-size: 13px;
  color: var(--text-3);
  margin-top: 6px;
  letter-spacing: 0.02em;
}

.nl { margin-top: 22px; }

.nl .row {
  padding: 14px 0;
  border-top: 0.5px solid var(--line);
}

.nl .row:first-child { border-top: none; padding-top: 0; }

.nl .v {
  font-size: 15px;
  line-height: 1.68;
  margin-top: 6px;
  color: var(--text);
  word-break: break-word;
}

.nl .v em { font-style: normal; font-weight: 500; }

.nl .v.bad { color: var(--f-wrong); }
.nl .v.ok  { color: var(--f-ok); }

.ref {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 8px;
  letter-spacing: 0.01em;
}

.mini {
  font-size: 14px;
  line-height: 1.75;
  color: #5E4A28;
  background: var(--note-bg);
  border: 0.5px solid var(--note-line);
  border-radius: 12px;
  padding: 16px 18px;
  margin-top: 20px;
}

.mini b { font-weight: 500; }

/* ---------- 类型标签（极简，去掉彩色胶囊） ---------- */

.chip {
  display: inline-block;
  font-size: 9px;
  line-height: 18px;
  height: 18px;
  padding: 0 8px;
  border-radius: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 0.5px solid var(--line-strong);
  color: var(--text-2);
  background: transparent;
}

.chip.word    { border-color: #C9D6C9; color: #3F6B4E; }
.chip.chunk   { border-color: #E3CFAC; color: #8A6421; }
.chip.grammar { border-color: #CBC7E4; color: #4F4880; }

/* ---------- 切页标签 ---------- */

.tabs {
  display: flex;
  gap: 6px;
  margin: 22px 0 6px;
  overflow-x: auto;
}

.tabs::-webkit-scrollbar { display: none; }

.tabs a {
  flex: 0 0 auto;
  font-size: 13px;
  color: var(--text-2);
  text-decoration: none;
  padding: 7px 15px;
  border-radius: 18px;
  border: 0.5px solid transparent;
  background: transparent;
  letter-spacing: 0.02em;
}

.tabs a.on {
  background: var(--card);
  border-color: var(--line-strong);
  color: var(--text);
}

.tabs.small { margin: 8px 0 18px; }
.tabs.small a { font-size: 12px; padding: 5px 12px; }

/* ---------- 笔记条目（细线分隔，不用卡片） ---------- */

.note-item {
  cursor: pointer;
  padding: 18px 2px;
  border-bottom: 0.5px solid var(--line);
  background: transparent;
  border-radius: 0;
  margin: 0;
  border-left: none;
  border-right: none;
  border-top: none;
}

.note-item .mean {
  font-size: 14px;
  color: var(--text-2);
  margin-top: 6px;
  line-height: 1.6;
  word-break: break-word;
}

.note-item .term { margin-top: 8px; }

/* ---------- 底部弹层 ---------- */

.sheet {
  position: fixed;
  inset: 0 0 0 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  background: rgba(35, 33, 30, 0.26);
  padding: 0 12px 12px;
}

.sheet[hidden] { display: none; }

.sheet-inner {
  width: 100%;
  max-width: 496px;
  max-height: 76vh;
  overflow-y: auto;
  background: var(--card);
  border-radius: 20px;
  padding: 26px 22px 22px;
}

/* ---------- 卡片墙 ---------- */

#gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.gal-card {
  background: var(--card);
  border: 0.5px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  min-height: 112px;
  display: flex;
  flex-direction: column;
}

.gal-term {
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.35;
  margin-top: 10px;
  word-break: break-word;
}

.gal-hint {
  font-size: 10px;
  color: var(--text-3);
  margin-top: auto;
  padding-top: 10px;
  letter-spacing: 0.06em;
}

/* ---------- 教练页 ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin-top: 22px;
  border-top: 0.5px solid var(--line);
  border-bottom: 0.5px solid var(--line);
}

.stat-card {
  padding: 20px 6px;
  text-align: center;
}

.stat-card + .stat-card { border-left: 0.5px solid var(--line); }

.stat-card .sn {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.stat-card .sl {
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-top: 6px;
}

.wp { padding: 16px 0; }
.wp + .wp { border-top: 0.5px solid var(--line); }

.wt {
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.wt .wn {
  font-family: var(--serif);
  font-size: 12px;
  color: var(--text-3);
}

.hint {
  font-size: 11px;
  color: var(--text-3);
  line-height: 1.7;
  margin-top: 16px;
  letter-spacing: 0.01em;
}

/* ---------- 提示条 ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 104px;
  transform: translateX(-50%);
  background: rgba(35, 33, 30, 0.94);
  color: #fff;
  font-size: 13px;
  padding: 10px 20px;
  border-radius: 20px;
  z-index: 30;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

/* ---------- 阅读正文 ---------- */

.article { padding-top: 8px; }

.article p {
  font-size: 17px;
  line-height: 1.85;
  margin: 0 0 22px;
  color: #2B2823;
}

.w.hit {
  background: #FBF3E2;
  border-radius: 3px;
  cursor: pointer;
  box-shadow: inset 0 -1.5px 0 #D9A44E;
}

/* ---------- 空状态 ---------- */

.empty {
  color: var(--text-3);
  font-size: 13px;
  padding: 44px 0;
  text-align: center;
  line-height: 1.8;
}

/* ---------- 底部导航 ---------- */

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 68px;
  background: rgba(250, 247, 241, 0.96);
  border-top: 0.5px solid var(--line);
  display: flex;
  max-width: 520px;
  margin: 0 auto;
  backdrop-filter: blur(12px);
  padding-bottom: env(safe-area-inset-bottom);
}

.tabbar a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--text-3);
  font-size: 10px;
  letter-spacing: 0.12em;
}

.tabbar a.on { color: var(--text); }

.tabbar .dot {
  width: 4px;
  height: 4px;
  border-radius: 2px;
  background: transparent;
  margin-bottom: 7px;
}

.tabbar a.on .dot { background: var(--accent); }
