/* ── 墨韵书卷 · 字词听写 v20260712h ── */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* 墨色系 */
  --ink: #2A2A2A; --ink-light: #555; --ink-muted: #8A8A8A; --ink-faint: #B5B5B5;
  /* 朱砂系 */
  --cinnabar: #BF3B3B; --cinnabar-soft: #FAEFEE; --cinnabar-dark: #9E2F2F;
  /* 花青系 */
  --indigo: #3A6888; --indigo-soft: #ECF3F7;
  /* 藤黄系 */
  --gold: #B8892E; --gold-soft: #FBF5E8;
  /* 松花绿 */
  --jade: #4E8048; --jade-soft: #EFF6ED;
  /* 宣纸底 */
  --paper: #F3EDE3; --paper-bright: #F9F5EE; --paper-deep: #E8E0D2;
  /* 古卷色 */
  --scroll: #E8DFD0; --scroll-dark: #D4C9B6;
  /* 墨边色 */
  --ink-border: #C8C0B4;
  /* 系统色 */
  --red: #C53030; --red-soft: #FBE9E7;
  --green: #3D8B40; --green-soft: #E8F5E9;
  /* 间距 */
  --safe-b: env(safe-area-inset-bottom, 0px);
  /* 字体 — 宋体为主 */
  --display: 'SimSun', 'STSong', 'Songti SC', 'Noto Serif SC', serif;
  --body: 'Microsoft YaHei', 'PingFang SC', -apple-system, sans-serif;
  /* 圆角 — 偏方正，如古籍版框 */
  --r-lg: 8px; --r: 6px; --r-sm: 4px; --r-xs: 2px;
  /* 阴影 — 偏暖调 */
  --shadow-sm: 0 1px 3px rgba(90,70,50,.06);
  --shadow-md: 0 2px 8px rgba(90,70,50,.08);
  --shadow-lg: 0 4px 20px rgba(90,70,50,.1);
}

html { font-size: 16px; -webkit-tap-highlight-color: transparent; }
body {
  font-family: var(--body); background: #D5CEC2; color: var(--ink);
  min-height: 100dvh; -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
.hidden { display: none !important; }
.view {
  max-width: 480px; margin: 0 auto; min-height: 100dvh;
  display: flex; flex-direction: column;
  background: var(--paper);
  position: relative;
  box-shadow: 0 0 0 1px var(--scroll-dark), 4px 0 20px rgba(90,70,50,.08), -4px 0 20px rgba(90,70,50,.08);
}
/* 宣纸纹理 — 墨渍与岁月感 */
.view::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    radial-gradient(ellipse at 12% 55%, rgba(184,137,46,.06) 0%, transparent 40%),
    radial-gradient(ellipse at 88% 20%, rgba(58,104,136,.04) 0%, transparent 35%),
    radial-gradient(ellipse at 45% 85%, rgba(191,59,59,.03) 0%, transparent 35%),
    radial-gradient(ellipse at 70% 45%, rgba(42,42,42,.015) 0%, transparent 30%);
}
.view > * { position: relative; z-index: 1; }

/* ── 通用按钮 — 书卷风格 ── */
.btn-primary {
  display: flex; align-items: center; justify-content: center;
  padding: 13px 28px; border: 2px solid var(--cinnabar-dark); border-radius: var(--r-xs);
  background: var(--cinnabar); color: #F5F0E8; font-size: 15px; font-weight: 600;
  font-family: var(--display); cursor: pointer; -webkit-user-select: none; user-select: none;
  transition: all .2s; position: relative; overflow: hidden;
  letter-spacing: .12em;
  text-shadow: 0 1px 1px rgba(0,0,0,.15);
}
.btn-primary:active { transform: scale(.96); background: var(--cinnabar-dark); }
.btn-primary::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,.08) 0%, transparent 50%);
  pointer-events: none;
}

.btn-outline {
  display: flex; align-items: center; justify-content: center;
  padding: 13px 24px; border: 1px solid var(--ink-border); border-radius: var(--r-xs);
  background: var(--paper-bright); color: var(--ink-light); font-size: 15px; font-weight: 500;
  font-family: var(--display); cursor: pointer; -webkit-user-select: none; user-select: none;
  transition: all .2s; letter-spacing: .08em;
}
.btn-outline:active { transform: scale(.96); background: var(--paper-deep); }

.btn-sm-primary {
  padding: 6px 14px; border: 1px solid var(--cinnabar-dark); border-radius: var(--r-xs);
  background: var(--cinnabar); color: #F5F0E8; font-size: 12px; font-weight: 600;
  font-family: var(--display); cursor: pointer; transition: opacity .15s;
  letter-spacing: .06em;
}
.btn-sm-primary:active { opacity: .8; }

.btn-danger {
  display: block; width: calc(100% - 32px); margin: 0 16px calc(16px + var(--safe-b));
  padding: 12px; border: 1px solid var(--red-soft); border-radius: var(--r);
  background: var(--paper-bright); color: var(--red); font-size: 14px; font-weight: 500;
  font-family: var(--body); cursor: pointer; text-align: center;
}

