/* ============ 基础变量与主题 ============ */
:root {
  --primary: #4f46e5;
  --primary-soft: #eef2ff;
  --primary-contrast: #fff;
  --bg: #f4f5fb;
  --surface: #ffffff;
  --surface-2: #f8f9fd;
  --text: #1f2430;
  --text-soft: #5b6172;
  --border: #e5e7f0;
  --ok: #16a34a;
  --ok-bg: #dcfce7;
  --bad: #dc2626;
  --bad-bg: #fee2e2;
  --warn: #d97706;
  --marked: #f59e0b;
  --marked-bg: #fef3c7;
  /* 固定搭配笔刷自己的高亮色（与单词笔刷的 --marked 区分） */
  --phrase: #6366f1;
  --phrase-bg: #eef2ff;
  --shadow: 0 4px 18px rgba(31, 36, 48, .08);
  --radius: 14px;
  --passage-size: 20px;
  --phonetic-size: 12px;
}
html[data-theme="dark"] {
  --primary: #818cf8;
  --primary-soft: #2a2f55;
  --primary-contrast: #14162b;
  --bg: #12141d;
  --surface: #1b1e2b;
  --surface-2: #222637;
  --text: #e7e9f2;
  --text-soft: #9aa1b5;
  --border: #2e3346;
  --ok: #4ade80;
  --ok-bg: #14301f;
  --bad: #f87171;
  --bad-bg: #3a1d1d;
  --warn: #fbbf24;
  --marked: #fbbf24;
  --marked-bg: #3d2f10;
  --phrase: #a5b4fc;
  --phrase-bg: #262b4a;
  --shadow: 0 4px 18px rgba(0, 0, 0, .35);
}
@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] {
    --primary: #818cf8;
    --primary-soft: #2a2f55;
    --primary-contrast: #14162b;
    --bg: #12141d;
    --surface: #1b1e2b;
    --surface-2: #222637;
    --text: #e7e9f2;
    --text-soft: #9aa1b5;
    --border: #2e3346;
    --ok: #4ade80;
    --ok-bg: #14301f;
    --bad: #f87171;
    --bad-bg: #3a1d1d;
    --warn: #fbbf24;
    --marked: #fbbf24;
    --marked-bg: #3d2f10;
    --phrase: #a5b4fc;
    --phrase-bg: #262b4a;
    --shadow: 0 4px 18px rgba(0, 0, 0, .35);
  }
}
html[data-font="s"] { --passage-size: 17px; }
html[data-font="m"] { --passage-size: 20px; }
html[data-font="l"] { --passage-size: 24px; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overscroll-behavior-y: none;
}
h1, h2, h3 { margin: 0; line-height: 1.3; }
p { margin: 0; }
button { font-family: inherit; }

/* ============ 布局骨架 ============ */
#app { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  padding-top: calc(10px + env(safe-area-inset-top));
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 17px; }
.brand-logo { font-size: 20px; }
.topbar-right { margin-left: auto; display: flex; gap: 6px; }
.admin-shortcut { color: var(--primary); }
/* 电脑端顶部导航：默认隐藏，宽屏显示（替代底部导航） */
.topnav { display: none; }

.content {
  flex: 1;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px 16px 110px;
}
@media (min-width: 760px) {
  .content { padding: 28px 28px 40px; }
}

.view { display: none; animation: fade .18s ease; }
.view.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head .row.gap { flex-wrap: wrap; }
.page-head.compact h1 { font-size: 20px; }
/* 操作页（打字/标注/留空/默写/助记）：标题独占整行宽度，功能键另起一行，不影响标题排版 */
.page-head.stack { flex-direction: column; align-items: stretch; }
.page-head.stack .page-head-main { width: 100%; flex: 1 1 100%; }
.page-head.stack .page-actions { width: 100%; flex: 1 1 100%; justify-content: flex-start; }
.page-head.stack .page-actions .back-library { margin-right: auto; }
.page-sub { color: var(--text-soft); font-size: 13.5px; margin-top: 4px; }
.grow { flex: 1; min-width: 0; }
.top-user { font-size: 13px; color: var(--text-soft); margin-right: 8px; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lang-tabs { display: flex; background: var(--surface-2); border-radius: 10px; padding: 3px; gap: 2px; }
.lang-tab { padding: 8px 16px; border: none; background: transparent; border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: 500; color: var(--text-soft); }
.lang-tab.active { background: var(--primary); color: #fff; font-weight: 600; box-shadow: 0 2px 8px rgba(79,70,229,.3); }
#wordSearch { min-width: 220px !important; flex: 2 !important; }
.daily-quote { background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 8%, transparent), transparent); }
.daily-quote .quote-text { font-size: 14px; font-weight: 600; line-height: 1.6; }
.daily-quote .quote-trans { font-size: 12.5px; color: var(--text-soft); margin-top: 6px; line-height: 1.5; }
.pin-btn { background: var(--surface-2); border: 1px solid var(--border); cursor: pointer; font-size: 12px; padding: 3px 8px; border-radius: 6px; opacity: 0.8; }
.pin-btn.on { opacity: 1; border-color: var(--primary); color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, transparent); }
.article-card.pinned { border-color: var(--primary); border-width: 2px; }
/* 下拉跳转定位时短暂高亮 */
.article-card.flash { animation: cardFlash 1.2s ease-out; }
@keyframes cardFlash {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--primary) 70%, transparent); background: color-mix(in srgb, var(--primary) 18%, transparent); }
  60% { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; background: transparent; }
}

/* 客户发布版首屏注册区；管理员入口由服务端身份动态显示 */
.client-welcome {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 1.1fr);
  gap: 20px; align-items: center; margin: 0 0 18px; padding: 20px;
  border: 1px solid color-mix(in srgb, var(--primary) 32%, var(--border));
  border-radius: var(--radius); background: linear-gradient(135deg, var(--primary-soft), var(--surface));
  box-shadow: var(--shadow);
}
body[data-app-mode="admin"] .brand-name::after {
  content: " · 开发管理端"; color: var(--primary); font-size: 12px; font-weight: 600;
}
body[data-app-mode="client"] #cloudSetup { display: none !important; }
.client-welcome-copy h2 { margin: 5px 0 6px; font-size: 21px; }
.client-welcome-copy p { color: var(--text-soft); font-size: 13.5px; line-height: 1.7; }
.eyebrow { color: var(--primary); font-size: 11px; font-weight: 800; letter-spacing: .12em; }
.client-auth-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.client-auth-actions .input, .client-auth-actions .hint { grid-column: span 2; }
.client-auth-actions .btn { min-height: 42px; }
@media (max-width: 680px) {
  .client-welcome { grid-template-columns: 1fr; padding: 16px; }
  .client-auth-actions { grid-template-columns: 1fr; }
  .client-auth-actions .input, .client-auth-actions .hint { grid-column: span 1; }
  .admin-shortcut { display: none; }
}

/* ============ 通用控件 ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .08s, background .15s, border-color .15s;
  white-space: nowrap;
}
.btn:hover { border-color: var(--primary); }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-contrast); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.small { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn.seg.on { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.icon-btn {
  width: 38px; height: 38px; border-radius: 10px;
  border: 1px solid transparent; background: transparent; color: var(--text);
  font-size: 18px; cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); }
.back-btn { font-size: 20px; font-weight: 700; }

.row { display: flex; align-items: center; }
.row.gap { gap: 10px; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.row.center { justify-content: center; }
.row.wrap { flex-wrap: wrap; }
.margin-top { margin-top: 12px; }

.input, .textarea {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  padding: 10px 12px;
  font-size: 15px;
  font-family: inherit;
}
.input:focus, .textarea:focus { outline: 2px solid var(--primary); outline-offset: -1px; border-color: transparent; }
.textarea { resize: vertical; line-height: 1.6; }
.textarea.small { font-size: 14px; }
.field-label { font-size: 13.5px; color: var(--text-soft); font-weight: 600; display: block; margin: 10px 0 6px; }
.field-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.field-row:first-child { margin-top: 0; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; }
.hint { color: var(--text-soft); font-size: 13px; line-height: 1.7; }
.file-btn { cursor: pointer; position: relative; overflow: hidden; display: inline-flex; align-items: center; gap: 6px; }
.file-btn input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.file-btn::after { content: '📄'; }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.panel-soft { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 12px; }
.device-self-service { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border); }
.device-list { display: grid; gap: 8px; margin-top: 10px; }
.device-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; }
.device-item span { display: flex; flex-direction: column; min-width: 0; }
.device-item small { color: var(--text-soft); overflow-wrap: anywhere; }
.admin-create h4 { margin: 0; font-size: 14px; }
.panel h3 { font-size: 15.5px; margin-bottom: 6px; }
.panel .hint + .hint { margin-top: 6px; }
.danger-panel { border-color: color-mix(in srgb, var(--bad) 40%, var(--border)); }

/* ============ 文章库左右分栏 ============ */
.library-layout { display: block; }
@media (min-width: 900px) {
  .library-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 18px;
    align-items: start;
  }
  .library-side { position: sticky; top: 70px; max-height: calc(100vh - 90px); overflow-y: auto; }
  .library-side .panel { margin-bottom: 10px; }
}
@media (max-width: 899px) {
  .library-side { margin-top: 16px; }
  .import-fab { display: flex !important; }
}
.import-fab {
  display: none;
  position: fixed; bottom: 80px; right: 16px; z-index: 50;
  width: 52px; height: 52px; border-radius: 50%;
  background: #6c5ce7; color: #fff; font-size: 24px;
  align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(108,92,231,.4);
  border: none; cursor: pointer;
}
.import-fab.has-hint::after {
  content: '';
  position: absolute; inset: -4px; border-radius: 50%;
  border: 2px solid #6c5ce7;
  animation: fabPulse 2s ease-out infinite;
  pointer-events: none;
}
@keyframes fabPulse {
  0% { transform: scale(1); opacity: .8; }
  100% { transform: scale(1.5); opacity: 0; }
}
.import-hint {
  display: none !important;
}
/* 只在手机端显示导入提示 */
@media (max-width: 680px) {
  .import-hint {
    position: fixed; bottom: 140px; right: 16px; z-index: 50;
    color: #6c5ce7; font-size: 12px; font-weight: 600;
    padding: 4px 8px; text-align: center; max-width: 180px;
    line-height: 1.4; background: transparent; box-shadow: none;
  }
  .import-hint.show { display: block !important; }
}

/* Word/Excel 版表格：单元格右/下边缘拖拽条提示 */
.bs-table-wrap td, .bs-table-wrap th { position: relative; }
.bs-table-wrap td::after, .bs-table-wrap th::after { content: ''; position: absolute; top: 0; bottom: 0; right: -4px; width: 8px; cursor: col-resize; z-index: 3; }
.bs-table-wrap td::before, .bs-table-wrap th::before { content: ''; position: absolute; left: 0; right: 0; bottom: -4px; height: 8px; cursor: row-resize; z-index: 3; }
.bs-table-wrap td:hover, .bs-table-wrap th:hover { outline: 1px dashed rgba(79,70,229,.45); outline-offset: -1px; }

/* Word/Excel 版表格：单元格右/下边缘拖拽条（可见标识 + hover 高亮） */
.bs-table-wrap td, .bs-table-wrap th { position: relative; }
.bs-table-wrap td::after, .bs-table-wrap th::after { content: ''; position: absolute; top: 2px; bottom: 2px; right: 0; width: 4px; background: linear-gradient(90deg, rgba(79,70,229,0), rgba(79,70,229,.18), rgba(79,70,229,0)); border-radius: 2px; cursor: col-resize; z-index: 3; transition: background .15s; }
.bs-table-wrap td::before, .bs-table-wrap th::before { content: ''; position: absolute; left: 2px; right: 2px; bottom: 0; height: 4px; background: linear-gradient(180deg, rgba(79,70,229,0), rgba(79,70,229,.18), rgba(79,70,229,0)); border-radius: 2px; cursor: row-resize; z-index: 3; transition: background .15s; }
.bs-table-wrap td:hover::after, .bs-table-wrap th:hover::after { background: linear-gradient(90deg, rgba(79,70,229,0), rgba(79,70,229,.45), rgba(79,70,229,0)); }
.bs-table-wrap td:hover::before, .bs-table-wrap th:hover::before { background: linear-gradient(180deg, rgba(79,70,229,0), rgba(79,70,229,.45), rgba(79,70,229,0)); }

/* ============ 文章卡片 ============ */
.article-list { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 700px) { .article-list { grid-template-columns: 1fr 1fr; } }
@media (min-width: 900px) { .library-main .article-list { grid-template-columns: 1fr; } }
.article-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 10px;
  transition: transform .1s, border-color .15s;
}
.article-card:hover { border-color: var(--primary); transform: translateY(-2px); }
.article-card h3 { font-size: 16.5px; word-break: break-word; }
.card-preview {
  color: var(--text-soft); font-size: 13px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-meta { display: flex; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--text-soft); }
.tag {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 999px; padding: 2px 10px;
}
.tag.marked { background: var(--marked-bg); border-color: transparent; color: var(--warn); }
.card-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 6px; }
.card-actions .btn { padding: 7px 12px; font-size: 13px; }
.empty {
  text-align: center; color: var(--text-soft);
  padding: 50px 20px; border: 1.5px dashed var(--border); border-radius: var(--radius);
}
.empty .big { font-size: 38px; display: block; margin-bottom: 8px; }

