:root {
  --green: #00934b;
  --border: #e2e8f0;
  --bg: #f6f8fa;
  --muted: #64748b;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background:
    radial-gradient(1200px 400px at 80% -120px, rgba(0, 147, 75, .07), transparent 70%),
    linear-gradient(180deg, #eef2f7 0%, var(--bg) 220px);
  color: #1e293b;
  font-size: 13px;
  line-height: 1.4;
  min-height: 100vh;
}

/* 科技感深色顶栏 */
header {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 9px 18px;
  color: #e2e8f0;
  background: linear-gradient(100deg, #0b1220 0%, #111c33 55%, #0b1220 100%);
  border-bottom: 1px solid #1e293b;
  box-shadow: 0 1px 0 rgba(0, 255, 170, .08), 0 6px 18px rgba(0, 0, 0, .25);
}
.brand { display: flex; align-items: center; gap: 9px; }
.brand h1 { margin: 0; font-size: 14px; font-weight: 600; letter-spacing: .3px; color: #f1f5f9; }
.logo-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(0, 147, 75, .25), 0 0 10px 2px rgba(0, 200, 120, .55);
}

/* 生成 / 历史 切换开关（深色顶栏版） */
.seg {
  display: inline-flex;
  border: 1px solid #2a3a55;
  border-radius: 999px;
  background: rgba(255, 255, 255, .04);
  padding: 2px;
}
.seg-btn {
  border: none;
  background: none;
  margin: 0;
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 12px;
  color: #94a3b8;
  cursor: pointer;
}
.seg-btn:hover { color: #e2e8f0; }
.seg-btn.active {
  background: var(--green);
  color: #fff;
  box-shadow: 0 0 10px rgba(0, 200, 120, .45);
}
.seg-btn.active:hover { color: #fff; }

/* ===== 状态方块 ===== */
.statusbar { position: static; margin-left: auto; display: flex; align-items: center; gap: 8px; }
.tile-group {
  display: flex;
  gap: 6px;
  padding: 3px;
  border: 1px solid #223049;
  border-radius: 8px;
  background: rgba(255, 255, 255, .03);
}
.tile {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 58px;
  padding: 4px 9px;
  border-radius: 6px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid transparent;
}
.tile .tk { font-size: 9px; letter-spacing: .8px; color: #7c8aa3; }
.tile .tv { font-size: 13px; font-weight: 600; color: #e8eef7; line-height: 1.1; }
.tile .tv.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12px; }
.tile .bar { height: 3px; border-radius: 3px; background: rgba(255, 255, 255, .12); overflow: hidden; margin-top: 1px; }
.tile .bar i { display: block; height: 100%; width: 0; background: var(--green); transition: width .5s ease; }
.tile .bar i.warn { background: #f59e0b; }
.tile .bar i.hot { background: #ef4444; }
.tile.clickable { cursor: pointer; border-color: #223049; }
.tile.clickable:hover { border-color: var(--green); background: rgba(0, 200, 120, .08); }
.tile.accent .tv { color: #34d399; }
.tile.active-pop { border-color: var(--green); box-shadow: 0 0 10px rgba(0, 200, 120, .35); }

/* ===== 浮窗（科技卡片） ===== */
.popover {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 12px;
  z-index: 60;
  min-width: 220px;
  background: #0f1a2e;
  color: #e2e8f0;
  border: 1px solid #233a5c;
  border-radius: 10px;
  padding: 12px 14px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, .5), 0 0 0 1px rgba(0, 200, 120, .08);
}
.popover.wide { min-width: 300px; }
.popover.open { display: block; }
.pop-title { font-size: 12px; font-weight: 700; margin-bottom: 8px; color: #f1f5f9; }
.pop-title .muted { color: #7c8aa3; font-weight: 400; }
.pop-row { display: flex; justify-content: space-between; gap: 16px; font-size: 12.5px; padding: 3px 0; }
.pop-row span { color: #94a3b8; }
.pop-row b { color: #e8eef7; }

select {
  padding: 4px 7px;
  border: 1px solid #2a3a55;
  border-radius: 5px;
  font-size: 12.5px;
  font-family: inherit;
  background: #0b1424;
  color: #e2e8f0;
  width: 100%;
}
select:focus { outline: none; border-color: var(--green); }
.usage-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 5px 14px;
  font-size: 12.5px;
  margin-top: 10px;
}
.usage-grid .lbl { color: #94a3b8; }
.usage-grid .val { text-align: right; font-variant-numeric: tabular-nums; font-family: ui-monospace, Menlo, monospace; color: #e8eef7; }
.usage-grid .total { font-weight: 700; border-top: 1px solid #233a5c; padding-top: 6px; margin-top: 3px; color: #f1f5f9; }
.usage-grid .total.val { color: #34d399; }

@media (max-width: 820px) {
  header { flex-wrap: wrap; }
  .statusbar { margin-left: 0; width: 100%; flex-wrap: wrap; }
  .popover { right: 8px; }
}

/* 当前用户 + 退出 */
.userbox { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #cbd5e1; }
.userbox .who b { color: #f1f5f9; }
.logout-btn {
  margin: 0;
  padding: 4px 10px;
  font-size: 12px;
  color: #cbd5e1;
  background: rgba(255, 255, 255, .05);
  border: 1px solid #2a3a55;
  border-radius: 6px;
  cursor: pointer;
}
.logout-btn:hover { border-color: #ef4444; color: #fca5a5; }

/* 登录遮罩 */
.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(900px 400px at 50% -80px, rgba(0, 147, 75, .15), transparent 70%),
    linear-gradient(160deg, #0b1220, #111c33);
}
.login-overlay.show { display: flex; }
.login-card {
  width: 300px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px;
  background: #0f1a2e;
  border: 1px solid #233a5c;
  border-radius: 12px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .5);
}
.login-logo {
  display: flex; align-items: center; gap: 8px;
  color: #f1f5f9; font-size: 15px; font-weight: 600; margin-bottom: 6px;
}
.login-card input {
  background: #0b1424;
  border: 1px solid #2a3a55;
  color: #e2e8f0;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 13px;
}
.login-card input:focus { outline: none; border-color: var(--green); }
.login-card .primary { margin-top: 4px; padding: 8px; letter-spacing: 2px; }
.login-err { color: #fca5a5; font-size: 12px; min-height: 14px; }
#projects-table.hide-owner .col-owner { display: none; }
button.danger { color: #dc2626; border-color: #fca5a5; }
button.danger:hover { background: #fef2f2; border-color: #dc2626; color: #dc2626; }
.tag-admin { color: var(--green); font-weight: 600; }

/* 操作提示 toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(20px);
  z-index: 300;
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 13px;
  color: #fff;
  background: #0f172a;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .3);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.ok { background: #0f7a45; }
.toast.err { background: #b91c1c; }

/* 主区：全宽单栏(最大 2000)，上模块一 / 下关键词词库。 */
main {
  width: 100%;
  max-width: 2000px;
  margin: 12px auto;
  padding: 0 16px;
}

/* 模块一表单：横向铺开、上下变矮的两列网格 */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 28px;
  align-items: start;
}
.form-grid .span2 { grid-column: 1 / -1; }
@media (max-width: 820px) {
  .form-grid { grid-template-columns: 1fr; }
}

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 12px 14px;
  margin-bottom: 10px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .05);
}
.card h2 {
  margin: 0 0 9px;
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.card h2::before {
  content: "";
  width: 4px;
  height: 13px;
  border-radius: 2px;
  background: linear-gradient(var(--green), #34d399);
}

/* 字段行：标签在左、控件在右，横排省竖向空间 */
.field {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 8px;
  align-items: start;
  margin-bottom: 6px;
}
.field > label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  padding-top: 5px;
  line-height: 1.25;
}
.field .ctrl { min-width: 0; }
.req { color: #dc2626; font-weight: 700; }
.hint { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.hint.done { color: var(--green); }

/* 关键词分类彩色标签：每类一种鲜明颜色，便于区分 */
.cat {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 11px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid transparent;
}
.cat-core  { background: #dcfce7; color: #15803d; border-color: #86efac; }  /* 核心词-绿 */
.cat-big   { background: #dbeafe; color: #1d4ed8; border-color: #93c5fd; }  /* 大词-蓝 */
.cat-scene { background: #ede9fe; color: #6d28d9; border-color: #c4b5fd; }  /* 场景长尾-紫 */
.cat-func  { background: #fef3c7; color: #b45309; border-color: #fcd34d; }  /* 功能长尾-琥珀 */
.cat-param { background: #cffafe; color: #0e7490; border-color: #67e8f9; }  /* 参数长尾-青 */
.cat-aud   { background: #ffedd5; color: #c2410c; border-color: #fdba74; }  /* 人群长尾-橙 */
.cat-gift  { background: #fee2e2; color: #b91c1c; border-color: #fca5a5; }  /* 礼物长尾-红 */
.cat-color { background: #fce7f3; color: #be185d; border-color: #f9a8d4; }  /* 颜色长尾-粉 */
.cat-other { background: #f1f5f9; color: #475569; border-color: #cbd5e1; }  /* 其他长尾-灰 */

/* 词根/关键词报告：固定列宽（colgroup 生效）、可点击排序的表头 */
.data-table { table-layout: fixed; width: 100%; }
.data-table th, .data-table td { overflow: hidden; text-overflow: ellipsis; }
.data-table td.kw { white-space: normal; word-break: break-word; }
.data-table th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.data-table th.sortable:hover { color: var(--green); }
.data-table th .arr { opacity: .55; font-size: 11px; }
.data-table th.sortable:hover .arr { opacity: 1; }
.data-table td.empty { text-align: center; color: var(--muted); padding: 16px; }
/* 自适应列宽（词根表用）：按内容收缩，不再固定那么宽 */
.data-table.auto { table-layout: auto; width: auto; min-width: 240px; max-width: 100%; }
.data-table.auto th, .data-table.auto td { white-space: nowrap; padding-right: 22px; }
.data-table.auto td.kw { white-space: nowrap; }
/* 全部行装进固定高度的内嵌滚动框，表头吸顶 */
.table-scroll { max-height: 58vh; overflow: auto; border: 1px solid var(--border); border-radius: 6px; }
.table-scroll thead th {
  position: sticky; top: 0; z-index: 1;
  background: #f1f5f9; box-shadow: inset 0 -1px 0 var(--border);
}
.tbl-count { font-size: 11.5px; color: var(--muted); margin-top: 5px; }

/* 生成进度条（不确定型动画，点击生成那一刻显示）*/
.gen-progress { margin: 8px 0 4px; }
.gen-progress-bar {
  height: 8px;
  background: #e2e8f0;
  border-radius: 5px;
  overflow: hidden;
  position: relative;
}
.gen-progress-bar > i {
  position: absolute; top: 0; left: 0;
  display: block; height: 100%; width: 35%;
  border-radius: 5px;
  background: linear-gradient(90deg, var(--green), #34d399);
  animation: indet 1.1s infinite ease-in-out;
}
@keyframes indet {
  0%   { left: -35%; }
  100% { left: 100%; }
}
.gen-progress-tip {
  margin-top: 5px;
  font-size: 11.5px; color: var(--muted);
}

/* 后台 Search Terms 展示 */
.st-box {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 9px 11px;
  word-break: break-word;
  line-height: 1.6;
  color: #0f172a;
}
.st-bytes { font-size: 11.5px; font-weight: 600; color: var(--green); margin-left: 6px; }
.st-bytes.over { color: #dc2626; }

/* 模块手动折叠 */
.card-h { cursor: pointer; }
.card-h .caret {
  display: inline-block; width: 0; height: 0;
  border-left: 5px solid transparent; border-right: 5px solid transparent;
  border-top: 6px solid var(--muted);
  transition: transform .15s; vertical-align: middle;
}
.card.collapsed .card-h .caret { transform: rotate(-90deg); }
.card.collapsed > :not(h2) { display: none; }

/* 本次任务 token 消耗 */
.gen-tokens { font-size: 12.5px; font-weight: 600; color: var(--green); margin-top: 8px; }
.tok-total td { border-top: 2px solid var(--border); background: var(--bg); }

/* 五点描述列表 */
ul.bullets, ol.bullets { margin: 6px 0 0; padding-left: 20px; }
ul.bullets li, ol.bullets li { margin-bottom: 8px; line-height: 1.55; font-size: 13px; }
.desc-actions { margin-bottom: 6px; }

/* 中英对照：中文行 */
.zh-line { font-size: 12.5px; color: #475569; margin-top: 3px; line-height: 1.5; }

/* 竞品 ASIN 国家选择行 */
.asin-country { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; flex-wrap: wrap; }
.asin-country select { width: auto; padding: 3px 6px; font-size: 12.5px; }

/* 系统工作流模块 */
.flow-h { margin: 14px 0 8px; font-size: 13px; color: #0f172a; }
.flow-table { table-layout: auto; }
.flow-table th, .flow-table td { font-size: 12.5px; vertical-align: top; padding: 6px 8px; line-height: 1.5; }
.flow-table td:first-child { white-space: nowrap; }
.flow { display: flex; flex-direction: column; align-items: stretch; gap: 0; }
.flow-step {
  display: flex; gap: 10px; align-items: flex-start;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg); padding: 9px 12px;
}
.flow-step > span.fs-n {
  flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%;
  background: linear-gradient(var(--green), #34d399); color: #fff;
  font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.flow-step b { font-size: 13px; }
.fs-d { font-size: 12px; color: var(--muted); line-height: 1.55; margin-top: 3px; }
.fs-o { font-size: 12px; color: var(--green); font-weight: 600; margin-top: 4px; }
.flow-arrow { text-align: center; color: #cbd5e1; font-size: 12px; line-height: 1.2; padding: 2px 0; }

/* 关键词报告标题里的下载按钮 */
.export.inline {
  width: auto; margin-left: auto; padding: 3px 10px; font-size: 11.5px;
  font-weight: 600; cursor: pointer;
}
/* 历史旧版本里的小标题 */
.gen-sub { font-size: 12px; font-weight: 600; color: var(--muted); margin: 8px 0 4px; }

/* 上传进度条与状态 */
.upbar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0 3px;
}
.upbar-row .upbar { flex: 1 1 auto; margin: 0; }
.stop-btn {
  flex: 0 0 auto;
  width: auto;
  padding: 3px 10px;
  font-size: 11.5px;
  border: 1px solid #fca5a5;
  background: #fef2f2;
  color: #dc2626;
  border-radius: 5px;
  cursor: pointer;
  white-space: nowrap;
}
.stop-btn:hover { background: #fee2e2; border-color: #f87171; }
.upbar {
  height: 8px;
  background: #e2e8f0;
  border-radius: 5px;
  overflow: hidden;
  margin: 6px 0 3px;
}
.upbar > i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--green), #34d399);
  transition: width .15s ease;
}
.up-status { font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.up-status.done { color: var(--green); }
.up-status.err { color: #dc2626; }
.link-btn {
  border: none; background: none; padding: 0 2px;
  color: #dc2626; cursor: pointer; font-size: 11.5px; text-decoration: underline;
  width: auto;
}

input, textarea {
  width: 100%;
  padding: 4px 7px;
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 12.5px;
  font-family: inherit;
}
textarea { resize: vertical; }
input:focus, textarea:focus { outline: none; border-color: var(--green); }

/* 产品描述：结构化分项网格，逐项填写更清晰 */
.desc-field > label { padding-top: 2px; }
.desc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px 16px;
}
.desc-grid .df {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.desc-grid .df.full { grid-column: 1 / -1; }
.desc-grid .df > label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.2;
  display: flex;
  align-items: center;
  gap: 4px;
}
.desc-grid .df textarea { height: 46px; resize: vertical; }
.desc-grid .df.full textarea { height: 52px; }
.gift-row { display: flex; gap: 8px; align-items: center; }
.gift-row select { flex: 0 0 92px; width: 92px; }
.gift-row input { flex: 1 1 auto; }
@media (max-width: 560px) {
  .desc-grid { grid-template-columns: 1fr; }
  .desc-grid .df.full { grid-column: auto; }
}

/* 产品图片：横向缩略图条，可横向滚动 */
:root { --media-h: 104px; }

/* 产品图片：横向缩略图条，高度与文本框一致，可横向滚动 */
.image-strip {
  display: flex;
  align-items: stretch;
  gap: 6px;
  height: var(--media-h);
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: #fff;
  overflow-x: auto;
}
.img-add {
  flex: 0 0 auto;
  min-width: 64px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--border);
  border-radius: 4px;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}
.img-add:hover { border-color: var(--green); color: var(--green); }
.thumb { position: relative; flex: 0 0 auto; height: 100%; }
.thumb img {
  height: 100%;
  width: auto;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: 4px;
  display: block;
}
.thumb .rm {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 16px;
  height: 16px;
  line-height: 14px;
  text-align: center;
  font-size: 12px;
  color: #fff;
  background: rgba(0, 0, 0, .55);
  border-radius: 50%;
  cursor: pointer;
}
.thumb .rm:hover { background: #e11d48; }

/* 重复输入项横向铺排 */
.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 5px;
}
/* 竞品 ASIN：URL 较长，给更宽的输入框 */
.field-grid.wide {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.add {
  padding: 1px 6px;
  font-size: 11px;
  border: 1px dashed var(--border);
  background: #fff;
  color: var(--muted);
  border-radius: 5px;
  cursor: pointer;
  margin-top: 4px;
}
.add:hover { border-color: var(--green); color: var(--green); }

button {
  padding: 5px 11px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 5px;
  cursor: pointer;
  font-size: 12px;
  margin: 0 4px 0 0;
}
button:hover { border-color: var(--green); color: var(--green); }
button.primary { background: var(--green); color: #fff; border-color: var(--green); }
button.primary:hover { opacity: .9; color: #fff; }
.actions { margin-top: 8px; }
.export { display: inline-block; margin-left: 6px; font-size: 12px; color: var(--green); }

/* 结果区 */
.results-placeholder { color: var(--muted); font-size: 12px; padding: 10px 4px; }
h3 { font-size: 12px; margin: 10px 0 5px; color: var(--muted); }

/* 紧凑表格：宽度按内容收缩，不强行拉满 */
table { border-collapse: collapse; margin-top: 6px; font-size: 12px; }
#keywords-result table { width: auto; }
th, td { border: 1px solid var(--border); padding: 3px 8px; text-align: left; }
th { background: var(--bg); font-weight: 600; white-space: nowrap; }
td.kw { max-width: 260px; }
.relev { text-align: right; }
tbody tr:nth-child(even) { background: #fafbfc; }
#projects-table { width: 100%; }

/* 长文本限制可读宽度，宽屏下不至于铺满整行 */
#title-result p {
  margin: 4px 0;
  padding: 7px;
  background: var(--bg);
  border-radius: 5px;
  max-width: 900px;
}
#bullets-result ul { margin: 5px 0; padding-left: 16px; max-width: 900px; }
#bullets-result li { margin-bottom: 4px; }

/* 窄屏：标签回到上方堆叠 */
@media (max-width: 560px) {
  .field { grid-template-columns: 1fr; gap: 3px; }
  .field > label { padding-top: 0; }
}

/* 历史项目查看弹窗 */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .45);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  z-index: 50;
}
.modal-overlay.open { display: flex; }
.modal {
  background: #fff;
  border-radius: 8px;
  width: 100%;
  max-width: 760px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 16px 18px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .25);
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
  margin-bottom: 10px;
}
.modal-head h2 { margin: 0; font-size: 15px; }
.modal-head .meta { font-size: 12px; color: var(--muted); }
.modal-close {
  border: none;
  background: none;
  font-size: 20px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  padding: 0 4px;
}
.modal-close:hover { color: #e11d48; }
.modal .section { margin-bottom: 14px; }
.modal .section > h3 { margin: 0 0 6px; }
.modal .desc {
  font-size: 12.5px;
  background: var(--bg);
  border-radius: 5px;
  padding: 8px;
  white-space: pre-wrap;
}
/* 结构化产品描述分项：左标签右内容的定义列表 */
.modal .kv {
  margin: 0;
  background: var(--bg);
  border-radius: 5px;
  padding: 4px 8px;
}
.modal .kv-row {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 10px;
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
}
.modal .kv-row:last-child { border-bottom: none; }
.modal .kv-row dt {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.modal .kv-row dd {
  margin: 0;
  font-size: 12.5px;
  color: #0f172a;
  white-space: pre-wrap;
}
details.gen {
  border: 1px solid var(--border);
  border-radius: 5px;
  margin-bottom: 6px;
}
details.gen > summary {
  cursor: pointer;
  padding: 6px 9px;
  font-size: 12px;
  color: var(--muted);
  user-select: none;
}
details.gen[open] > summary { border-bottom: 1px solid var(--border); color: #1e293b; }
.gen-body { padding: 8px 9px; }
.gen-body pre { font-size: 11px; overflow-x: auto; margin: 0; }

/* 弹窗内：图片、词根标签、链接列表 */
.modal-imgs { display: flex; flex-wrap: wrap; gap: 6px; }
.modal-imgs img {
  height: 90px;
  width: auto;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: 5px;
  display: block;
}
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2px 9px;
  font-size: 12px;
}
ul.links { margin: 4px 0; padding-left: 18px; font-size: 12px; word-break: break-all; }
ul.links li { margin-bottom: 3px; }
ul.links a { color: var(--green); }