.icon-btn {
  width: 36px; height: 36px; border: 1px solid var(--scroll-dark); border-radius: var(--r-xs);
  background: var(--paper-bright); color: var(--ink-light); cursor: pointer;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  transition: all .15s;
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:active { background: var(--scroll); color: var(--ink); }

/* ── 首页 ── */
.home-header {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px 20px 14px; position: relative;
  background: linear-gradient(180deg, var(--paper-bright) 0%, var(--paper) 100%);
  min-height: 120px;
}
/* 古典卷草纹分隔 */
.home-header::after {
  content: '❧ ❦ ❧ ❦ ❧ ❦ ❧';
  position: absolute; bottom: 0; left: 0; right: 0;
  font-size: 8px; color: var(--ink-faint); letter-spacing: 8px;
  line-height: 1; text-align: center; opacity: .5;
}
.home-badge {
  display: inline-block; padding: 3px 16px; border-radius: 2px;
  border: 1px solid var(--gold); color: var(--gold); font-size: 11px;
  font-weight: 600; letter-spacing: .15em;
  background: var(--gold-soft);
  font-family: var(--display);
  order: 1;
}
.home-title {
  font-family: var(--display); font-size: 32px; font-weight: 700;
  color: var(--ink); letter-spacing: .25em;
  text-shadow: 2px 2px 0 rgba(184,137,46,.06), 0 0 20px rgba(184,137,46,.04);
  position: relative; display: inline-block;
  order: 2; margin-top: 8px;
  line-height: 1.2;
}
/* 标题下划线 — 如毛笔收笔 */
.home-title::after {
  content: ''; position: absolute; bottom: -6px; left: 15%; right: 15%; height: 2px;
  background: linear-gradient(90deg, transparent, var(--cinnabar) 30%, var(--cinnabar) 70%, transparent);
  opacity: .25; border-radius: 1px;
}
.home-subtitle {
  font-size: 12px; color: var(--ink-muted);
  letter-spacing: .3em; font-weight: 300;
  font-family: var(--display);
  order: 3; margin-top: 14px;
}
/* 印章装饰 */
.home-seal {
  position: absolute; top: 28px; right: 22px;
  width: 40px; height: 40px; border: 2.5px solid var(--cinnabar);
  border-radius: 3px; display: flex; align-items: center; justify-content: center;
  font-family: var(--display); font-size: 18px; color: var(--cinnabar);
  font-weight: 700; transform: rotate(5deg); opacity: .25;
  line-height: 1;
  box-shadow: inset 0 0 0 1px rgba(191,59,59,.15);
}

.home-body { flex: 1; padding: 10px 14px 56px; overflow-y: auto; }

/* ── 登录/注册页 ── */
.account-header {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 48px 24px 24px; position: relative;
  background: linear-gradient(180deg, var(--paper-bright) 0%, var(--paper) 100%);
}
.account-seal {
  position: relative; top: auto; right: auto;
  margin-bottom: 16px; opacity: .35;
  animation: sealFloat 3s ease-in-out infinite;
}
@keyframes sealFloat {
  0%, 100% { transform: rotate(5deg) translateY(0); }
  50% { transform: rotate(5deg) translateY(-4px); }
}
.account-title {
  font-family: var(--display); font-size: 32px; font-weight: 700;
  color: var(--ink); letter-spacing: .3em;
  text-shadow: 2px 2px 0 rgba(184,137,46,.06);
  line-height: 1.2;
}
.account-subtitle {
  font-size: 13px; color: var(--ink-muted);
  letter-spacing: .2em; font-weight: 300;
  font-family: var(--display);
  margin-top: 10px;
}

/* ── 登录表单 ── */
.login-form {
  padding: 24px 28px 0; flex: 1;
}
.login-field {
  margin-bottom: 16px;
}
.login-label {
  display: block; font-family: var(--display); font-size: 13px;
  color: var(--ink-light); letter-spacing: .1em; margin-bottom: 6px;
  font-weight: 500;
}
.login-input {
  width: 100%; padding: 12px 14px; border: 1px solid var(--ink-border);
  border-radius: var(--r-xs); background: var(--paper-bright);
  font-size: 15px; font-family: var(--body); color: var(--ink);
  outline: none; transition: border-color .2s;
}
.login-input:focus {
  border-color: var(--cinnabar);
  box-shadow: 0 0 0 2px rgba(191,59,59,.08);
}
.login-input::placeholder { color: var(--ink-faint); }
.login-error {
  color: var(--red); font-size: 12px; margin-bottom: 10px;
  font-family: var(--display); letter-spacing: .04em;
  padding: 6px 10px; background: var(--red-soft); border-radius: var(--r-xs);
}
.login-submit {
  width: 100%; margin-top: 4px;
}
.login-register {
  width: 100%; margin-top: 10px;
  border-color: var(--cinnabar); color: var(--cinnabar);
  background: transparent;
}

/* ── 学生选择页 ── */
.student-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-bottom: 1px solid var(--scroll);
  background: var(--paper-bright);
}
.student-header-center {
  text-align: center; flex: 1;
}
.student-header-title {
  font-family: var(--display); font-size: 18px; font-weight: 700;
  color: var(--ink); letter-spacing: .15em;
}
.student-header-account {
  font-size: 12px; color: var(--ink-muted);
  font-family: var(--body); letter-spacing: 0;
}
.student-header-right {
  display: flex; align-items: center; gap: 6px;
}

.student-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 12px; padding: 20px 20px 0;
  flex: 1;
}
.student-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 20px 8px 16px; border: 1px solid var(--ink-border); border-radius: var(--r);
  background: var(--paper-bright); cursor: pointer;
  -webkit-user-select: none; user-select: none;
  transition: all .2s; position: relative;
  box-shadow: var(--shadow-sm);
}
.student-card::before {
  content: ''; position: absolute; inset: 3px;
  border: 1px solid var(--scroll); border-radius: calc(var(--r) - 3px);
  pointer-events: none;
}
.student-card:active { transform: scale(.94); background: var(--cinnabar-soft); }
.student-card-avatar {
  font-size: 36px; line-height: 1; margin-bottom: 8px;
}
.student-card-name {
  font-family: var(--display); font-size: 14px; font-weight: 600;
  color: var(--ink); letter-spacing: .08em;
}

.account-add-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin: 16px 20px 0; padding: 12px;
  border: 1px dashed var(--ink-border); border-radius: var(--r);
  background: transparent; color: var(--ink-muted);
  font-family: var(--display); font-size: 14px; font-weight: 500;
  cursor: pointer; transition: all .2s;
  letter-spacing: .08em;
}
.account-add-btn:active { background: var(--scroll); color: var(--ink); }
.account-add-icon { font-size: 20px; font-weight: 400; line-height: 1; }