/* ============ 文章正文（阅读/打字/留空共用） ============ */
.passage {
  font-size: var(--passage-size);
  line-height: 2.1;
  word-break: break-word;
  white-space: pre-wrap;
}
.reader-body {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}
.reader-body .word { border-radius: 4px; cursor: pointer; }
.reader-body .word:hover { background: var(--primary-soft); }
.reader-body.show-phonetic .word {
  display: inline-block; text-align: center; vertical-align: bottom;
  margin: 0 1px; position: relative;
}
.reader-body.show-phonetic .word .ph {
  display: block; font-size: var(--phonetic-size); color: var(--primary); line-height: 1.1;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-weight: 700;
  white-space: nowrap; margin-top: 1px; opacity: .95;
}
.reader-body.show-phonetic .word .ph.missing,
.preview-body.show-phonetic .word .ph.missing,
.cloze-body.show-phonetic .ph.missing { color: var(--text-soft); opacity: .55; }
.reader-body .word.marked {
  background: var(--marked-bg);
  color: var(--warn);
  border-bottom: 2px solid var(--marked);
  font-weight: 600;
}
.preview-body .word { border-radius: 4px; cursor: pointer; }
.preview-body .word:hover { background: var(--primary-soft); }
.preview-body .word.marked {
  background: var(--marked-bg);
  color: var(--warn);
  border-bottom: 2px solid var(--marked);
  font-weight: 600;
}
/* 固定句型 / 搭配里的词：搭配笔刷专属色 + 虚线底边（与「已收藏」的实线底边可叠加） */
.reader-body .word.in-phrase,
.preview-body .word.in-phrase,
.type-text .word.in-phrase {
  border-bottom: 2px dotted var(--phrase) !important;
  border-radius: 4px;
}
/* 阅读/预览里只用搭配笔刷标过的词，文字也跟随搭配色（打字页保留对错反馈色，只加虚线） */
.reader-body .word.in-phrase,
.preview-body .word.in-phrase { color: var(--phrase) !important; }
/* 只被搭配笔刷标到、没进单词本的词 → 用搭配底色铺底（两者都中时保留单词本的实心底） */
.reader-body .word.in-phrase:not(.marked),
.preview-body .word.in-phrase:not(.marked) {
  background: var(--phrase-bg);
}
/* 迷你条里的「笔刷模式」切换：单词 / 搭配 两态 */
/* 迷你条是白底浮层，配色写死，避免深色主题下白底浅字看不清 */
#noteMiniBar .mm-mode { display: inline-flex; align-items: center; gap: 3px; padding: 2px 7px; border-radius: 7px; border: 1px solid #e2e6ef; background: #f6f7fb; color: #5b6172; font-size: 12px; cursor: pointer; line-height: 1.5; }
#noteMiniBar .mm-mode:hover { background: #eef1f8; }
#noteMiniBar .mm-mode.on-word { border-color: #f59e0b; color: #b45309; background: #fffbeb; font-weight: 700; }
#noteMiniBar .mm-mode.on-phrase { border-color: #6366f1; color: #4338ca; background: #eef2ff; font-weight: 700; }
/* 工具栏的笔刷模式按钮：激活态用对应那套色描边（不抢 primary 的蓝底也看得清） */
.bs-note-bar .ntmode { border-radius: 7px; }
.bs-note-bar .ntmode.on-word { background: #fffbeb !important; border-color: #f59e0b !important; color: #b45309 !important; font-weight: 700; }
.bs-note-bar .ntmode.on-phrase { background: #eef2ff !important; border-color: #6366f1 !important; color: #4338ca !important; font-weight: 700; }
/* 单词本页：句型颜色小圆点 */
.phrase-item .ph-dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; background: var(--phrase); box-shadow: 0 0 0 2px var(--phrase-bg); }

/* 中英对照段落（英文段 + 中文译文段） */
.reader-body .en-p {
  margin: 0 0 4px;
  font-size: var(--passage-size);
  line-height: 2.1;
  word-break: break-word;
}
.reader-body .en-p + .zh-p { margin-bottom: 20px; }
.reader-body .zh-p {
  margin: 0 0 20px;
  padding: 10px 14px;
  font-size: calc(var(--passage-size) - 4px);
  line-height: 1.9;
  color: var(--text-soft);
  background: var(--surface-2);
  border-left: 3px solid var(--primary);
  border-radius: 0 8px 8px 0;
  white-space: pre-wrap;
  word-break: break-word;
}
.reader-body .zh-p[hidden] { display: none; }

/* ============ 打字练习 ============ */
.stats-bar {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 8px; margin-bottom: 14px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 6px;
  text-align: center;
}
.stat-label { display: block; font-size: 11.5px; color: var(--text-soft); }
.stat-value { font-size: 15px; font-weight: 700; }
.stat-value b { color: var(--primary); }

.type-wrap { position: relative; }
.type-text {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  cursor: text;
  max-height: 62vh; overflow-y: auto;
  font-variant-numeric: tabular-nums;
}
.type-text .c { color: var(--text-soft); border-radius: 3px; position: relative; }
.type-text .c.ok { color: var(--text); }
.type-text .c.bad { color: var(--bad); background: var(--bad-bg); }
.type-text .c.nl.bad::after { background: var(--bad); }
/* 拼音打字模式：汉字在上、拼音字母在下（字母是目标，随 ok/bad 变色） */
.type-text .cunit { display: inline-block; vertical-align: bottom; text-align: center; margin: 0 1px; }
.type-text .cunit .ch { display: block; line-height: 1.4; }
.type-text .cunit .pyl { display: block; font-size: 12px; line-height: 1.15; color: var(--text-soft); min-height: 14px; }
.type-text .cunit .c.py { display: inline; color: var(--text-soft); background: transparent; box-shadow: none; }
.type-text .cunit .c.py.ok { color: var(--text); }
.type-text .cunit .c.py.bad { color: var(--bad); background: transparent; }
.type-text .cunit .c.py.cur { background: var(--primary-soft); box-shadow: inset 0 -1.5px 0 var(--primary); color: var(--text); }
.type-text .cunit .pymiss { display: block; font-size: 12px; line-height: 1.15; color: #94a3b8; }
.type-text .cunit.skip { opacity: .85; }
.type-text .cunit.skip .ch { color: var(--text-soft); }
.type-text .cunit .nl { display: block; }
.type-text .c.cur {
  background: var(--primary-soft);
  box-shadow: inset 0 -2.5px 0 var(--primary);
  color: var(--text);
  animation: blink-cur 1.1s ease-in-out infinite;
}
@keyframes blink-cur { 0%, 100% { box-shadow: inset 0 -2.5px 0 var(--primary); } 50% { box-shadow: inset 0 -2.5px 0 transparent; } }
.type-text .word.marked { background: var(--marked-bg); }
.type-text.annotate { cursor: default; }
.type-text.annotate .word { cursor: pointer; }
.type-text.annotate .word:hover { background: var(--primary-soft); }
.type-text.show-phonetic .word { display: inline-block; text-align: center; vertical-align: bottom; }
.type-text.show-phonetic .word .ph,
.preview-body.show-phonetic .word .ph,
.cloze-body.show-phonetic .ph {
  display: block; color: var(--primary); font-size: var(--phonetic-size); line-height: 1.1;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-weight: 700;
  white-space: nowrap;
}
html:not(.phonetic-clear) .reader-body.show-phonetic .ph,
html:not(.phonetic-clear) .type-text.show-phonetic .ph,
html:not(.phonetic-clear) .preview-body.show-phonetic .ph,
html:not(.phonetic-clear) .cloze-body.show-phonetic .ph {
  color: var(--text-soft); font-weight: 500; opacity: .72;
}
.cloze-word { display: inline-block; text-align: center; vertical-align: bottom; }
/* 留空练习：非显示音标态隐藏音标（支持练习中免重渲染切换） */
.cloze-body:not(.show-phonetic) .ph { display: none; }
/* 操作页整篇译文容器（打字 / 留空） */
.bilingual-trans {
  margin-top: 10px; padding: 10px 14px;
  border: 1px dashed var(--border); border-radius: 10px;
  background: var(--surface-2);
}
.bilingual-trans[hidden] { display: none; }
.bilingual-trans .trans-tag { font-size: 12px; color: var(--text-soft); opacity: .8; margin-bottom: 4px; }
.bilingual-trans .zh-p { color: var(--text-soft); font-size: 14px; line-height: 1.75; margin: 6px 0; }
.bilingual-trans .trans-empty { color: var(--text-soft); font-size: 13px; opacity: .8; }
.type-input {
  position: absolute; left: 0; top: 0;
  width: 1px; height: 1px; opacity: 0;
  border: none; padding: 0; background: transparent;
  font-size: 16px; /* 避免 iOS 缩放 */
}

/* 完成弹层 */
.result-mask {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(10, 12, 22, .55);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.result-mask[hidden] { display: none; }
.result-card {
  background: var(--surface); border-radius: 18px;
  padding: 26px 22px; width: 100%; max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  text-align: center;
}
.result-card h2 { margin-bottom: 18px; }
.result-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 12px; margin-bottom: 20px; }
.result-grid > div {
  background: var(--surface-2); border-radius: 12px; padding: 12px;
  display: flex; flex-direction: column;
}
.result-grid b { font-size: 26px; color: var(--primary); }
.result-grid span { font-size: 12.5px; color: var(--text-soft); }

/* ============ 留空练习 ============ */
.cloze-body {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}
.cloze-input {
  font: inherit;
  border: none;
  border-bottom: 2.5px solid var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
  border-radius: 6px 6px 0 0;
  padding: 0 6px;
  margin: 0 2px;
  text-align: center;
  font-weight: 700;
  min-width: 48px;
  line-height: 1.6;
}
.cloze-input:focus { outline: none; background: color-mix(in srgb, var(--primary) 16%, transparent); }
.cloze-input.ok { border-bottom-color: var(--ok); background: var(--ok-bg); color: var(--ok); }
.cloze-input.bad { border-bottom-color: var(--bad); background: var(--bad-bg); color: var(--bad); }
.cloze-body.checked .cloze-input { pointer-events: none; }
.cloze-score {
  text-align: center; font-size: 17px; font-weight: 700;
  margin-top: 14px; color: var(--primary);
}
#extraRow input[type="range"] { flex: 1; min-width: 140px; accent-color: var(--primary); }

/* ============ 单词本 ============ */
.word-list { display: flex; flex-direction: column; gap: 8px; }
.word-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  display: flex; flex-direction: column; gap: 4px;
}
.word-item .w-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.word-item .w-text { font-weight: 700; font-size: 16px; min-width: 110px; word-break: break-word; }
.word-item .w-meta {
  font-size: 12px; color: var(--text-soft);
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px;
  padding-left: 2px; user-select: none;
}
.word-item .w-meta .dot { opacity: 0.5; }
#wordSourceFilter, #wordSortFilter { max-width: 210px; }

/* 搭配语料（单词下方小字） */
.word-item .w-collocations {
  display: flex; flex-direction: column; gap: 4px;
  margin-top: 6px; padding: 8px 10px;
  background: var(--surface-2);
  border-left: 3px solid var(--primary);
  border-radius: 6px;
}
.word-item .w-coll {
  font-size: 12.5px; line-height: 1.55;
  color: var(--text-soft);
  display: flex; flex-direction: column; gap: 1px;
}
.word-item .w-coll-s { color: var(--text); font-style: italic; word-break: break-word; }
.word-item .w-coll-src { font-size: 11px; opacity: 0.7; }

/* 文章库分类筛选 chips */
.category-bar {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: 6px 0 16px;
}
.category-bar .chip {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-soft);
  font-size: 13px; font-family: inherit;
  padding: 5px 10px; border-radius: 999px;
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  transition: border-color .15s, color .15s, background .15s;
}
.category-bar .chip:hover { border-color: var(--primary); color: var(--text); }
.category-bar .chip.active {
  background: var(--primary); color: #fff; border-color: var(--primary);
}
.category-bar .chip-count {
  font-size: 11px; opacity: 0.75;
  background: color-mix(in srgb, var(--text) 12%, transparent);
  border-radius: 999px; padding: 1px 7px; min-width: 18px; text-align: center;
}
.category-bar .chip.active .chip-count {
  background: rgba(255,255,255,0.25); opacity: 1;
}

/* 文章卡片上的分类标签（可点击编辑） */
.article-card .category-tag { cursor: pointer; }
.article-card .category-tag:hover { border-color: var(--primary); color: var(--primary); }
.article-card .category-tag.ghost {
  border-style: dashed; color: var(--text-soft); opacity: 0.85;
}
.article-card .category-tag.ghost:hover { opacity: 1; }
.article-card .category-tag.static { cursor: default; opacity: 0.9; }
.article-card .category-tag.static:hover { border-color: var(--border); color: inherit; }

/* ============ 批量管理 ============ */
.batch-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px;
  margin: 4px 0 14px; padding: 10px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.batch-toolbar .batch-info {
  font-size: 13px; color: var(--text-soft); margin-right: 4px;
}
.batch-toolbar .batch-info b { color: var(--primary); font-size: 15px; }

#batchModeBtn.active {
  background: var(--primary); color: #fff; border-color: var(--primary);
}

/* 批量模式下卡片样式：可点击 + 选中高亮 */
.article-card.batch { cursor: pointer; position: relative; }
.article-card.batch:hover { border-color: var(--primary); }
.article-card.batch.selected {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 8%, var(--surface));
  box-shadow: 0 0 0 1px var(--primary);
}
.article-card .batch-check {
  position: absolute; top: 10px; right: 12px;
  width: 22px; height: 22px;
  border: 2px solid var(--border);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: #fff;
  background: var(--surface);
  transition: background .15s, border-color .15s;
  user-select: none;
}
.article-card.batch.selected .batch-check {
  background: var(--primary); border-color: var(--primary);
}
.article-card.batch.selected .batch-check::before { content: '✓'; }

/* ============ 分类选择模态框 ============ */
.cat-modal-mask {
  position: fixed; inset: 0; z-index: 70;
  background: rgba(10, 12, 22, .55);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.cat-modal-mask[hidden] { display: none; }
.cat-modal-card { max-height: 86vh; overflow-y: auto; -webkit-overflow-scrolling: touch;
  background: var(--surface); border-radius: 18px;
  padding: 22px 20px; width: 100%; max-width: 440px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  display: flex; flex-direction: column; gap: 6px;
}
.cat-modal-card h3 { font-size: 17px; margin-bottom: 6px; }
.cat-modal-card .field-label { margin-top: 6px; }
#featuresBtn { font-weight: 700; border: 1px dashed var(--primary, #4f46e5); color: var(--primary, #4f46e5); }
.cat-modal-card .hint { font-size: 12px; color: var(--text-soft); margin-top: 2px; }
.cat-modal-card select.input,
.cat-modal-card input.input { width: 100%; }

/* 试用倒计时弹窗 */
.trial-countdown {
  font-size: 22px; font-weight: 700; color: var(--primary);
  text-align: center; padding: 16px 0;
}

/* 积分兑换列表 */
.redeem-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.redeem-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px;
  cursor: pointer; transition: border-color .15s, background .15s;
}
.redeem-item:hover:not(.disabled) { border-color: var(--primary); background: var(--primary-soft); }
.redeem-item.disabled { opacity: .5; cursor: not-allowed; }
.redeem-item .redeem-info { display: flex; flex-direction: column; gap: 2px; }
.redeem-item .redeem-info b { font-size: 14px; }
.redeem-item .redeem-info .hint { margin-top: 0; }

