/* 词光 WordGlow · 各功能模块样式 */

/* ---------- 查词：搜索框 ---------- */
.search-hero {
  background: linear-gradient(180deg, var(--primary-soft), transparent 70%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
}
.search-box { display: flex; gap: 8px; align-items: stretch; }
.search-input-wrap { position: relative; flex: 1; }
.search-input-wrap .input {
  padding-left: 40px;
  padding-right: 12px;
  height: 46px;
  font-size: 16px;
}
.search-input-wrap .lead-icon {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  color: var(--text-faint); font-size: 16px;
}
.search-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.suggest-list {
  position: absolute; z-index: 30; left: 0; right: 0; top: 52px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.suggest-item { padding: 9px 14px; cursor: pointer; display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.suggest-item:hover, .suggest-item.on { background: var(--surface-2); }
.suggest-item .en { font-weight: 600; }

/* ---------- 每日一句 / 节日插图（项目自带 SVG，免版权） ---------- */
.quote-art {
  display: block; width: 100%; height: 132px;
  object-fit: cover; border-radius: var(--radius-sm);
  margin: 10px 0 4px; background: var(--surface-2);
}
.quote-art.small { height: 96px; }
.festival-art {
  display: block; width: 100%; height: 150px;
  object-fit: cover; border-radius: var(--radius-sm);
  margin-bottom: 4px; background: var(--surface-2);
}

/* ---------- 查词：九要素卡片 ---------- */
.word-card { display: flex; flex-direction: column; gap: 14px; }
.word-head { display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.word-title { font-family: var(--font-en); font-size: 34px; font-weight: 700; line-height: 1.1; }
.word-flags { display: flex; flex-direction: column; gap: 6px; }
.phonetic-row { display: flex; align-items: center; gap: 8px; font-family: var(--font-en); color: var(--text-dim); font-size: 14px; }
.speak-btn {
  border: 1px solid var(--border); background: var(--surface);
  border-radius: 8px; padding: 2px 8px; cursor: pointer; font-size: 12.5px; color: var(--text-dim);
}
.speak-btn:hover { border-color: var(--primary); color: var(--primary); }
.speak-btn.on { background: var(--primary-soft); color: var(--primary-strong); border-color: var(--primary); }

.element { border-top: 1px dashed var(--border); padding-top: 11px; }
.element:first-of-type { border-top: none; padding-top: 0; }
.element-head { display: flex; align-items: center; gap: 7px; margin-bottom: 6px; font-size: 13px; color: var(--text-dim); font-weight: 600; }
.element-head .idx {
  width: 18px; height: 18px; border-radius: 6px; background: var(--surface-2); color: var(--text-dim);
  display: grid; place-items: center; font-size: 11px;
}
.element.miss { opacity: 0.6; }
.element.miss .element-head::after { content: "（暂缺）"; font-weight: 400; }

.meaning-group { display: flex; gap: 9px; margin-bottom: 5px; }
.pos-badge {
  flex: none; min-width: 40px; text-align: center;
  background: var(--primary-soft); color: var(--primary-strong);
  border-radius: 7px; padding: 2px 7px; font-size: 12.5px; font-family: var(--font-en); font-weight: 600;
}
.meaning-list { display: flex; flex-direction: column; gap: 4px; font-size: 15px; }

.pill-list { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  background: var(--surface-2); border-radius: 10px; padding: 6px 11px; font-size: 13.5px;
  border: 1px solid transparent;
  display: inline-flex; align-items: center; gap: 6px;
}
.pill .note { color: var(--text-faint); font-size: 12px; margin-left: 6px; }
.pill.click { cursor: pointer; }
.pill.click:hover { border-color: var(--primary); color: var(--primary-strong); }
.pill.en { font-family: var(--font-en); }
.mini-add {
  border: 1px solid var(--border); background: var(--surface);
  border-radius: 8px; padding: 1px 7px; cursor: pointer; font-size: 12px; color: var(--text-dim);
}
.mini-add:hover { border-color: var(--primary); color: var(--primary); }
.mini-add:disabled { opacity: 0.55; cursor: default; }

.example { background: var(--bg-soft); border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 8px; }
.example .en-line { font-family: var(--font-en); font-size: 15px; display: flex; gap: 8px; align-items: flex-start; }
.example .zh-line { color: var(--text-dim); font-size: 13.5px; margin-top: 3px; }
.example .src { color: var(--text-faint); font-size: 11.5px; margin-top: 2px; }

.correction-banner {
  background: var(--accent-soft); border: 1px solid var(--accent);
  color: var(--text); border-radius: var(--radius-sm); padding: 9px 12px; font-size: 13.5px;
}
.correction-banner b { color: var(--accent); font-family: var(--font-en); }

.sentence-keywords { display: flex; flex-wrap: wrap; gap: 7px; }
.kw { border-bottom: 1px dashed var(--border-strong); cursor: pointer; padding-bottom: 1px; }
.kw.known { border-bottom-color: var(--primary); color: var(--primary-strong); }
.kw:hover { background: var(--primary-soft); }

/* ---------- 每日任务 ---------- */
.task-item { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 10px; overflow: hidden; }
.task-item .task-head { display: flex; align-items: center; gap: 10px; padding: 11px 14px; background: var(--surface-2); }
.task-item.done .task-head { background: var(--primary-soft); }
.task-word { font-family: var(--font-en); font-size: 19px; font-weight: 700; }
.task-body { padding: 14px; border-top: 1px solid var(--border); }
.task-body.collapsed { display: none; }

.stat-row { display: flex; gap: 18px; flex-wrap: wrap; }
.stat { display: flex; flex-direction: column; }
.stat .num { font-size: 22px; font-weight: 700; color: var(--primary-strong); }
.stat .lab { font-size: 12.5px; color: var(--text-dim); }

/* ---------- 日历 ---------- */
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-head { text-align: center; font-size: 12.5px; color: var(--text-dim); padding: 4px 0; }
.cal-cell {
  min-height: 74px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 6px; background: var(--surface); cursor: pointer; position: relative;
  display: flex; flex-direction: column; gap: 3px;
}
.cal-cell:hover { border-color: var(--primary); }
.cal-cell.empty { background: transparent; border: 1px dashed var(--border); cursor: default; }
.cal-cell.today { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.cal-cell.selected { background: var(--primary-soft); }
.cal-day { font-size: 13.5px; font-weight: 600; }
.cal-fest { font-size: 11px; color: var(--warn); line-height: 1.25; }

.quote-card { display: flex; flex-direction: column; gap: 10px; }
.quote-figure {
  height: 132px; border-radius: var(--radius); overflow: hidden;
  background: linear-gradient(135deg, var(--primary-soft), var(--accent-soft));
  display: grid; place-items: center; font-size: 40px; color: var(--primary);
}
.quote-en { font-family: var(--font-en); font-size: 18px; line-height: 1.6; }
.quote-zh { color: var(--text-dim); font-size: 14px; }
.quote-meta { font-size: 12.5px; color: var(--text-faint); }

/* ---------- 社区 ---------- */
.post { border-bottom: 1px solid var(--border); padding: 14px 0; }
.post:last-child { border-bottom: none; }
.post-head { display: flex; align-items: center; gap: 9px; margin-bottom: 6px; }
.post-name { font-weight: 600; font-size: 14px; }
.post-bio { color: var(--text-faint); font-size: 12px; }
.post-body { font-size: 14.8px; white-space: pre-wrap; word-break: break-word; }
.post-foot { display: flex; gap: 12px; align-items: center; margin-top: 8px; font-size: 12.5px; color: var(--text-faint); }
.replies { margin-top: 10px; padding-left: 14px; border-left: 2px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.reply { background: var(--bg-soft); border-radius: var(--radius-sm); padding: 9px 12px; }

/* ---------- AI 助手 ---------- */
.chat-box { display: flex; flex-direction: column; gap: 12px; height: 54vh; min-height: 320px; overflow-y: auto; padding-right: 4px; }
.bubble { max-width: 82%; padding: 11px 14px; border-radius: 14px; font-size: 14.6px; white-space: pre-wrap; word-break: break-word; }
.bubble.me { align-self: flex-end; background: var(--primary); color: var(--primary-ink); border-bottom-right-radius: 4px; }
.bubble.bot { align-self: flex-start; background: var(--surface-2); border-bottom-left-radius: 4px; }
.bubble.bot .en { font-family: var(--font-en); }
.chat-input-row { display: flex; gap: 8px; margin-top: 12px; }
.ai-turn { display: flex; flex-direction: column; gap: 5px; align-items: flex-start; max-width: 82%; }
.ai-turn .bubble { max-width: 100%; }
.ai-turn .tiny { padding-left: 2px; }

/* ---------- 历史 / 个人中心 / 后台 ---------- */
.list-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface); margin-bottom: 7px; cursor: pointer;
}
.list-row:hover { border-color: var(--primary); background: var(--bg-soft); }
.list-row .q { font-family: var(--font-en); font-weight: 600; }

.avatar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)); gap: 10px; }
.avatar-pick {
  width: 100%; aspect-ratio: 1; border-radius: 14px; border: 2px solid var(--border);
  background: var(--surface-2); cursor: pointer; overflow: hidden; padding: 0;
}
.avatar-pick.active { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.avatar-pick img { width: 100%; height: 100%; object-fit: cover; display: block; }

.avatar-big {
  width: 84px; height: 84px; border-radius: 24px; object-fit: cover;
  background: var(--surface-2); border: 1px solid var(--border);
}

.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(146px, 1fr)); gap: 10px; }
.theme-card {
  border: 2px solid var(--border); border-radius: var(--radius); padding: 10px; cursor: pointer;
  background: var(--surface); display: flex; flex-direction: column; gap: 7px;
}
.theme-card.active { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.theme-swatch { height: 34px; border-radius: 9px; display: flex; overflow: hidden; }
.theme-swatch i { flex: 1; }

/* 表格：固定列宽（每列宽度由 JS 的 colgroup 显式给出，合计 100%），窄屏可横向滑动、内容不裁剪 */
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; table-layout: fixed; }
.data-table th, .data-table td {
  text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border);
  overflow-wrap: anywhere; word-break: break-word; vertical-align: middle;
}
.data-table th { color: var(--text-dim); font-weight: 600; font-size: 12.5px; }
.data-table tr:hover td { background: var(--bg-soft); }
.data-table .nowrap-cell { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-wrap .data-table { min-width: 680px; }
@media (max-width: 560px) {
  .table-wrap { margin: 0 -4px; padding: 0 4px; }
  .table-wrap .data-table { min-width: 640px; }
}

.drop-zone {
  border: 2px dashed var(--border-strong); border-radius: var(--radius);
  padding: 18px; text-align: center; color: var(--text-dim); font-size: 13.5px; cursor: pointer;
}
.drop-zone:hover { border-color: var(--primary); color: var(--primary); }
.drop-zone.busy { border-color: var(--accent); color: var(--accent); }

@media (max-width: 560px) {
  .word-title { font-size: 27px; }
  .cal-cell { min-height: 58px; padding: 4px; }
  .cal-fest { font-size: 10px; }
  .chat-box { height: 46vh; }
}

/* ---------- 词卡「暂缺」占位 & 文章点词弹层（文章点词 → 九要素词卡） ---------- */
.element-miss {
  margin-top: 6px; padding: 8px 10px; border: 1px dashed var(--border-strong);
  border-radius: 10px; color: var(--text-faint); font-size: 12px;
}
.gloss-ph { font-size: 12px; color: var(--text-dim); }
.gloss-actions { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
