/* ═══════════════════════════════════════════════════════════════════════
   ReadLens Library / 学习中心
   沿用 popup/options 的"编辑物"设计语言（米色 + 衬线 + 发丝线 + 茄子紫）
   ═══════════════════════════════════════════════════════════════════════ */

:root {
  --paper:        #f5f1e8;
  --paper-2:      #ece6d6;
  --paper-3:      #fbf9f3;
  --ink:          #1f1a14;
  --ink-2:        #5a5145;
  --ink-3:        #8a8071;
  --rule:         #d4cab5;
  --rule-soft:    #e3dccb;
  --accent:       #6e3982;
  --accent-2:     #582867;
  --accent-soft:  #ece0ee;
  --ok:           #3d6e3d;
  --ok-soft:      #e8f0e3;
  --err:          #9c2a2a;
  --err-soft:     #f6e6e6;

  --serif: "Newsreader", "Source Serif Pro", "Source Serif 4",
           Charter, "Iowan Old Style", "Sitka Text",
           Cambria, Georgia, serif;
  --sans:  "IBM Plex Sans", "Söhne",
           -apple-system, BlinkMacSystemFont,
           "Segoe UI Variable", "Segoe UI",
           "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
           sans-serif;
  --mono:  "IBM Plex Mono", "JetBrains Mono", "SF Mono",
           "Cascadia Code", Consolas, Menlo, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
.hidden { display: none !important; }

body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 28px 80px;
  display: flex;
  flex-direction: column;
  gap: 0;
  animation: paper-in .3s ease-out;
}
@keyframes paper-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ═══════ 词标 ═══════ */
.page-header { display: flex; flex-direction: column; gap: 4px; }
.wordmark { display: flex; align-items: center; gap: 11px; }
.lens-mark {
  width: 16px; height: 16px;
  color: var(--ink); flex-shrink: 0;
}
.wordmark-name {
  font-family: var(--serif);
  font-size: 22px; font-weight: 600;
  letter-spacing: 1.8px;
  color: var(--ink); line-height: 1;
}
.wordmark-tag {
  font-family: var(--mono);
  font-size: 10.5px; font-weight: 500;
  letter-spacing: 2.2px;
  color: var(--ink-3);
  margin-left: auto; line-height: 1;
}
.wordmark-cn {
  font-family: var(--serif); font-style: italic;
  font-size: 13.5px;
  color: var(--ink-2);
  letter-spacing: 0.6px;
  margin-left: 27px;
}

/* ═══════ 发丝线 ═══════ */
.rule {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 24px 0;
}

/* ═══════ Eyebrow / 标题 ═══════ */
.eyebrow {
  display: block;
  font-family: var(--mono);
  font-size: 10px; font-weight: 500;
  letter-spacing: 2.4px;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 4px;
  line-height: 1;
}
.panel h2,
.section-vocab h2,
.section-domains h2,
.section-sentences h2 {
  font-family: var(--serif);
  font-size: 20px; font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.2px;
  line-height: 1.2;
}
.section-desc {
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--ink-2);
  margin-top: 4px;
  line-height: 1.5;
}

/* ═══════ Sync status 条 ═══════ */
.sync-status {
  background: var(--paper-3);
  border: 1px solid var(--rule);
  border-left-width: 3px;
  padding: 12px 16px;
  display: flex; align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  transition: border-color 200ms ease, background 200ms ease;
}
.sync-status-main {
  display: flex; align-items: center;
  gap: 12px; min-width: 0;
}
.sync-status-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--ink-3);
  flex-shrink: 0;
}
.sync-status-title {
  font-family: var(--serif);
  font-size: 14px; font-weight: 600;
  color: var(--ink);
}
.sync-status-detail {
  margin-top: 2px;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--ink-2);
  line-height: 1.45;
  word-break: break-word;
}

/* 四种状态 */
.sync-status--backend { border-left-color: var(--ok); background: var(--ok-soft); }
.sync-status--backend .sync-status-dot { background: var(--ok); }

