/* =========================================================================
   若一学习辅导 · 样式表
   设计令牌 → 基础元素 → 组件 → 页面 → 响应式 → 打印
   只依赖 HTML 里已有的类名，不改动 Python 模板。
   ========================================================================= */

:root {
  /* 文字 */
  --ink: #16212e;
  --ink-2: #43566b;
  /* 浅灰文字也保证了 4.5:1 以上的对比度，家长在手机上看得清 */
  --muted: #6b7a8d;
  --muted-2: #8b98a8;

  /* 线条与背景 */
  --line: #e4e9f0;
  --line-2: #d3dce7;
  --bg: #f4f6fa;
  --bg-soft: #fafbfd;
  --card: #ffffff;

  /* 品牌色与语义色 */
  --blue: #1f4e79;
  --blue-dark: #173c5e;
  --blue-ink: #102e48;
  --blue-soft: #e9f1f9;
  --blue-softer: #f4f8fc;
  --gold: #a8790a;
  --gold-soft: #fff6e3;
  --orange: #bd5f0c;
  --orange-soft: #fdefe0;
  --red: #ad241d;
  --red-soft: #fdecea;
  --green: #2c7a4b;
  --green-soft: #e9f5ee;
  --violet: #64489f;
  --violet-soft: #f1ecfb;

  /* 圆角 */
  --r-xs: 6px;
  --r-sm: 9px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --r-pill: 999px;

  /* 阴影 */
  --sh-1: 0 1px 2px rgba(16, 32, 52, .05), 0 1px 3px rgba(16, 32, 52, .05);
  --sh-2: 0 4px 10px rgba(16, 32, 52, .06), 0 14px 30px rgba(16, 32, 52, .06);
  --sh-3: 0 18px 48px rgba(12, 28, 48, .22);
  --ring: 0 0 0 3px rgba(31, 78, 121, .18);

  /* 节奏 */
  --gap-xs: 6px;
  --gap-sm: 10px;
  --gap: 16px;
  --gap-lg: 24px;
  --gap-xl: 34px;
  --head-h: 68px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background:
    radial-gradient(1100px 460px at 50% -240px, #e8eff8 0%, rgba(232, 239, 248, 0) 70%),
    var(--bg);
  color: var(--ink);
  font: 16px/1.72 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
        "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--blue); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--blue-dark); text-decoration: underline; text-underline-offset: 3px; }

:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: var(--r-sm);
}

.wrap { max-width: 1000px; margin: 0 auto; padding: 0 18px; }

/* ============================================================ 顶栏 */

.site-head {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.head-inner {
  display: flex; align-items: center; gap: var(--gap);
  flex-wrap: wrap; padding: 11px 18px; min-height: var(--head-h);
}
.brand { display: flex; align-items: center; gap: 11px; color: inherit; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 13px;
  background: linear-gradient(150deg, #2a6b9f, var(--blue) 55%, var(--blue-ink));
  color: #fff; display: grid; place-items: center;
  font-weight: 700; font-size: 20px; letter-spacing: .5px;
  box-shadow: 0 6px 14px rgba(31, 78, 121, .28);
}
.brand-text strong { display: block; font-size: 17.5px; letter-spacing: .2px; line-height: 1.3; }
.brand-text small { color: var(--muted); font-size: 12.5px; }

.topnav { margin-left: auto; display: flex; align-items: center; gap: 3px; flex-wrap: wrap; }
.topnav a {
  padding: 8px 14px; border-radius: var(--r-pill);
  color: var(--ink-2); font-size: 15px; white-space: nowrap;
  transition: background .15s ease, color .15s ease;
}
.topnav a:hover { background: var(--bg); text-decoration: none; color: var(--ink); }
.topnav a.on {
  background: var(--blue-soft); color: var(--blue-ink); font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(31, 78, 121, .12);
}
.topnav a.teacher-link {
  border: 1px solid var(--line-2); color: var(--blue);
  font-weight: 600; margin-left: 4px;
}
.topnav a.teacher-link:hover { background: var(--blue); border-color: var(--blue); color: #fff; }

/* ============================================================ 基础排版 */

main { padding: var(--gap-lg) 18px 72px; }

.hero { margin: 4px 0 20px; }
.hero h1 { font-size: 29px; line-height: 1.3; margin: 0 0 8px; letter-spacing: -.2px; }
.hero p { color: var(--ink-2); margin: 0; max-width: 62ch; }

.page-head { margin: 4px 0 20px; }
.page-head h1 {
  font-size: 25px; line-height: 1.3; margin: 0 0 8px;
  display: flex; align-items: center; gap: 10px;
}
.page-head h1::before {
  content: ""; width: 5px; height: 22px; border-radius: 3px;
  background: linear-gradient(180deg, #2f6d9e, var(--blue-ink)); flex: none;
}
.page-head p { color: var(--ink-2); margin: 0; max-width: 74ch; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px;
  margin-bottom: var(--gap);
  box-shadow: var(--sh-1);
}
.card h2 { font-size: 17px; margin: 0 0 10px; letter-spacing: .1px; }
.card-head { display: flex; align-items: baseline; gap: var(--gap-sm); flex-wrap: wrap; margin-bottom: 10px; }
.card-head h2 { margin: 0; }
.stamp { color: var(--muted); font-size: 12.5px; }
.more { font-size: 14px; margin-left: auto; white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.summary { margin: 0 0 12px; white-space: pre-line; }

/* 自动生成的摘要：单独做成一块浅色提示区，多科目时按行读 */
.card > .summary:first-of-type {
  background: linear-gradient(180deg, var(--blue-softer), #fff);
  border: 1px solid #e2ecf5;
  border-left: 3px solid #b8d3e8;
  border-radius: var(--r-md);
  padding: 13px 15px;
  font-size: 15px;
  line-height: 1.8;
}

.error, .ok {
  display: block; padding: 11px 14px; border-radius: var(--r-md);
  font-size: 14.5px; margin: 0 0 var(--gap);
}
.error { color: var(--red); background: var(--red-soft); border: 1px solid #f7d5d2; }
.ok { color: var(--green); background: var(--green-soft); border: 1px solid #cfe9da; }

code {
  background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--r-xs); padding: 1px 6px; font-size: .92em;
}

/* ============================================================ 统计卡 */

.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--gap-sm); margin-bottom: 20px;
}
.stat {
  position: relative; overflow: hidden;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 15px 17px; box-shadow: var(--sh-1);
}
.stat::after {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 3px;
  background: linear-gradient(180deg, #3d80b4, var(--blue));
  opacity: .75;
}
.stat span { display: block; color: var(--muted); font-size: 13px; margin-bottom: 2px; }
.stat strong {
  font-size: 22px; letter-spacing: .2px;
  font-variant-numeric: tabular-nums;
}

.kv { display: flex; flex-wrap: wrap; gap: var(--gap-lg); margin-bottom: 14px; }
.kv > div { min-width: 92px; }
.kv span { display: block; color: var(--muted); font-size: 12.5px; margin-bottom: 2px; }
.kv b { font-size: 15px; font-weight: 600; }

/* ============================================================ 胶囊与标签 */

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: var(--gap); }
.chip {
  padding: 7px 15px; border: 1px solid var(--line-2); border-radius: var(--r-pill);
  background: var(--card); color: var(--ink-2); font-size: 14px;
  transition: all .15s ease;
}
.chip:hover { text-decoration: none; border-color: #b9c9da; color: var(--ink); background: var(--blue-softer); }
.chip.on { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 600; }

.badge {
  display: inline-block; padding: 3px 10px; border-radius: var(--r-pill);
  font-size: 12.5px; font-weight: 600; white-space: nowrap; line-height: 1.5;
}
.m-none { background: #eef1f5; color: #5c6b7d; }
.m-low  { background: var(--gold-soft);   color: var(--gold); }
.m-mid  { background: var(--orange-soft); color: var(--orange); }
.m-high { background: var(--red-soft);    color: var(--red); }
.m-ok   { background: var(--green-soft);  color: var(--green); }

/* 题目类型标签（错题 / 变式题 / 相似练习） */
.kind {
  display: inline-block; padding: 2px 9px; border-radius: var(--r-xs);
  font-size: 12px; font-weight: 600; line-height: 1.6;
  border: 1px solid transparent;
}
.k-mistake { background: #eef2f7; color: #46607c; border-color: #dfe7f0; }
.k-variant { background: var(--orange-soft); color: var(--orange); border-color: #f6ddc4; }
.k-practice { background: var(--violet-soft); color: var(--violet); border-color: #e3d9f6; }

.tag {
  background: var(--blue-soft); color: var(--blue-ink);
  padding: 4px 11px; border-radius: var(--r-pill); font-size: 13px; font-weight: 500;
}

/* ============================================================ 照片 */

.thumbs {
  display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 10px;
  scroll-snap-type: x proximity;
}
.thumbs.big { flex-wrap: wrap; overflow: visible; }
.shot { flex: 0 0 auto; display: block; scroll-snap-align: start; border-radius: var(--r-md); }
.shot img {
  width: 138px; height: 138px; object-fit: cover; display: block;
  border-radius: var(--r-md); border: 1px solid var(--line);
  background: var(--bg-soft); cursor: zoom-in;
  transition: transform .18s ease, box-shadow .18s ease;
}
.shot:hover img { transform: translateY(-2px) scale(1.01); box-shadow: var(--sh-2); }
.thumbs.big .shot img { width: 196px; height: 196px; }
.mini-shot img {
  width: 64px; height: 64px; object-fit: cover;
  border-radius: var(--r-sm); border: 1px solid var(--line); cursor: zoom-in;
}

/* 灯箱 */
.lightbox {
  position: fixed; inset: 0; z-index: 80; display: none;
  align-items: center; justify-content: center; gap: 14px;
  background: rgba(12, 20, 32, .88); padding: 24px;
  backdrop-filter: blur(3px);
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: min(94vw, 1240px); max-height: 86vh; border-radius: 10px;
  box-shadow: var(--sh-3); background: #fff;
}
.lightbox .lb-close, .lightbox .lb-prev, .lightbox .lb-next {
  position: absolute; border: 0; cursor: pointer; color: #fff;
  background: rgba(255, 255, 255, .14); border-radius: var(--r-pill);
  width: 46px; height: 46px; font-size: 22px; line-height: 1;
  display: grid; place-items: center; transition: background .15s ease;
}
.lightbox .lb-close:hover, .lightbox .lb-prev:hover, .lightbox .lb-next:hover {
  background: rgba(255, 255, 255, .26);
}
.lightbox .lb-close { top: 20px; right: 20px; }
.lightbox .lb-prev { left: 18px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-next { right: 18px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-count {
  position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
  color: #fff; font-size: 13px; background: rgba(255, 255, 255, .14);
  padding: 5px 14px; border-radius: var(--r-pill);
}

/* ============================================================ 学习日志 */

.log-list { display: flex; flex-direction: column; gap: var(--gap); }

.log {
  position: relative; padding-left: 22px;
}
.log::before {
  content: ""; position: absolute; left: 0; top: 22px; bottom: 22px;
  width: 3px; border-radius: 3px;
  background: linear-gradient(180deg, #cfe0ef, var(--blue-soft));
}
.log-head { display: flex; align-items: flex-start; gap: var(--gap-sm); flex-wrap: wrap; margin-bottom: 12px; }
.log-date { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.log-date b { font-size: 19px; letter-spacing: .2px; font-variant-numeric: tabular-nums; }
.log-date span { color: var(--muted); font-size: 13px; }
.log-tags { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }

.fields { display: flex; flex-direction: column; gap: 12px; margin: 14px 0 6px; }
.fields > div,
.fields-block {
  border-left: 3px solid var(--blue-soft);
  padding-left: 13px;
}
.fields span, .fields-block > span {
  display: block; color: var(--muted); font-size: 12.5px;
  font-weight: 600; letter-spacing: .3px; margin-bottom: 3px;
}
.fields p { margin: 2px 0 0; }
.plain-block .subj-p { margin: 0 0 8px; }
.plain-block .subj-p:last-child { margin-bottom: 0; }

/* 每个科目一行：加一条淡淡的分隔，读起来更清楚 */
.subj-p {
  position: relative; padding-left: 2px; margin: 0 0 7px;
}
.subj-p + .subj-p { padding-top: 7px; border-top: 1px dashed var(--line); }
.subj-p:last-child { margin-bottom: 0; }
.subj-line {
  display: inline-block; margin-right: 7px; padding: 1px 8px;
  background: var(--blue-soft); color: var(--blue-ink);
  border-radius: var(--r-xs); font-size: 12.5px; font-weight: 600;
  vertical-align: 1px;
}

.log-foot {
  display: flex; align-items: center; gap: var(--gap-sm); flex-wrap: wrap;
  margin-top: 14px; border-top: 1px dashed var(--line); padding-top: 11px;
}

details.mistake-box { margin-top: 14px; border-top: 1px dashed var(--line); padding-top: 12px; }
details.mistake-box summary { cursor: pointer; color: var(--blue); font-size: 14px; font-weight: 500; }
details.mistake-box summary:hover { text-decoration: underline; text-underline-offset: 3px; }
details.mistake-box ul {
  list-style: none; padding: 0; margin: 12px 0 0;
  display: flex; flex-direction: column; gap: 10px;
}
details.mistake-box li {
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 12px 14px;
}

ul.plain { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
ul.plain li { border-bottom: 1px dashed var(--line); padding-bottom: 10px; }
ul.plain li:last-child { border-bottom: 0; padding-bottom: 0; }

.kp-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.kp-list li {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  border-bottom: 1px dashed var(--line); padding-bottom: 10px;
}
.kp-list li:last-child { border-bottom: 0; padding-bottom: 0; }

/* ============================================================ 筛选与导出 */

.filters {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 18px; margin-bottom: 12px;
  box-shadow: var(--sh-1);
}
.filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(196px, 1fr)); gap: 13px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { color: var(--ink-2); font-size: 13px; font-weight: 600; }
.filter-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }

input, select, textarea {
  font: inherit; font-size: 15px; color: var(--ink); background: #fff;
  border: 1px solid var(--line-2); border-radius: var(--r-sm);
  padding: 10px 12px; width: 100%; min-height: 44px;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
input:hover, select:hover, textarea:hover { border-color: #bccbdc; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--blue); box-shadow: var(--ring);
}
input::placeholder, textarea::placeholder { color: var(--muted-2); }
textarea { resize: vertical; min-height: 64px; line-height: 1.65; }
select {
  appearance: none; -webkit-appearance: none; padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23697d93' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}

.export-bar {
  display: flex; align-items: center; gap: var(--gap-sm); flex-wrap: wrap;
  background: linear-gradient(180deg, var(--blue-softer), #fff);
  border: 1px dashed #c3d6e8; border-radius: var(--r-lg);
  padding: 14px 18px; margin-bottom: var(--gap);
}
.export-label { color: var(--ink-2); font-size: 14px; font-weight: 600; margin-right: 2px; }

.filter-toggle { display: none; }

.tally-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: var(--gap); }
.tally {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-pill); padding: 6px 14px;
  font-size: 13.5px; color: var(--ink-2); box-shadow: var(--sh-1);
}
.tally b { color: var(--ink); font-variant-numeric: tabular-nums; }

/* ============================================================ 题目卡片 */

.mistake-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
  gap: var(--gap-sm);
}
.mistake-card, .kp-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 17px; box-shadow: var(--sh-1);
  transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease;
  display: flex; flex-direction: column;
}
.mistake-card:hover, .kp-card:hover {
  box-shadow: var(--sh-2); border-color: var(--line-2); transform: translateY(-1px);
}
.kp-card h3 { margin: 10px 0 6px; font-size: 16px; line-height: 1.5; }

.m-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.m-top .subj { font-weight: 700; font-size: 15px; color: var(--blue-ink); }
.m-top em { color: var(--muted); font-style: normal; font-size: 12.5px; }
.m-top .small { margin-left: auto; }

.q { margin: 4px 0 12px; font-size: 15.5px; line-height: 1.68; color: var(--ink); }
.q b, .meta b { color: var(--muted); font-weight: 600; margin-right: 6px; font-size: 12.5px; }

.m-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.m-grid > div {
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 10px 12px; min-width: 0;
}
.m-grid span { color: var(--muted); font-size: 12px; display: block; margin-bottom: 2px; }
.m-grid p { margin: 0; font-size: 14.5px; word-break: break-word; }

.meta { color: var(--ink-2); font-size: 13px; margin: 7px 0; line-height: 1.65; }
.variant { margin: 10px 0 0; }
.variant summary {
  cursor: pointer; color: var(--blue); font-size: 14px; font-weight: 500;
  padding: 4px 0;
}
.variant summary:hover { text-decoration: underline; text-underline-offset: 3px; }
.variant p { margin: 6px 0 0; }

.m-actions {
  display: flex; align-items: center; gap: var(--gap-sm); flex-wrap: wrap;
  margin-top: auto; padding-top: 12px;
}
.m-actions form { margin: 0; }

/* ============================================================ 按钮 */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--blue); background: var(--blue); color: #fff;
  padding: 10px 19px; border-radius: var(--r-md); font-size: 15px; font-weight: 500;
  cursor: pointer; text-align: center; min-height: 44px;
  transition: background .15s ease, box-shadow .15s ease, transform .08s ease, opacity .15s ease;
  box-shadow: 0 1px 2px rgba(31, 78, 121, .18);
}
.btn:hover { background: var(--blue-dark); color: #fff; text-decoration: none; box-shadow: 0 4px 12px rgba(31, 78, 121, .22); }
.btn:active { transform: translateY(1px); box-shadow: none; }
.btn.ghost { background: #fff; color: var(--blue); border-color: var(--line-2); box-shadow: none; }
.btn.ghost:hover { background: var(--blue-softer); border-color: #b7cbe0; color: var(--blue-dark); }
.btn.on { background: var(--green); border-color: var(--green); }
.btn.on:hover { background: #256741; }
.btn.tiny { padding: 6px 13px; font-size: 13px; border-radius: var(--r-sm); min-height: 34px; }
.btn.big { padding: 13px 28px; font-size: 16px; min-height: 50px; }
.btn[disabled], .btn.is-loading { opacity: .62; pointer-events: none; }
.btn.is-loading::before {
  content: ""; width: 13px; height: 13px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff;
  animation: spin .7s linear infinite;
}
.btn.ghost.is-loading::before { border-color: rgba(31, 78, 121, .3); border-top-color: var(--blue); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================ 表单页 */

.upload h2 {
  font-size: 16px; margin: 26px 0 12px; padding-top: 15px;
  border-top: 1px solid var(--line); display: flex; align-items: center; gap: 9px;
}
.upload h2::before {
  content: ""; width: 4px; height: 16px; border-radius: 2px;
  background: var(--blue); opacity: .55;
}
.upload h2:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }

.checks { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 12px 0 16px; }
.checks .label { color: var(--ink-2); font-size: 13px; font-weight: 600; margin-right: 2px; }
.check {
  display: inline-flex; align-items: center; gap: 7px;
  min-height: 44px; padding: 0 13px;
  border: 1px solid var(--line-2); border-radius: var(--r-pill);
  background: var(--bg-soft); cursor: pointer; font-size: 14px;
  transition: all .15s ease;
}
.check:hover { border-color: #b7cbe0; background: var(--blue-softer); }
.check:has(input:checked) {
  background: var(--blue-soft); border-color: #b7cbe0; color: var(--blue-ink); font-weight: 600;
}
.check input { width: auto; min-height: 0; accent-color: var(--blue); }

.dropzone {
  display: block; border: 2px dashed #c3d6e8; border-radius: var(--r-lg);
  padding: 30px 22px; text-align: center; color: var(--ink-2);
  background: var(--blue-softer); cursor: pointer; margin-bottom: 10px;
  transition: all .18s ease;
}
.dropzone::before {
  content: "📷"; display: block; font-size: 26px; margin-bottom: 6px;
}
.dropzone:hover, .dropzone.is-over {
  border-color: var(--blue); background: var(--blue-soft); color: var(--blue-ink);
}
.dropzone input { display: none; }

.mrow {
  border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 16px; margin-bottom: 14px; background: var(--bg-soft);
}
.mrow-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.mrow-head b {
  font-size: 13.5px; color: var(--blue-ink); background: var(--blue-soft);
  padding: 3px 11px; border-radius: var(--r-pill);
}
.mrow-head button { margin-left: auto; }
.mrow-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(186px, 1fr)); gap: 11px; margin-bottom: 11px; }
.submit-row { display: flex; align-items: center; gap: var(--gap-sm); margin-top: 22px; flex-wrap: wrap; }

.card.login { max-width: 430px; }
.card.login .field { margin-bottom: 15px; }

/* ============================================================ 页脚 */

.site-foot {
  border-top: 1px solid var(--line); padding: 20px 0 34px;
  color: var(--muted); font-size: 13px; background: rgba(255, 255, 255, .5);
}
.site-foot .wrap { display: flex; align-items: center; gap: var(--gap-sm); flex-wrap: wrap; }
.live { margin-left: auto; display: inline-flex; align-items: center; gap: 7px; }
.live::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: #37b26a; box-shadow: 0 0 0 3px rgba(55, 178, 106, .16);
  animation: pulse 2.4s ease-in-out infinite;
}
.live.updating::before { background: var(--gold); box-shadow: 0 0 0 3px rgba(168, 121, 10, .16); }
@keyframes pulse { 50% { opacity: .45; } }

#update-banner {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  background: var(--blue); color: #fff; padding: 12px 22px;
  border-radius: var(--r-pill); box-shadow: var(--sh-3);
  font-size: 14.5px; cursor: pointer; display: none; z-index: 60;
  animation: rise .3s ease;
}
#update-banner:hover { background: var(--blue-dark); }
@keyframes rise { from { opacity: 0; transform: translate(-50%, 12px); } }

#to-top {
  position: fixed; right: 20px; bottom: 26px; z-index: 55;
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, .94); color: var(--blue);
  box-shadow: var(--sh-2); cursor: pointer; font-size: 17px;
  display: none; place-items: center;
}
#to-top.show { display: grid; }

/* ============================================================ 响应式 */

@media (max-width: 900px) {
  .mistake-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  :root { --gap: 14px; --gap-lg: 18px; }
  .wrap { padding: 0 14px; }
  main { padding: var(--gap-lg) 14px 64px; }

  .head-inner { padding: 10px 14px; gap: 10px; }
  .brand-mark { width: 36px; height: 36px; border-radius: 11px; font-size: 18px; }
  .brand-text strong { font-size: 16px; }
  .brand-text small { font-size: 11.5px; }

  /* 导航变成可以横滑的一行胶囊，不再折成两行 */
  .topnav {
    width: 100%; margin: 2px 0 0; gap: 6px; flex-wrap: nowrap;
    overflow-x: auto; scrollbar-width: none; padding-bottom: 2px;
  }
  .topnav::-webkit-scrollbar { display: none; }
  /* 收紧内边距，让 5 个入口在 390px 宽的手机上也排得下、不被切掉 */
  .topnav a { padding: 8px 10px; font-size: 14px; letter-spacing: -.2px; }
  .topnav a.teacher-link { margin-left: 0; }

  .hero h1 { font-size: 23px; }
  .hero p { font-size: 15px; }
  .page-head h1 { font-size: 21px; }
  .page-head h1::before { height: 19px; }
  .card { padding: 16px; border-radius: var(--r-md); }

  .stats { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat { padding: 12px 13px; }
  .stat strong { font-size: 19px; }
  .stat span { font-size: 12px; }

  /* 手机端筛选：两列，宽的字段占满 */
  .filters { padding: 15px; }
  .filter-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .filter-grid .field.wide { grid-column: 1 / -1; }
  .filter-grid .field > span { font-size: 12.5px; }
  input, select, textarea { font-size: 16px; padding: 9px 11px; }
  .filter-actions .btn { flex: 1; }

  /* 手机端默认把筛选收起来，避免一屏全是下拉框 */
  .filter-toggle { display: inline-flex; width: 100%; }
  .filters.collapsed .filter-grid,
  .filters.collapsed .filter-actions { display: none; }

  .export-bar { padding: 13px 15px; }
  .export-bar .btn { flex: 1 1 auto; }
  .export-label { width: 100%; }

  .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: 0 0 auto; }

  .m-grid { grid-template-columns: 1fr; }
  .thumbs.big .shot img { width: 46%; height: auto; aspect-ratio: 1 / 1; }
  .thumbs.big { gap: 8px; }
  .log { padding-left: 16px; }
  .log::before { top: 18px; bottom: 18px; }
  .log-date b { font-size: 17px; }
  .log-tags { margin-left: 0; }

  .m-top .small { margin-left: 0; }
  .btn { padding: 10px 16px; }
  #to-top { right: 14px; bottom: 18px; }
  #update-banner { width: calc(100% - 28px); text-align: center; }
}

/* 更窄的手机（iPhone 等 390–430px）：老师端导航有 6 个字的入口，再收紧一点 */
@media (max-width: 430px) {
  .topnav { gap: 2px; }
  .topnav a { padding: 8px 7px; font-size: 13.5px; letter-spacing: -.3px; }
  .topnav a.teacher-link { padding: 8px 9px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

/* ============================================================ 打印 */

@media print {
  .site-head, .site-foot, .filters, .export-bar, .tally-row,
  .m-actions, .chips, #update-banner, #to-top, .lightbox { display: none !important; }
  body { background: #fff; font-size: 11pt; }
  .card, .mistake-card { box-shadow: none; border-color: #ddd; break-inside: avoid; }
  .mistake-grid { grid-template-columns: 1fr; }
  main { padding: 0; }
  .wrap { max-width: none; padding: 0; }
  a { color: inherit; text-decoration: none; }
}

/* ============================================================ 日志：科目分块 + 概要 */

.log-brief {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: 10px 0 14px;
}
.pill {
  display: inline-flex; align-items: baseline; gap: 6px;
  background: var(--blue-soft, #e9f1f9); color: var(--blue-ink, #102e48);
  border-radius: 999px; padding: 5px 13px; font-size: 13.5px; font-weight: 600;
}
.pill i { font-style: normal; font-weight: 500; opacity: .62; font-size: 12.5px; }

.subject-cards { display: flex; flex-direction: column; gap: 10px; margin: 4px 0 12px; }
.subject-card {
  border: 1px solid var(--line, #e3e8ef);
  border-left: 3px solid var(--blue, #1f4e79);
  border-radius: 10px;
  padding: 12px 14px;
  background: #fbfdff;
}
.subject-card > header {
  font-weight: 700; font-size: 14.5px; color: var(--blue-ink, #102e48);
  margin-bottom: 6px;
}
.subject-card .row {
  display: grid; grid-template-columns: 68px 1fr; gap: 10px;
  padding: 4px 0; border-top: 1px dashed rgba(31, 78, 121, .12);
}
.subject-card .row:first-of-type { border-top: 0; }
.subject-card .row > span {
  color: var(--muted, #8593a3); font-size: 13px; font-weight: 600; line-height: 1.6;
}
.subject-card .row > p { margin: 0; }

.log-fold { display: flex; flex-direction: column; gap: 6px; margin: 10px 0 4px; }
.log-more { border-top: 1px dashed var(--line, #e3e8ef); padding-top: 8px; }
.log-more > summary {
  cursor: pointer; color: var(--blue, #1f4e79); font-size: 14px; font-weight: 600;
  list-style: none;
}
.log-more > summary::before { content: "▸ "; }
.log-more[open] > summary::before { content: "▾ "; }
.log-more > summary::-webkit-details-marker { display: none; }
.log-more p { margin: 8px 0 2px; color: var(--ink-2, #4a5b6d); }

/* 筛选：分组下拉 + 快捷类型 + 提示 */
.filter-hint {
  margin: 0 0 12px; color: var(--muted, #8593a3); font-size: 13px;
}
.kind-chips { align-items: center; margin-bottom: 12px; }
.kind-chips .chip-label {
  color: var(--muted, #8593a3); font-size: 13.5px; font-weight: 600; margin-right: 2px;
}
.llm-hint {
  background: #fff8e6; border: 1px solid #f0dfae; color: #7a5b12;
  border-radius: 10px; padding: 10px 14px; font-size: 14px; margin: 0 0 14px;
}
.llm-hint a { color: #7a5b12; font-weight: 700; text-decoration: underline; }

@media (max-width: 640px) {
  .subject-card .row { grid-template-columns: 1fr; gap: 2px; }
  .subject-card .row > span { font-size: 12.5px; }
}

/* 错字重测 与 上传后的自动处理说明 */
.k-retest { border-color: #e0c98d; color: #8a6a17; background: #fffaf0; }
.auto-note { border-left: 3px solid var(--green, #2f7d4f); background: #f4fbf6; }
.auto-note h2 { color: var(--green, #2f7d4f); margin-bottom: 6px; }
.auto-note p { margin: 0 0 10px; }

/* =========================================================================
   B 版视觉：K12 教育 App 风格（亮蓝主色 + 彩色科目 + 圆润大卡片）
   这一层写在最后，用层叠顺序覆盖上面的基础样式；不改动任何模板。
   ========================================================================= */

:root {
  /* 文字 */
  --ink: #16233c;
  --ink-2: #4f6188;
  --muted: #78859f;
  --muted-2: #9aa6bd;

  /* 线条与背景 */
  --line: #e7eefb;
  --line-2: #d5e1f6;
  --bg: #f1f5fe;
  --bg-soft: #f7faff;
  --card: #ffffff;

  /* 品牌与语义色 */
  --blue: #2e7cf6;
  --blue-dark: #1b5fd0;
  --blue-ink: #123a86;
  --blue-soft: #e8f1ff;
  --blue-softer: #f5f9ff;
  --gold: #dd8b00;
  --gold-soft: #fff6e2;
  --orange: #e8721c;
  --orange-soft: #fff1e7;
  --red: #e13b52;
  --red-soft: #ffedf0;
  --green: #0fa97a;
  --green-soft: #e5f9f1;
  --violet: #7a4ff0;
  --violet-soft: #f2ecff;

  /* 科目色 */
  --s-语文: #ff7a45;
  --s-语文-bg: #fff1e8;
  --s-数学: #2e7cf6;
  --s-数学-bg: #e9f1ff;
  --s-英语: #0fb98a;
  --s-英语-bg: #e5f9f1;
  --s-科学: #8257f5;
  --s-科学-bg: #f2ecff;
  --s-默认: #2e7cf6;
  --s-默认-bg: #e9f1ff;

  --r-xs: 8px;
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 20px;
  --r-xl: 28px;
  --sh-1: 0 2px 6px rgba(46, 124, 246, .05), 0 10px 24px rgba(46, 124, 246, .06);
  --sh-2: 0 8px 22px rgba(46, 124, 246, .13), 0 2px 6px rgba(46, 124, 246, .07);
  --sh-3: 0 22px 60px rgba(12, 28, 60, .3);
  --ring: 0 0 0 4px rgba(46, 124, 246, .16);
}

body {
  background:
    radial-gradient(760px 420px at 12% -140px, #dce9ff 0%, rgba(220, 233, 255, 0) 65%),
    radial-gradient(680px 420px at 92% -60px, #e8e2ff 0%, rgba(232, 226, 255, 0) 62%),
    var(--bg);
  background-attachment: fixed;
}

a { color: var(--blue); }
a:hover { color: var(--blue-dark); }

/* ---------------- 顶栏 ---------------- */
.site-head {
  background: rgba(255, 255, 255, .92);
  border-bottom: 1px solid rgba(46, 124, 246, .1);
  box-shadow: 0 2px 12px rgba(46, 124, 246, .06);
}
.brand-mark {
  border-radius: 14px;
  background: linear-gradient(140deg, #63a8ff, var(--blue) 52%, #1b5fd0);
  box-shadow: 0 8px 18px rgba(46, 124, 246, .35);
}
.brand-text strong { font-size: 18px; }
.brand-text small { color: var(--muted); }
.topnav a { font-weight: 600; color: var(--ink-2); }
.topnav a:hover { background: var(--blue-soft); color: var(--blue-ink); }
.topnav a.on {
  background: linear-gradient(135deg, #4f9bff, var(--blue) 60%, #1f66e0);
  color: #fff; box-shadow: 0 6px 14px rgba(46, 124, 246, .3);
}
.topnav a.teacher-link {
  background: var(--blue-soft); border-color: transparent; color: var(--blue-ink);
}
.topnav a.teacher-link:hover { background: var(--blue); color: #fff; }

/* ---------------- 首页大 banner ---------------- */
.hero {
  position: relative; overflow: hidden;
  border-radius: var(--r-xl);
  padding: 26px 26px 28px;
  margin: 0 0 18px;
  background: linear-gradient(135deg, #57a1ff 0%, #2e7cf6 52%, #1c5fd6 100%);
  box-shadow: 0 16px 36px rgba(46, 124, 246, .28);
  color: #fff;
}
.hero::before, .hero::after {
  content: ""; position: absolute; border-radius: 50%;
  background: rgba(255, 255, 255, .16);
}
.hero::before { width: 190px; height: 190px; right: -48px; top: -78px; }
.hero::after { width: 120px; height: 120px; right: 76px; bottom: -70px; background: rgba(255, 255, 255, .12); }
.hero h1 { font-size: 27px; color: #fff; margin: 0 0 8px; letter-spacing: .2px; }
.hero h1::after { content: " ✏️"; font-size: 22px; }
.hero p { color: rgba(255, 255, 255, .92); max-width: 60ch; position: relative; }

/* ---------------- 页面标题 ---------------- */
.page-head h1 { font-size: 26px; color: var(--ink); }
.page-head h1::before {
  width: 6px; height: 24px; border-radius: 4px;
  background: linear-gradient(180deg, #6cabff, var(--blue));
}
.page-head p { color: var(--ink-2); }

/* ---------------- 统计卡 ---------------- */
.stats { gap: 12px; }
.stat {
  border: 0; border-radius: var(--r-lg);
  padding: 16px 18px 15px;
  box-shadow: var(--sh-1);
  background: linear-gradient(160deg, #ffffff, #f6faff);
}
.stat::after { display: none; }
.stat::before {
  content: ""; position: absolute; right: 14px; top: 14px;
  width: 34px; height: 34px; border-radius: 12px;
  background: var(--blue-soft);
  box-shadow: inset 0 0 0 1px rgba(46, 124, 246, .1);
  display: grid; place-items: center; font-size: 17px; line-height: 1;
}
.stat:nth-child(1)::before { content: "📅"; background: #e9f1ff; }
.stat:nth-child(2)::before { content: "📝"; background: #fff1e7; }
.stat:nth-child(3)::before { content: "📷"; background: #f2ecff; }
.stat:nth-child(4)::before { content: "🎯"; background: #e5f9f1; }
.stat span { color: var(--muted); font-size: 12.5px; }
.stat strong { font-size: 26px; color: var(--blue-ink); }
.stat:nth-child(2) strong { color: #d9660f; }
.stat:nth-child(3) strong { color: #6f45e6; }
.stat:nth-child(4) strong { color: #0c9a6e; }

/* ---------------- 卡片 ---------------- */
.card {
  border: 0; border-radius: var(--r-xl);
  padding: 20px; box-shadow: var(--sh-1);
}
.card h2 { font-size: 18px; color: var(--ink); }
.card-head h2::before {
  content: ""; display: inline-block; width: 6px; height: 17px;
  border-radius: 4px; background: linear-gradient(180deg, #6cabff, var(--blue));
  margin-right: 9px; vertical-align: -2px;
}
.stamp { color: var(--muted-2); }
.more { font-weight: 600; }

/* ---------------- 胶囊 / 徽章 ---------------- */
.chip {
  border: 0; background: #fff; box-shadow: var(--sh-1);
  color: var(--ink-2); font-weight: 600;
}
.chip:hover { background: var(--blue-soft); color: var(--blue-ink); }
.chip.on {
  background: linear-gradient(135deg, #4f9bff, var(--blue) 60%, #1f66e0);
  color: #fff; box-shadow: 0 8px 16px rgba(46, 124, 246, .26);
}

.badge { padding: 3px 11px; font-weight: 700; }
.m-none { background: #eef2f8; color: #6b7a92; }
.m-low  { background: var(--gold-soft);   color: var(--gold); }
.m-mid  { background: var(--orange-soft); color: var(--orange); }
.m-high { background: var(--red-soft);    color: var(--red); }
.m-ok   { background: var(--green-soft);  color: var(--green); }

.kind { border: 0; border-radius: 8px; padding: 3px 9px; font-weight: 700; }
.k-mistake { background: #e9f1ff; color: #1f66e0; }
.k-variant { background: #fff1e7; color: #d9660f; }
.k-practice { background: #f2ecff; color: #6f45e6; }

.tag { background: var(--blue-soft); color: var(--blue-ink); font-weight: 600; }

/* 科目配色：由 JS 给元素补 data-subject */
[data-subject="语文"] { --sj: var(--s-语文); --sj-bg: var(--s-语文-bg); }
[data-subject="数学"] { --sj: var(--s-数学); --sj-bg: var(--s-数学-bg); }
[data-subject="英语"] { --sj: var(--s-英语); --sj-bg: var(--s-英语-bg); }
[data-subject="科学"] { --sj: var(--s-科学); --sj-bg: var(--s-科学-bg); }
.subj[data-subject], .tag[data-subject] {
  color: var(--sj, var(--s-默认));
  background: var(--sj-bg, var(--s-默认-bg));
  border-radius: 8px; padding: 2px 9px; font-weight: 700;
}
.mistake-card[data-subject] { border-top: 3px solid var(--sj, var(--s-默认)); }
.kp-card[data-subject] { border-top: 3px solid var(--sj, var(--s-默认)); }

/* ---------------- 照片 ---------------- */
.shot img, .thumbs.big .shot img {
  border: 3px solid #fff; box-shadow: var(--sh-1); border-radius: var(--r-md);
}
.shot:hover img { box-shadow: var(--sh-2); transform: translateY(-3px); }
.mini-shot img { border: 2px solid #fff; box-shadow: var(--sh-1); }
.lightbox { background: rgba(10, 20, 40, .9); }

/* ---------------- 学习日志 ---------------- */
.log { border-radius: var(--r-xl); }
.log::before {
  width: 4px; border-radius: 4px;
  background: linear-gradient(180deg, #8fc0ff, var(--blue));
}
.log-date b { font-size: 20px; color: var(--blue-ink); }
.log-date span { color: var(--muted); }
.log-brief { gap: 8px; margin: 12px 0 14px; }
.pill {
  background: #fff; border: 1px solid var(--line);
  box-shadow: var(--sh-1); border-radius: 12px;
  padding: 6px 12px; font-size: 14px; color: var(--ink);
  align-items: center; flex-wrap: wrap; row-gap: 2px;
}
.pill i { color: var(--muted); font-weight: 600; white-space: nowrap; }
.pill:nth-child(1) { background: linear-gradient(160deg, #fff, #f2f8ff); }
.pill:nth-child(2) { background: linear-gradient(160deg, #fff, #fff4ec); }
.pill:nth-child(3) { background: linear-gradient(160deg, #fff, #f4f0ff); }

.subject-cards { gap: 12px; }
.subject-card {
  border: 0; border-left: 4px solid var(--sj, var(--s-默认));
  border-radius: var(--r-lg);
  background: linear-gradient(160deg, #ffffff, var(--sj-bg, var(--s-默认-bg)));
  padding: 14px 16px; box-shadow: var(--sh-1);
}
.subject-card > header {
  display: inline-block; font-size: 15px; font-weight: 800;
  color: var(--sj, var(--s-默认));
  background: #fff; border-radius: 8px; padding: 2px 10px; margin-bottom: 10px;
  box-shadow: var(--sh-1);
}
.subject-card .row { border-top: 1px dashed rgba(46, 124, 246, .16); }
.subject-card .row > span { color: var(--muted); font-weight: 700; }

.log-more > summary { color: var(--blue); font-weight: 700; }
.log-more p { color: var(--ink-2); }
details.mistake-box summary { font-weight: 700; }
details.mistake-box li { border-radius: var(--r-md); background: var(--bg-soft); }

/* ---------------- 筛选与导出 ---------------- */
.filters { border: 0; border-radius: var(--r-xl); box-shadow: var(--sh-1); padding: 20px; }
.field > span { color: var(--ink-2); font-weight: 700; font-size: 12.5px; }
input, select, textarea {
  background: #f8fbff; border: 1.5px solid var(--line-2); border-radius: var(--r-sm);
}
input:hover, select:hover, textarea:hover { border-color: #b9d0f2; }
input:focus, select:focus, textarea:focus {
  background: #fff; border-color: var(--blue); box-shadow: var(--ring);
}
.filter-hint { color: var(--muted); }
.kind-chips .chip-label { color: var(--ink-2); font-weight: 700; }

.export-bar {
  border: 0; border-radius: var(--r-xl);
  background: linear-gradient(135deg, #eef5ff, #ffffff 60%);
  box-shadow: var(--sh-1); padding: 16px 20px;
}
.export-label { color: var(--blue-ink); font-weight: 800; }

.tally {
  border: 0; box-shadow: var(--sh-1); font-weight: 600;
  background: #fff; border-radius: 12px;
}
.tally b { color: var(--blue-ink); }

/* ---------------- 题目卡 ---------------- */
.mistake-grid { gap: 14px; }
.mistake-card, .kp-card {
  border: 0; border-radius: var(--r-xl);
  padding: 18px; box-shadow: var(--sh-1);
  background: #fff;
}
.mistake-card:hover, .kp-card:hover { box-shadow: var(--sh-2); transform: translateY(-2px); }
.m-top .subj { font-size: 15px; }
.m-top em { color: var(--muted); }
.q { font-size: 16px; line-height: 1.7; }
.m-grid > div {
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 11px 13px;
}
.m-grid span { color: var(--muted); font-weight: 700; }
.meta { color: var(--ink-2); }
.variant summary { font-weight: 700; }
.kp-card h3 { font-size: 17px; }

/* 掌握度进度条（JS 注入 .mastery-bar） */
.mastery-row {
  display: flex; align-items: center; gap: 9px; margin: 2px 0 12px;
}
.mastery-row > span {
  color: var(--muted); font-size: 12px; font-weight: 700; white-space: nowrap;
}
.mastery-row .mastery-bar { flex: 1; margin: 0; }
.mastery-bar {
  position: relative; height: 7px; border-radius: 5px;
  background: #eef3fb; overflow: hidden; margin: 10px 0 2px;
}
.mastery-bar > i {
  position: absolute; inset: 0 auto 0 0; border-radius: 5px;
  background: linear-gradient(90deg, #8fc0ff, var(--blue));
  transition: width .5s ease;
}
.mastery-bar.lv-none > i { background: linear-gradient(90deg, #dfe6f1, #c3ccdd); }
.mastery-bar.lv-low > i { background: linear-gradient(90deg, #ffd479, #ffab1f); }
.mastery-bar.lv-mid > i { background: linear-gradient(90deg, #ffb27a, #f97316); }
.mastery-bar.lv-high > i { background: linear-gradient(90deg, #ff9aa8, #ef3e57); }
.mastery-bar.lv-ok > i { background: linear-gradient(90deg, #7fe0bd, #10b981); }

/* ---------------- 按钮 ---------------- */
.btn {
  border: 0; border-radius: var(--r-sm); font-weight: 700;
  background: linear-gradient(135deg, #4f9bff, var(--blue) 58%, #1f66e0);
  box-shadow: 0 8px 18px rgba(46, 124, 246, .26);
}
.btn:hover { background: linear-gradient(135deg, #4389ec, #1b5fd0); box-shadow: 0 10px 22px rgba(46, 124, 246, .32); }
.btn.ghost {
  background: #fff; color: var(--blue-ink);
  box-shadow: inset 0 0 0 1.5px var(--line-2);
}
.btn.ghost:hover { background: var(--blue-soft); box-shadow: inset 0 0 0 1.5px #b9d0f2; }
.btn.on { background: linear-gradient(135deg, #34d5a5, #0fa97a); box-shadow: 0 8px 18px rgba(15, 169, 122, .26); }
.btn.tiny { border-radius: 10px; }

/* ---------------- 表单页 ---------------- */
.upload h2 { font-size: 17px; color: var(--ink); }
.upload h2::before { width: 6px; height: 18px; border-radius: 4px; background: linear-gradient(180deg, #6cabff, var(--blue)); opacity: 1; }
.check {
  border: 1.5px solid var(--line-2); background: #fff;
  border-radius: 14px; font-weight: 600;
}
.check:hover { background: var(--blue-softer); border-color: #b9d0f2; }
.check:has(input:checked) {
  background: var(--blue-soft); border-color: var(--blue); color: var(--blue-ink);
  box-shadow: 0 4px 10px rgba(46, 124, 246, .14);
}
.check input { accent-color: var(--blue); }
.dropzone {
  border: 2px dashed #b9d0f2; border-radius: var(--r-xl);
  background: linear-gradient(160deg, #f2f8ff, #ffffff);
  font-weight: 600; color: var(--blue-ink);
}
.dropzone::before { font-size: 30px; }
.dropzone:hover, .dropzone.is-over {
  border-color: var(--blue); background: linear-gradient(160deg, #e8f2ff, #f7fbff);
  box-shadow: 0 10px 24px rgba(46, 124, 246, .14);
}
.mrow { border: 0; border-radius: var(--r-lg); background: var(--bg-soft); box-shadow: inset 0 0 0 1px var(--line); }
.mrow-head b { background: var(--blue-soft); color: var(--blue-ink); font-weight: 800; border-radius: 10px; }

/* ---------------- 页脚 / 提示 ---------------- */
.site-foot { border-top: 1px solid rgba(46, 124, 246, .1); background: transparent; color: var(--muted); }
.live::before { background: #19c37d; box-shadow: 0 0 0 4px rgba(25, 195, 125, .16); }
.llm-hint { background: var(--gold-soft); border-color: #f2ddb0; color: #8a6212; border-radius: var(--r-md); }
.error { border: 0; border-radius: var(--r-md); }
.ok { border: 0; border-radius: var(--r-md); }
#update-banner { background: linear-gradient(135deg, #4f9bff, var(--blue)); box-shadow: 0 16px 34px rgba(46, 124, 246, .38); }

/* ---------------- 手机端：底部标签栏 ---------------- */
@media (max-width: 640px) {
  body { padding-bottom: 84px; }
  .site-head .topnav { display: none; }
  /* 老师端把顶部导航放回来（设置 / 退出在这里），底部栏仍保留 5 个主入口 */
  body.teacher-mode .site-head .topnav {
    display: flex; overflow-x: auto; scrollbar-width: none; margin-top: 2px;
  }
  body.teacher-mode .site-head .topnav::-webkit-scrollbar { display: none; }
  body.teacher-mode .topnav a { padding: 7px 11px; font-size: 13.5px; }
  /* 底部栏已经有的入口不在顶部重复，顶部只留「设置 / 退出」这类页面操作 */
  body.teacher-mode .topnav a.tb-dup { display: none; }
  .head-inner { min-height: 60px; }
  .hero { border-radius: var(--r-lg); padding: 22px 20px 24px; }
  .hero h1 { font-size: 22px; }
  .hero p { font-size: 14.5px; }
  .page-head h1 { font-size: 22px; }
  .card, .filters, .export-bar { border-radius: var(--r-lg); padding: 16px; }
  .stat { border-radius: var(--r-lg); }
  .stat strong { font-size: 22px; }
  .mistake-card, .kp-card { border-radius: var(--r-lg); }
  #to-top { bottom: 100px; }
  #update-banner { bottom: 96px; }

  /* 快捷类型筛选：标签不参与横滑，胶囊换行显示 */
  .kind-chips { flex-wrap: wrap; overflow: visible; }
  .kind-chips .chip-label { flex: 0 0 auto; white-space: nowrap; }
}

#tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: none;
  background: rgba(255, 255, 255, .97);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-top: 1px solid rgba(46, 124, 246, .12);
  box-shadow: 0 -6px 22px rgba(46, 124, 246, .1);
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px));
}
#tabbar .tb {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 2px; border-radius: 14px; color: var(--muted);
  font-size: 11.5px; font-weight: 700; line-height: 1.2;
}
#tabbar .tb:hover { text-decoration: none; }
#tabbar .tb svg { width: 23px; height: 23px; display: block; }
#tabbar .tb.on { color: var(--blue); background: var(--blue-soft); }
#tabbar .tb.on svg { transform: translateY(-1px); }
#tabbar .tb-up { color: #fff; }
#tabbar .tb-up .tb-ico {
  width: 42px; height: 42px; margin-top: -18px; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(140deg, #63a8ff, var(--blue) 55%, #1f66e0);
  box-shadow: 0 10px 20px rgba(46, 124, 246, .38);
}
#tabbar .tb-up .tb-ico svg { width: 22px; height: 22px; }
#tabbar .tb-up span { color: var(--blue-ink); font-size: 11px; }

@media (max-width: 640px) {
  #tabbar { display: flex; align-items: flex-end; }
}

@media print {
  #tabbar { display: none !important; }
  body { padding-bottom: 0; }
}