.account-footer {
  text-align: center; padding: 20px 16px calc(24px + var(--safe-b));
  font-size: 12px; color: var(--ink-faint); letter-spacing: .15em;
  font-family: var(--display);
}

/* ── 首页当前账号栏 ── */
.current-account-section { padding: 10px 14px !important; }
.current-account-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.current-account-avatar { font-size: 24px; line-height: 1; }
.current-account-name {
  font-family: var(--display); font-size: 15px;
  font-weight: 600; color: var(--ink); letter-spacing: .08em;
}
.current-account-acct {
  font-size: 11px; color: var(--ink-faint); font-family: var(--body); letter-spacing: 0;
}
.current-account-switch {
  padding: 4px 10px; border: 1px solid var(--scroll-dark); border-radius: var(--r-xs);
  background: var(--paper); color: var(--ink-muted); font-size: 11px;
  font-family: var(--display); cursor: pointer; transition: all .15s;
  letter-spacing: .04em; white-space: nowrap; margin-left: auto;
}
.current-account-switch:active { background: var(--scroll); color: var(--ink); }

/* ── 底部Tab导航栏 ── */
.tab-bar {
  display: flex; border-top: 1px solid var(--scroll);
  background: var(--paper-bright); padding: 6px 0 calc(6px + var(--safe-b));
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
}
.tab-bar::before {
  content: ''; position: absolute; top: -1px; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--ink-border) 20%, var(--ink-border) 80%, transparent);
}
.tab-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 4px 0; border: none; background: none; cursor: pointer;
  color: var(--ink-faint); font-size: 11px; font-family: var(--display);
  letter-spacing: .06em; transition: color .2s;
}
.tab-item svg { width: 22px; height: 22px; }
.tab-item.active { color: var(--cinnabar); }
.tab-item:active { opacity: .7; }

/* ── Tab页面容器 ── */
.tab-page {
  display: flex; flex-direction: column; min-height: 0;
  flex: 1;
}

/* ── 我的页面 ── */
.mine-header {
  display: flex; align-items: center; gap: 14px;
  padding: 24px 20px 16px;
  background: linear-gradient(180deg, var(--paper-bright) 0%, var(--paper) 100%);
  border-bottom: 1px solid var(--scroll);
}
.mine-avatar {
  font-size: 44px; line-height: 1;
  width: 60px; height: 60px; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--scroll); border-radius: var(--r);
  background: var(--paper-bright);
}
.mine-info { flex: 1; }
.mine-name {
  font-family: var(--display); font-size: 20px; font-weight: 700;
  color: var(--ink); letter-spacing: .1em;
}
.mine-acct {
  font-size: 13px; color: var(--ink-muted);
  font-family: var(--body); letter-spacing: 0; margin-top: 4px;
}
.mine-body {
  flex: 1; padding: 10px 14px 56px; overflow-y: auto;
}
.mine-stats {
  display: flex; align-items: center; justify-content: space-around;
  padding: 6px 0;
}
.mine-stats-item {
  text-align: center; flex: 1;
}
.mine-stats-num {
  display: block; font-size: 22px; font-weight: 700; color: var(--cinnabar);
  font-family: var(--display); letter-spacing: .04em;
}
.mine-stats-label {
  font-size: 11px; color: var(--ink-muted); font-family: var(--display);
  letter-spacing: .08em;
}
.mine-student-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--scroll); border-radius: var(--r-xs);
  margin-bottom: 8px; background: var(--paper); cursor: pointer;
  transition: all .15s;
}
.mine-student-item:active { background: var(--cinnabar-soft); }
.mine-student-item.active {
  border-color: var(--cinnabar); background: var(--cinnabar-soft);
}
.mine-student-avatar { font-size: 22px; }
.mine-student-name {
  flex: 1; font-family: var(--display); font-size: 14px;
  font-weight: 600; letter-spacing: .06em; color: var(--ink);
}
.mine-student-badge {
  font-size: 10px; padding: 2px 8px; border-radius: 2px;
  background: var(--cinnabar); color: #F5F0E8; font-weight: 600;
  letter-spacing: .06em;
}
.mine-add-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; padding: 10px; margin-top: 4px;
  border: 1px dashed var(--ink-border); border-radius: var(--r-xs);
  background: transparent; color: var(--ink-muted);
  font-family: var(--display); font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all .2s; letter-spacing: .06em;
}
.mine-add-btn:active { background: var(--scroll); color: var(--ink); }

.mine-menu-btn {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 12px 14px; border: none; border-bottom: 1px solid var(--scroll);
  background: transparent; color: var(--ink-light); font-size: 14px;
  font-family: var(--display); cursor: pointer; letter-spacing: .06em;
  transition: background .15s;
}
.mine-menu-btn:last-child { border-bottom: none; }
.mine-menu-btn:active { background: var(--scroll); }
.mine-menu-btn--danger { color: var(--red); }

/* ── 首页view需支持内部tab布局 ── */
#homeView { display: flex; flex-direction: column; }
#homeView > .tab-page { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
#homeView > .tab-bar { flex-shrink: 0; }

/* ── 密码登录弹窗 ── */
.password-login-body {
  display: flex; flex-direction: column; align-items: center;
  padding: 4px 0 12px;
}
.password-login-icon {
  font-size: 36px; margin-bottom: 6px; opacity: .5;
}
.password-login-name {
  font-family: var(--display); font-size: 16px; font-weight: 600;
  color: var(--ink); margin-bottom: 12px; letter-spacing: .08em;
}
.password-login-body .student-name-input {
  width: 100%; text-align: center;
}
.password-error {
  color: var(--red); font-size: 12px; margin-top: 6px;
  font-family: var(--display); letter-spacing: .04em;
}