.sync-status--local { border-left-color: #b8773d; background: #f5ecdc; }
.sync-status--local .sync-status-dot { background: #b8773d; }

.sync-status--error { border-left-color: var(--err); background: var(--err-soft); }
.sync-status--error .sync-status-dot { background: var(--err); }

.sync-status--loading { border-left-color: var(--accent); background: var(--accent-soft); }
.sync-status--loading .sync-status-dot {
  background: var(--accent);
  animation: sync-pulse 1.4s ease-in-out infinite;
}
@keyframes sync-pulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50%      { opacity: 1;   transform: scale(1.15); }
}

/* ═══════ 统计行（三联式）═══════ */
.stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.stat-card {
  padding: 20px 24px;
  display: flex; flex-direction: column;
  gap: 6px;
  border-right: 1px solid var(--rule-soft);
}
.stat-card:last-child { border-right: none; }

.stat-eyebrow {
  font-family: var(--mono);
  font-size: 9.5px; font-weight: 500;
  letter-spacing: 2.2px;
  text-transform: uppercase;
  color: var(--ink-3);
  line-height: 1;
}
.stat-num {
  font-family: var(--serif);
  font-size: 36px; font-weight: 600;
  color: var(--accent);
  line-height: 1.1;
  letter-spacing: -0.5px;
}
.stat-label {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--ink-2);
}

/* ═══════ Tab 导航 ═══════ */
.page-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--rule);
}
.page-tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 14px 22px 12px;
  cursor: pointer;
  display: flex; align-items: center; gap: 10px;
  color: var(--ink-3);
  transition: color 140ms ease, border-color 140ms ease;
  margin-bottom: -1px;
}
.page-tab-mark {
  font-family: var(--mono);
  font-size: 10px; font-weight: 500;
  letter-spacing: 1.8px;
  padding: 2px 6px;
  border: 1px solid currentColor;
  line-height: 1;
}
.page-tab-label {
  font-family: var(--serif);
  font-size: 15px; font-weight: 500;
  letter-spacing: 0.3px;
}
.page-tab:hover { color: var(--ink-2); }
.page-tab.active {
  color: var(--ink);
  border-bottom-color: var(--accent);
}
.page-tab.active .page-tab-mark {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

/* ═══════ 主网格 ═══════ */
.tab-content { padding-top: 24px; }
.main-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 28px;
  align-items: start;
}
.right-col { display: flex; flex-direction: column; gap: 28px; }

/* ═══════ Panel（替代以前的 .card 概念）═══════ */
.panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.panel + .panel,
.section-domains + .section-sentences {
  padding-top: 28px;
  border-top: 1px solid var(--rule-soft);
}
.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

/* ═══════ 按钮 ═══════ */
.btn-secondary-sm,
.btn-danger-sm,
.btn-show-more {
  padding: 7px 13px;
  border-radius: 0;
  font-family: var(--serif);
  font-size: 13px; font-weight: 500;
  letter-spacing: 0.3px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}

.btn-secondary-sm {
  background: transparent;
  border: 1px solid var(--ink);
  color: var(--ink);
}
.btn-secondary-sm:hover:not(:disabled) {
  background: var(--ink);
  color: var(--paper);
}
.btn-secondary-sm:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-danger-sm {
  background: transparent;
  border: 1px solid var(--err);
  color: var(--err);
}
.btn-danger-sm:hover:not(:disabled) {
  background: var(--err);
  color: var(--paper);
}

.btn-show-more {
  width: 100%;
  padding: 10px;
  background: transparent;
  border: 1px dashed var(--rule);
  color: var(--ink-2);
}
.btn-show-more:hover {
  border-color: var(--accent);
  color: var(--accent);
  border-style: solid;
}
.btn-show-more.hidden { display: none; }

/* ═══════ Inline status / 增量提示 ═══════ */
.inline-status {
  font-family: var(--sans);
  font-size: 12.5px;
  line-height: 1.5;
  padding: 8px 11px;
  border-radius: 0;
  border-left: 3px solid;
}
.inline-status.success { background: var(--ok-soft);  color: var(--ok);    border-left-color: var(--ok); }
.inline-status.error   { background: var(--err-soft); color: var(--err);   border-left-color: var(--err); }
.inline-status.info    { background: var(--accent-soft); color: var(--accent-2); border-left-color: var(--accent); }

/* ═══════ Empty hint ═══════ */
.empty-hint {
  font-family: var(--serif); font-style: italic;
  font-size: 13.5px;
  color: var(--ink-3);
  text-align: center;
  padding: 24px 0;
  line-height: 1.5;
}

