/* 能用就行。功能正确性远高于外观。 */
* { box-sizing: border-box; }
body {
  font: 15px/1.55 system-ui, "Segoe UI", "Microsoft YaHei", sans-serif;
  margin: 0; padding: 24px; background: #fbfbfc; color: #1c1e21;
}
.wrap { max-width: 940px; margin: 0 auto; }
h1 { font-size: 20px; margin: 0 0 4px; }
h2 { font-size: 16px; margin: 24px 0 8px; }
.sub { color: #777; font-size: 13px; margin-bottom: 18px; }
a { color: #2563a8; }

.card {
  background: #fff; border: 1px solid #e2e4e8; border-radius: 6px;
  padding: 14px 16px; margin-bottom: 12px;
}
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.grow { flex: 1; }

button {
  font: inherit; padding: 6px 14px; border: 1px solid #c8ccd2;
  background: #fff; border-radius: 5px; cursor: pointer;
}
button:hover:not(:disabled) { background: #f0f2f5; }
button:disabled { opacity: .45; cursor: default; }
button.primary { background: #2563a8; color: #fff; border-color: #2563a8; }
button.danger  { background: #b3261e; color: #fff; border-color: #b3261e; }
button.on      { background: #1b7f4b; color: #fff; border-color: #1b7f4b; }

kbd {
  font: 12px/1 ui-monospace, Consolas, monospace; background: #eceef1;
  border: 1px solid #d2d6dc; border-bottom-width: 2px; border-radius: 3px;
  padding: 2px 5px; color: #444;
}

.bar { height: 6px; background: #e6e8ec; border-radius: 3px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: #1b7f4b; }

table { border-collapse: collapse; width: 100%; }
td, th { border-top: 1px solid #e8eaee; padding: 7px 8px; text-align: left; }
th { color: #777; font-weight: 500; font-size: 12px; border-top: none; }
tr.done td { color: #8a8f96; }
td.num { font-variant-numeric: tabular-nums; white-space: nowrap; color: #666; }

.tag {
  font-size: 11px; padding: 1px 7px; border-radius: 9px;
  background: #eceef1; color: #555;
}
.tag.ok { background: #dcefe3; color: #17603a; }
.tag.warn { background: #fdf0d5; color: #8a5d00; }

/* diff */
.diff { font-size: 16px; line-height: 2; word-break: break-word; }
.diff .eq   { color: #1c1e21; }
.diff .miss { background: #ffd9d6; color: #8a1c14; border-radius: 3px;
              padding: 1px 3px; }
.diff .extra{ background: #e2e2e6; color: #666; text-decoration: line-through;
              border-radius: 3px; padding: 1px 3px; }
.diff .sub  { background: #fdf0c8; border-radius: 3px; padding: 1px 3px; }
.diff .sub .m { color: #b3261e; font-weight: 700; }
.diff .arrow { color: #999; margin: 0 3px; }

.label { font-size: 12px; color: #888; margin: 12px 0 4px; }
textarea {
  width: 100%; font: 16px/1.5 ui-monospace, Consolas, monospace;
  padding: 10px; border: 1px solid #c8ccd2; border-radius: 5px; resize: vertical;
}
textarea:focus { outline: 2px solid #2563a8; border-color: #2563a8; }

/* 句子导航条 */
.strip { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 10px; }
.strip button {
  min-width: 30px; padding: 3px 0; font-size: 12px; border-radius: 4px;
  border: 1px solid #d4d8de; background: #f2f3f5; color: #666;
  font-variant-numeric: tabular-nums;
}
.strip button.dict { background: #fdf0c8; border-color: #e6cf8a; color: #7a5c00; }
.strip button.rec  { background: #dcefe3; border-color: #a9d3bd; color: #17603a; }
.strip button.cur  { outline: 2px solid #2563a8; outline-offset: 1px;
                     font-weight: 700; color: #17406e; }
.legend { font-size: 12px; color: #999; margin-top: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px;
            vertical-align: -1px; margin: 0 3px 0 10px; border: 1px solid #ccc; }

.resume { background: #fff8e6; border-color: #e6cf8a; }

.hidden { display: none !important; }
.muted { color: #888; }
.mono { font-family: ui-monospace, Consolas, monospace; }
.step { font-size: 12px; color: #888; margin-bottom: 10px; }
.step b { color: #2563a8; }
.hint { font-size: 12px; color: #777; margin-top: 8px; }
.err { color: #b3261e; font-size: 13px; }
.warn-text { color: #8a5d00; }
/* 素材按子文件夹分组的组名 */
.cat { font-weight: 600; font-size: 14px; color: #444; margin: 16px 0 6px; }

/* 当前速度 */
button.sel { background: #e8f0fa; border-color: #2563a8; color: #17406e; font-weight: 600; }
/* 难句：金色 */
button.star-on { background: #fff4cc; border-color: #d9a300; color: #7a5600; }

/* 句子导航条：跳过的句子划掉，难句右上角一个星 */
.strip button.skip { background: #fff; color: #bbb; text-decoration: line-through;
                     border-style: dashed; }
.strip button.star { position: relative; }
.strip button.star::after { content: "★"; position: absolute; top: -7px; right: -4px;
                            font-size: 10px; color: #d9a300; }

/* 点词回放：原文里每个词都能点 */
.diff .w { cursor: pointer; border-radius: 3px; }
.diff .w:hover { box-shadow: inset 0 -2px 0 #9dbbe0; }
.diff .w.playing { background: #cfe0f5; box-shadow: none; }

.notice { background: #f4f8fc; border: 1px solid #c9d8e8; border-radius: 5px;
          padding: 10px 12px; margin-top: 10px; font-size: 14px; }

/* 状态筛选 */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.chips button { font-size: 13px; padding: 3px 11px; border-radius: 14px; }
.chips button.sel { background: #2563a8; color: #fff; border-color: #2563a8; }
.chips button .n { opacity: .7; margin-left: 4px; font-variant-numeric: tabular-nums; }
.cat { cursor: pointer; user-select: none; display: flex; align-items: baseline; gap: 8px; }
.cat .caret { display: inline-block; width: 12px; color: #999; }
.cat .sum { font-weight: normal; font-size: 12px; color: #888; }

/* 网页版登录 */
.login { display: flex; justify-content: center; padding-top: 12vh; }
.login-card { width: 340px; display: flex; flex-direction: column; gap: 10px; }
.login-card h1 { margin: 0; }
.login-card .sub { margin: 0 0 6px; }
.login-card label { font-size: 13px; color: #666; }
.login-card input { font: inherit; padding: 8px 10px; border: 1px solid #c8ccd2; border-radius: 5px; }
.login-card input:focus { outline: 2px solid #2563a8; border-color: #2563a8; }

/* Review 打分按钮：和 es / cn 的卡片一样四档、四种颜色，按钮上写下次间隔 */
.grade-btns { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; }
button.grade { display: flex; flex-direction: column; align-items: center; gap: 1px;
               min-height: 66px; padding: 6px 4px; line-height: 1.25; font-weight: 600; }
button.grade small { font-weight: 400; font-size: 12px; opacity: .9; }
button.grade .iv { opacity: .8; }
button.grade.again { background: #b3261e; border-color: #b3261e; color: #fff; }
button.grade.hard  { background: #fff; color: #1c1e21; }
button.grade.good  { background: #1b7f4b; border-color: #1b7f4b; color: #fff; }
button.grade.easy  { background: #2563a8; border-color: #2563a8; color: #fff; }
button.grade:hover:not(:disabled) { filter: brightness(0.93); }
button.grade.hard:hover:not(:disabled) { background: #f0f2f5; }

/* 顶部三个并列的入口：学习 / Review / 错误统计 */
.tabs { display: flex; gap: 4px; margin: 2px 0 18px; border-bottom: 1px solid #e2e4e8; }
.tabs a { padding: 9px 18px 8px; font-size: 16px; font-weight: 600; color: #555;
          text-decoration: none; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: #2563a8; }
.tabs a.on { color: #2563a8; border-bottom-color: #2563a8; }
.badge { display: inline-block; min-width: 18px; padding: 0 6px; border-radius: 9px;
         background: #b3261e; color: #fff; font-size: 12px; line-height: 18px;
         text-align: center; vertical-align: 2px; }