/* ── 注册/编辑账号弹窗 ── */
.register-dialog {
  background: var(--paper-bright); border-radius: var(--r-lg);
  width: 100%; max-width: 380px; padding: 0;
  border: 1px solid var(--ink-border);
  box-shadow: var(--shadow-lg);
  animation: scaleIn .25s cubic-bezier(.34,1.56,.64,1);
}
.register-header {
  display: flex; flex-direction: column; align-items: center;
  padding: 24px 24px 8px;
}
.register-icon {
  font-size: 36px; margin-bottom: 8px; opacity: .7;
}
.register-title {
  font-family: var(--display); font-size: 20px; font-weight: 700;
  color: var(--ink); letter-spacing: .15em;
}
.register-desc {
  font-size: 12px; color: var(--ink-muted);
  font-family: var(--body); margin-top: 6px; letter-spacing: 0;
}
.register-body {
  padding: 16px 24px 0;
}
.register-actions {
  display: flex; gap: 10px; padding: 16px 24px 20px;
}
.register-actions .btn-outline,
.register-actions .btn-primary {
  flex: 1;
}

/* ── 管理弹窗用户名标签 ── */
.mgmt-student-username {
  font-size: 11px; color: var(--ink-faint);
  font-family: var(--body); margin-right: auto;
}

/* ── 学生管理弹窗 ── */
.student-mgmt-dialog {
  background: var(--paper-bright); border-radius: var(--r);
  width: 100%; max-width: 360px; padding: 0;
  border: 1px solid var(--ink-border);
  box-shadow: var(--shadow-lg);
  animation: scaleIn .25s cubic-bezier(.34,1.56,.64,1);
  max-height: 80vh; display: flex; flex-direction: column;
}
.student-mgmt-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--scroll);
}
.student-mgmt-title {
  font-size: 16px; font-weight: 700; font-family: var(--display);
  letter-spacing: .1em;
}
.student-mgmt-list {
  flex: 1; overflow-y: auto; padding: 8px 12px;
}

.mgmt-student-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--scroll);
  border-radius: var(--r-xs); margin-bottom: 8px;
  background: var(--paper); transition: all .15s;
}
.mgmt-student-item.active {
  border-color: var(--cinnabar); background: var(--cinnabar-soft);
}
.mgmt-student-avatar { font-size: 22px; }
.mgmt-student-name {
  flex: 1; font-family: var(--display); font-size: 14px;
  font-weight: 600; letter-spacing: .06em; color: var(--ink);
}
.mgmt-student-badge {
  font-size: 10px; padding: 2px 8px; border-radius: 2px;
  background: var(--cinnabar); color: #F5F0E8; font-weight: 600;
  letter-spacing: .06em;
}
.mgmt-student-actions { display: flex; gap: 6px; }
.mgmt-btn {
  padding: 4px 10px; border: 1px solid var(--scroll-dark); border-radius: var(--r-xs);
  background: var(--paper-bright); color: var(--ink-muted); font-size: 12px;
  font-family: var(--display); cursor: pointer; transition: all .15s;
  letter-spacing: .04em;
}
.mgmt-btn:active { background: var(--scroll); }
.mgmt-del-btn { border-color: rgba(197,48,48,.2); color: var(--red); }
.mgmt-del-btn:active { background: var(--red-soft); }

.student-mgmt-add {
  display: flex; gap: 8px; padding: 12px 16px;
  border-top: 1px solid var(--scroll);
}
.student-name-input {
  flex: 1; padding: 8px 12px; border: 1px solid var(--scroll-dark);
  border-radius: var(--r-xs); background: var(--paper);
  font-family: var(--display); font-size: 14px; color: var(--ink);
  outline: none; transition: border-color .2s;
  letter-spacing: .06em;
}
.student-name-input:focus { border-color: var(--cinnabar); }
.student-name-input::placeholder { color: var(--ink-faint); }

/* ── 学生编辑弹窗 ── */
.student-edit-body { padding: 4px 0 12px; }
.student-edit-label {
  display: block; font-size: 12px; font-weight: 600; color: var(--ink-muted);
  margin-bottom: 6px; letter-spacing: .08em; font-family: var(--display);
}
.student-edit-label + .student-name-input { margin-bottom: 12px; }

.avatar-picker {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 4px 0;
}
.avatar-option {
  width: 42px; height: 42px; border: 1px solid var(--scroll);
  border-radius: var(--r); background: var(--paper);
  font-size: 22px; cursor: pointer; display: flex;
  align-items: center; justify-content: center;
  transition: all .15s; position: relative;
}
.avatar-option:active { transform: scale(.9); }
.avatar-option.selected {
  border-color: var(--cinnabar); background: var(--cinnabar-soft);
  box-shadow: 0 0 0 2px rgba(191,59,59,.15);
}

/* 卡片区块 — 古籍版框 */
.card-section {
  background: var(--paper-bright);
  border: 1px solid var(--ink-border);
  border-radius: var(--r-lg); padding: 12px 14px; margin-bottom: 8px;
  box-shadow: var(--shadow-sm);
  position: relative;
}
/* 外粗内细双线框 */
.card-section::before {
  content: ''; position: absolute; inset: 4px;
  border: 1px solid var(--scroll); border-radius: calc(var(--r-lg) - 4px);
  pointer-events: none;
}
/* 版心角标 — 右上角装饰 */
.card-section::after {
  content: '◆'; position: absolute; top: 6px; right: 8px;
  font-size: 6px; color: var(--cinnabar); opacity: .2;
}
.section-label {
  font-size: 13px; font-weight: 700; color: var(--ink-light);
  letter-spacing: .2em; margin-bottom: 12px;
  padding-left: 2px;
  font-family: var(--display);
}
/* 朱笔批注竖线 */
.section-label::before {
  content: ''; display: inline-block; width: 3px; height: 14px;
  background: var(--cinnabar); margin-right: 8px; vertical-align: middle;
  border-radius: 1px; opacity: .5;
}