/* ═══════ 搜索栏 ═══════ */
.search-bar input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--ink-2);
  border-radius: 0;
  background: var(--paper-3);
  font-size: 13.5px;
  font-family: var(--sans);
  color: var(--ink);
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.search-bar input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}
.search-bar input::placeholder { color: var(--ink-3); }

/* ═══════ 过滤 Tab（未掌握 / 全部 / 已掌握）═══════ */
.filter-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0;
  border: 1px solid var(--ink-2);
}
.filter-tab {
  padding: 8px 6px;
  background: transparent;
  border: none;
  border-right: 1px solid var(--ink-2);
  color: var(--ink-2);
  cursor: pointer;
  display: flex; align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--serif);
  font-size: 13px; font-weight: 500;
  transition: background 140ms ease, color 140ms ease;
}
.filter-tab:last-child { border-right: none; }
.filter-tab:hover:not(.active) { background: var(--paper-3); color: var(--ink); }
.filter-tab.active {
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
}

.tab-badge {
  font-family: var(--mono);
  font-size: 10.5px; font-weight: 500;
  padding: 1px 5px;
  background: var(--paper-2);
  color: var(--ink-2);
  min-width: 20px;
  text-align: center;
  letter-spacing: 0;
}
.filter-tab.active .tab-badge {
  background: var(--paper);
  color: var(--ink);
}

/* ═══════ 词汇列表 ═══════ */
.vocab-list {
  display: flex; flex-direction: column;
  gap: 0;
  max-height: 580px;
  overflow-y: auto;
  border: 1px solid var(--rule);
  background: var(--paper-3);
}
.vocab-list::-webkit-scrollbar { width: 6px; }
.vocab-list::-webkit-scrollbar-thumb { background: var(--rule); }
.vocab-list::-webkit-scrollbar-track { background: var(--paper-2); }

.vocab-row {
  padding: 11px 14px;
  cursor: pointer;
  transition: background 140ms ease;
  border-bottom: 1px solid var(--rule-soft);
}
.vocab-row:last-child { border-bottom: none; }
.vocab-row:hover { background: var(--paper-2); }

.vocab-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.vocab-word {
  font-family: var(--serif);
  font-size: 15.5px; font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.1px;
}

.vocab-count {
  font-family: var(--mono);
  font-size: 11px; font-weight: 500;
  color: var(--accent-2);
  background: var(--accent-soft);
  padding: 2px 8px;
  letter-spacing: 0.5px;
}

.vocab-bar-wrap {
  height: 2px;
  background: var(--rule-soft);
  margin-bottom: 6px;
}
.vocab-bar {
  height: 100%;
  background: var(--accent);
  transition: width .3s ease;
}

.vocab-preview {
  font-family: var(--sans);
  font-size: 11.5px;
  color: var(--ink-3);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-style: italic;
}

.vocab-preview mark {
  background: var(--accent-soft);
  color: var(--accent-2);
  padding: 0 2px;
  font-style: normal;
  font-weight: 600;
}

/* 列表行的简义：紧跟单词右侧，靠 margin-right:auto 把词+义压在左、计数/按钮推到右 */
.vocab-meaning {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--ink-2);
  margin-right: auto;
  padding-left: 4px;
  letter-spacing: 0.2px;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.vocab-meaning.is-loading::after {
  content: "释义…";
  color: var(--ink-3);
  font-style: italic;
  opacity: 0.45;
}
.vocab-meaning.is-empty { display: none; }

/* ── 掌握按钮（词条内小按钮）── */
.vocab-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.btn-master {
  width: 24px; height: 24px;
  border-radius: 0;
  border: 1px solid var(--ink-2);
  background: var(--paper);
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
  flex-shrink: 0;
  line-height: 1;
}
.btn-master:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.btn-master.is-mastered {
  border-color: var(--ok);
  background: var(--ok-soft);
  color: var(--ok);
}
.btn-master.is-mastered:hover {
  border-color: var(--err);
  background: var(--err-soft);
  color: var(--err);
}

/* 已掌握词条整行变淡 */
.vocab-row.is-mastered { opacity: 0.55; }
.vocab-row.is-mastered .vocab-word {
  text-decoration: line-through;
  text-decoration-color: var(--ok);
  text-decoration-thickness: 1.5px;
}
.vocab-row.is-mastered .vocab-bar { background: var(--ok); }