/* 管理员用户管理表格 */
.admin-table-wrap { overflow: auto; max-height: 400px; border: 1px solid var(--border); border-radius: 8px; }
.admin-table {
  width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12px;
}
.admin-table th, .admin-table td {
  padding: 6px 8px; text-align: left; white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
.admin-table th { background: #f0f2f5; font-weight: 600; position: sticky; top: 0; z-index: 2; box-shadow: 0 1px 0 var(--border); }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--primary-soft); }
.word-item .w-note {
  flex: 1; min-width: 0;
  background: transparent; border: 1px solid transparent;
  color: var(--text-soft); font-size: 14px; font-family: inherit;
  border-radius: 8px; padding: 6px 8px;
}
.word-item .w-note:focus { outline: none; border-color: var(--primary); background: var(--surface-2); color: var(--text); }
.word-item .w-del {
  border: none; background: transparent; color: var(--text-soft);
  font-size: 18px; cursor: pointer; padding: 4px 8px; border-radius: 8px;
}
.word-item .w-del:hover { color: var(--bad); background: var(--bad-bg); }
.word-item .w-speak {
  border: none; background: transparent; color: var(--text-soft);
  font-size: 16px; cursor: pointer; padding: 4px 8px; border-radius: 8px;
  transition: background .15s, color .15s;
}
.word-item .w-speak:hover { color: var(--primary); background: color-mix(in srgb, var(--primary) 12%, transparent); }

/* 单词词典信息：音标 / 词性 / 中文意思 / 助记 */
.word-item .w-phonetic {
  color: var(--text-soft); font-size: 13px; font-family: "Segoe UI", Georgia, serif;
  margin-right: auto; white-space: nowrap;
}
.word-item .w-dict {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  padding: 2px 2px 0;
}
.word-item .w-dict .lex-edit {
  flex: none; align-self: center;
  border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text-soft); font-size: 12px; line-height: 1;
  border-radius: 6px; padding: 3px 6px; cursor: pointer;
  opacity: .75; transition: opacity .15s, color .15s, border-color .15s;
}
.word-item .w-dict .lex-edit:hover { opacity: 1; color: var(--primary); border-color: var(--primary); }
.word-item .w-dict .lex-edit.lex-has {
  color: #b45309; border-color: #d97706; background: color-mix(in srgb, #d97706 10%, transparent);
}
html[data-theme="dark"] .word-item .w-dict .lex-edit.lex-has { color: #fbbf24; border-color: #f59e0b; }
.word-item .w-affix .ax-edit {
  flex: none;
  border: 1px dashed var(--border); background: transparent;
  color: var(--text-soft); font-size: 11px; line-height: 1;
  border-radius: 6px; padding: 2px 6px; cursor: pointer;
  margin-left: 8px; opacity: .8; transition: opacity .15s, color .15s, border-color .15s;
}
.word-item .w-affix .ax-edit:hover { opacity: 1; color: var(--primary); border-color: var(--primary); }
.word-item .w-affix .ax-prefix.ax-user b,
.word-item .w-affix .ax-suffix.ax-user b {
  color: #b45309; text-decoration: underline dotted;
}
html[data-theme="dark"] .word-item .w-affix .ax-prefix.ax-user b,
html[data-theme="dark"] .word-item .w-affix .ax-suffix.ax-user b { color: #fbbf24; }
.lex-owner { font-weight: 600; color: var(--text-soft); margin-top: 6px; text-align: center; }
.lex-source { font-weight: 600; color: var(--primary); margin: 4px 0 10px; }
.btn.danger-ghost { color: #dc2626; border-color: color-mix(in srgb, #dc2626 45%, var(--border)); background: transparent; }
html[data-theme="dark"] .btn.danger-ghost { color: #f87171; }
.lexmgr-body { max-height: 48vh; overflow-y: auto; margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.lexmgr-sec { font-size: 12px; color: var(--text-soft); padding: 8px 2px 2px; border-bottom: 1px solid var(--border); }
.lexmgr-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2);
}
.lexmgr-row.off { opacity: .55; }
.lexmgr-badge {
  flex: none; font-size: 11px; font-weight: 700; border-radius: 6px; padding: 1px 7px;
}
.lexmgr-badge.mine { color: #b45309; background: color-mix(in srgb, #d97706 14%, transparent); }
html[data-theme="dark"] .lexmgr-badge.mine { color: #fbbf24; }
.lexmgr-badge.off { color: var(--text-soft); background: color-mix(in srgb, var(--text-soft) 12%, transparent); }
.lexmgr-key { font-weight: 700; color: var(--text); }
.lexmgr-val { color: var(--text-soft); font-size: 12.5px; flex: 1 1 120px; word-break: break-word; }
.lexmgr-ops { display: inline-flex; gap: 6px; margin-left: auto; }
.word-item .w-pos {
  font-style: normal; font-weight: 700; font-size: 12px;
  color: var(--primary); background: var(--primary-soft);
  border-radius: 6px; padding: 1px 7px; white-space: nowrap;
}
.word-item .w-meaning { font-size: 15px; color: var(--text); word-break: break-word; }
.word-item .w-mnemonic,
.word-item .w-note {
  width: 100%; flex: none;
  background: transparent; border: 1px solid transparent;
  color: var(--text-soft); font-size: 13.5px; font-family: inherit;
  border-radius: 8px; padding: 6px 8px;
}
.word-item .w-mnemonic { color: #b45309; }
html[data-theme="dark"] .word-item .w-mnemonic { color: #fbbf24; }
.word-item .w-mnemonic:focus,
.word-item .w-note:focus { outline: none; border-color: var(--primary); background: var(--surface-2); color: var(--text); }

/* 词缀拆解卡（前后缀模式） */
.word-item .w-affix {
  display: flex; flex-direction: column; gap: 2px;
  padding: 4px 8px; margin: 2px 0;
  border-left: 3px solid color-mix(in srgb, var(--primary) 55%, transparent);
  background: color-mix(in srgb, var(--primary) 6%, transparent);
  border-radius: 0 8px 8px 0;
}
.word-item .w-affix .ax-part { font-size: 14px; line-height: 1.6; }
.word-item .w-affix .ax-prefix,
.word-item .w-affix .ax-suffix {
  color: var(--primary); font-weight: 600;
  border-radius: 4px; padding: 0 2px;
}
.word-item .w-affix .ax-prefix { background: color-mix(in srgb, var(--primary) 14%, transparent); }
.word-item .w-affix .ax-suffix { background: color-mix(in srgb, var(--primary) 10%, transparent); }
.word-item .w-affix .ax-stem {
  color: var(--text); font-weight: 700;
  border-bottom: 2px dotted color-mix(in srgb, var(--primary) 60%, transparent);
  padding: 0 3px;
}
.word-item .w-affix .ax-part b { font-weight: 600; color: var(--text-soft); font-size: 12px; margin-left: 3px; }
.word-item .w-affix .ax-part i { font-style: normal; color: var(--text-soft); opacity: .7; }
.word-item .w-affix .ax-plus { color: var(--text-soft); opacity: .6; margin: 0 3px; }
.word-item .w-affix .ax-tip { color: var(--text-soft); font-size: 12px; margin-left: 6px; }
.word-item .w-affix .bi-cn .ax-tip { margin-left: 0; }
html[data-theme="dark"] .word-item .w-affix .ax-stem { color: var(--text); }

/* 文章卡片译文标记 */
.tag.zh-tag { color: var(--primary); border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); }
.tag.zh-tag.loading { opacity: 0.65; }

/* ============ 朗读工具条 ============ */
.tts-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 55;
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
  box-shadow: 0 -6px 24px rgba(0,0,0,.12);
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 6px;
}
.tts-bar[hidden] { display: none; }
.tts-bar .tts-info {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 12px; color: var(--text-soft);
}
.tts-bar .tts-mode-tag {
  background: var(--primary); color: #fff;
  padding: 2px 8px; border-radius: 999px; font-size: 11px;
}
.tts-bar .tts-progress { color: var(--primary); font-weight: 600; }
.tts-bar .tts-cur {
  flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: var(--text); font-style: italic; opacity: 0.85;
}
.tts-bar .tts-controls {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.tts-bar .tts-btn {
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font-size: 16px; cursor: pointer;
  width: 38px; height: 38px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s, border-color .15s;
}
.tts-bar .tts-btn:hover { border-color: var(--primary); }
.tts-bar .tts-btn.primary {
  background: var(--primary); color: #fff; border-color: var(--primary);
}
.tts-bar .tts-btn.primary.paused { background: var(--surface-2); color: var(--primary); }
.tts-bar .tts-field {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-soft);
}
.tts-bar .tts-field select.input {
  width: auto; min-width: 70px; padding: 4px 8px; font-size: 13px;
}
.tts-bar .tts-loop {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; color: var(--text-soft); cursor: pointer;
  user-select: none;
}
.tts-bar .tts-loop input { margin: 0; }
.tts-bar #ttsClose {
  width: 32px; height: 32px; font-size: 18px; color: var(--text-soft);
  margin-left: auto;
}
/* 工具条打开时给底部留出空间（避免遮住单词本/文章列表底部） */
body.tts-active .content { padding-bottom: 110px; }

/* ============ 底部导航 ============ */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: grid; grid-template-columns: repeat(6, 1fr);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.tab {
  border: none; background: transparent; cursor: pointer;
  color: var(--text-soft);
  font-size: 11px;
  padding: 7px 0 8px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.tab span { font-size: 13.5px; }
.tabbar .tab span:first-child { font-size: 17px; }
.topnav .tab span:first-child { font-size: 15px; }
.tab.active { color: var(--primary); font-weight: 700; }
@media (min-width: 760px) {
  .tabbar { display: none; }
  /* 电脑端：顶部导航替代底部导航 */
  .topnav { display: flex; align-items: center; gap: 4px; margin-left: 14px; }
  .topnav .tab {
    flex-direction: row; gap: 6px;
    font-size: 14px; font-weight: 500;
    padding: 8px 14px; border-radius: 10px;
    transition: background 0.15s, color 0.15s;
  }
  .topnav .tab:hover { background: var(--surface-2); color: var(--text); }
  .topnav .tab.active { font-weight: 700; background: color-mix(in srgb, var(--primary) 10%, transparent); }
  .content { padding-bottom: 40px; }
}

.quick-nav-row {
  display: flex; gap: 10px; flex-wrap: wrap;
  margin: 10px 0 16px;
}
.quick-nav-btn {
  flex-direction: row !important; gap: 6px;
  font-size: 14px !important; font-weight: 500;
  padding: 10px 18px !important; border-radius: 10px;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border);
  transition: background 0.15s, color 0.15s;
}
.quick-nav-btn:hover { background: color-mix(in srgb, var(--primary) 12%, transparent); }
.quick-nav-btn span { font-size: 13.5px !important; }
.quick-nav-btn.active { background: color-mix(in srgb, var(--primary) 15%, transparent); color: var(--primary); font-weight: 700; }
.quick-nav-btn.danger { color: #d33; border-color: color-mix(in srgb, #d33 40%, var(--border)); }
.quick-nav-btn.danger:hover { background: color-mix(in srgb, #d33 14%, transparent); }
.quick-nav-manage { border-style: dashed; }
.searchable-select { position: relative; flex: 1; min-width: 200px; max-width: 400px; }
.searchable-select input { width: 100%; }
.searchable-dropdown {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 100;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  max-height: 280px; overflow-y: auto; margin-top: 4px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}
.searchable-dropdown .sd-item {
  padding: 10px 14px; cursor: pointer; font-size: 14px;
  border-bottom: 1px solid var(--border);
}
.searchable-dropdown .sd-item:hover, .searchable-dropdown .sd-item.active {
  background: color-mix(in srgb, var(--primary) 12%, transparent);
}
.searchable-dropdown .sd-empty { padding: 12px 14px; color: var(--text-dim); font-size: 13px; }
.phonetic-size-select { width: auto; min-width: 76px; padding: 6px 8px; }
.article-note { margin-top: 16px; }
.article-note h3 { margin: 0; }
/* 笔记框：右下角可自由拉宽拉高（resize:both），自动保存 */
.article-note .textarea { margin-top: 10px; min-height: 90px; resize: both; max-width: 100%; }
.preview-tools { margin: 8px 0 6px; }
.quick-nav-editor { display: grid; gap: 8px; margin-top: 12px; }
.quick-nav-edit-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 9px;
  background: var(--surface-2);
}
.quick-nav-edit-row label > span { display: inline-flex; flex-direction: column; gap: 1px; }
.quick-nav-edit-row small { color: var(--text-soft); font-size: 11px; font-weight: 400; }
.quick-nav-edit-actions { display: inline-flex; gap: 2px; }
.quick-nav-edit-actions .icon-btn.small { width: 30px; height: 30px; font-size: 15px; }

.footer-note { text-align: center; color: var(--text-soft); font-size: 12px; margin-top: 22px; }

/* ============ 单词备注弹层 ============ */
.popover {
  position: fixed; z-index: 70;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,.22);
  padding: 14px;
  width: min(320px, calc(100vw - 32px));
}
.pop-word { font-size: 20px; font-weight: 800; color: var(--primary); margin-bottom: 8px; word-break: break-word; }

/* ============ 悬浮取词翻译卡片 ============ */
.dict-pop {
  position: fixed; z-index: 80;
  width: min(300px, calc(100vw - 24px));
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 14px 44px rgba(0,0,0,.24);
  padding: 12px 14px;
  display: flex; flex-direction: column; gap: 6px;
  animation: dict-in .12s ease;
}
@keyframes dict-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.dict-pop .dp-head { display: flex; align-items: center; gap: 10px; }
.dict-pop .dp-word { font-size: 19px; font-weight: 800; color: var(--primary); word-break: break-word; }
.dict-pop .dp-phonetic {
  font-size: 13px; color: var(--text-soft);
  font-family: "Segoe UI", Georgia, serif;
}
.dict-pop .dp-icon {
  margin-left: auto; border: none; background: transparent;
  font-size: 16px; cursor: pointer; padding: 4px 8px; border-radius: 8px;
}
.dict-pop .dp-icon:hover { background: var(--surface-2); }
.dict-pop .dp-pos {
  font-size: 12px; font-weight: 700; color: var(--primary);
  display: flex; flex-wrap: wrap; gap: 6px;
}
.dict-pop .dp-meaning { font-size: 16px; color: var(--text); line-height: 1.5; word-break: break-word; }
/* 自主添加内容（自定义备注 / 助记联想 / 词根） */
.dict-pop .dp-user {
  margin: 6px 0; padding: 8px 10px;
  background: color-mix(in srgb, var(--warn) 10%, var(--surface-2));
  border: 1px dashed color-mix(in srgb, var(--warn) 45%, var(--border));
  border-radius: 8px; font-size: 12.5px; line-height: 1.55;
}
.dict-pop .dp-user-head { font-size: 11px; font-weight: 700; color: var(--warn); margin-bottom: 4px; letter-spacing: .03em; }
.dict-pop .dp-user-row { color: var(--text); word-break: break-word; }
.dict-pop .dp-user-row + .dp-user-row { margin-top: 3px; }
.dict-pop .dp-user-tag { font-size: 11px; font-weight: 700; color: var(--warn); margin-right: 3px; }
/* 中文补充信息：拼音 / 偏旁 / 词语 / 成语 */
.dict-pop .dp-cn {
  margin: 6px 0; padding: 8px 10px;
  background: color-mix(in srgb, var(--primary) 10%, var(--surface-2));
  border: 1px dashed color-mix(in srgb, var(--primary) 45%, var(--border));
  border-radius: 8px; font-size: 12.5px; line-height: 1.55;
}
.dict-pop .dp-cn-head { font-size: 11px; font-weight: 700; color: var(--primary); margin-bottom: 4px; letter-spacing: .03em; }
.dict-pop .dp-cn-row { color: var(--text); word-break: break-word; }
.dict-pop .dp-cn-row + .dp-cn-row { margin-top: 3px; }
.dict-pop .dp-cn-tag { font-size: 11px; font-weight: 700; color: var(--primary); margin-right: 3px; }
.dict-pop .dp-defs { display: flex; flex-direction: column; gap: 3px; }
.dict-pop .dp-def { font-size: 12.5px; color: var(--text-soft); line-height: 1.5; }
.dict-pop .dp-def em {
  font-style: normal; color: var(--primary); font-weight: 700;
  font-size: 11px; margin-right: 2px;
}
.dict-pop .dp-loading { font-size: 12.5px; color: var(--text-soft); }
.dict-pop .dp-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; }
.dict-pop .dp-actions .btn { padding: 6px 12px; font-size: 13px; }
.dict-pop #dpFav.done { background: var(--marked-bg); border-color: var(--marked); color: var(--warn); }

/* ============ Toast ============ */
.toast {
  position: fixed; left: 50%; bottom: 90px;
  transform: translateX(-50%);
  background: rgba(20, 22, 34, .92); color: #fff;
  padding: 10px 18px; border-radius: 999px;
  font-size: 14px; z-index: 90;
  max-width: calc(100vw - 40px); text-align: center;
  animation: toast-in .2s ease;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ============ 默写训练 ============ */
.dict-bar {
  height: 6px; background: var(--surface-2);
  border-radius: 999px; overflow: hidden; margin: 10px 0 14px;
}
.dict-bar i { display: block; height: 100%; width: 0; background: var(--primary); transition: width .25s; }
.dict-prompt {
  background: var(--surface-2);
  border: 1.5px dashed var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 12px;
  min-height: 56px;
  font-size: var(--passage-size);
  line-height: 2.1;
  word-break: break-word;
}
.dict-prompt .dict-line { white-space: pre-wrap; }
.dict-prompt .zh-line {
  color: var(--text);
  font-size: 1.18em;
  font-weight: 600;
  line-height: 1.9;
  letter-spacing: .5px;
  padding: 6px 2px;
}
.dict-prompt .c { color: var(--text-soft); border-radius: 3px; }
.dict-prompt .c.ok { color: var(--text); }
.dict-prompt .c.bad { color: var(--bad); background: var(--bad-bg); }
.dict-prompt .c.miss { color: var(--text-soft); border-bottom: 2px solid var(--marked); }
.dict-prompt .c.reveal { color: var(--text); }
.dict-prompt .c.cur {
  background: var(--primary-soft);
  box-shadow: inset 0 -2.5px 0 var(--primary);
  color: var(--text);
  animation: blink-cur 1.1s ease-in-out infinite;
}
.dict-prompt b { color: var(--primary); font-weight: 800; }
.dict-prompt .dots { color: var(--text-soft); letter-spacing: 1px; }
.dict-meta { display: block; color: var(--text-soft); font-size: 12.5px; line-height: 1.6; margin-bottom: 4px; }
.typed-line { color: var(--text-soft); font-size: .82em; }
.dict-input { font-size: 17px; line-height: 1.7; }
.dict-summary { margin-top: 4px; }
/* 默写：上一句/跳过此句 导航行 */
.dict-nav { padding-top: 4px; border-top: 1px dashed var(--border); }
.dict-nav #dictNavHint { font-size: 12px; opacity: .8; }

/* ============ 文章卡片：标题/预览 可点击 ============ */
.article-card h3,
.article-card .card-preview { cursor: pointer; }
.article-card h3:hover { color: var(--primary); }

/* ============ 文章预览模态框 ============ */
.preview-card {
  background: var(--surface);
  border-radius: 18px;
  padding: 18px 18px 16px;
  width: 100%; max-width: 640px;
  max-height: calc(100vh - 60px);
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  display: flex; flex-direction: column; gap: 8px;
}
.preview-card .preview-head { align-items: flex-start; gap: 12px; }
.preview-card .preview-head h3 { word-break: break-word; font-size: 17px; }
.preview-meta { display: flex; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--text-soft); }
.preview-body {
  overflow-y: auto; flex: 1; min-height: 80px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 16px;
  font-size: var(--passage-size); line-height: 1.9; white-space: pre-wrap; word-break: break-word;
}
.preview-body p { margin: 0 0 10px; }
.preview-body p:last-child { margin-bottom: 0; }
.preview-body.show-phonetic .word {
  display: inline-block; text-align: center; vertical-align: bottom;
  margin: 0 1px;
}
.preview-actions { gap: 8px; flex-wrap: wrap; }
@media (max-width: 480px) {
  .preview-card { padding: 14px 12px; max-height: calc(100vh - 20px); }
  .preview-body { padding: 10px 12px; font-size: 15px; }
  .preview-actions .btn { padding: 8px 10px; font-size: 12px; }
  .quick-nav-btn { padding: 8px 12px !important; font-size: 12px !important; }
  .card-actions .btn { padding: 6px 10px; font-size: 12px; }
}

/* ============ 助记训练 ============ */
.mem-progress { display: flex; flex-direction: column; gap: 2px; font-size: 13px; color: var(--text-soft); }
.flashcard {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 16px;
  min-height: 180px;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  padding: 20px;
  cursor: pointer;
  user-select: none;
  transition: transform .1s, border-color .15s;
}
.flashcard:hover { border-color: var(--primary); }
.flashcard:active { transform: scale(.99); }
.fc-face { animation: fade .18s ease; }
.fc-word { font-size: 32px; font-weight: 800; color: var(--primary); word-break: break-word; }
.fc-src { margin-top: 8px; font-size: 12.5px; color: var(--text-soft); }
/* 助记三级烙印徽章 */
.lvl-badge { display: inline-block; vertical-align: middle; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 999px; margin-left: 6px; }
.lvl-badge.lvl-0 { background: var(--bad-bg); color: var(--bad); }
.lvl-badge.lvl-1 { background: var(--marked-bg); color: var(--warn); }
.lvl-badge.lvl-2 { background: var(--ok-bg); color: var(--ok); }
.fc-word .lvl-badge { font-size: 13px; }
.fc-note { font-size: 20px; line-height: 1.7; word-break: break-word; }
.fc-mnemonic {
  display: block; width: min(420px, 100%); margin-top: 14px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 14px;
}
.fc-mnemonic:focus { outline: 2px solid var(--primary); border-color: transparent; }
.fc-face .hint { font-size: 14px; }
.notes-list { display: grid; gap: 12px; }
.note-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow);
}
.note-item h3 { font-size: 15px; word-break: break-word; }
.note-item .note-input { margin-top: 10px; }

.sc-chips, .sc-slots { display: flex; flex-wrap: wrap; gap: 8px; }
.sc-chips { margin: 14px 0 6px; }
.sc-slots { min-height: 50px; margin-top: 8px; align-content: flex-start; }
.sc-chip, .sc-slot {
  width: 44px; height: 50px;
  border-radius: 10px;
  font-size: 20px; font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}
.sc-chip {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
}
.sc-chip:disabled { opacity: .2; cursor: default; }
.sc-slot {
  border: 1.5px dashed var(--border);
  background: transparent;
  color: var(--primary);
}
.sc-slot.filled { border-style: solid; background: var(--primary-soft); }
.sc-slots.ok .sc-slot { border-color: var(--ok); color: var(--ok); background: var(--ok-bg); }
.sc-slots.bad { animation: shake .3s; }
@keyframes shake {
  0%, 100% { transform: none; }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}
.sc-answer { font-size: 28px; font-weight: 800; color: var(--primary); padding: 4px 8px; word-break: break-word; }

/* ============================================================
 * 授权：激活门 / 面板 / 升级 / VIP / 文档 / 新手指引
 * ============================================================ */

/* ---------- 激活门（全屏锁定） ---------- */
.gate-mask {
  position: fixed; inset: 0; z-index: 200;
  background: color-mix(in srgb, var(--bg) 92%, #000 8%);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; overflow-y: auto;
}
.gate-card {
  width: min(440px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(0,0,0,.28);
  padding: 28px 26px calc(22px + env(safe-area-inset-bottom));
}
.gate-logo {
  width: 64px; height: 64px; margin: 0 auto 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 34px; border-radius: 18px;
  background: var(--primary-soft); color: var(--primary);
}
.gate-card h2 { text-align: center; font-size: 22px; margin-bottom: 4px; }
.hint.center { text-align: center; }
.gate-input { letter-spacing: .5px; font-weight: 600; }
.gate-btn { width: 100%; margin-top: 14px; padding: 13px; font-size: 16px; }
.gate-msg { min-height: 22px; margin: 8px 2px 0; font-size: 13.5px; color: var(--bad); }
.gate-links { margin-top: 10px; }
.gate-contact { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border); }
.link-btn {
  border: none; background: none; color: var(--primary);
  font-size: 13.5px; font-weight: 600; cursor: pointer; padding: 6px 10px;
}
.link-btn:hover { text-decoration: underline; }

/* ---------- 注册引导：侧边悬浮面板（不遮挡文章库） ---------- */
.side-panel {
  position: fixed;
  top: 50%; right: 18px;
  transform: translateY(-50%);
  z-index: 150;
  width: min(288px, calc(100vw - 28px));
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0,0,0,.18);
  padding: 14px 14px calc(12px + env(safe-area-inset-bottom));
}
.side-panel .panel-close {
  position: absolute; top: 10px; right: 12px;
  border: none; background: none; font-size: 24px; line-height: 1;
  color: var(--muted, #999); cursor: pointer; padding: 4px 8px;
  border-radius: 8px;
}
.side-panel .panel-close:hover { color: var(--text); background: var(--border, rgba(0,0,0,.06)); }
@media (max-width: 640px) {
  .side-panel {
    top: auto; bottom: 0; right: 0; left: 0;
    transform: none;
    width: 100%;
    max-height: 72vh;
    border-radius: 18px 18px 0 0;
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
    height: auto;
  }
}


/* ---------- 我的授权面板 ---------- */
.lic-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
  margin-top: 14px;
}
.lic-item {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 12px; padding: 10px 12px;
  display: flex; flex-direction: column; gap: 3px;
}
.lic-k { font-size: 12px; color: var(--text-soft); }
.lic-v { font-size: 15.5px; word-break: break-word; }
.lic-device code, #vipDeviceId, #licDeviceId {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 6px; padding: 1px 7px; font-size: 12px;
  user-select: all; word-break: break-all;
}
@media (min-width: 640px) { .lic-grid { grid-template-columns: repeat(4, 1fr); } }

/* ---------- 升级 / VIP 弹窗 ---------- */
.upsell-opts { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.upsell-opt {
  border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 14px; display: flex; flex-direction: column; gap: 6px;
  background: var(--surface-2);
}
.upsell-opt .btn { align-self: flex-start; }
.vip-plans { display: flex; gap: 10px; margin: 10px 0 14px; flex-wrap: wrap; }
.vip-plan {
  flex: 1 1 90px; text-align: center;
  border: 1px solid var(--border); border-radius: 12px; padding: 12px 8px;
  background: var(--surface-2);
  display: flex; flex-direction: column; gap: 6px;
}
.vip-plan b { color: var(--primary); font-size: 16px; }
.vip-plan span { font-size: 12px; color: var(--text-soft); }

/* ---------- 文档型弹窗（使用说明 / 规则） ---------- */
.doc-modal { z-index: 120; }

/* ============================================================
 * 规则说明页
 * ============================================================ */
.rules-page {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-bottom: calc(20px + env(safe-area-inset-bottom));
}
.rule-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: 0 2px 10px rgba(0,0,0,.04);
}
.rule-card h3 {
  font-size: 16.5px;
  margin: 0 0 10px;
  color: var(--primary);
}
.rule-card h4 {
  font-size: 14.5px;
  margin: 14px 0 6px;
}
.rule-card ol, .rule-card ul {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  line-height: 1.7;
  font-size: 14px;
}
.rule-card p { margin: 8px 0; line-height: 1.7; font-size: 14px; }
.rule-warn {
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--warn) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--warn) 35%, var(--border));
  color: var(--warn);
  font-size: 13px;
}
.rule-redeem { gap: 8px; }
.rule-tier {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  margin: 10px 0;
  background: var(--surface-2);
}
.rule-tier-h {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 10px; flex-wrap: wrap;
}
.rule-tier-h b { font-size: 15px; color: var(--primary); }
.rule-tier-h span { font-size: 13px; color: var(--text-soft); }
.rule-tier .hint { margin: 4px 0 0; font-size: 13px; }