/* 年级选择 */
.grade-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.grade-chip {
  display: flex; flex-direction: column; align-items: center;
  padding: 12px 4px 8px; border: 1px solid var(--scroll); border-radius: var(--r-xs);
  background: var(--paper); cursor: pointer; -webkit-user-select: none; user-select: none;
  transition: all .2s; position: relative;
}
.grade-chip:active { transform: scale(.95); }
.grade-chip.selected {
  border-color: var(--cinnabar); background: var(--cinnabar-soft);
  box-shadow: inset 0 0 0 1px rgba(191,59,59,.08);
}
/* 选中态左竖线 */
.grade-chip.selected::before {
  content: ''; position: absolute; left: 0; top: 4px; bottom: 4px;
  width: 3px; background: var(--cinnabar); border-radius: 0 1px 1px 0; opacity: .6;
}
.grade-chip-num {
  font-family: var(--display); font-size: 24px; line-height: 1; color: var(--ink-light);
  font-weight: 700; transition: color .2s;
}
.grade-chip.selected .grade-chip-num { color: var(--cinnabar); }
.grade-chip-suffix { font-size: 12px; color: var(--ink-muted); margin-top: 2px; }
.grade-chip-count { font-size: 11px; color: var(--ink-faint); margin-top: 3px; }

/* 类型选择 */
.type-row { display: flex; gap: 8px; }
.type-chip {
  flex: 1; padding: 10px 8px; border: 1px solid var(--scroll);
  border-radius: var(--r-xs); background: var(--paper); text-align: center;
  font-size: 13px; font-weight: 600; cursor: pointer;
  font-family: var(--display);
  -webkit-user-select: none; user-select: none; transition: all .2s;
  letter-spacing: .1em;
}
.type-chip:active { transform: scale(.96); }
.type-chip.selected {
  border-color: var(--cinnabar); background: var(--cinnabar-soft); color: var(--cinnabar);
}

/* 设置 */
.settings-card .setting-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px dashed var(--scroll);
}
.settings-card .setting-row:last-child { border-bottom: none; }
.setting-label { font-size: 14px; font-weight: 500; color: var(--ink); }
.setting-control { display: flex; align-items: center; gap: 6px; }