/* ═══════ 来源站点 ═══════ */
.domain-list {
  display: flex; flex-direction: column;
  gap: 12px;
}
.domain-row { display: flex; flex-direction: column; gap: 5px; }
.domain-info {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.domain-name {
  font-family: var(--mono);
  font-size: 12px; font-weight: 500;
  color: var(--ink);
  word-break: break-all;
  letter-spacing: 0.1px;
}
.domain-count {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  white-space: nowrap;
  letter-spacing: 1px;
}
.domain-bar-wrap {
  height: 2px;
  background: var(--rule-soft);
}
.domain-bar {
  height: 100%;
  background: var(--accent);
  transition: width .3s ease;
}

/* ═══════ 最近采集 句子 ═══════ */
.sentence-list {
  display: flex; flex-direction: column;
  gap: 0;
  max-height: 380px;
  overflow-y: auto;
  border: 1px solid var(--rule);
  background: var(--paper-3);
}
.sentence-list::-webkit-scrollbar { width: 6px; }
.sentence-list::-webkit-scrollbar-thumb { background: var(--rule); }

.sentence-row {
  padding: 12px 14px;
  border-bottom: 1px solid var(--rule-soft);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sentence-row:last-child { border-bottom: none; }

.sentence-original {
  font-family: var(--serif);
  font-size: 13.5px;
  color: var(--ink);
  line-height: 1.5;
}
.sentence-translated {
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.5;
  padding-left: 10px;
  border-left: 2px solid var(--accent-soft);
}
.sentence-meta {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-3);
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* ═══════ AI 分析 Tab ═══════ */
.ai-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 24px;
}
.ai-action-info { flex: 1; }
.report-meta {
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--ink-2);
}

.btn-generate {
  padding: 12px 22px;
  background: var(--accent);
  color: var(--paper);
  border: 1px solid var(--accent);
  border-radius: 0;
  cursor: pointer;
  display: flex; align-items: center; gap: 10px;
  font-family: var(--serif);
  font-size: 14px; font-weight: 600;
  letter-spacing: 0.6px;
  white-space: nowrap;
  transition: background 140ms ease, transform 80ms ease;
}
.btn-generate:hover:not(:disabled) {
  background: var(--accent-2);
  border-color: var(--accent-2);
}
.btn-generate:active:not(:disabled) { transform: translateY(1px); }
.btn-generate:disabled {
  background: var(--ink-3);
  border-color: var(--ink-3);
  cursor: not-allowed;
}
.btn-generate-icon {
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1;
}

/* ── 空状态占位 ── */
.report-placeholder {
  padding: 64px 32px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  color: var(--ink-2);
}
.placeholder-illustration {
  color: var(--accent);
  opacity: 0.6;
  margin-bottom: 4px;
}
.report-placeholder p {
  font-family: var(--serif);
  font-size: 15px;
  color: var(--ink);
  max-width: 440px;
  line-height: 1.55;
}
.placeholder-hint {
  font-family: var(--sans) !important;
  font-size: 12.5px !important;
  color: var(--ink-3) !important;
  font-style: italic;
}

/* ── Loading 状态 ── */
.report-loading {
  padding: 64px 32px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.loading-spinner {
  width: 30px; height: 30px;
  border: 2px solid var(--rule);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .85s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.report-loading p {
  font-family: var(--serif);
  font-size: 14px;
  color: var(--ink-2);
  font-style: italic;
}

/* ── Report content（learning.js 动态写入，给通用样式） ── */
.report-content {
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.report-content h3 {
  font-family: var(--serif);
  font-size: 18px; font-weight: 600;
  color: var(--ink);
  margin-bottom: 8px;
}
.report-content h4 {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 16px 0 8px;
}
.report-content p {
  font-family: var(--sans);
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.6;
}
.report-content ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.report-content li {
  padding: 12px 14px;
  background: var(--paper-3);
  border-left: 3px solid var(--accent);
  font-family: var(--sans);
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink);
}
.report-content code {
  font-family: var(--mono);
  font-size: 12px;
  background: var(--accent-soft);
  color: var(--accent-2);
  padding: 1px 5px;
}

/* ═══════ Modal（单词详情）═══════ */
.modal {
  position: fixed; inset: 0;
  z-index: 2147483647;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
}
.modal.hidden { display: none !important; }

.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(31, 26, 20, 0.45);
  animation: backdrop-in .2s ease;
}
@keyframes backdrop-in { from { opacity: 0; } to { opacity: 1; } }

.modal-box {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 0;
  width: 100%;
  max-width: 560px;
  max-height: 80vh;
  overflow-y: auto;
  padding: 28px 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 20px 60px rgba(31, 26, 20, 0.2);
  animation: modal-in .25s ease-out;
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--ink-3);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  transition: color 140ms ease;
}
.modal-close:hover { color: var(--err); }

