:root {
  --bg: #f5f6f8; --panel: #fff; --ink: #1f2430; --muted: #6b7280;
  --line: #e4e7ec; --accent: #c0392b; --accent-d: #97271c; --chip: #eef1f5;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 14px/1.5 -apple-system, "PingFang SC", "Microsoft YaHei", Segoe UI, sans-serif;
}
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 20px; background: var(--panel); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.brand { display: inline-flex; align-items: center; gap: 7px; font-size: 18px; font-weight: 700; color: var(--accent); }
.brand .logo { width: 26px; height: 26px; display: block; border-radius: 6px; }
.brand span { color: var(--muted); font-weight: 500; font-size: 14px; }
.stats { color: var(--muted); font-size: 13px; }
.stats b { color: var(--ink); }

.filters {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  padding: 12px 20px; background: var(--panel); border-bottom: 1px solid var(--line);
}
.filters select, .filters input[type=search], .filters input[type=date] {
  padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; background: #fff; font: inherit;
}
.filters input[type=search] { min-width: 240px; flex: 1; }
.filters .date { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 4px; }
.filters .chk { color: var(--muted); display: flex; align-items: center; gap: 5px; }
.filters button {
  padding: 7px 14px; border: 1px solid var(--line); border-radius: 6px; background: #fff;
  cursor: pointer; font: inherit;
}
.filters button:hover { background: var(--chip); }
.filters button.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.filters button.primary:hover { background: var(--accent-d); }

main { padding: 16px 20px 60px; }
.result-meta { color: var(--muted); margin-bottom: 8px; font-size: 13px; }

