:root {
  --green: #2e8b57;
  --green-dark: #1f6b42;
  --green-light: #e8f5ec;
  --green-border: #c3e6d0;
  --bg: #f4faf4;
  --card: #ffffff;
  --text: #2b3a2f;
  --muted: #7d8f83;
  --red: #d9534f;
  --radius: 14px;
}
[v-cloak] { display: none; }
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text); font-size: 15px;
}

/* 登录 */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth-card {
  width: 100%; max-width: 380px; background: var(--card); border-radius: 20px;
  padding: 32px 26px; box-shadow: 0 8px 30px rgba(46,139,87,.12); text-align: center;
}
.auth-logo { font-size: 44px; }
.auth-title { font-size: 22px; margin: 8px 0 4px; color: var(--green-dark); }
.auth-sub { color: var(--muted); font-size: 13px; margin-bottom: 18px; }
.auth-tabs { display: flex; background: var(--green-light); border-radius: 10px; padding: 4px; margin-bottom: 16px; }
.auth-tabs button { flex: 1; border: none; background: transparent; padding: 8px; border-radius: 8px; font-size: 14px; color: var(--muted); }
.auth-tabs button.on { background: var(--green); color: #fff; }
.auth-err { color: var(--red); font-size: 13px; margin-top: 10px; }

/* 通用 */
.ipt {
  width: 100%; padding: 11px 14px; border: 1.5px solid var(--green-border); border-radius: 10px;
  font-size: 15px; margin-bottom: 12px; background: #fff; color: var(--text);
}
.ipt:focus { outline: none; border-color: var(--green); }
textarea.ta { resize: vertical; line-height: 1.7; font-size: 14px; }
.btn {
  border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer;
  background: var(--green-light); color: var(--green-dark); font-weight: 500;
}
.btn.primary { background: var(--green); color: #fff; }
.btn.primary:disabled { opacity: .5; }
.btn.ghost { background: transparent; border: 1.5px solid var(--green-border); }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn.block { width: 100%; }
.card {
  background: var(--card); border-radius: var(--radius); padding: 16px; margin-bottom: 14px;
  box-shadow: 0 2px 10px rgba(46,139,87,.06);
}
.card-title { font-weight: 600; font-size: 16px; color: var(--green-dark); margin-bottom: 10px; }
.muted { color: var(--muted); font-size: 13px; line-height: 1.6; }
.pre-text { line-height: 1.7; font-size: 14px; white-space: pre-wrap; }
.pre-nl { white-space: pre-wrap; }
.row-flex { display: flex; gap: 8px; align-items: center; }
.grow { flex: 1; margin-bottom: 0; }
.plain-list { list-style: none; margin-top: 12px; }
.plain-list li { padding: 6px 0; border-bottom: 1px dashed var(--green-border); font-size: 14px; }
.back-btn {
  background: none; border: none; color: var(--green); font-size: 14px; padding: 4px 0 10px; cursor: pointer;
}
.mnemo { margin-top: 10px; background: var(--green-light); border-radius: 10px; padding: 10px 12px; font-size: 14px; color: var(--green-dark); }
.frame-box { margin-top: 12px; background: #fbfdfb; border: 1.5px dashed var(--green-border); border-radius: 10px; padding: 12px; font-size: 14px; }
.frame-label { font-weight: 600; color: var(--green); font-size: 13px; margin-bottom: 6px; }
.tabs, .subtabs { display: flex; gap: 8px; margin-bottom: 12px; }
.tabs button, .subtabs button {
  border: 1.5px solid var(--green-border); background: #fff; color: var(--muted);
  padding: 8px 16px; border-radius: 20px; font-size: 14px; cursor: pointer;
}
.tabs button.on, .subtabs button.on { background: var(--green); border-color: var(--green); color: #fff; }

/* 顶栏与底部 tab */
.topbar {
  position: sticky; top: 0; z-index: 10; display: flex; justify-content: space-between; align-items: center;
  background: var(--green); color: #fff; padding: 12px 16px; padding-top: calc(12px + env(safe-area-inset-top));
}
.topbar-title { font-size: 17px; font-weight: 600; }
.logout-btn { background: rgba(255,255,255,.18); border: none; color: #fff; padding: 6px 12px; border-radius: 16px; font-size: 12px; cursor: pointer; }
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 10; display: flex;
  background: #fff; border-top: 1px solid var(--green-border);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar button {
  flex: 1; border: none; background: none; padding: 8px 0 10px; font-size: 11px;
  color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer;
}
.tabbar button.on { color: var(--green); font-weight: 600; }
.tab-ico { font-size: 20px; }
.page { max-width: 640px; margin: 0 auto; padding: 14px 14px 90px; }

/* 首页 */
.stat-row { display: flex; gap: 10px; margin-bottom: 14px; }
.stat-card {
  flex: 1; background: var(--card); border-radius: var(--radius); text-align: center; padding: 14px 0;
  box-shadow: 0 2px 10px rgba(46,139,87,.06);
}
.stat-num { font-size: 24px; font-weight: 700; color: var(--green); }
.stat-label { font-size: 12px; color: var(--muted); margin-top: 4px; }
.quick-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.chip {
  border: 1.5px solid var(--green-border); background: #fff; color: var(--green-dark);
  padding: 7px 14px; border-radius: 18px; font-size: 13px; cursor: pointer;
}
.chip:disabled { opacity: .55; }
.entry-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.entry {
  border: 1.5px solid var(--green-border); background: var(--green-light); border-radius: 12px;
  padding: 14px; font-size: 15px; color: var(--green-dark); display: flex; align-items: center; gap: 10px; cursor: pointer;
}
.entry-ico { font-size: 22px; }

/* 列表 */
.list { display: flex; flex-direction: column; gap: 8px; }
.item { border: 1px solid var(--green-border); border-radius: 12px; overflow: hidden; }
.item-main { width: 100%; text-align: left; border: none; background: none; padding: 12px 14px; cursor: pointer; color: var(--text); }
.item-title { font-size: 15px; font-weight: 500; }
.item-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.score-badge { font-size: 12px; padding: 2px 8px; border-radius: 10px; background: var(--green-light); color: var(--green-dark); margin-left: 6px; }
.score-badge.bad { background: #fdecea; color: var(--red); }
.score-badge.mid { background: #fff7e0; color: #a67c00; }

/* 例题/练习 */
.example, .exercise { border-top: 1px dashed var(--green-border); padding: 12px 0; }
.example:first-of-type, .exercise:first-of-type { border-top: none; }
.example-passage { background: #fbfdfb; border-radius: 8px; padding: 10px; margin-bottom: 8px; font-size: 13px; }
.example-q, .q-text { font-size: 14px; line-height: 1.6; margin-bottom: 8px; }
.answer-box { background: var(--green-light); border-radius: 10px; padding: 10px 12px; margin-top: 8px; }
.opts { display: flex; flex-direction: column; gap: 8px; }
.opt {
  text-align: left; border: 1.5px solid var(--green-border); background: #fff;
  padding: 10px 14px; border-radius: 10px; font-size: 14px; cursor: pointer; color: var(--text);
}
.opt.right { background: var(--green); border-color: var(--green); color: #fff; }
.opt.wrong { background: #fdecea; border-color: var(--red); color: var(--red); }
.judge { margin-top: 10px; border-radius: 10px; padding: 10px 12px; font-size: 14px; line-height: 1.6; }
.judge.ok { background: var(--green-light); color: var(--green-dark); }
.judge.bad { background: #fdecea; color: #a33; }
.judge .expl { margin-top: 6px; font-size: 13px; }

/* 作文批改 */
.score-hero { text-align: center; padding: 10px 0 16px; }
.score-num { font-size: 52px; font-weight: 700; color: var(--green); }
.score-label { color: var(--muted); font-size: 13px; }
.dim-grid { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.dim { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.dim-name { width: 70px; color: var(--muted); flex-shrink: 0; }
.dim-bar { flex: 1; height: 8px; background: #eef3ef; border-radius: 4px; overflow: hidden; }
.dim-fill { height: 100%; border-radius: 4px; background: var(--green); }
.dim-fill.mid { background: #e6a23c; }
.dim-fill.bad { background: var(--red); }
.dim-score { width: 30px; text-align: right; font-weight: 600; }
.para-cmt { border-left: 3px solid var(--green-border); padding: 6px 0 6px 10px; margin-bottom: 8px; font-size: 13px; line-height: 1.6; }
.para-name { font-weight: 600; color: var(--green-dark); margin-bottom: 2px; }
.upgrade { background: #fbfdfb; border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; font-size: 13px; line-height: 1.6; }
.u-orig { color: var(--muted); text-decoration: line-through; }
.u-imp { color: var(--green-dark); font-weight: 500; margin: 4px 0; }

/* 开头结尾句子 */
.sentence { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--green-border); }
.s-body { flex: 1; font-size: 14px; line-height: 1.6; }
.s-tag { font-size: 11px; padding: 1px 8px; border-radius: 8px; margin-right: 6px; }
.tag-open { background: #e8f1fd; color: #3a6ea8; }
.tag-close { background: #fdf0e8; color: #b0603a; }
.s-actions { display: flex; gap: 4px; flex-shrink: 0; }
.icon-btn {
  border: 1.5px solid var(--green-border); background: #fff; border-radius: 8px;
  width: 32px; height: 32px; font-size: 14px; cursor: pointer; color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn.on { background: var(--green); border-color: var(--green); color: #fff; }

/* 单词 */
.word-card { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--green-border); }
.w-main { flex: 1; }
.w-word { font-size: 17px; font-weight: 600; color: var(--green-dark); }
.w-phon { color: var(--muted); font-size: 13px; margin: 2px 0; }
.w-mean { font-size: 14px; }
.w-example { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* AI 浮层 */
.modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 50;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal { background: #fff; border-radius: 16px; padding: 18px; width: 100%; max-width: 520px; max-height: 80vh; overflow-y: auto; }
.ai-text { font-size: 14px; line-height: 1.8; margin-bottom: 14px; }
.cursor { animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0; } }

.toast {
  position: fixed; bottom: 110px; left: 50%; transform: translateX(-50%);
  background: rgba(43,58,47,.9); color: #fff; padding: 10px 20px; border-radius: 20px;
  font-size: 13px; z-index: 99; white-space: nowrap;
}