#modal-word {
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.2px;
  line-height: 1.1;
}

.modal-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--rule-soft);
  border-bottom: 1px solid var(--rule-soft);
}

.modal-count {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-2);
  letter-spacing: 0.5px;
}

.btn-master-lg {
  padding: 8px 18px;
  border-radius: 0;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}
.btn-master-lg:hover {
  background: var(--ink);
  color: var(--paper);
}
.btn-master-lg.is-mastered {
  border-color: var(--ok);
  background: var(--ok-soft);
  color: var(--ok);
}
.btn-master-lg.is-mastered:hover {
  border-color: var(--err);
  background: var(--err-soft);
  color: var(--err);
}

/* 详情弹窗的释义区：short 做小标题，detailed 做正文说明 */
.modal-definition {
  margin: 4px 0 4px;
  padding: 12px 14px;
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
}
.modal-def-short {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
  color: var(--accent-2);
  margin-bottom: 4px;
}
.modal-def-detailed {
  font-family: var(--sans);
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink-2);
}
.modal-def-loading {
  font-family: var(--sans);
  font-size: 12.5px;
  font-style: italic;
  color: var(--ink-3);
}

.modal-box h4 {
  font-family: var(--mono);
  font-size: 10.5px; font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--ink-3);
}

.modal-examples {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.modal-example {
  padding: 12px 14px;
  background: var(--paper-3);
  border-left: 3px solid var(--accent);
}
.modal-example-en {
  font-family: var(--serif);
  font-size: 14px;
  color: var(--ink);
  line-height: 1.55;
}
.modal-example-en mark {
  background: var(--accent-soft);
  color: var(--accent-2);
  padding: 0 3px;
  font-weight: 600;
}
.modal-example-zh {
  margin-top: 6px;
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.5;
}
.modal-example-meta {
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-3);
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* 例句里收录词：可悬停出词义、可点击钻取该词详情 */
.ex-word {
  cursor: pointer;
  border-bottom: 1px dotted var(--rule);
  transition: background 120ms ease, border-color 120ms ease;
}
.ex-word:hover {
  background: var(--accent-soft);
  border-bottom-color: var(--accent);
}
.ex-word.is-current {
  background: #fdf3a8;
  border-bottom: none;
}

/* 悬停词义气泡（fixed，body 级，不被弹窗 overflow 裁剪）。
   弹窗 z-index 是 32 位最大值，没法再往上加；气泡在 DOM 里排在 .modal 之后，
   同 z-index 时后者覆盖前者，所以这里取同一最大值即可压在弹窗最上层。 */
.word-tooltip {
  position: fixed;
  z-index: 2147483647;
  max-width: 300px;
  background: var(--ink);
  color: var(--paper);
  padding: 9px 11px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
  pointer-events: none;
}
.word-tooltip.hidden { display: none; }
.wt-short {
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 3px;
}
.wt-detailed {
  font-family: var(--sans);
  font-size: 11.5px;
  line-height: 1.5;
  color: #d9d3c5;
}
.wt-loading {
  font-family: var(--sans);
  font-size: 11.5px;
  font-style: italic;
  color: #cfc8b8;
}

/* 详情弹窗钻词返回面包屑 */
.modal-breadcrumb { margin: 2px 0 8px; }
.modal-breadcrumb.hidden { display: none; }
.breadcrumb-back {
  background: none;
  border: none;
  padding: 2px 0;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent-2);
  cursor: pointer;
  letter-spacing: 0.3px;
}
.breadcrumb-back:hover { text-decoration: underline; }

/* ═══════ 响应式（窄屏单列） ═══════ */
@media (max-width: 880px) {
  .main-grid {
    grid-template-columns: 1fr;
  }
  .stats-row {
    grid-template-columns: 1fr;
  }
  .stat-card {
    border-right: none;
    border-bottom: 1px solid var(--rule-soft);
  }
  .stat-card:last-child { border-bottom: none; }
}