/* ---------- 匿名体验横幅 ---------- */
.anon-banner {
  border: 1px solid color-mix(in srgb, var(--warn) 40%, var(--border));
  background: color-mix(in srgb, var(--warn) 10%, var(--surface));
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 14px;
}
.anon-banner b { color: var(--warn); font-size: 15px; }
.anon-banner .hint { margin: 6px 0 0; font-size: 12.5px; line-height: 1.6; }

/* ---------- 通用工具 ---------- */
.center-block { display: block; margin: 12px auto 0; }
.tag-anon, .tag-reg {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.tag-anon {
  color: var(--warn);
  background: color-mix(in srgb, var(--warn) 14%, transparent);
}
.tag-reg {
  color: var(--ok);
  background: var(--ok-bg);
}
.doc-card {
  width: min(720px, 94vw);
  max-height: 86vh; display: flex; flex-direction: column;
}
.doc-body { overflow-y: auto; margin-top: 10px; padding-right: 6px; }
.doc-body details {
  border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 14px; margin-bottom: 10px; background: var(--surface-2);
}
.doc-body summary {
  cursor: pointer; font-weight: 700; font-size: 15px; color: var(--text);
  list-style: none;
}
.doc-body summary::before { content: '▸ '; color: var(--primary); }
.doc-body details[open] summary::before { content: '▾ '; }
.doc-body ul { margin: 10px 0 2px; padding-left: 20px; }
.doc-body li { font-size: 13.5px; color: var(--text-soft); margin: 6px 0; line-height: 1.7; }
.doc-body li b { color: var(--text); }
.rules-body p { margin: 14px 0 6px; font-size: 14.5px; }
.rules-body ol { margin: 0; padding-left: 22px; }
.rules-body li { font-size: 13.5px; color: var(--text-soft); margin: 6px 0; line-height: 1.75; }
.rules-body li b { color: var(--text); }

/* ---------- 新手指引 ---------- */
.tour-mask {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(15, 18, 32, .55);
}
.tour-spot {
  position: fixed; z-index: 1;
  border-radius: 10px;
  box-shadow: 0 0 0 9999px rgba(15, 18, 32, .72), 0 0 0 3px var(--primary);
  transition: all .22s ease;
  pointer-events: none;
}
.tour-pop {
  position: fixed; z-index: 2;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,.4);
  padding: 16px 18px;
}
.tour-progress { font-size: 12px; color: var(--text-soft); margin-bottom: 4px; }
.tour-pop h4 { font-size: 17px; margin: 0 0 6px; color: var(--primary); }
.tour-pop p { font-size: 14px; line-height: 1.7; color: var(--text); margin: 0; }
.tour-pop .btn[disabled] { opacity: .4; pointer-events: none; }

/* ============================================================
 * 双语并列样式（UI 文本始终中英双语显示）
 * - 短文本（按钮/标签）：data-i18n 返回 "英文 / 中文" 纯文本，自动换行
 * - 长正文（help/rules）：data-i18n-html 返回
 *   <div class="bi-en">…</div><div class="bi-cn">…</div> 上下排列
 * ============================================================ */

/* 长正文双语并列容器 */
.bi-en, .bi-cn { display: block; }
.bi-en { margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px dashed var(--border); }
.bi-en[lang="en"], .bi-cn[lang="zh"] { line-height: 1.7; }
.bi-en:last-child, .bi-cn:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: 0; }

/* 顶部 brand name：双语显示时允许换行不溢出 */
.brand-name {
  white-space: normal;
  line-height: 1.3;
  max-width: 220px;
}
@media (min-width: 900px) {
  .brand-name { max-width: 320px; }
}