.step-btn {
  width: 28px; height: 28px; border: 1px solid var(--scroll-dark); border-radius: var(--r-xs);
  background: var(--paper); font-size: 15px; font-weight: 600; color: var(--ink-light);
  font-family: var(--body); cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.step-btn:active { border-color: var(--cinnabar); color: var(--cinnabar); background: var(--cinnabar-soft); }
.step-value { font-size: 17px; font-weight: 700; min-width: 28px; text-align: center; color: var(--ink); font-family: var(--display); }
.step-unit { font-size: 13px; color: var(--ink-muted); }

/* 开关 */
.switch { position: relative; width: 44px; height: 26px; cursor: pointer; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-track {
  position: absolute; inset: 0; background: var(--scroll); border-radius: 2px;
  transition: background .25s; border: 1px solid var(--scroll-dark);
}
.switch-track::before {
  content: ''; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px;
  background: #fff; border-radius: 1px; transition: transform .25s;
  box-shadow: 0 1px 2px rgba(0,0,0,.1);
}
.switch input:checked + .switch-track { background: var(--cinnabar); border-color: var(--cinnabar-dark); }
.switch input:checked + .switch-track::before { transform: translateX(18px); }

/* 滑块 */
.slider {
  -webkit-appearance: none; width: 80px; height: 3px;
  background: var(--scroll); border-radius: 0; border: 1px solid var(--scroll-dark);
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px; border-radius: 2px;
  background: var(--cinnabar); border: 1px solid var(--cinnabar-dark);
  box-shadow: 0 1px 3px rgba(90,70,50,.15);
}

/* 统计 — 古卷横卷 */
.stats-bar {
  display: flex; align-items: center; justify-content: center;
  padding: 10px 16px; margin-bottom: 8px; gap: 0;
  background: var(--scroll);
  border-top: 2px solid var(--scroll-dark);
  border-bottom: 2px solid var(--scroll-dark);
  box-shadow: var(--shadow-sm);
  position: relative;
}
/* 卷轴端装饰 */
.stats-bar::before, .stats-bar::after {
  content: '◈'; position: absolute; top: 50%; transform: translateY(-50%);
  font-size: 8px; color: var(--scroll-dark); opacity: .4;
}
.stats-bar::before { left: 8px; }
.stats-bar::after { right: 8px; }
.stats-item { flex: 1; text-align: center; }
.stats-num {
  display: block; font-size: 22px; font-weight: 700; color: var(--cinnabar);
  font-variant-numeric: tabular-nums; font-family: var(--display);
}
.stats-label { font-size: 13px; color: var(--ink-muted); letter-spacing: .12em; font-family: var(--display); }
.stats-divider {
  width: 1px; height: 28px; background: var(--scroll-dark); margin: 0 4px;
}

/* 底部按钮 */
.home-footer {
  padding: 12px 16px calc(12px + 56px + var(--safe-b));
  display: flex; gap: 10px;
  background: linear-gradient(0deg, var(--paper) 60%, transparent);
}
.btn-wrongbook, .btn-start {
  flex: 1; font-size: 15px; padding: 14px 12px; letter-spacing: .1em;
}

/* ── 听写页 ── */

/* 顶栏 */
.d-topbar {
  display: flex; align-items: center; gap: 12px; padding: 10px 16px;
  position: sticky; top: 0; z-index: 10;
  background: linear-gradient(180deg, var(--paper) 80%, transparent);
  border-bottom: 1px solid transparent;
}
.d-progress-wrap { flex: 1; display: flex; align-items: center; gap: 10px; }
.d-progress-track {
  flex: 1; height: 4px; background: var(--scroll); border-radius: 0; overflow: hidden;
  border: 1px solid var(--scroll-dark);
}
.d-progress-fill {
  height: 100%; border-radius: 0;
  background: linear-gradient(90deg, var(--gold), var(--cinnabar));
  transition: width .4s cubic-bezier(.4,0,.2,1); width: 0%;
}
.d-progress-text {
  font-size: 13px; font-weight: 700; color: var(--ink-muted);
  white-space: nowrap; font-variant-numeric: tabular-nums; min-width: 42px; text-align: right;
  font-family: var(--display);
}

/* 中央舞台 */
.d-stage {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 16px 20px; touch-action: pan-y; position: relative;
}

/* 田字格卡片 — 书法练习纸 */
.d-card {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  z-index: 2; transition: all .3s ease;
  padding: 0;
  border: 2px solid var(--ink-border);
  border-radius: 2px;
  background: #FDFBF6;
  box-shadow: var(--shadow-md), inset 0 0 80px rgba(184,137,46,.04);
}
.d-card:active { transform: scale(.97); }

/* 单字田字格 — 十字虚线 + 米字虚线 */
.d-card.single-char {
  width: min(240px, 60vmin); height: min(240px, 60vmin);
}
.d-card.single-char::before {
  content: ''; position: absolute; left: 10px; right: 10px; top: 50%;
  border-top: 1px dashed rgba(44,44,44,.08);
}
.d-card.single-char::after {
  content: ''; position: absolute; top: 10px; bottom: 10px; left: 50%;
  border-left: 1px dashed rgba(44,44,44,.08);
}

/* 多字田字格容器 */
.d-grid {
  display: flex; align-items: stretch; z-index: 1;
}
.d-grid.hidden { display: none !important; }

/* 每个田字格单元格 */
.d-cell {
  width: min(120px, 28vmin); height: min(120px, 28vmin);
  position: relative;
  display: flex; align-items: center; justify-content: center;
  background: #FDFBF6;
  border: 1px solid rgba(44,44,44,.05);
  transition: all .3s ease;
}
/* 田字格虚线 */
.d-cell::before {
  content: ''; position: absolute; left: 4px; right: 4px; top: 50%;
  border-top: 1px dashed rgba(44,44,44,.07);
}
.d-cell::after {
  content: ''; position: absolute; top: 4px; bottom: 4px; left: 50%;
  border-left: 1px dashed rgba(44,44,44,.07);
}
.d-cell + .d-cell { border-left: 1.5px solid var(--ink-border); }

/* 单元格字 — 墨迹感 */
.d-cell-char {
  font-family: var(--display); font-size: min(72px, 18vmin); font-weight: 700;
  line-height: 1; color: var(--ink); z-index: 1;
  animation: charIn .4s cubic-bezier(.25,.46,.45,.94);
  text-shadow: 1px 1px 0 rgba(42,42,42,.06);
}
.d-cell-char.hidden { visibility: hidden; }

/* 脱敏遮罩字 */
.d-cell-mask {
  font-family: var(--display); font-size: min(40px, 10vmin); font-weight: 400;
  line-height: 1; color: var(--ink-faint); z-index: 1; letter-spacing: .1em;
}
.d-cell-mask.hidden { display: none !important; }

/* 成语单元格缩小 */
.d-cell.chengyu-cell { width: min(90px, 22vmin); height: min(90px, 22vmin); }
.d-cell.chengyu-cell .d-cell-char { font-size: min(54px, 14vmin); }
.d-cell.chengyu-cell .d-cell-mask { font-size: min(28px, 7vmin); }

/* 单字模式容器 */
.d-single {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  z-index: 1;
}
.d-single.hidden { display: none !important; }

/* 字 — 浓墨效果 */
.d-char {
  font-family: var(--display); font-size: min(120px, 30vmin); font-weight: 700;
  line-height: 1; color: var(--ink); z-index: 1;
  animation: charIn .4s cubic-bezier(.25,.46,.45,.94);
  text-shadow: 2px 2px 0 rgba(42,42,42,.05);
}
.d-char.hidden { display: none !important; }

/* 单字脱敏遮罩 */
.d-mask {
  font-family: var(--display); font-size: min(60px, 15vmin); font-weight: 400;
  line-height: 1; color: var(--ink-faint); z-index: 1;
}
.d-mask.hidden { display: none !important; }

/* ---- 拼音行 ---- */
.d-pinyin-row {
  display: flex; justify-content: center; gap: 0; z-index: 2;
  margin-bottom: 8px; min-height: 22px;
}
.d-pinyin-row.hidden { display: none !important; }
.d-pinyin-cell {
  text-align: center; font-family: var(--body); font-weight: 400;
  color: var(--ink-muted); letter-spacing: 0;
}
.d-pinyin-cell.single { font-size: 20px; letter-spacing: .06em; min-width: min(240px, 60vmin); }
.d-pinyin-cell.phrase { font-size: 16px; width: min(120px, 28vmin); }
.d-pinyin-cell.chengyu { font-size: 14px; width: min(90px, 22vmin); }

/* 标签 — 印签风格 */
.d-tags { display: flex; gap: 8px; margin-top: 16px; z-index: 2; }
.d-tag {
  padding: 4px 14px; border-radius: 2px;
  font-size: 13px; font-weight: 600; letter-spacing: .08em;
  font-family: var(--display);
}
.d-tag--grade { background: var(--cinnabar-soft); color: var(--cinnabar); border: 1px solid rgba(191,59,59,.15); }
.d-tag--type { background: var(--indigo-soft); color: var(--indigo); border: 1px solid rgba(58,104,136,.12); }
.d-tag--type.chengyu { background: var(--gold-soft); color: var(--gold); border-color: rgba(184,137,46,.15); }

/* 底部控制栏 — 两行布局 */
.d-controls {
  padding: 10px 16px calc(16px + var(--safe-b));
  position: sticky; bottom: 0; z-index: 10;
  background: linear-gradient(0deg, var(--paper) 70%, transparent);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.d-controls-row {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%;
}
.d-controls-sub { gap: 20px; }

/* 控制按钮 — 古朴方印风 */
.ctrl-pill {
  display: flex; align-items: center; gap: 6px;
  padding: 11px 18px; border: 1px solid var(--ink-border); border-radius: var(--r-xs);
  background: var(--paper-bright); color: var(--ink-light); cursor: pointer;
  font-family: var(--display); font-size: 14px; font-weight: 600;
  -webkit-user-select: none; user-select: none;
  transition: all .2s cubic-bezier(.4,0,.2,1);
  box-shadow: var(--shadow-sm);
  white-space: nowrap; letter-spacing: .08em;
}
.ctrl-pill svg { width: 17px; height: 17px; flex-shrink: 0; }
.ctrl-pill:disabled { opacity: .2; pointer-events: none; box-shadow: none; }
.ctrl-pill:active { transform: scale(.94); box-shadow: none; }

/* 小号辅助按钮 */
.ctrl-pill--sm {
  padding: 8px 14px; font-size: 12px;
}
.ctrl-pill--sm svg { width: 14px; height: 14px; }

/* 主按钮（朗读）— 朱砂大印 */
.ctrl-pill--main {
  padding: 14px 28px; border: 2px solid var(--cinnabar-dark); border-radius: var(--r-xs);
  background: var(--cinnabar); color: #F5F0E8; font-size: 15px; font-weight: 700;
  box-shadow: 0 3px 12px rgba(191,59,59,.22);
  letter-spacing: .12em;
  text-shadow: 0 1px 1px rgba(0,0,0,.12);
}
.ctrl-pill--main svg { width: 19px; height: 19px; }
.ctrl-pill--main:active {
  transform: scale(.94);
  box-shadow: 0 1px 6px rgba(191,59,59,.18);
}
@keyframes soundBreath {
  0%, 100% { box-shadow: 0 3px 12px rgba(191,59,59,.22); }
  50% { box-shadow: 0 3px 20px rgba(191,59,59,.35); }
}
.ctrl-pill--main.speaking { animation: soundBreath 1.5s ease-in-out infinite; }

/* 偷看态 */
.ctrl-pill.peeking {
  border-color: var(--cinnabar); color: var(--cinnabar); background: var(--cinnabar-soft);
}
/* 自动播放态 */
.ctrl-pill.auto-active {
  border-color: var(--cinnabar); color: var(--cinnabar); background: var(--cinnabar-soft);
}

/* 下一题 — 最后一题强调 */
.ctrl-pill--next.is-last {
  padding: 14px 28px; border: 2px solid var(--cinnabar-dark); border-radius: var(--r-xs);
  background: var(--cinnabar); color: #F5F0E8; font-size: 15px; font-weight: 700;
  box-shadow: 0 3px 12px rgba(191,59,59,.22);
  animation: lastPulse 2s ease-in-out infinite;
  letter-spacing: .12em;
  text-shadow: 0 1px 1px rgba(0,0,0,.12);
}
@keyframes lastPulse {
  0%, 100% { box-shadow: 0 3px 12px rgba(191,59,59,.22); }
  50% { box-shadow: 0 3px 20px rgba(191,59,59,.4), 0 0 0 4px rgba(191,59,59,.06); }
}

.play-icon, .pause-icon { width: 17px; height: 17px; }
.ctrl-pill--sm .play-icon, .ctrl-pill--sm .pause-icon { width: 14px; height: 14px; }

/* ── 批改页 ── */
.chk-topbar {
  display: flex; align-items: center; gap: 10px; padding: 10px 16px;
  position: sticky; top: 0; background: var(--paper); z-index: 10;
  border-bottom: 1px solid var(--ink-border);
}
.chk-topbar-info { flex: 1; }
.chk-title { font-size: 17px; font-weight: 700; font-family: var(--display); letter-spacing: .1em; }
.chk-hint { font-size: 12px; color: var(--ink-muted); }
.chk-badge {
  padding: 4px 12px; border-radius: 2px; background: var(--green-soft);
  color: var(--green); font-size: 13px; font-weight: 700; min-width: 40px; text-align: center;
  border: 1px solid rgba(61,139,64,.15);
  font-family: var(--display);
}
.chk-badge.has-wrong { background: var(--red-soft); color: var(--red); border-color: rgba(197,48,48,.15); }

.chk-grid {
  flex: 1; display: flex; flex-wrap: wrap; gap: 8px;
  padding: 12px 16px; align-content: flex-start;
}
.check-item {
  display: flex; flex-direction: column; align-items: center;
  padding: 10px 14px; border: 1px solid var(--scroll);
  border-radius: var(--r-xs); background: var(--paper-bright); position: relative;
  cursor: pointer; -webkit-user-select: none; user-select: none;
  transition: all .15s; min-width: 50px;
}
.check-item:active { transform: scale(.94); }
.check-item.marked { border-color: var(--red); background: var(--red-soft); }
.check-item.marked .check-char { color: var(--red); }
.check-item .check-pinyin {
  font-size: 12px; color: var(--ink-muted); margin-bottom: 2px;
}
.check-item .check-char {
  font-family: var(--display); font-size: 22px; font-weight: 700; line-height: 1.2;
  letter-spacing: .06em;
}
.check-item.phrase .check-char { font-size: 16px; }
.check-item.chengyu .check-char { font-size: 14px; }
.check-item .check-idx { font-size: 12px; color: var(--ink-faint); margin-top: 2px; font-weight: 500; }
.check-item.marked::after {
  content: '✗'; position: absolute; top: -6px; right: -6px;
  width: 18px; height: 18px; border-radius: 50%; background: var(--red);
  color: #fff; font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

.chk-footer {
  display: flex; gap: 8px; padding: 12px 16px calc(12px + var(--safe-b));
  background: var(--paper); position: sticky; bottom: 0; z-index: 10;
  border-top: 1px solid var(--ink-border);
}
.chk-footer .btn-primary, .chk-footer .btn-outline { flex: 1; }

/* ── 错词本 ── */
.wb-topbar {
  display: flex; align-items: center; gap: 10px; padding: 10px 16px;
  position: sticky; top: 0; background: var(--paper); z-index: 10;
  border-bottom: 1px solid var(--ink-border);
}
.wb-title { flex: 1; font-size: 17px; font-weight: 700; font-family: var(--display); letter-spacing: .1em; }
.wb-count { font-size: 12px; color: var(--ink-muted); font-weight: 400; }

.wb-body { padding: 8px 16px; flex: 1; }
.wb-group { margin-bottom: 14px; }
.wb-group-title {
  font-size: 14px; font-weight: 600; color: var(--ink-muted);
  padding: 4px 0 8px; letter-spacing: .1em;
  border-bottom: 1px solid var(--scroll); margin-bottom: 10px;
  font-family: var(--display);
}

/* 错词卡片列表 */
.wb-group-chars { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.wb-char-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; background: var(--paper-bright); border-radius: var(--r-xs);
  border: 1px solid var(--scroll); cursor: pointer; position: relative;
  transition: all .15s; box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.wb-char-item:active { border-color: var(--cinnabar); background: var(--cinnabar-soft); }
.wb-char-item .wb-char-main {
  flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
.wb-char-item .char {
  font-family: var(--display); font-size: 18px; font-weight: 700; letter-spacing: .04em;
  color: var(--ink); flex-shrink: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wb-char-item.phrase .char { font-size: 15px; }
.wb-char-item.chengyu .char { font-size: 13px; }
.wb-char-item .pinyin {
  font-size: 12px; color: var(--ink-muted); font-weight: 400;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wb-char-item .wb-char-meta {
  display: flex; align-items: center; gap: 4px; flex-shrink: 0;
}
.wb-char-item .type-tag {
  font-size: 10px; padding: 1px 4px; border-radius: 2px;
  background: var(--indigo-soft); color: var(--indigo); font-weight: 500;
  border: 1px solid rgba(58,104,136,.1);
}
.wb-char-item.chengyu .type-tag { background: var(--gold-soft); color: var(--gold); border-color: rgba(184,137,46,.1); }
.wb-char-item .wrong-count {
  min-width: 20px; height: 20px; padding: 0 4px;
  background: var(--red-soft); color: var(--red); border-radius: 2px; font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(197,48,48,.12);
}
.wb-char-item .remove-btn {
  width: 24px; height: 24px; border-radius: 50%;
  background: transparent; color: var(--ink-faint); border: none; font-size: 14px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all .15s; flex-shrink: 0;
}
.wb-char-item .remove-btn:active { background: var(--red-soft); color: var(--red); }

.wb-empty {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--ink-muted); text-align: center; padding: 40px 20px;
}
.wb-empty p { font-size: 14px; font-weight: 500; }
.wb-empty-hint { font-size: 12px; margin-top: 4px; opacity: .6; }

/* ── 弹窗 ── */
.overlay {
  position: fixed; inset: 0; background: rgba(42,42,42,.5); z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 24px; animation: fadeIn .2s ease;
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
}
.dialog {
  background: var(--paper-bright); border-radius: var(--r); padding: 24px;
  width: 100%; max-width: 320px;
  border: 1px solid var(--ink-border);
  box-shadow: var(--shadow-lg);
  animation: scaleIn .25s cubic-bezier(.34,1.56,.64,1);
}
.dialog-title { font-size: 17px; font-weight: 700; margin-bottom: 10px; font-family: var(--display); letter-spacing: .08em; }
.dialog-body { font-size: 14px; color: var(--ink-light); line-height: 1.6; margin-bottom: 20px; }
.dialog-actions { display: flex; gap: 8px; }
.dialog-actions button { flex: 1; }

/* ── 结果摘要 ── */
.result-card {
  background: var(--paper-bright); border-radius: var(--r); padding: 28px 24px;
  width: 100%; max-width: 340px; text-align: center;
  border: 1px solid var(--ink-border);
  box-shadow: var(--shadow-lg);
  animation: scaleIn .3s cubic-bezier(.34,1.56,.64,1);
  position: relative;
}
/* 卷首装饰 */
.result-card::before {
  content: '✦'; position: absolute; top: 8px; left: 12px;
  font-size: 8px; color: var(--cinnabar); opacity: .2;
}
.result-card::after {
  content: '✦'; position: absolute; top: 8px; right: 12px;
  font-size: 8px; color: var(--cinnabar); opacity: .2;
}
.result-title {
  font-family: var(--display); font-size: 24px; font-weight: 700;
  margin-bottom: 20px; letter-spacing: .2em;
}
.result-stats {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-bottom: 16px;
}
.result-stat {
  padding: 10px 4px; background: var(--paper); border-radius: var(--r-xs);
  border: 1px solid var(--scroll);
}
.result-stat-num { display: block; font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; font-family: var(--display); }
.result-stat-num.correct { color: var(--green); }
.result-stat-num.wrong { color: var(--red); }
.result-stat-num.rate { color: var(--cinnabar); }
.result-stat-label { font-size: 11px; color: var(--ink-muted); margin-top: 2px; display: block; }

.result-wrong-list {
  margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--scroll);
  text-align: left;
}
.result-wrong-title { font-size: 13px; font-weight: 600; color: var(--red); margin-bottom: 8px; font-family: var(--display); }
.result-wrong-items { display: flex; flex-wrap: wrap; gap: 6px; }
.result-wrong-item {
  padding: 4px 10px; background: var(--red-soft); color: var(--red);
  border-radius: 2px; font-size: 13px; font-weight: 600;
  font-family: var(--display); letter-spacing: .06em;
  border: 1px solid rgba(197,48,48,.12);
}

.result-btn { margin-top: 20px; width: 100%; }

/* ── 动画 ── */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.view:not(.hidden) { animation: fadeIn .15s ease; }
@keyframes charIn { from { transform: scale(.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes pop { 0% { transform: scale(1); } 50% { transform: scale(.92); } 100% { transform: scale(1); } }
.check-item.just-marked { animation: pop .2s ease; }
@keyframes scaleIn { from { transform: scale(.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}
.grade-chip.shake, .type-chip.shake { animation: shake .4s ease; }