.grid { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--panel); table-layout: fixed; }
.grid th, .grid td { padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grid thead th { background: #fafbfc; color: var(--muted); font-weight: 600; font-size: 12px; white-space: nowrap; }
.grid tbody tr { cursor: pointer; }
.grid tbody tr:hover { background: #fbf7f6; }
.grid td.mono { font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: #444; }
.grid td.empty { text-align: center; color: var(--muted); padding: 30px; }
/* 固定列宽:翻页不再重新计算宽度;名称列(第5)吃掉剩余空间 */
.grid col.c-date { width: 110px; } .grid col.c-country { width: 80px; } .grid col.c-cat { width: 72px; }
.grid col.c-num { width: 124px; } .grid col.c-mfr { width: 168px; } .grid col.c-origin { width: 100px; }
.grid col.c-src { width: 46px; }
/* 名称列(c-name)不设宽度,占据剩余空间;所有列单行,超出省略号,悬停看全文,点击看详情 */
.badge-cn { background: var(--accent); color: #fff; padding: 1px 7px; border-radius: 10px; font-size: 12px; }

/* 翻页：紧凑、等高、与统计文字对齐；按钮固定宽度(位数变化也不挪位) */
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.pager button {
  height: 26px; width: 32px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 5px; background: #fff;
  color: var(--ink); cursor: pointer; font: inherit; font-size: 13px; line-height: 1;
}
.pager button.pg-go { width: auto; padding: 0 10px; }   /* “跳转” 按文字宽 */
.pager button:hover:not(:disabled):not(.active) { border-color: var(--accent); color: var(--accent); }
.pager button:disabled { opacity: .4; cursor: default; }
.pager button.active { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; }
.pager .page-jump {
  height: 26px; width: 48px; padding: 0 7px; box-sizing: border-box;
  border: 1px solid var(--line); border-radius: 5px; font: inherit; font-size: 13px;
}

.detail { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: flex; align-items: center; justify-content: center; z-index: 50; }
.detail.hidden { display: none; }
.detail-card { background: #fff; border-radius: 10px; max-width: 760px; width: 92%; max-height: 86vh; overflow: auto; padding: 22px; position: relative; }
.detail-card h3 { margin: 0 40px 14px 0; color: var(--accent); }
.detail-card .close { position: absolute; top: 12px; right: 14px; border: none; background: none; font-size: 26px; line-height: 1; cursor: pointer; color: var(--muted); }
#detail-fields { width: 100%; border-collapse: collapse; }
#detail-fields th { text-align: left; width: 150px; color: var(--muted); font-weight: 600; padding: 6px 10px 6px 0; vertical-align: top; }
#detail-fields td { padding: 6px 0; border-bottom: 1px solid var(--line); word-break: break-word; }
#detail-fields a { color: var(--accent); }

/* 导入页 */
.back { color: var(--accent); text-decoration: none; font-size: 13px; white-space: nowrap; }
.back:hover { text-decoration: underline; }
.import-wrap { padding: 20px; max-width: 900px; }
.import-wrap .hint { color: var(--muted); background: var(--chip); padding: 12px 14px; border-radius: 8px; line-height: 1.6; }
.import-wrap .row { display: flex; gap: 16px; margin: 16px 0; flex-wrap: wrap; }
.import-wrap label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.import-wrap select, .import-wrap input { padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
.drop { border: 2px dashed var(--line); border-radius: 10px; padding: 26px; text-align: center; color: var(--muted); background: var(--panel); }
.drop.over { border-color: var(--accent); background: #fbf7f6; }
.drop input[type=file] { display: block; margin: 0 auto 10px; }
.filelist { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.chip { background: var(--chip); border-radius: 12px; padding: 2px 10px; font-size: 12px; color: var(--ink); }
.upload-status { margin: 14px 0; color: var(--muted); }
.import-wrap button.primary { padding: 9px 18px; background: var(--accent); color: #fff; border: none; border-radius: 6px; cursor: pointer; font: inherit; }
.import-wrap button.primary:disabled { opacity: .5; cursor: default; }

/* 导入页:胶囊选择 */
.picker { margin: 16px 0; }
.pick-label { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink); cursor: pointer; font: inherit; font-size: 13px; transition: all .12s; }
.pill:hover { border-color: var(--accent); }
.pill.sel { background: var(--accent); color: #fff; border-color: var(--accent); }

/* 使用指南页 */
.guide { max-width: 820px; margin: 24px auto 64px; padding: 0 20px; line-height: 1.75; color: var(--ink); }
.guide h1 { font-size: 26px; margin: 8px 0 4px; }
.guide h2 { font-size: 19px; margin: 30px 0 10px; padding-bottom: 6px; border-bottom: 2px solid var(--accent); color: var(--accent); }
.guide p { margin: 10px 0; }
.guide ul, .guide ol { margin: 8px 0 8px 4px; padding-left: 22px; }
.guide li { margin: 5px 0; }
.guide code { background: #f2f3f5; padding: 1px 6px; border-radius: 4px; font-size: 13px; }
.guide .lead { color: #444; }
.guide .muted { color: var(--muted); font-size: 14px; }
.guide-ver { color: var(--muted); font-size: 13px; margin: 0 0 16px; }
.guide .cn-hl { color: var(--accent); }
.guide .callout { background: #fef6f5; border: 1px solid #f3c9c4; border-left: 4px solid var(--accent);
  border-radius: 8px; padding: 12px 16px; margin: 14px 0; }
.guide-table { border-collapse: collapse; width: 100%; margin: 12px 0; font-size: 14px; }
.guide-table th, .guide-table td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; }
.guide-table th { background: #fef0ee; color: var(--accent); }
.guide-table td:first-child { width: 90px; font-weight: 600; white-space: nowrap; }
.guide-foot { margin-top: 28px; color: var(--muted); font-size: 14px; }

/* 使用指南提示弹窗 */
.gnotice-ov { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: flex;
  align-items: center; justify-content: center; z-index: 1000; padding: 20px; }
.gnotice { background: #fff; border-radius: 14px; max-width: 440px; width: 100%;
  padding: 24px 24px 20px; box-shadow: 0 12px 40px rgba(0,0,0,.25); }
.gnotice h3 { margin: 0 0 10px; font-size: 19px; }
.gnotice p { margin: 0 0 18px; color: #444; line-height: 1.65; font-size: 14px; }
.gnotice-btns { display: flex; gap: 10px; justify-content: flex-end; align-items: center; }
.gnotice-later { background: #f2f3f5; border: 1px solid var(--line); color: #555;
  padding: 8px 16px; border-radius: 8px; cursor: pointer; font: inherit; font-size: 14px; }
.gnotice-go { background: var(--accent); color: #fff; text-decoration: none;
  padding: 9px 18px; border-radius: 8px; font-size: 14px; font-weight: 600; }
.gnotice-go:hover { filter: brightness(1.05); }

/* 弹窗内更新要点列表 + 指南页本次更新框 */
.gnotice-hl { margin: 4px 0 18px; padding-left: 20px; color: #444; font-size: 13.5px; line-height: 1.6; }
.gnotice-hl li { margin: 4px 0; }
#gv-highlights ul { margin: 6px 0 0; padding-left: 20px; }
#gv-highlights li { margin: 4px 0; }

/* 原产国（非中国）展示：低调中性 */
.origin { color: var(--ink); font-size: 13px; }

/* 详情页翻译 */
.detail-actions { margin: 6px 0 12px; display: flex; align-items: center; gap: 10px; }
.tr-status { font-size: 13px; color: var(--muted); }
.tr-cn { margin-top: 4px; color: var(--accent); font-size: 13px; line-height: 1.55;
  padding-left: 8px; border-left: 2px solid #f3c9c4; }

/* 译文来源标记 */
.tr-badge { font-size: 12px; padding: 2px 9px; border-radius: 999px; font-weight: 600; }
.tr-badge.ai { background: #fff3e0; color: #b9770e; border: 1px solid #f0c987; }
.tr-badge.human { background: #e7f6ec; color: #1f8a4c; border: 1px solid #a8dcbb; }
.tr-tag { position: absolute; top: 6px; right: 6px; font-size: 10px; line-height: 1;
  padding: 1px 4px; border-radius: 4px; font-weight: 600; }
.tr-tag.ai { background: #fff3e0; color: #b9770e; }
.tr-tag.human { background: #e7f6ec; color: #1f8a4c; }
button.ghost { background: #fff; border: 1px solid var(--line); color: #555; padding: 6px 12px;
  border-radius: 8px; cursor: pointer; font: inherit; font-size: 13px; }
button.ghost:hover { border-color: var(--accent); color: var(--accent); }

/* 结果统计 + 翻页同一行（顶部/底部各一份） */
.list-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; margin: 12px 0; }
.list-bar .result-meta { margin: 0; white-space: nowrap; min-width: 200px; }
.list-bar.top { margin: 10px 0 8px; }
.list-bar.bottom { margin: 0; position: sticky; bottom: 0; background: var(--bg);
  padding: 8px 0 6px; justify-content: space-between; }
.lb-left { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.pagesize { color: var(--muted); font-size: 13px; white-space: nowrap; }
.pagesize select { height: 26px; padding: 0 4px; margin: 0 2px; border: 1px solid var(--line);
  border-radius: 5px; background: #fff; color: var(--ink); font: inherit; font-size: 13px; cursor: pointer; }

/* 名称列：中文单行,超长省略号(由 td 统一处理),右上角留出译/校气泡的位置 */
.grid td.name { position: relative; padding-right: 26px; }
.grid td.name .nm { vertical-align: middle; }
.grid td.name .hz { vertical-align: middle; }

/* 详情页译文编辑框 */
.tr-input { width: 100%; margin-top: 4px; padding: 6px 8px; box-sizing: border-box;
  border: 1px solid #f3c9c4; border-radius: 6px; font: inherit; font-size: 13px;
  color: var(--accent); resize: vertical; }
.tr-input:focus { outline: none; border-color: var(--accent); }

/* 我的关注页 */
.watch-wrap { padding: 20px; max-width: 880px; margin: 0 auto; }
.watch-wrap .hint { color: var(--muted); background: var(--chip); padding: 12px 14px; border-radius: 8px; line-height: 1.6; }
.watch-wrap .hint a { color: var(--accent); }
.watch-who { margin: 16px 0 10px; color: var(--muted); font-size: 13px; }
.watch-empty { color: var(--muted); padding: 24px 0; }
.watch-empty a { color: var(--accent); }
.watch-card { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin: 10px 0; background: var(--panel); }
.watch-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.watch-label { font-weight: 600; font-size: 15px; }
.watch-cond { color: var(--muted); font-size: 13px; margin-top: 3px; }
.watch-btns { display: flex; gap: 8px; flex-shrink: 0; }
.watch-preview { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; font-size: 13px; }
.watch-preview ul { margin: 6px 0 0; padding-left: 20px; line-height: 1.7; }
.watch-cnt { color: var(--muted); }
.watch-preview .mono { font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: #888; }

/* 套餐/配额 + 频率 + 管理员 */
.plan-tag { padding: 1px 8px; border-radius: 999px; font-size: 12px; }
.plan-tag.plan-free { background: #eef1f5; color: #555; }
.plan-tag.plan-starter { background: #eaf2fd; color: #2563a8; }
.plan-tag.plan-pro { background: #fff3e0; color: #b9770e; }
.plan-tag.plan-enterprise { background: #e7f6ec; color: #1f8a4c; }
.up-hint { color: var(--accent); font-size: 12px; }
.admin-box { margin: 8px 0 14px; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 8px; font-size: 13px; color: var(--muted); }
.admin-box input, .admin-box select { padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; font: inherit; font-size: 13px; margin: 0 4px; }
.admin-box button { padding: 5px 12px; border: 1px solid var(--line); border-radius: 6px; background: #fff; cursor: pointer; font: inherit; font-size: 13px; }
.freq-sel { height: 28px; border: 1px solid var(--line); border-radius: 5px; font: inherit; font-size: 13px; background: #fff; padding: 0 4px; }

/* API 密钥(企业版) */
.api-box { margin: 10px 0 16px; padding: 14px 16px; border: 1px solid #a8dcbb; background: #f3fbf6; border-radius: 10px; font-size: 13px; }
.api-box .muted { color: var(--muted); margin: 4px 0 10px; }
.api-keys { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.api-key { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; }
.api-key .mono { font-family: ui-monospace, Menlo, monospace; font-size: 12px; word-break: break-all; }
.api-sample { margin-top: 10px; background: #1f2430; color: #e6e8ec; padding: 12px; border-radius: 8px; font-size: 12px; overflow-x: auto; white-space: pre; }

/* —— 结果表格容器：内部纵向滚动 + 冻结表头,翻页栏固定在底部,整页一屏 —— */
.table-wrap { width: 100%; overflow: auto; -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line); border-radius: 8px;
  max-height: calc(100dvh - 212px); }
.table-wrap .grid { min-width: 720px; }
/* 检索页 app-shell:整页恰好一屏,仅列表内部纵向滚动,表头与翻页栏不动 */
body.app-list { height: 100dvh; overflow: hidden; display: flex; flex-direction: column; }
body.app-list > header, body.app-list > .filters { flex: 0 0 auto; }
body.app-list main { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; padding-bottom: 10px; }
body.app-list .table-wrap { flex: 1 1 auto; min-height: 0; max-height: none; }
.grid thead th { position: sticky; top: 0; z-index: 2; box-shadow: inset 0 -1px 0 var(--line); }

/* —— 移动端适配 —— */
@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; gap: 6px 14px; padding: 10px 14px; }
  .brand { white-space: nowrap; flex: 0 0 auto; font-size: 16px; }
  .brand span { display: none; }            /* 窄屏隐藏“信息检索”副标题 */
  #stats.stats { order: 5; flex-basis: 100%; font-size: 12px; margin-top: 2px; }
  .topbar .back { font-size: 13px; }
  .filters { padding: 10px 14px; gap: 6px; }
  .filters input[type=search] { min-width: 140px; }
  .filters .date input[type=date] { width: 130px; }
  main { padding: 12px 14px 48px; }
  .detail-card { width: 94%; padding: 18px; }
  #detail-fields th { width: 96px; }
}
@media (max-width: 430px) {
  .filters select { flex: 1 1 44%; }         /* 两个下拉各占一半 */
  .brand .logo { width: 22px; height: 22px; }
}

/* ── 中文化改造:列表原文次行 / 详情中外对照 / 中国产入口与行高亮 ── */
.nm-raw { display: block; color: #9aa0aa; font-size: 12px; line-height: 1.35; margin-top: 2px; }
.fv-zh { color: var(--ink); }
.fv-raw { color: #9aa0aa; font-size: 12.5px; line-height: 1.5; margin-top: 3px; }
.cn-entry { color: var(--accent); font-weight: 700; text-decoration: none; white-space: nowrap; }
.cn-entry:hover { text-decoration: underline; }
.grid tr.row-cn td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.hz { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 8px; margin-right: 6px;
  font-weight: 600; vertical-align: middle; white-space: nowrap; }
.hz-high { background: #fdecea; color: #c0392b; }
.hz-mid { background: #fef5e7; color: #b9770e; }
.hz-info { background: #eef1f4; color: #5b6470; }
.range-note { font-size: 12px; color: var(--muted); align-self: center; white-space: nowrap; }