/* tabbar 底部按钮双语文字允许换行 */
.tabbar .tab span,
.lang-tabs .lang-tab {
  white-space: normal;
  line-height: 1.25;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* 通用按钮双语文字自动换行 */
.btn, .icon-btn, .lang-tab, .tab {
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: anywhere;
  line-height: 1.3;
}

/* 长文本按钮（如操作页标题区按钮）允许更宽换行 */
.row.gap.page-actions .btn,
.row.gap .btn { min-height: 34px; }

/* 短按钮双语用 「/」 分隔时压缩空格 */
.btn.compact-bi { letter-spacing: -0.2px; }

/* ===== 手机端优化 ===== */
@media (max-width: 680px) {
  /* 底部导航：紧凑不换行 */
  .tabbar { grid-template-columns: repeat(6, 1fr); }
  .tabbar .tab { font-size: 9px; padding: 5px 2px 6px; gap: 1px; }
  .tabbar .tab span { font-size: 16px; }
  .tabbar .tab span:last-child {
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    max-width: 100%; font-size: 9px; line-height: 1.1; display: block;
  }
  /* 快捷入口按钮：小一号 */
  .quick-nav-btn { font-size: 12px !important; padding: 7px 12px !important; border-radius: 8px; }
  .quick-nav-btn span { font-size: 13px !important; }
  /* 删除按钮不要红色描边 */
  .quick-nav-btn.danger { color: inherit; border-color: var(--border); background: var(--surface-2); }
  .quick-nav-btn.danger:hover { background: color-mix(in srgb, #d33 10%, transparent); color: #d33; }
  /* 搜索框 */
  .searchable-select { min-width: 100%; max-width: 100%; }
  /* 标题 */
  .brand-name { font-size: 14px !important; }
  /* 分类chips手机端更紧凑 */
  .category-bar { gap: 6px; margin: 4px 0 12px; }
  .category-bar .chip { font-size: 12px; padding: 4px 9px; }
  /* 文章卡片手机端减小内边距 */
  .article-card { padding: 12px; gap: 8px; border-radius: 12px; }
  .article-card h3 { font-size: 15px; }
  .card-preview { font-size: 12.5px; -webkit-line-clamp: 2; }
}


/* ============ 看图描述页 ============ */
.describe-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:12px; padding:8px 0; }
.describe-card { background:var(--card,#fff); border:1px solid var(--border,#e5e7eb); border-radius:12px; padding:12px; cursor:pointer; text-align:center; transition:transform .15s, box-shadow .15s; }
.describe-card:hover { transform:translateY(-2px); box-shadow:0 4px 12px rgba(0,0,0,.1); }
.describe-card .thumb { font-size:48px; line-height:1.2; margin-bottom:8px; }
.describe-card .name { font-size:13px; font-weight:600; }
.describe-card .en { font-size:11px; color:#888; }
.describe-stage { background:linear-gradient(135deg,#667eea,#764ba2); border-radius:16px; padding:40px 20px; text-align:center; margin-bottom:16px; min-height:200px; display:flex; align-items:center; justify-content:center; }
.describe-stage .scene-emoji { font-size:96px; animation:bounce 2s ease-in-out infinite; }
/* 声调小游戏 */
.tone-btn { border:2px solid var(--border,#e5e7eb); border-radius:12px; padding:10px 6px; font-size:16px; line-height:1.4; background:var(--surface-2,#fff); cursor:pointer; transition:all .15s; min-width:72px; }
.tone-btn:hover { border-color:#6c5ce7; transform:translateY(-2px); }
.tone-btn:disabled { opacity:.45; cursor:default; transform:none; }
.tone-btn b { font-size:18px; color:#6c5ce7; }
/* 看图描述：三模式输入 */
.desc-mode-btn.on { border-color:#6c5ce7 !important; background:#6c5ce7 !important; color:#fff !important; }
.desc-fb { font-size:18px; line-height:2; letter-spacing:1px; margin-top:8px; font-family:Consolas,Menlo,monospace; word-break:break-all; }
.desc-fb .c.ok { color:#16a34a; }
.desc-fb .c.bad { color:#dc2626; background:rgba(220,38,38,.08); border-radius:2px; }
.desc-fb .c.pend { color:#cbd5e1; }
/* 看图描述：汉字+拼音提示 */
.py-word { display:inline-block; text-align:center; margin:0 2px; vertical-align:bottom; }
.py-word .py-txt { display:block; font-size:12px; color:#6c5ce7; line-height:1.4; }
/* 功能清单 Features */
.feat-item { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; background: var(--surface); }
.feat-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.feat-icon { font-size: 18px; }
.feat-head b { font-size: 15px; }
.feat-en { font-size: 12px; color: var(--text-soft); font-weight: 400; }
.feat-row { font-size: 13px; color: var(--text); line-height: 1.65; margin: 4px 0; }
.feat-k { display: inline-block; font-size: 11px; font-weight: 700; color: var(--primary); background: var(--primary-soft); padding: 1px 7px; border-radius: 20px; margin-right: 6px; }
/* 随行笔记（全局悬浮） */
#floatNoteFab { position: fixed; right: 16px; bottom: 160px; z-index: 9997; width: 46px; height: 46px; border-radius: 50%; background: var(--primary, #4f46e5); color: #fff; font-size: 20px; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 16px rgba(79,70,229,.35); border: none; }
#floatNoteFab:hover { transform: scale(1.06); }
#floatNotePanel { position: fixed; right: 16px; bottom: 214px; z-index: 9998; width: 300px; max-width: calc(100vw - 32px); background: var(--surface, #fff); border: 1px solid var(--border, #e5e7f0); border-radius: 14px; box-shadow: 0 8px 30px rgba(31,36,48,.16); padding: 12px; animation: floatNoteIn .3s ease-out; }
@keyframes floatNoteIn { from { transform: translateX(28px); opacity: .35; } to { transform: translateX(0); opacity: 1; } }
.float-note-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.float-note-head b { font-size: 14px; }
#floatNotePanel textarea { width: 100%; box-sizing: border-box; }
.float-note-item { border-bottom: 1px dashed var(--border, #e5e7f0); padding: 8px 0; font-size: 13px; line-height: 1.6; }
/* 聊天框样式笔记（左内容 / 右时间+轨迹） */
.chat-note { display: flex; flex-direction: column; gap: 4px; background: var(--surface-2, #f6f7fb); border: 1px solid var(--border, #e5e7f0); border-radius: 12px; padding: 10px 12px; margin: 6px 0; }
.chat-note.pinned { border-color: var(--primary, #4f46e5); background: color-mix(in srgb, var(--primary, #4f46e5) 6%, transparent); }
.chat-note .cn-body { font-size: 13.5px; line-height: 1.65; white-space: pre-wrap; word-break: break-word; }
.chat-note .cn-meta { font-size: 11px; color: var(--text-soft, #5b6172); display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.chat-note .cn-meta .btn { padding: 0 5px; font-size: 11px; }
#floatNoteTab { position: fixed; right: 0; top: 38%; z-index: 9999; width: 22px; min-height: 70px; background: var(--primary, #4f46e5); color: #fff; font-size: 12px; display: flex; align-items: center; justify-content: center; border-radius: 10px 0 0 10px; cursor: pointer; box-shadow: 0 4px 12px rgba(79,70,229,.3); writing-mode: vertical-rl; letter-spacing: 2px; }
.float-note-item.pinned { background: color-mix(in srgb, var(--primary, #4f46e5) 6%, transparent); border-radius: 8px; padding: 8px; }
.float-note-time { font-size: 11px; color: var(--text-soft, #5b6172); }
.mini-imitation { margin-top: 8px; border-top: 1px dashed var(--border, #e5e7f0); padding-top: 8px; }
.mini-im-head { font-size: 11.5px; font-weight: 700; color: var(--text-soft, #5b6172); margin: 4px 0; }
.mini-im-item { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; padding: 3px 0; color: var(--text, #222); }
.mini-im-item i { font-style: normal; font-size: 10.5px; color: var(--text-soft, #5b6172); white-space: nowrap; }
.trash-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid var(--border, #e5e7f0); border-radius: 10px; margin-bottom: 8px; background: var(--surface, #fff); }
.trash-item .ti-title { font-weight: 600; font-size: 13.5px; }
.trash-item .ti-meta { font-size: 11px; color: var(--text-soft, #5b6172); margin-top: 2px; }
.note-item.pinned-note { border: 1px solid var(--primary, #4f46e5); }
.pron-opts { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.pron-opt { font-size: 12.5px; padding: 3px 9px; border: 1px solid var(--border, #e5e7f0); border-radius: 20px; cursor: pointer; background: var(--surface, #fff); }
.pron-opt.on { background: var(--primary, #4f46e5); color: #fff; border-color: var(--primary, #4f46e5); }
/* 问题看板 FAQ */
.faq-item { border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; margin-bottom: 8px; background: var(--surface); }
.faq-item summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--text); list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::before { content: "❓ "; }
.faq-item[open] summary { color: var(--primary); }
.faq-q { display: block; }
.faq-qen { display: block; font-size: 12px; color: var(--text-soft); font-weight: 400; margin-top: 2px; }
.faq-a { font-size: 13.5px; color: var(--text); line-height: 1.7; margin: 8px 0 6px; }
.faq-aen { font-size: 12.5px; color: var(--text-soft); line-height: 1.7; margin: 4px 0 6px; }
.faq-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.faq-tag { font-size: 11px; color: var(--primary); background: var(--primary-soft); padding: 2px 8px; border-radius: 20px; }
@keyframes bounce { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-15px)} }
@keyframes float { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-8px)} }
@keyframes steam { 0%{opacity:0;transform:translateY(0)} 50%{opacity:1} 100%{opacity:0;transform:translateY(-20px)} }
@keyframes rain { 0%{transform:translateY(-10px);opacity:1} 100%{transform:translateY(30px);opacity:0} }
@keyframes spin { from{transform:rotate(0)} to{transform:rotate(360deg)} }
.animate-float { animation:float 2s ease-in-out infinite; display:inline-block; }
.animate-steam { animation:steam 1.5s ease-out infinite; display:inline-block; }
.animate-spin { animation:spin 3s linear infinite; display:inline-block; }
.rain-drop { animation:rain 1s linear infinite; display:inline-block; }
.describe-prompt h3 { font-size:16px; margin-bottom:8px; }
.desc-lang { margin-top:12px; padding:12px; background:var(--primary-soft,#eef2ff); border-radius:8px; font-size:14px; line-height:1.8; }

/* 全局缩放悬浮按钮 */
.scale-floating { position:fixed; bottom:80px; right:16px; z-index:9999; }
.scale-panel { background:#fff; border-radius:12px; box-shadow:0 4px 20px rgba(0,0,0,.15); padding:12px; min-width:200px; }
.scale-head { display:flex; justify-content:space-between; align-items:center; font-size:13px; font-weight:600; margin-bottom:8px; }
.scale-close { background:none; border:none; font-size:16px; cursor:pointer; color:#888; padding:0 4px; }
.scale-body { display:flex; align-items:center; justify-content:center; gap:12px; margin-bottom:8px; }
.scale-btn { width:36px; height:36px; border-radius:50%; border:1px solid #ddd; background:#f5f5f5; cursor:pointer; font-size:16px; font-weight:600; }
.scale-btn:hover { background:var(--primary,#4f46e5); color:#fff; }
.scale-value { font-size:14px; font-weight:600; min-width:50px; text-align:center; }
.scale-actions { display:flex; align-items:center; justify-content:space-between; font-size:12px; }
.scale-keep { display:flex; align-items:center; gap:4px; cursor:pointer; }

/* 全局单词搜索面板 */
.word-search-panel { background:var(--surface-2,#f4f5f7); border-radius:12px; padding:12px 16px; margin-bottom:12px; }
.ws-card { display:flex; justify-content:space-between; align-items:center; gap:12px; background:var(--surface,#fff); border:1px solid var(--border,#e5e7eb); border-radius:10px; padding:10px 14px; margin-bottom:8px; cursor:pointer; }
.ws-card:hover { border-color:var(--primary,#4f46e5); box-shadow:0 2px 8px rgba(79,70,229,.15); }
.ws-card .ws-title { font-weight:600; font-size:14px; }
.ws-card .ws-count { font-size:12px; color:var(--primary,#4f46e5); white-space:nowrap; }
.ws-card .ws-snippet { font-size:12px; color:var(--text-soft,#666); margin-top:4px; line-height:1.6; }
.ws-card .ws-snippet mark { background:#fde68a; border-radius:3px; padding:0 2px; }
.ws-empty { padding:16px; text-align:center; color:var(--text-soft,#888); font-size:13px; }

/* 练习册工坊：手机端模块板 → 右侧吸边浮标（随行笔记式） */
#bsPaletteWrap{position:relative}
@media (max-width:899px){
  #bsPaletteWrap{position:fixed;right:6px;top:44%;z-index:70;width:auto;flex:none;background:transparent;padding:0}
  #bsPaletteFab{display:block;writing-mode:vertical-rl;letter-spacing:2px;padding:14px 7px;border-radius:12px;box-shadow:0 2px 10px rgba(0,0,0,.25);font-size:12.5px}
  .bs-palette-body{display:none;position:fixed;right:44px;top:30%;width:210px;max-height:60vh;overflow:auto;background:var(--surface-2,#fff);border-radius:12px;padding:10px;box-shadow:0 6px 18px rgba(0,0,0,.22);z-index:71}
  #bsPaletteWrap.open .bs-palette-body{display:block}
}

/* 练习册工坊：纸张预览与打印稿 */
.bs-studio { max-width: 1040px; margin: 0 auto; padding: 12px 14px 24px; }
.bs-toolbar { position: relative; z-index: 2; margin: -12px -14px 0; padding: 14px 18px; background: #fff; border-bottom: 1px solid #dfe8e2; }
.bs-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; font-size: 16px; color: #24312c; }
.bs-brand span { width: 28px; height: 28px; border-radius: 9px; background: linear-gradient(135deg, #27805d, #77c69c); }
.bs-toolbar-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.bs-toolbar-actions .btn { min-height: 42px; padding: 8px 14px; border: 1px solid #d9e3dd; border-radius: 10px; background: #fff; color: #43554c; font-size: 14px; }
.bs-toolbar-actions .btn.primary { border-color: #287c5b; background: #287c5b; color: #fff; }
.bs-toolbar-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 0; }
.bs-toolbar-meta > span { font-size: 12px; color: var(--text-soft); }
.bs-editor-mode.bs-studio { max-width: 1440px; }
.bs-editor-mode > .bs-toolbar { display: none; }
.bs-editor-mode > .bs-mode-row { padding: 4px 0 8px; border-bottom: 1px solid #e3ebe6; }
.bs-editor-mode > .bs-toolbar-meta:not(.bs-mode-row) { padding: 6px 0 10px; }
.bs-editor-mode .bs-mode-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.bs-editor-mode .bs-mode-tabs .btn { border-radius: 8px; }
.bs-editor-mode .bs-mode-tabs .btn.on { border-color: #287c5b; background: #eaf5ee; color: #246b4d; font-weight: 700; }
.bs-editor-tools { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.bs-editor-tools > div { min-width: 0; }
.bs-mode-actions { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 0 4px; }
.bs-mode-actions .btn,
.bs-more-actions .btn { min-height: 32px; padding: 5px 10px; border: 1px solid #d7e2db; border-radius: 7px; background: #fff; color: #3b5145; font-size: 12.5px; }
.bs-mode-actions .btn.primary { border-color: #287c5b; background: #287c5b; color: #fff; }
.bs-more-actions { margin: 0 0 4px; color: #5d7569; font-size: 12px; }
.bs-more-actions summary { width: fit-content; padding: 4px 8px; border-radius: 6px; background: #f1f6f3; cursor: pointer; }
.bs-more-actions > div { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 0; }
.bs-workspace { display: flex; align-items: flex-start; gap: 12px; padding-top: 12px; }
.bs-paper { --bs-accent: #287c5b; --bs-paper: #fffdf5; --bs-page-width: 760px; --bs-page-padding: 30px; --bs-font: Georgia, "Times New Roman", "Songti SC", SimSun, serif; --bs-font-size: 18px; --bs-line-height: 1.85; width: min(100%, var(--bs-page-width)); min-height: 640px; flex: 1 1 auto; margin: 0 auto; padding: var(--bs-page-padding); border: 1px solid #e8e8df; border-radius: 10px; background: var(--bs-paper); color: #202a28; box-shadow: 0 8px 26px rgba(34, 54, 44, .08); font-family: var(--bs-font); font-size: var(--bs-font-size); line-height: var(--bs-line-height); }
.bs-block { margin: 0 0 14px; border: 1.5px solid transparent; border-radius: 8px; padding: 2px 6px; transition: background .2s, border-color .2s; }
.bs-block[data-bssel="1"] { border-color: #287c5b; background: rgba(40, 124, 91, .035); }
.bs-block-toolbar { display: flex; align-items: center; gap: 4px; min-height: 22px; color: #668074; font: 11px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.bs-block-toolbar > span { flex: 1; font-weight: 600; }
.bs-block-toolbar .btn { padding: 1px 6px; font-size: 11px; line-height: 1.4; }
.bs-paper .bs-header { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 4px 0 14px; padding: 0 0 8px; border-bottom: 2px solid #27342f; color: #59776a; font: 700 13px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; letter-spacing: .12em; }
.bs-paper .bs-title { margin: 10px 0 18px; padding-bottom: 18px; border-bottom: 1px solid #d8dfd9; }
.bs-paper .bs-title h1 { margin: 0; color: #202a28; font: 700 28px/1.25 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.bs-paper .bs-title p { margin: 8px 0 0; color: #6c8579; font: 16px/1.5 "Segoe UI", "Microsoft YaHei", sans-serif; }
.bs-paper .bs-info { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 28px; margin: 14px 0 24px; padding-bottom: 8px; border-bottom: 2px solid #29332f; color: #496257; font: 15px/1.5 "Segoe UI", "Microsoft YaHei", sans-serif; }
.bs-paper .bs-info-cell { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.bs-paper .bs-info-cell b { white-space: nowrap; font-weight: 500; }
.bs-paper .bs-info-cell span { flex: 1; height: 18px; border-bottom: 1px solid #aebbb3; }
.bs-paper .bs-guide { margin: 20px 0 24px; padding: 12px 16px; border-left: 4px solid var(--bs-accent); border-radius: 0 7px 7px 0; background: #f2f7f3; color: #5d7569; font: 16px/1.8 "Segoe UI", "Microsoft YaHei", sans-serif; }
.bs-paper .bs-passage { margin: 20px 0 28px; }
.bs-paper .bs-passage-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; color: #648173; font: 600 13px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; letter-spacing: .14em; }
.bs-paper .bs-passage-head:after { content: ""; height: 1px; flex: 1; background: #d5dfd8; }
.bs-paper .bs-passage-head span { white-space: nowrap; }
.bs-paper .bs-passage-text { margin: 0; font-family: var(--bs-font); font-size: var(--bs-font-size); line-height: var(--bs-line-height); text-align: justify; white-space: pre-wrap; }
.bs-paper .bs-passage-text[contenteditable="true"]:empty::before { content: attr(data-placeholder); color: #9db8aa; font-size: 13px; }
.bs-paper .bs-header [contenteditable="true"]:empty, .bs-paper .bs-info-cell b[contenteditable="true"]:empty { display: inline-block; min-width: 1em; min-height: 1em; }
.bs-paper .bs-practice-title[contenteditable="true"]:empty::before, .bs-paper .bs-practice-body[contenteditable="true"]:empty::before { content: attr(data-placeholder); color: #9db8aa; font-size: 13px; }
.bs-paper .bs-practice-body[contenteditable="true"]:empty { min-height: 2em; }
.bs-paper .bs-practice { margin: 24px 0 12px; }
.bs-paper .bs-practice-title { display: block; margin-bottom: 8px; padding-bottom: 4px; border-bottom: 1px solid var(--bs-accent); color: var(--bs-accent); font: 700 17px/1.5 "Segoe UI", "Microsoft YaHei", sans-serif; }
.bs-paper .bs-practice-prompt { margin: 4px 0 8px; color: #61766b; font: 14px/1.7 "Segoe UI", "Microsoft YaHei", sans-serif; }
/* 每个内容元素都可编辑：悬停虚线 / 聚焦高亮，方便看出哪里能改 */
.bs-paper [contenteditable="true"] { outline: none; border-radius: 3px; }
.bs-paper.bs-can-edit [contenteditable="true"] { transition: background .15s, box-shadow .15s; }
.bs-paper.bs-can-edit [contenteditable="true"]:hover { background: rgba(40, 124, 91, .07); box-shadow: inset 0 -1px 0 rgba(40, 124, 91, .3); }
.bs-paper.bs-can-edit [contenteditable="true"]:focus { background: #fffdf0; box-shadow: 0 0 0 2px rgba(40, 124, 91, .2); }
.bs-paper .bs-bank[contenteditable="true"]:empty::before { content: "点击输入词库 / Edit word bank"; color: #9db8aa; font-size: 12px; }
.bs-paper .bs-bank { font-family: "Segoe UI", "Microsoft YaHei", sans-serif; }
.bs-paper .bs-practice-prompt[contenteditable="true"]:empty::before { content: attr(data-placeholder); color: #b3c4bb; font-size: 12.5px; }
.bs-paper .bs-block.bs-locked { background: rgba(120, 110, 90, .035); }
.bs-paper .bs-block.bs-locked > .bs-block-toolbar { opacity: .72; }
.bs-palette { width: 188px; flex: 0 0 188px; padding: 10px; border-radius: 10px; background: #f2f6f3; font-size: 12px; }
.bs-settings, .bs-answers { margin-top: 10px; padding: 12px; border: 1px solid #e1e9e3; border-radius: 10px; background: #f7faf8; }
.bs-settings-hint { margin: 0 0 10px; color: var(--text-soft); font-size: 12px; }
.bs-layout-controls { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 8px; margin-bottom: 10px; padding: 10px; border: 1px solid #e1e9e3; border-radius: 8px; background: #fff; }
.bs-layout-field { display: flex; flex-direction: column; gap: 4px; color: #56675e; font-size: 12px; }
.bs-layout-field .input, .bs-layout-field .select { width: 100%; min-height: 34px; font-size: 12px; }
.bs-settings-card { padding: 9px; border: 1px solid #e7ece8; border-radius: 8px; background: #fff; font-size: 12.5px; }
.bs-settings-card-head { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.bs-settings-row { display: flex; align-items: center; gap: 6px; margin: 4px 0; font-size: 12.5px; }
.bs-settings-row > span { min-width: 64px; }
.bs-settings-row .input, .bs-settings-row .select { flex: 1; min-width: 0; font-size: 12px; }
.bs-answers { max-height: 300px; overflow: auto; font-size: 13px; line-height: 1.8; }

@media (max-width: 899px) {
  .bs-studio { padding: 8px 0 20px; }
  .bs-toolbar { margin: -8px 0 0; padding: 12px 14px; }
  .bs-toolbar-actions .btn { min-height: 38px; padding: 6px 10px; font-size: 12px; }
  .bs-toolbar-meta { padding: 8px 12px; }
  .bs-workspace { padding: 8px 8px 0; }
  .bs-paper { min-height: 520px; padding: clamp(16px, 5vw, 30px); border-radius: 8px; }
  .bs-paper .bs-title h1 { font-size: clamp(22px, 5vw, 28px); }
  .bs-paper .bs-info { gap: 8px 14px; }
  .bs-palette { width: auto; flex: none; }
  .bs-settings { margin-right: 8px; margin-left: 8px; }
  .bs-answers { margin-right: 8px; margin-left: 8px; }
}

/* 每日一词：文章库顶部美观卡片 */
.daily-word-home { margin: 10px 0; }
.daily-word-card {
  display: flex; flex-direction: column; gap: 8px;
  padding: 14px 18px; border-radius: 14px;
  background: linear-gradient(135deg, #f2fbf6, #eaf3ee 60%, #fdf7ee);
  border: 1px solid #d9e9df; box-shadow: 0 2px 10px rgba(40,124,91,.06);
}
.dwc-tag { font-size: 11px; font-weight: 700; letter-spacing: .12em; color: #27805d; text-transform: uppercase; }
.dwc-row { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.dwc-en { font-size: 24px; font-weight: 800; color: #23332b; margin-top: 6px; }
.dwc-en i { font-size: 13px; font-weight: 500; color: #5d7569; margin-left: 8px; font-style: normal; }
.dwc-cn { font-size: 15.5px; font-weight: 600; color: #3a4f45; margin-top: 4px; }
.dwc-cn i { font-size: 12.5px; font-weight: 400; color: #7b9085; margin-left: 8px; font-style: normal; }
.dqc-en { font-size: 15px; line-height: 1.5; color: #24372e; margin-top: 5px; }
.dqc-zh { font-size: 12.5px; color: #7b9085; margin-top: 3px; }
.dwc-mean { font-size: 12.5px; color: #5d7569; line-height: 1.6; }

/* 练习册工坊：右侧 模块/设置/格式 三栏 */
.bs-palette { align-self: flex-start; }
.bs-pane-tabs { display: flex; gap: 4px; margin-bottom: 8px; }
.bs-pane-tabs .btn { flex: 1; padding: 5px 4px; font-size: 12px; }
.bs-pane-tabs .btn.on { background: var(--bs-accent, #27805d); color: #fff; border-color: var(--bs-accent, #27805d); }
.bs-palette-body[hidden] { display: none !important; }
.bs-fmt-row { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: #33443b; }
.bs-fmt-row > span { min-width: 40px; flex: none; }
.bs-fmt-row .select, .bs-fmt-row input[type=number] { flex: 1; min-width: 0; font-size: 12px; }
.bs-fmt-row input[type=number] { width: 54px; padding: 4px; border: 1px solid #d9e3dd; border-radius: 6px; }
.bs-fmt-row input[type=color] { flex: none; }
/* v174：模块编辑态 + 内联设置条 + 自定义/表格/图片/图表模块 */
.bs-block.bs-editing { outline: 2px solid var(--bs-accent, #27805d); outline-offset: 3px; border-radius: 8px; }
.bs-inline-settings {
  display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center;
  margin-top: 8px; padding: 8px 10px; border-radius: 8px;
  background: #f0f7f2; border: 1px solid #d9e9df; font-size: 12px;
}
.bs-inline-field { display: flex; align-items: center; gap: 6px; }
.bs-inline-field > span { color: #5d7569; white-space: nowrap; }
.bs-custom {
  min-height: 48px; padding: 10px 12px; border: 1px dashed #c4d8cc; border-radius: 8px;
  background: rgba(255,255,255,.4); color: #33443b;
}
.bs-custom:empty::before, .bs-table-wrap:empty::before {
  content: attr(data-placeholder); color: #9db8aa; font-size: 13px;
}
.bs-table-wrap { overflow-x: auto; border-radius: 8px; }
.bs-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.bs-table th, .bs-table td { border: 1px solid #b9c8bf; padding: 6px 9px; min-width: 60px; }
.bs-table th { background: #eef5f0; font-weight: 600; text-align: left; }
.bs-img-empty {
  display: flex; flex-direction: column; gap: 8px; align-items: center; justify-content: center;
  min-height: 120px; padding: 16px; border: 1px dashed #c4d8cc; border-radius: 10px;
  color: #7c9a8b; font-size: 13px; background: rgba(255,255,255,.5);
}
.bs-img { margin: 8px 0; } .bs-img img { max-width: 100%; height: auto; border-radius: 8px; }
.bs-img figcaption, .bs-chart figcaption {
  font-size: 12.5px; color: #5d7569; text-align: center; margin-top: 6px;
}
.bs-chart { margin: 8px 0; }
/* ===== 通篇版板块 ===== */
.bs-mode-row { gap: 10px; }
.bs-mode-tabs { display: inline-flex; gap: 4px; padding: 3px; border: 1px solid #d9e3dd; border-radius: 10px; background: #f2f6f3; }
.bs-mode-tabs .btn { min-height: 30px; padding: 4px 12px; border: 1px solid transparent; background: transparent; color: #55705f; font-size: 12.5px; }
.bs-mode-tabs .btn.on { border-color: var(--bs-accent, #287c5b); background: #fff; color: var(--bs-accent, #287c5b); font-weight: 700; box-shadow: 0 1px 4px rgba(40,124,91,.16); }
.bs-mode-desc { font-size: 11.5px; color: #8a9f94; }
.bs-paper .bs-sheet { margin: 22px 0 14px; }
.bs-sheet-list { margin: 6px 0; }
.bs-sheet-item { position: relative; margin: 9px 0; font-size: 14px; line-height: 1.75; }
.bs-sheet-item .bs-qline { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
.bs-sheet-item .bs-qn { flex: none; font-weight: 700; color: var(--bs-accent, #287c5b); }
.bs-sheet-item .bs-qtext, .bs-sheet-item .bs-stmt { flex: 1; min-width: 0; }
.bs-tf-mark { margin-left: 6px; color: #5d7569; }
.bs-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 18px; margin: 4px 0 0 16px; font-size: 13.5px; }
.bs-opt { display: flex; gap: 4px; align-items: baseline; }
.bs-opt b { flex: none; color: var(--bs-accent, #287c5b); }
.bs-lines { margin: 4px 0 2px; }
.bs-lines span { display: block; height: 26px; border-bottom: 1px solid #c9d6cd; }
.bs-paper .bs-vocab { font-size: 13px; }
.bs-paper .bs-vocab .bs-vnum { width: 24px; text-align: center; color: #7b8f84; }
.bs-paper .bs-match td { vertical-align: top; font-size: 13.5px; }
.bs-paper .bs-match .bs-match-r { width: 46%; }
.bs-letter { color: var(--bs-accent, #287c5b); margin-right: 4px; }
.bs-item-del {
  margin-left: 4px; padding: 0 5px; border: 1px solid #e2d2d2; border-radius: 5px;
  background: #fff; color: #c0645e; font-size: 11px; line-height: 16px; cursor: pointer; opacity: .55;
}
.bs-sheet-item:hover > .bs-qline > .bs-item-del,
.bs-paper .bs-vocab tr:hover .bs-item-del { opacity: 1; }
.bs-ans-line { margin: 2px 0 6px; color: var(--bs-accent, #287c5b); font-size: 12.5px; }
.bs-wmeta { color: #7b8f84; font-size: 12px; margin: 2px 0 4px; }
.bs-media { margin: 10px 0; }
.bs-media audio { width: 100%; }
.bs-media video { width: 100%; max-height: 380px; border-radius: 8px; background: #000; }
.bs-media figcaption { font-size: 12.5px; color: #5d7569; text-align: center; margin-top: 6px; }
@media print { .bs-item-del, .bs-media audio, .bs-media video { display: none !important; } }

.bs-lib-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 9px 10px; border: 1px solid #e2ebe5; border-radius: 10px; background: #fafcfb;
}
.bs-lib-name { font-weight: 600; font-size: 13.5px; flex: 1; min-width: 160px; }
.bs-lib-tag { margin-left: 6px; padding: 1px 6px; border-radius: 999px; background: #eaf4ee; color: #2b6b4f; font-size: 10.5px; font-style: normal; font-weight: 600; }
.bs-lib-meta { font-size: 11.5px; color: #8a9f94; }
.bs-lib-ops { display: flex; gap: 5px; flex-wrap: wrap; }

/* ===== Word 版：空白文档面板 ===== */
/* Word/Excel tools stay above their editable page inside the shared workbook workspace. */
.bs-word { flex-direction: column; align-items: stretch; gap: 10px; }
.bs-word-bar { flex: none; width: 100%; max-width: none; max-height: none; overflow: visible; order: 0; border: 1px solid #e0eae4; border-radius: 12px; background: #fbfdfc; padding: 10px; align-content: flex-start; }
.bs-word-stage { flex: 1 1 auto; min-width: 0; width: 100%; order: 1; }
.bs-word-page svg { max-width: 100%; height: auto; }
.bs-word-page .bs-movable { position: absolute; cursor: move; box-shadow: 0 1px 4px rgba(20,50,38,.16); border-radius: 4px; z-index: 3; }
.bs-movable * { user-select: none; -webkit-user-select: none; }
.bs-movable [contenteditable] { user-select: text; -webkit-user-select: text; }
.bs-movable2 { max-width: 100%; }
/* 可移动/缩放/旋转的插入元素 */
.bs-movable { position: absolute; cursor: move; box-shadow: 0 1px 4px rgba(20,50,38,.16); border-radius: 4px; z-index: 3; }
.bs-movable * { user-select: none; -webkit-user-select: none; }
.bs-movable [contenteditable] { user-select: text; -webkit-user-select: text; }
.bs-movable2 { position: relative; display: inline-block; cursor: move; user-select: none; }
.bs-movable.bs-sel { outline: 1.5px dashed #2b8f68; outline-offset: 2px; }
.bs-movable .bs-handle { position: absolute; width: 10px; height: 10px; background: #2b8f68; border: 1.5px solid #fff; border-radius: 2px; box-shadow: 0 0 0 1px #2b8f68; z-index: 6; }
.bs-handle-nw { top: -6px; left: -6px; cursor: nwse-resize; }
.bs-handle-se { bottom: -6px; right: -6px; cursor: nwse-resize; }
.bs-handle-rot { top: -20px; left: 50%; margin-left: -5px; cursor: grab; border-radius: 50%; }
.bs-movable .bs-rotline { position: absolute; top: -15px; left: 50%; width: 1px; height: 12px; background: #2b8f68; z-index: 5; }
/* 文章笔记透明图层 */
.bs-note-wrap { position: relative; }
.bs-note-layer { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 5; touch-action: none; cursor: crosshair; border-radius: 8px; }
/* 圈点工具栏（v233）：贴在正文上沿、吸顶悬浮 —— 文章再长，滚动时也一直前置可见 */
/* v235：紧凑化 —— 按钮「图标 + 文字」，窄屏只留图标；分组用细竖线，整体高度压到 1~2 行 */
.bs-note-bar {
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
  padding: 5px 7px; border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  border: 1px solid var(--border);
  box-shadow: 0 3px 10px rgba(34,54,44,.12);
  margin-bottom: 6px; font-size: 12px;
  position: sticky;
  top: var(--nt-bar-top, 0px);   /* 顶栏高度，由 JS 实时量出来写进变量 */
  z-index: 45;
  max-height: min(42vh, 240px);
  overflow-y: auto; overflow-x: hidden;
  overscroll-behavior: contain;
  backdrop-filter: saturate(1.4) blur(8px);
  -webkit-backdrop-filter: saturate(1.4) blur(8px);
  transition: box-shadow .18s ease, background .18s ease;
}
.bs-note-bar .btn.small { padding: 4px 7px; font-size: 12px; line-height: 1.25; border-radius: 7px; gap: 3px; }
.bs-note-bar .nt-lead { display: inline-flex; align-items: center; gap: 3px; font-weight: 700; font-size: 12px; white-space: nowrap; }
.bs-note-bar .nt-sep { flex: 0 0 1px; width: 1px; height: 15px; background: color-mix(in srgb, var(--border) 88%, transparent); }
.bs-note-bar .nt-size { height: 26px; padding: 0 1px; font-size: 12px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--text); flex: 0 0 auto; }
.bs-note-bar .nt-color { width: 26px; height: 26px; padding: 0; border: 1px solid var(--border); border-radius: 6px; background: transparent; cursor: pointer; flex: 0 0 auto; }
.bs-note-bar .nt-sw { display: inline-flex; align-items: center; gap: 3px; cursor: pointer; flex: 0 0 auto; }
.bs-note-bar .nt-sw span { font-size: 11px; color: var(--text-soft); line-height: 1; }
.bs-note-bar .nt-sw input { width: 24px; height: 22px; padding: 0; border: 1px solid var(--border); border-radius: 6px; background: transparent; cursor: pointer; }
/* 吸住时加深一点投影，和正文拉开层次（滚动离开原位才有） */
.bs-note-bar.is-stuck { box-shadow: 0 8px 22px rgba(34,54,44,.20); background: color-mix(in srgb, var(--surface) 97%, transparent); }
/* 吸顶后正文从工具栏下方穿过：给下面压一点内阴影，视觉上像被「压住」 */
.bs-note-bar.is-stuck::after { content: ''; position: absolute; left: 0; right: 0; bottom: -9px; height: 9px; pointer-events: none;
  background: linear-gradient(to bottom, rgba(34,54,44,.10), transparent); border-radius: 0 0 8px 8px; }
@media (max-width: 640px) {
  .bs-note-bar { gap: 3px; padding: 4px 5px; max-height: 34vh; }
  .bs-note-bar .btn.small { padding: 4px 5px; font-size: 12px; min-width: 29px; min-height: 29px; }
  .bs-note-bar .nt-lbl { display: none; }          /* 窄屏只留图标，靠 title 说明 */
  .bs-note-bar .nt-lead { font-size: 11px; }
  .bs-note-bar .nt-size { height: 29px; }
  .bs-note-bar .nt-color { width: 29px; height: 29px; }
  .bs-note-bar .nt-sw span { display: none; }
  .bs-note-bar .nt-sw input { width: 22px; height: 22px; }
}

/* v235：笔迹迷你条 —— 吸附在圈点工具栏下沿（工具栏内的第二行），随吸顶工具栏走，不再浮在触点旁遮住正文 */
/* v237：与工具栏去重后只剩「这一笔」专属动作，不再强制独占整行：放得下就并进工具栏同行末尾 */
#noteMiniBar.nt-sub {
  position: static; flex: 0 1 auto; order: 99;
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px;
  margin: 0; padding: 0;
  border: 0; border-radius: 0; background: transparent; box-shadow: none;
  font-size: 12px; max-width: 100%;
}
#noteMiniBar.nt-sub > * { flex: 0 0 auto; }
/* 深色主题下别用死白底：非激活态跟工具栏同色系 */
#noteMiniBar.nt-sub .mm-mode:not(.on-word):not(.on-phrase) {
  background: color-mix(in srgb, var(--surface) 55%, var(--surface-2));
  border-color: var(--border); color: var(--text-soft);
}
#noteMiniBar.nt-sub .mm-mode { padding: 2px 6px; }
#noteMiniBar.nt-sub .btn.small { padding: 3px 7px; font-size: 12px; border-radius: 6px; gap: 3px; }
#noteMiniBar.nt-sub .nt-lead { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; color: var(--text-soft); white-space: nowrap; }
#noteMiniBar.nt-sub .nt-sep { flex: 0 0 1px; width: 1px; height: 14px; background: color-mix(in srgb, var(--border) 88%, transparent); }
#noteMiniBar.nt-sub .nt-size { height: 24px; padding: 0 1px; font-size: 12px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--text); }
#noteMiniBar.nt-sub .nt-color { width: 24px; height: 24px; padding: 0; border: 1px solid var(--border); border-radius: 6px; background: transparent; cursor: pointer; }
#noteMiniBar.nt-sub .mm-phstat { color: #6366f1; font-size: 11px; white-space: nowrap; }
@media (max-width: 640px) {
  /* v237：去重后只剩几颗按钮，正常换行即可；万一偏长再横向滑动 */
  #noteMiniBar.nt-sub { flex-wrap: wrap; overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
  #noteMiniBar.nt-sub::-webkit-scrollbar { height: 0; }
  #noteMiniBar.nt-sub .nt-lbl { display: none; }
  #noteMiniBar.nt-sub .btn.small { padding: 3px 6px; min-width: 28px; min-height: 28px; }
  #noteMiniBar.nt-sub .nt-color { width: 28px; height: 28px; }
  #noteMiniBar.nt-sub .nt-size { height: 28px; }
}
/* v236：窄屏「只留图标」时，点一下浮出的工具名称气泡（鼠标/手指都走 pointerdown） */
#ntTip {
  position: fixed; z-index: 260; pointer-events: none;
  padding: 4px 9px; border-radius: 7px;
  background: rgba(26,38,32,.94); color: #fff;
  font-size: 12px; line-height: 1.4; font-weight: 600; white-space: nowrap;
  box-shadow: 0 6px 18px rgba(0,0,0,.26);
  opacity: 0; transform: translateY(-3px);
  transition: opacity .12s ease, transform .12s ease;
}
#ntTip.on { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) { #ntTip { transition: none; } }

/* 兜底（工具栏还没建好时的浮动形态）：贴视口上沿 */
#noteMiniBar.nt-float {
  position: fixed; z-index: 60; max-width: calc(100vw - 12px);
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px;
  padding: 5px 7px; font-size: 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 9px;
  box-shadow: 0 6px 24px rgba(0,0,0,.16);
}
#noteMiniBar.nt-float .btn.small { padding: 3px 7px; font-size: 12px; border-radius: 6px; }
#noteMiniBar.nt-float .nt-sep { width: 1px; height: 14px; background: var(--border); }
#noteMiniBar.nt-float .nt-size { height: 24px; }
#noteMiniBar.nt-float .nt-color { width: 24px; height: 24px; padding: 0; border: 1px solid var(--border); border-radius: 6px; }
@media (max-width: 640px) { #noteMiniBar.nt-float .nt-lbl { display: none; } }

/* v235：备注输入弹层（桌面居中 / 手机底部抽屉，避免挡满正文） */
.note-pop {
  position: fixed; z-index: 300; left: 50%; top: 42%; transform: translate(-50%, -50%);
  width: 340px; max-width: 92vw;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,.22); padding: 14px;
}
@media (max-width: 640px) {
  .note-pop {
    left: 0; right: 0; bottom: 0; top: auto; transform: none;
    width: 100%; max-width: 100%; max-height: 76vh; overflow: auto;
    border-radius: 14px 14px 0 0; padding: 11px 12px calc(11px + env(safe-area-inset-bottom));
    box-shadow: 0 -10px 40px rgba(0,0,0,.28);
  }
  .note-pop .bs-note-body { min-height: 84px !important; }
  .note-pop .bs-note-body textarea, .note-pop .bs-note-body > div { height: 92px !important; min-height: 84px !important; }
  .note-pop .bs-note-drag { cursor: default; }
}

.bs-word { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.bs-word-bar {
  position: sticky; top: 0; z-index: 20;
  display: flex; flex-direction: column; gap: 6px;
  padding: 8px 10px; border: 1px solid #e2ebe5; border-radius: 10px;
  background: #f7faf8; box-shadow: 0 2px 8px rgba(34, 54, 44, .05);
}
.bs-word-row { display: flex; align-items: center; gap: 3px; flex-wrap: wrap; }
.bs-word-row + .bs-word-row { padding-top: 6px; border-top: 1px dashed #e0eae4; }
.bs-word-bar .bs-word-mode-row { order: -1; }
.bs-word-bar .bs-word-tools-stem { order: 3; }
.bs-word-bar .bs-word-tools-lang { order: 4; }
.bs-word-bar .bs-word-insert-row { order: 5; }
.bs-word-bar .bs-word-excel-ops { order: 1; }
.bs-word-bar .bs-word-excel-actions { order: 2; }
.bs-word-bar .bs-word-help-row { order: 3; }
/* Excel 工具栏：共享工具行排在表格操作行之后、帮助行之前（对齐设计稿） */
.bs-word-bar #bsExcelCommonHost { order: 2; }
.bs-editor-mode #bsWordToolbarHost .bs-word-bar,
.bs-editor-mode #bsExcelToolbarHost .bs-word-bar { position: static; padding: 7px 9px; border-color: #dce7e0; border-radius: 8px; background: #f7faf8; box-shadow: none; }
.bs-editor-mode #bsExcelToolbarHost .bs-word-bar { gap: 3px; }
.bs-editor-mode #bsExcelToolbarHost .bs-word-excel-ops,
.bs-editor-mode #bsExcelToolbarHost .bs-word-excel-actions { padding-top: 5px; }
.bs-editor-mode #bsExcelToolbarHost #bsExcelActionRow { align-items: center; }
.bs-editor-mode #bsExcelToolbarHost #bsExcelActionRow > .btn { min-height: 28px; padding: 4px 8px; border-radius: 6px; font-size: 12px; }
.bs-editor-mode.bs-excel-mode #bsWordToolbarHost .bs-word-mode-row { order: 2; }
.bs-editor-mode.bs-excel-mode .bs-word-mode-row > span:first-child,
.bs-editor-mode.bs-excel-mode .bs-word-mode-row > [data-wcmd="open"],
.bs-editor-mode.bs-excel-mode .bs-word-mode-row > [data-wins="excelTpl"],
.bs-editor-mode.bs-excel-mode .bs-word-insert-row > [data-wins="pageSetup"] { display: none; }
.bs-editor-mode.bs-excel-mode #bsExcelActionRow::before { content: "表格操作"; padding-right: 4px; color: #657a6e; font-size: 11px; }
.bs-editor-mode.bs-excel-mode #bsWordCount { display: none; }
.bs-editor-mode .bs-workspace { padding-top: 6px; }
.bs-editor-mode #bsWordPad,
.bs-editor-mode #bsExcelPad { gap: 6px; }
.bs-editor-mode #bsExcelPage { width: 100%; max-width: none; min-height: 720px; padding: 28px; }
.bs-editor-mode.bs-excel-mode #bsExcelPage { overflow-x: auto; }
.bs-editor-mode.bs-excel-mode #bsWordToolbarHost .bs-word-bar { border-color: #e3ebe6; background: #fff; }
.bs-word-bar.tools-collapsed > .bs-word-row:not(:first-child) { display: none; }
.bs-word-bar.tools-collapsed > .bs-word-row:first-child { padding: 0; border: 0; }
.bs-word-bar.tools-collapsed > .bs-word-row:first-child > :not([data-wins="toggleBar"]):not([data-ecmd="toggleBar"]) { display: none; }
/* 共享工具行容器（Word/Excel/白板三处挂载） */
#bsCommonRows { display: flex; flex-direction: column; min-width: 0; }
.bs-word-common-host { min-width: 0; }
/* 折叠：行在 #bsCommonRows 内层，须用后代选择器，且保留第一行折叠键 */
.bs-word-bar.tools-collapsed #bsCommonRows .bs-word-row:not(:first-child) { display: none; }
.bs-word-bar.tools-collapsed #bsCommonRows .bs-word-row:first-child { padding: 0; border: 0; }
.bs-word-bar.tools-collapsed #bsCommonRows .bs-word-row:first-child > :not([data-wins="toggleBar"]):not([data-ecmd="toggleBar"]) { display: none; }
.bs-word-bar.tools-collapsed > .bs-word-row:not(:first-child) { display: none; }
.bs-word-bar.tools-collapsed > .bs-word-row:first-child > :not([data-wins="toggleBar"]):not([data-ecmd="toggleBar"]) { display: none; }
.bs-word-bar.tools-collapsed > .bs-word-common-host { display: none; }
.bs-word-bar.tools-collapsed > #bsExcelCommonHost { display: none; }
.bs-word-act-row { gap: 6px; }
.bs-word-act-row .wbtn { min-width: 64px; height: 30px; }
.bs-word-act-row .wbtn.primary { border-color: #287c5b; background: #287c5b; color: #fff; }
.bs-word-act-row .wbtn.primary:hover { background: #246b4d; }
/* Excel 版：动作行已自带模板/打印/保存/导出，隐藏共享动作行避免重复；模式行仅属 Word 版 */
.bs-editor-mode.bs-excel-mode #bsCommonRows .bs-word-act-row { display: none; }
.bs-editor-mode.bs-excel-mode .bs-word-mode-row { display: none; }
/* 白板：顶部三组并排一行的紧凑布局；更多工具区独占整行 */
.bs-board-bar > .bs-board-group { flex: 0 1 auto; border-top: 0; padding-top: 0; }
.bs-board-bar > #bsBoardMore { flex: 1 0 100%; border-top: 1px solid #e2eae5; padding-top: 4px; }
.bs-board-bar > #bsBoardMore > .bs-board-group { flex: 1 0 100%; border-top: 0; padding-top: 2px; }
.bs-board-common-host { flex: none; max-height: 34vh; overflow-y: auto; border-bottom: 1px solid #dfe8e2; background: #fbfdfc; }
.bs-board-common-host #bsCommonRows { padding: 2px 9px 6px; }
/* OpenBoard 式辅助：放大镜 + 幕布/聚光灯（不拦截操作，工具栏保持可点） */
#bsBoardLens { position: fixed; left: 0; top: 0; width: 180px; height: 180px; z-index: 1520; border-radius: 50%; border: 3px solid #287c5b; box-shadow: 0 12px 30px rgba(0,0,0,.28); background: #fff; pointer-events: none; display: none; }
#bsBoardCurtain { position: fixed; inset: 0; z-index: 1502; pointer-events: none; display: none;
  background: radial-gradient(circle 130px at var(--cx, 50%) var(--cy, 50%), rgba(0,0,0,0) 0 126px, rgba(6,18,13,.9) 132px); }
.bs-board-bar { position: relative; z-index: 1510; }
.bs-board-common-host { position: relative; z-index: 1508; }
.bs-board-bar.tools-collapsed > :not(#bsBoardToolsToggle) { display: none !important; }
.bs-board-bar.tools-collapsed { min-height: 42px; }
.bs-board-bar.auto-hidden { transform: translateY(calc(-100% + 42px)); transition: transform .18s ease; }
.bs-board-bar.auto-hidden #bsBoardToolsToggle { position: absolute; bottom: 4px; left: 8px; }
.bs-board-bar { display: flex; align-items: center; gap: 4px 7px; flex: none; flex-wrap: wrap; max-height: min(44vh, 420px); overflow-y: auto; padding: 5px 8px; border-bottom: 1px solid #dfe8e2; background: #f4f7f5; position: relative; }
.bs-board-group { display: flex; align-items: center; gap: 5px; flex: 1 0 100%; flex-wrap: wrap; min-width: 0; padding: 5px 2px 2px; border-top: 1px solid #e2eae5; }
.bs-board-mode-group { align-items: center; }
.bs-board-group > b { font-size: 13px; color: #33473c; }
.bs-board-group > span { color: #7b9186; font-size: 12px; }
.bs-board-group label { display: inline-flex; align-items: center; gap: 4px; color: #53685c; font-size: 12px; }
.bs-board-group input[type="color"] { width: 34px; height: 26px; border: 0; padding: 0; background: transparent; }
.bs-board-group select { padding: 3px 6px; }
/* 工具栏吸顶锁定：正文滚动时工具栏固定在顶部（类似表格首行冻结） */
#bsWordBar, #bsExcelBar { position: sticky; top: 0; z-index: 40; background: #fbfdfc; }
/* 白板工具栏贴边停靠：鼠标离开滑到边缘留把手，靠近滑出 */
.bs-board-bar { transition: transform .25s ease; }
.bs-board-bar.edge-hide { transform: translateY(calc(-100% + 16px)); }
/* 白板第二套工具栏折叠：只隐藏非折叠键行，折叠键保持可见 */
.bs-board-common-host.collapsed > #bsCommonRows > .bs-word-row:not(:first-child) { display: none; }
.bs-board-common-host.collapsed > #bsCommonRows > .bs-word-row:first-child { padding: 0; border: 0; }
.bs-board-common-host.collapsed > #bsCommonRows > .bs-word-row:first-child > :not([data-wins="toggleBar"]):not([data-ecmd="toggleBar"]) { display: none; }
.bs-board-common-host.collapsed { max-height: 44px; overflow: hidden; }
/* 白板「更多工具」按钮紧凑排满整行 */
.bs-board-bar #bsBoardMore .btn.small { flex: 0 0 auto; }
/* 白板两套工具栏：紧凑排满整行再换行，字号适中 */
.bs-board-bar .btn.small, .bs-board-bar select.btn.small, .bs-board-bar label { min-height: 26px; white-space: nowrap; padding: 1px 7px; font-size: 12.5px; }
.bs-board-bar .bs-board-group { padding: 3px 2px 2px; }
.bs-board-bar .bs-board-close { position: absolute; right: 8px; top: 4px; z-index: 5; }
.bs-board-common-host #bsCommonRows .bs-word-row { flex-wrap: wrap; gap: 3px 6px; }
.bs-board-common-host .bs-word-row .wbtn, .bs-board-common-host .bs-word-row select { font-size: 12px; padding: 1px 7px; min-height: 26px; }
.bs-board-bar.tools-collapsed { max-height: none; overflow: visible; }
.bs-board-bar.tools-collapsed > #bsBoardToolsToggle { margin: 0; }
@media (max-width: 700px) {
  .bs-board-bar { max-height: 42vh; padding: 5px 6px; gap: 3px; }
  .bs-board-group { gap: 3px; padding-top: 4px; }
  .bs-board-group .btn.small { padding: 4px 6px; font-size: 11px; }
}
.wbtn {
  min-width: 26px; height: 26px; padding: 0 6px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid #dce7e0; border-radius: 6px; background: #fff;
  color: #33443b; font-size: 12.5px; line-height: 1; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.wbtn:hover { background: #eef7f1; border-color: #c6ded0; color: #1f6b4b; }
.wbtn:active { background: #e2f1e8; }
.wsel {
  height: 28px; max-width: 132px; padding: 0 6px;
  border: 1px solid #dce7e0; border-radius: 6px; background: #fff;
  color: #33443b; font-size: 12px;
}
.wsel-sm { max-width: 82px; }
.wsep { width: 1px; height: 18px; margin: 0 3px; background: #e0eae4; }
.wcolor {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 28px; border: 1px solid #dce7e0; border-radius: 6px;
  background: #fff; color: #33443b; font-size: 12.5px; font-weight: 700; cursor: pointer; overflow: hidden;
}
.wcolor input[type=color] {
  position: absolute; inset: 0; width: 100%; height: 100%;
  border: none; padding: 0; opacity: 0; cursor: pointer;
}
.bs-word-count { margin-left: auto; color: #7b9186; font-size: 11.5px; }
.bs-word-stage {
  padding: 18px 8px 40px; border-radius: 10px;
  background: #eef2ef;
}
.bs-word-page {
  width: min(100%, 794px); min-height: 1000px; margin: 0 auto;
  padding: 64px 68px; box-sizing: border-box;
  border: 1px solid #e6e6dc; border-radius: 3px; background: #fff;
  color: #1d2521; font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  font-size: 16px; line-height: 1.85; outline: none;
  box-shadow: 0 8px 28px rgba(34, 54, 44, .10);
}
.bs-word-page:empty::before { content: attr(data-placeholder); color: #a9bcb2; font-size: 14px; }
.bs-word-page h1 { font-size: 28px; line-height: 1.35; margin: 18px 0 12px; }
.bs-word-page h2 { font-size: 22px; margin: 16px 0 10px; }
.bs-word-page h3 { font-size: 18px; margin: 14px 0 8px; }
.bs-word-page p { margin: 8px 0; }
.bs-word-page blockquote { margin: 10px 0; padding: 8px 14px; border-left: 3px solid #b9c8bf; background: #f7faf8; color: #4c5b53; }
.bs-word-page pre { padding: 10px 12px; border: 1px solid #e2eae5; border-radius: 6px; background: #f4f7f5; font-family: Consolas, monospace; font-size: 13.5px; white-space: pre-wrap; }
.bs-word-page table { width: 100%; margin: 10px 0; border-collapse: collapse; font-size: 14px; }
.bs-word-page table th, .bs-word-page table td { border: 1px solid #adbdb4; padding: 6px 9px; text-align: left; vertical-align: top; }
.bs-word-page table th { background: #eef5f0; font-weight: 700; }
.bs-word-page img { max-width: 100%; height: auto; border-radius: 4px; }
.bs-word-page ul, .bs-word-page ol { margin: 8px 0 8px 24px; padding: 0; }
.bs-word-page li { margin: 3px 0; }
.bs-word-page hr { border: 0; border-top: 1px solid #cfd9d3; margin: 16px 0; }
.bs-word-page a { color: #1e6fd9; text-decoration: underline; }
.bs-word-page .bs-wp-pagebreak {
  height: 0; margin: 16px 0; border-top: 1px dashed #c3d2c9; position: relative;
  page-break-after: always;
}
.bs-word-page .bs-wp-pagebreak::after {
  content: "分页符 Page break"; position: absolute; right: 0; top: -9px;
  padding: 0 6px; background: #fff; color: #9db2a7; font-size: 10.5px;
}
@media (max-width: 899px) {
  .bs-word { flex-direction: column !important; }
  .bs-word-bar { position: static; flex: none !important; max-width: none !important; max-height: none !important; overflow: visible !important; order: 0 !important; }
  .bs-word-stage { padding: 10px 2px 24px; }
  .bs-word-page { padding: clamp(18px, 5vw, 40px); min-height: 70vh; font-size: 15px; }
  .bs-word-count { display: none; }
}

@media (max-width: 899px) {
  #bsPaneTabs { display: none; }
  #bsPaletteWrap.open #bsPaneTabs { display: flex; }
}

/* Word 式直接编辑：contenteditable 视觉提示 */
.bs-block [contenteditable="true"] { border-radius: 3px; cursor: text; }
.bs-block [contenteditable="true"]:hover { outline: 1px dashed #b8d8c6; }
.bs-block [contenteditable="true"]:focus { outline: 2px solid var(--bs-accent, #27805d); background: #f2fbf6; }
.bs-fmt-biu { border: 1px solid #d4e2da; border-radius: 6px; background: #fff; color: #33443b; }
.bs-fmt-biu.on { background: var(--bs-accent, #27805d); color: #fff; border-color: var(--bs-accent, #27805d); }

/* ===== 可做题版（在线作答）：学生端作业链接渲染 ===== */
.bs-do-in { display: block; width: 100%; box-sizing: border-box; margin: 6px 0 12px; padding: 8px 10px; border: 1px solid #b9c8bf; border-radius: 6px; font-size: 14px; font-family: inherit; background: #fff; }
.bs-do-in:focus { outline: 2px solid var(--bs-accent, #27805d); }
.bs-verdict { display: inline-block; margin-left: 8px; font-weight: 700; }
.bs-verdict.ok { color: #1f9d5b; }
.bs-verdict.no { color: #d64545; }
.bs-ans-sheet { margin: 18px 0; padding: 12px; background: #f6faf7; border: 1px solid #cfe0d6; border-radius: 8px; font-size: 14px; }
.bs-ans-sheet b { color: var(--bs-accent, #27805d); }
.bs-toolbar { text-align: center; margin: 18px 0; }
.bs-toolbar button { margin: 4px; padding: 9px 18px; border-radius: 8px; font-size: 14px; cursor: pointer; }


/* VIP 呼吸红点：非会员时右上角 👑 VIP 按钮提示 */
#renewVipBtn.vip-pulse { position: relative; }
#renewVipBtn.vip-pulse::after { content: ''; position: absolute; top: 2px; right: 4px; width: 9px; height: 9px; border-radius: 50%; background: #ef4444; box-shadow: 0 0 0 0 rgba(239,68,68,.7); animation: vipPulse 1.6s infinite; }
@keyframes vipPulse { 0% { box-shadow: 0 0 0 0 rgba(239,68,68,.7); } 70% { box-shadow: 0 0 0 9px rgba(239,68,68,0); } 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); } }
/* ===== 固定句型 / 搭配（单词本页） ===== */
.phrase-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.phrase-item {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2);
}
.phrase-item .ph-text { font-weight: 700; color: var(--text); letter-spacing: .2px; }
.phrase-item .ph-edit {
  flex: 1 1 auto; min-width: 120px; font: inherit; font-weight: 700; color: var(--text);
  letter-spacing: .2px; padding: 4px 8px; border-radius: 7px; border: 1px solid transparent;
  background: transparent; outline: none;
}
.phrase-item .ph-edit:hover { border-color: var(--border); background: var(--surface); }
.phrase-item .ph-edit:focus { border-color: var(--primary); background: var(--surface); box-shadow: 0 0 0 3px var(--primary-soft); }
.phrase-item .ph-src { font-size: 12px; color: var(--text-soft); margin-left: auto; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.phrase-item .ph-del {
  border: 0; background: transparent; cursor: pointer; color: var(--text-soft);
  font-size: 14px; line-height: 1; padding: 2px 4px; border-radius: 6px;
}
.phrase-item .ph-del:hover { color: var(--bad); background: var(--bad-bg); }

/* ============ 右侧工具坞（v234）============
   文章操作页的功能键全部纵向吸附在文章框右侧外边：
   收起时只留一条贴边窄标签，悬停 / 触碰即展开，闲置自动靠边（可 📌 固定）。 */
.art-dock { position: fixed; right: 0; top: 50%; transform: translateY(-50%); z-index: 72; width: 0; height: 0; font-size: 13px; }
.art-dock[hidden] { display: none !important; }
.art-dock-tab {
  position: absolute; right: 0; top: 0; transform: translate(0, -50%);
  width: 28px; padding: 12px 4px; display: flex; flex-direction: column; align-items: center; gap: 7px;
  border: 1px solid var(--border); border-right: 0; border-radius: 14px 0 0 14px;
  background: var(--surface); color: var(--text-soft); cursor: pointer;
  box-shadow: -4px 0 18px rgba(31, 36, 48, .14);
  transition: transform .2s ease, opacity .18s ease, color .15s, border-color .15s;
}
.art-dock-tab:hover, .art-dock-tab:focus-visible { color: var(--primary); border-color: var(--primary); }
.art-dock-tab-i { font-size: 15px; line-height: 1; }
.art-dock-tab-t { writing-mode: vertical-rl; letter-spacing: 2px; font-size: 11.5px; font-weight: 700; }
.art-dock.open .art-dock-tab { opacity: 0; transform: translate(24px, -50%); pointer-events: none; }
.art-dock-panel {
  position: absolute; right: 0; top: 0;
  width: 254px; max-height: 84vh; overflow-y: auto; overscroll-behavior: contain;
  padding: 8px 9px 10px;
  background: var(--surface); border: 1px solid var(--border); border-right: 0; border-radius: 16px 0 0 16px;
  box-shadow: -8px 0 30px rgba(31, 36, 48, .18);
  transform: translate(calc(100% + 16px), -50%); opacity: 0; pointer-events: none;
  transition: transform .24s cubic-bezier(.2, .8, .3, 1), opacity .18s ease;
}
.art-dock.open .art-dock-panel { transform: translate(0, -50%); opacity: 1; pointer-events: auto; }
.art-dock-head { display: flex; align-items: center; gap: 4px; padding: 1px 1px 6px; border-bottom: 1px solid var(--border); margin-bottom: 7px; }
.art-dock-head b { font-size: 12.5px; }
.art-dock-sp { flex: 1 1 auto; }
.art-dock-ico { width: 24px; height: 24px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--text-soft); cursor: pointer; font-size: 12px; line-height: 1; }
.art-dock-ico:hover { background: var(--surface-2); border-color: var(--border); }
.art-dock-ico.on { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.art-dock-body { display: flex; flex-direction: column; gap: 6px; }
/* 搬进来的按钮排成竖列、占满整行，一眼看清、一点就中 */
.art-dock-body .page-actions,
.art-dock-body #clozeActions {
  display: flex !important; flex-direction: column; align-items: stretch; gap: 6px;
  width: 100%; margin: 0 !important; padding: 0;
}
.art-dock-body .page-actions > *,
.art-dock-body #clozeActions > * { width: 100%; }
.art-dock-body .page-actions .btn,
.art-dock-body #clozeActions .btn {
  justify-content: flex-start; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.art-dock-body .page-actions > span, .art-dock-body #clozeActions > span { font-size: 11.5px; }
.art-dock-body select.input { width: 100%; }
.art-dock-body label.check { font-size: 12px; }
/* 笔记框（随文笔记）：和坞里的按钮同进退 */
.art-dock-note { margin-top: 9px; padding-top: 7px; border-top: 1px solid var(--border); }
.art-dock-note[hidden] { display: none !important; }
.art-dock-note:has(.article-note[hidden]) { display: none !important; }
.art-dock-note-h { width: 100%; display: flex; align-items: center; gap: 4px; padding: 3px 2px; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.art-dock-note-h i { margin-left: auto; font-style: normal; color: var(--text-soft); }
.art-dock-note.collapsed .art-dock-note-b { display: none; }
.art-dock-note-b .article-note, .art-dock-note-b .panel {
  margin: 0; padding: 0; border: 0; background: transparent; box-shadow: none;
}
.art-dock-note-b .article-note h3 { font-size: 12px; margin: 0 0 4px; }
.art-dock-note-b .article-note .row.between { margin-bottom: 4px; }
.art-dock-note-b .article-note .hint { font-size: 10.5px; }
.art-dock-note-b textarea, .art-dock-note-b .note-edit { min-height: 76px; font-size: 12.5px; width: 100%; }
@media (max-width: 520px) {
  .art-dock-panel { width: 76vw; max-width: 300px; max-height: 78vh; }
  .art-dock-tab { width: 26px; padding: 10px 3px; }
}
