:root {
  --bg: #f0f2f7;
  --card: #ffffff;
  --border: #e3e7ee;
  --text: #1a2030;
  --muted: #6b7689;
  --primary: #4f6bff;
  --primary-l: #eef1ff;
  --primary-d: #3a53e0;
  --green: #1aab5e;
  --green-l: #e7f8ef;
  --amber: #e8920c;
  --amber-l: #fef5e7;
  --red: #e5484d;
  --red-l: #fdeeee;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(20,30,50,.04), 0 4px 16px rgba(20,30,50,.04);
  --shadow-hover: 0 2px 8px rgba(20,30,50,.06), 0 8px 28px rgba(20,30,50,.08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 14px;
}
a { color: var(--primary); text-decoration: none; transition: color .15s; }
a:hover { color: var(--primary-d); }

/* ---- 顶栏 ---- */
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 28px;
  position: sticky; top: 0; z-index: 100;
}
.topbar .brand {
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -.01em;
  color: var(--text);
  display: flex; align-items: center; gap: 8px;
}
.topbar .brand .dot {
  width: 28px; height: 28px; border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), var(--primary-d));
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 15px; color: #fff;
}
.topbar nav { display: flex; gap: 4px; }
.topbar nav a {
  color: var(--muted); font-size: 14px; font-weight: 500;
  padding: 7px 14px; border-radius: var(--radius-sm);
  transition: all .15s;
}
.topbar nav a:hover { background: var(--bg); color: var(--text); text-decoration: none; }
.topbar nav a.active { background: var(--primary-l); color: var(--primary); }

/* ---- 容器 ---- */
.container { max-width: 1080px; margin: 0 auto; padding: 32px; }

/* ---- 页头 ---- */
.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 24px; gap: 16px;
}
.page-head h1 {
  font-size: 24px; font-weight: 800; margin: 0; letter-spacing: -.02em;
}
.page-head .sub { color: var(--muted); font-size: 13px; margin-top: 6px; }

/* ---- 卡片 ---- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.card h3 {
  margin: 0 0 16px; font-size: 15px; font-weight: 700;
  display: flex; align-items: center; gap: 7px;
}

/* ---- 网格 ---- */
.grid { display: grid; gap: 16px; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 820px) { .grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr; } }

/* ---- 按钮 ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--primary); color: #fff; border: none;
  padding: 10px 18px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: all .15s; text-decoration: none;
}
.btn:hover { background: var(--primary-d); color: #fff; }
.btn.ghost { background: var(--primary-l); color: var(--primary); }
.btn.ghost:hover { background: #e1e6ff; }
.btn.amber { background: var(--amber); color: #fff; }
.btn.amber:hover { background: #d07d0a; color: #fff; }
.btn.sm { padding: 7px 14px; font-size: 13px; }
.btn.loading { opacity: .7; pointer-events: none; }

/* ---- 输入 ---- */
input[type=text], input[type=url], textarea, select {
  width: 100%; padding: 10px 14px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 14px; font-family: inherit; outline: none;
  background: #fff; color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,107,255,.1);
}
label { font-size: 13px; color: var(--muted); display: block; margin-bottom: 7px; font-weight: 500; }

/* ---- 表格 ---- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 14px 16px; border-bottom: 1px solid var(--border); font-size: 14px; }
th {
  color: var(--muted); font-weight: 600; font-size: 12px;
  text-transform: uppercase; letter-spacing: .04em;
  background: #fafbfd;
}
tbody tr { transition: background .1s; }
tbody tr:hover { background: #f8faff; }
tr:last-child td { border-bottom: none; }

/* ---- 徽章 ---- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600;
}
.badge-pending  { background: var(--amber-l);  color: var(--amber); }
.badge-running  { background: var(--primary-l); color: var(--primary); }
.badge-success  { background: var(--green-l);  color: var(--green); }
.badge-partial  { background: #fef9e7;          color: #9a7000; }
.badge-failed   { background: var(--red-l);     color: var(--red); }

/* ---- 指标卡片 ---- */
.metric {
  background: #fafbfd; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; text-align: center;
  transition: box-shadow .15s;
}
.metric:hover { box-shadow: var(--shadow-hover); }
.metric .num { font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.metric .lbl { color: var(--muted); font-size: 12px; margin-top: 6px; }
.metric .src {
  display: inline-block; margin-top: 8px;
  font-size: 11px; color: var(--muted);
  background: #f0f2f7; padding: 2px 8px; border-radius: 999px;
}

/* ---- 截图 ---- */
.shot {
  width: 100%; max-width: 720px;
  border: 1px solid var(--border); border-radius: var(--radius);
  display: block;
}

/* ---- 杂项 ---- */
.tag {
  display: inline-block; background: var(--primary-l); color: var(--primary);
  padding: 2px 9px; border-radius: 6px; font-size: 12px; font-weight: 500;
}
.note {
  background: #fafbfd; border-left: 3px solid var(--primary);
  padding: 10px 14px; color: var(--muted); font-size: 13px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin: 8px 0;
}
.empty { color: var(--muted); text-align: center; padding: 48px 0; }
.content-box {
  white-space: pre-wrap; max-height: 360px; overflow: auto;
  background: #fafbfd; border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 16px; font-size: 13px; line-height: 1.7;
}

/* ---- 标题链接 ---- */
.title-link { color: var(--text); font-weight: 600; }
.title-link:hover { color: var(--primary); }

/* ---- 平台徽章（任务列表标题前） ---- */
.plat-badge {
  display: inline-block;
  margin-right: 6px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 18px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), #6d8bff);
  vertical-align: middle;
  white-space: nowrap;
}

/* ---- 行内操作 ---- */
.col-ops { width: 1%; white-space: nowrap; }
.row-ops { display: inline-flex; gap: 6px; align-items: center; }
.icon-btn {
  border: 1px solid var(--border); background: #fff; color: var(--muted);
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  cursor: pointer; font-size: 14px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.icon-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-l); }
.icon-btn.danger:hover { border-color: var(--red); color: var(--red); background: var(--red-l); }
.btn-sm {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 6px 14px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600;
  border: 1px solid var(--primary); background: var(--primary); color: #fff;
  cursor: pointer; text-decoration: none; transition: all .15s;
}
.btn-sm:hover { background: var(--primary-d); border-color: var(--primary-d); text-decoration: none; }
.btn-sm.danger { border-color: var(--red); background: var(--red); color: #fff; }
.btn-sm.danger:hover { background: #c93a3f; border-color: #c93a3f; }
.btn-sm.ghost { background: transparent; color: var(--muted); border-color: var(--border); }
.btn-sm.ghost:hover { border-color: var(--primary); color: var(--primary); }

/* ---- 项目卡片 ---- */
.project-card {
  display: block; text-decoration: none; color: inherit;
  transition: all .2s;
}
.project-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}
.project-card .pname { font-weight: 700; font-size: 16px; }
.project-card .pdesc { margin: 8px 0 16px; min-height: 40px; font-size: 13px; color: var(--muted); }
.project-card .pstats { display: flex; gap: 16px; font-size: 13px; color: var(--muted); }
.project-card .card-link { display: block; text-decoration: none; color: inherit; }
.project-card .card-link:hover { text-decoration: none; }

/* ---- 分隔线 ---- */
.divider { display: inline-block; width: 1px; height: 20px; background: var(--border); margin: 0 2px; vertical-align: middle; }

/* ---- 视图切换 ---- */
.view-switch {
  display: inline-flex; gap: 2px;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 2px;
}
.btn-switch {
  border: none; background: transparent; color: var(--muted);
  width: 32px; height: 32px; border-radius: 6px;
  cursor: pointer; font-size: 16px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.btn-switch:hover { color: var(--text); }
.btn-switch.active { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(20,30,50,.1); }

/* ---- 详情页清理后样式 ---- */
.url-clip {
  max-width: 320px; display: inline-block; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom;
  color: var(--muted); font-weight: 500;
}
.url-clip:hover { color: var(--primary); }
.head-actions { display: flex; gap: 8px; align-items: center; }
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.card-head h3 { margin: 0; }

/* 项目互动数据汇总（紧凑一行） */
.summary-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 16px 24px;
}
.summary-bar .sb-item {
  display: flex; align-items: center; gap: 12px;
  flex: 1; min-width: 0;
}
.summary-bar .sb-ic {
  flex: 0 0 40px; width: 40px; height: 40px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.summary-bar .sb-txt { display: flex; flex-direction: column; line-height: 1.2; }
.summary-bar .sb-txt b { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.summary-bar .sb-txt span { font-size: 12px; color: var(--muted); margin-top: 2px; }
.summary-bar .sb-sep { width: 1px; height: 36px; background: var(--border); flex: 0 0 auto; }
@media (max-width: 720px) {
  .summary-bar { flex-wrap: wrap; }
  .summary-bar .sb-sep { display: none; }
  .summary-bar .sb-item { flex: 1 1 45%; }
}

/* 新建项目表单：名称宽、描述窄、按钮贴右，避免文字换行 */
.new-project-form {
  display: flex; align-items: flex-end; gap: 14px;
}
.new-project-form .npf-name { flex: 0 0 180px; }
.new-project-form .npf-desc { flex: 1 1 auto; }
.new-project-form .npf-btn { flex: 0 0 auto; white-space: nowrap; }
@media (max-width: 720px) {
  .new-project-form { flex-wrap: wrap; }
  .new-project-form .npf-name, .new-project-form .npf-desc { flex: 1 1 100%; }
}

/* 项目卡片互动数据 */
.project-card .pmetrics {
  display: flex; gap: 8px; margin-top: 14px;
}
.project-card .pmetrics .pm {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  gap: 2px; padding: 10px 6px; background: #fafbfd;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 16px; font-weight: 800; color: var(--text); letter-spacing: -.01em;
}
.project-card .pmetrics .pm i { font-style: normal; font-size: 15px; }
.project-card .pmetrics .pm em {
  font-style: normal; font-size: 11px; font-weight: 500; color: var(--muted);
}

/* 键值对 */
.kv { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.kv:last-child { border-bottom: none; }
.kv > span { color: var(--muted); font-size: 13px; min-width: 64px; }
.kv > b { font-weight: 600; }

/* ---- 数据变化日志 ---- */
.delta-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.delta-chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: #fafbfd; border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px 14px;
}
.delta-chip .d-ic { font-size: 15px; }
.delta-chip .d-lbl { font-size: 12px; color: var(--muted); font-weight: 600; }
.delta-chip .d-val { font-size: 15px; font-weight: 800; }
.d-up { color: var(--green); font-weight: 800; }
.d-down { color: var(--red); font-weight: 800; }
.d-flat { color: var(--muted); font-weight: 700; }

.spark-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 720px) { .spark-wrap { grid-template-columns: 1fr; } }
.spark-block {
  background: #fafbfd; border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 14px;
}
.spark-title { font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.spark { width: 100%; height: 56px; display: block; }

.delta-cell { white-space: nowrap; }
.delta-cell .d-up, .delta-cell .d-down, .delta-cell .d-flat { margin: 0 1px; }

/* 评论区 */
.count-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 22px; padding: 0 7px; margin-left: 4px;
  background: var(--primary-l); color: var(--primary);
  border-radius: 999px; font-size: 12px; font-weight: 700;
  vertical-align: middle;
}
.comment-list { display: flex; flex-direction: column; gap: 2px; max-height: 460px; overflow: auto; }
.comment {
  display: flex; gap: 12px; padding: 12px 4px;
  border-bottom: 1px solid var(--border);
}
.comment:last-child { border-bottom: none; }
.avatar {
  flex: 0 0 36px; width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-d));
  color: #fff; font-weight: 700; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
}
.c-body { flex: 1; min-width: 0; }
.c-top { display: flex; align-items: center; gap: 10px; margin-bottom: 3px; }
.c-name { font-weight: 700; font-size: 13px; color: var(--text); }
.c-like { color: var(--muted); font-size: 12px; }
.c-text {
  font-size: 13px; line-height: 1.7; color: var(--text);
  white-space: pre-wrap; word-break: break-word;
}
/* 评论折叠：默认仅显示最后 3 条，其余隐藏，点击「更多」展开 */
.comment-list:not(.expanded) .c-hidden { display: none; }
.c-more { align-self: flex-start; margin-top: 10px; }

/* ---- AI 全面总结卡片 ---- */
.ai-summary-card { border: 1px solid var(--border); }
.ai-sum-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 12px;
}
.ai-sum-head h3 { margin: 0; font-size: 16px; color: var(--text); }
.ai-meta { font-size: 12px; color: var(--muted); }
.ai-loading {
  padding: 22px 0; text-align: center; color: var(--primary);
  font-size: 14px; animation: aiPulse 1.2s ease-in-out infinite;
}
@keyframes aiPulse { 0%,100%{opacity:.55} 50%{opacity:1} }
.ai-error {
  padding: 14px 16px; border-radius: var(--radius-sm);
  background: #fff4f4; border: 1px solid #ffd0d0; color: #c0392b;
  font-size: 13px; line-height: 1.7; white-space: pre-wrap; word-break: break-word;
}
.ai-summary-content { font-size: 14px; line-height: 1.8; color: var(--text); }
.ai-summary-content h2 { font-size: 19px; margin: 18px 0 8px; color: var(--text); }
.ai-summary-content h3 { font-size: 16px; margin: 16px 0 6px; color: var(--primary); }
.ai-summary-content h4 { font-size: 14px; margin: 12px 0 4px; color: var(--text); font-weight: 700; }
.ai-summary-content p { margin: 6px 0; }
.ai-summary-content ul, .ai-summary-content ol { margin: 6px 0; padding-left: 22px; }
.ai-summary-content li { margin: 3px 0; }
.ai-summary-content blockquote {
  margin: 8px 0; padding: 8px 12px; border-left: 3px solid var(--primary-l);
  background: var(--primary-l); color: var(--muted); border-radius: var(--radius-sm);
}
.ai-summary-content strong { color: var(--text); font-weight: 700; }

/* ---- 设置页 ---- */
.settings-card { max-width: 720px; }
.settings-card h2 { margin: 0 0 4px; }
.settings-card .muted { color: var(--muted); margin: 0 0 18px; font-size: 13px; }
.set-row {
  display: flex; gap: 16px; align-items: flex-start;
  padding: 14px 0; border-top: 1px solid var(--border);
}
.set-row > label {
  flex: 0 0 110px; font-weight: 600; color: var(--text); padding-top: 8px;
}
.set-row .grow { flex: 1 1 auto; min-width: 0; }
.set-row input {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 14px; background: #fff; color: var(--text);
}
.set-row input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-l); }
.hint { color: var(--muted); font-size: 12px; margin-top: 6px; }
.hint code, .set-tip code { background: #f3f5fa; padding: 1px 6px; border-radius: 5px; font-size: 12px; }
.presets { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--border); background: #fff; color: var(--text);
  padding: 6px 12px; border-radius: 999px; cursor: pointer; font-size: 13px;
  transition: all .15s;
}
.chip:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-l); }
.set-actions { display: flex; align-items: center; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
.btn-ghost { background: #fff; border: 1px solid var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.ai-status { font-size: 13px; font-weight: 600; transition: none; }
.ai-status.ok { color: var(--green); animation: statusFlash 1.2s ease-out; }
.ai-status.err { color: var(--red); animation: statusShake 0.4s ease-out; }
@keyframes statusFlash {
  0% { background: rgba(22,163,74,0.15); border-radius: 4px; padding: 2px 6px; }
  100% { background: transparent; }
}
@keyframes statusShake {
  0%,100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}
.btn-sm:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}
.status-ok { color: var(--green); font-weight: 600; }
.status-off { color: var(--amber); font-weight: 600; }
.set-tip {
  margin-top: 18px; padding: 12px 14px; background: var(--primary-l);
  border-radius: var(--radius-sm); font-size: 13px; color: var(--text);
}
.set-tip b { color: var(--primary-d); }
.set-hr { border: none; border-top: 1px solid var(--border); margin: 24px 0 18px; }
.fw-textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 13px; line-height: 1.65;
  font-family: inherit; resize: vertical; color: var(--text);
}
.fw-textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-l); }

/* ---- 采集说明内嵌的「数据变化」区块 ---- */
.change-inline {
  margin-top: 14px; padding-top: 14px;
  border-top: 1px dashed var(--border);
}

/* ---- 项目资料库卡片 ---- */
.file-card .card-head,
.news-card .card-head {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 14px;
}
.file-card .card-head h3,
.news-card .card-head h3 { margin: 0; }

.file-upload-area {
  border: 2px dashed var(--border); border-radius: var(--r); padding: 28px 16px;
  text-align: center; cursor: pointer; transition: border-color .2s, background .2s;
  margin-bottom: 14px;
}
.file-upload-area:hover,
.file-upload-area.drag-over {
  border-color: var(--primary); background: var(--primary-l);
}
.file-upload-hint {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  color: var(--muted); font-size: 14px;
}
.file-upload-icon { font-size: 32px; }

.file-list { display: flex; flex-direction: column; gap: 6px; }
.file-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  background: var(--bg); border-radius: var(--r); border: 1px solid var(--border);
}
.file-icon { font-size: 18px; flex-shrink: 0; }
.file-name { flex: 1; font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta { font-size: 11px; color: var(--muted); white-space: nowrap; }
.file-del { flex-shrink: 0; }

/* ---- 全网报道监控卡片 ---- */
.news-keywords-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px;
}
.news-keywords-bar label { font-size: 13px; font-weight: 600; white-space: nowrap; }
.news-keywords-bar input[type="text"] { flex: 1; min-width: 220px; font-size: 13px; }

.news-list { display: flex; flex-direction: column; gap: 10px; }
.news-item {
  display: flex; gap: 12px; padding: 12px 14px; border-radius: var(--r);
  border: 1px solid var(--border); background: var(--bg);
  transition: opacity .3s;
}
.news-unkept { opacity: .45; }
.news-body { flex: 1; min-width: 0; }
.news-title { font-size: 14px; font-weight: 600; margin-bottom: 4px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.news-title a { color: var(--primary); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 420px; display: inline-block; }
.news-title a:hover { text-decoration: underline; }
.news-kw-badge {
  font-size: 11px; background: var(--primary-l); color: var(--primary);
  padding: 1px 8px; border-radius: 10px; white-space: nowrap;
}
.news-meta { font-size: 11px; color: var(--muted); display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.news-has-content { color: var(--green); }
.news-no-content { color: var(--amber); }
.news-snippet { font-size: 12px; color: var(--muted); line-height: 1.6; margin-top: 4px; }
.news-actions { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; flex-shrink: 0; }
.news-actions.row { flex-direction: row; align-items: center; gap: 8px; }

.news-ai-score-badge {
  font-size: 11px; padding: 1px 8px; border-radius: 10px; white-space: nowrap;
  background: #f3f4f6; color: #6b7280;
}
.news-ai-score-badge.high { background: #dcfce7; color: #16a34a; font-weight: 600; }
.news-ai-score-badge.mid { background: #fef3c7; color: #d97706; font-weight: 600; }
.news-ai-score-badge.low { background: #fee2e2; color: #dc2626; font-weight: 600; }

/* ---- 报道监控：候选区 / 待采集区 ---- */
.news-sub { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border); }
.news-sub-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; margin-bottom: 10px; font-size: 13px; font-weight: 600; color: var(--text);
}
.news-sub-head .ai-status { font-weight: 400; }
.news-sub-head b { color: var(--primary); }
.cand-item { border-left: 3px solid var(--primary-l); }
.cand-item .news-kw-badge.high { background: #dcfce7; color: #16a34a; font-weight: 600; }
.sel-item { border-left: 3px solid var(--green); background: var(--green-l, #f0fdf4); }

/* ---- AI 总结：简版 + 更多展开 ---- */
.ai-short {
  font-size: 14px; line-height: 1.75; color: var(--text);
  margin: 0 0 4px;
}
.ai-detail {
  margin-top: 12px; padding-top: 12px;
  border-top: 1px dashed var(--border);
}
.ai-more { margin-top: 8px; }

/* ---- 站点修复规则管理 ---- */
.rule-form-row {
  display: flex; gap: 10px; margin-bottom: 8px; align-items: flex-end;
}
.rule-fg {
  display: flex; flex-direction: column; gap: 3px; flex: 1;
}
.rule-fg label {
  font-size: 12px; font-weight: 600; color: var(--muted);
}
.rule-fg input, .rule-fg select {
  font-size: 13px; padding: 6px 10px; border: 1px solid var(--border);
  border-radius: 6px; background: var(--card); color: var(--text);
  outline: none;
}
.rule-fg input:focus, .rule-fg select:focus {
  border-color: var(--primary);
}

.rule-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.rule-table th {
  text-align: left; padding: 8px 10px; font-size: 11px; font-weight: 600;
  color: var(--muted); text-transform: uppercase; border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
.rule-table td {
  padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: middle;
}
.rule-table tr:last-child td { border-bottom: none; }
.rule-table tr:hover td { background: var(--bg); }
.rule-disabled td { opacity: 0.45; }

/* 规则分组 + 折叠 */
.rule-group { margin-bottom: 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.rule-group-header {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; cursor: pointer; user-select: none;
  background: var(--bg); transition: background .1s;
}
.rule-group-header:hover { background: var(--primary-l); }
.rule-group-header .group-icon { font-size: 16px; }
.rule-group-header .group-domain { font-weight: 700; font-size: 14px; flex: 1; }
.rule-group-header .group-count { font-size: 12px; color: var(--muted); }
.rule-group-header .group-toggle { font-size: 13px; color: var(--muted); transition: transform .2s; }
.rule-group-header .group-toggle.open { transform: rotate(90deg); }
.rule-group-body { display: none; overflow-x: auto; }
.rule-group-body.open { display: block; }
.rule-group-body .rule-table { margin: 0; }
.rule-group-body .rule-table td:first-child { padding-left: 20px; }

/* 分页控件 */
.pagination {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: 16px; padding: 8px 0; flex-wrap: wrap;
}
.pagination .page-btn {
  padding: 5px 12px; border: 1px solid var(--border); border-radius: 6px;
  background: var(--card); cursor: pointer; font-size: 13px; color: var(--text); min-width: 34px; text-align: center;
}
.pagination .page-btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.pagination .page-btn:disabled { opacity: 0.4; cursor: default; }
.pagination .page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination .page-info { font-size: 13px; color: var(--muted); padding: 0 8px; }

/* ---- AI 采集规则分析 ---- */
.ai-analyze-card { border: 1px solid var(--primary-l); background: linear-gradient(135deg, #f8faff 0%, #eef1ff 100%); }
.ai-analyze-card h2 { color: var(--primary-d); }
.ai-nl-row { margin-bottom: 4px; }
.ai-describe {
  width: 100%; font-size: 14px; padding: 12px 14px;
  border: 2px solid var(--primary-l); border-radius: 10px;
  background: var(--card); color: var(--text); outline: none;
  resize: vertical; min-height: 100px; line-height: 1.6;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.ai-describe:focus {
  border-color: var(--primary); box-shadow: 0 0 0 4px rgba(var(--primary-rgb, 99, 102, 241), 0.12);
}
.ai-describe::placeholder { color: var(--muted); opacity: 0.7; font-size: 13px; }
.ai-analyze-url-row { display: flex; gap: 8px; align-items: flex-start; }
.ai-analyze-url-row input[type="url"] {
  flex: 1; font-size: 14px; padding: 9px 14px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--card); color: var(--text); outline: none;
}
.ai-analyze-url-row input[type="url"]:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-l);
}
.ai-analyze-hint {
  width: 100%; font-size: 13px; padding: 8px 12px; margin-top: 8px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--card); color: var(--text); outline: none; resize: vertical;
}
.ai-analyze-hint:focus { border-color: var(--primary); }
.ai-result { margin-top: 16px; display: none; }
.ai-result.active { display: block; }
.ai-result-inner {
  background: var(--card); border-radius: var(--radius-sm);
  border: 1px solid var(--border); padding: 16px;
}
.ai-result-inner h4 {
  margin: 0 0 12px; font-size: 15px; color: var(--primary-d);
}
.ai-result-inner h4 small { font-weight: 400; color: var(--muted); font-size: 12px; }
.ai-result-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px;
}
.ai-result-item {
  background: var(--bg); border-radius: 6px; padding: 10px 12px;
}
.ai-result-item .ai-r-label { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; margin-bottom: 3px; }
.ai-result-item .ai-r-val { font-family: "SF Mono","Fira Code","Consolas",monospace; font-size: 13px; color: var(--primary-d); word-break: break-all; }
.ai-result-item .ai-r-val.null { color: var(--muted); font-style: italic; }
.ai-metrics-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.ai-metric-item {
  background: var(--bg); border-radius: 6px; padding: 8px 10px; text-align: center;
}
.ai-metric-item .ai-m-num { font-size: 18px; font-weight: 700; color: var(--primary-d); }
.ai-metric-item .ai-m-label { font-size: 11px; color: var(--muted); margin-top: 2px; }
.ai-result-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ai-skill-notes { flex: 1; min-width: 180px; }
.ai-skill-notes input {
  width: 100%; font-size: 13px; padding: 7px 10px;
  border: 1px solid var(--border); border-radius: 6px; outline: none;
}
.ai-skill-notes input:focus { border-color: var(--primary); }

/* ---- 候选式结果卡片 ---- */
.cand-group { margin-bottom: 18px; }
.cand-title {
  font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 8px;
  display: flex; align-items: center; gap: 6px;
}
.cand-title small { font-weight: 400; color: var(--muted); font-size: 12px; }
.cand-title .cand-count { margin-left: auto; color: var(--muted); font-weight: 400; }
.cand-list { display: flex; flex-direction: column; gap: 8px; }
.cand-card {
  position: relative; display: flex; align-items: flex-start; gap: 10px;
  background: var(--bg); border: 2px solid var(--border); border-radius: 10px;
  padding: 10px 12px; cursor: pointer; transition: all 0.15s ease;
}
.cand-card:hover { border-color: var(--primary); background: var(--primary-l); }
.cand-card.selected { border-color: var(--primary); background: var(--primary-l); box-shadow: 0 2px 8px rgba(var(--primary-rgb, 99,102,241),0.2); }
.cand-card.empty {
  cursor: default; color: var(--muted); font-style: italic; justify-content: center;
  border-style: dashed; background: transparent;
}
.cand-card.empty:hover { border-color: var(--border); background: transparent; }
.cand-radio {
  width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border);
  flex-shrink: 0; margin-top: 2px; display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: #fff; transition: all 0.15s;
}
.cand-card.selected .cand-radio { background: var(--primary); border-color: var(--primary); }
.cand-card.selected .cand-radio::after { content: "✓"; }
.cand-body { flex: 1; min-width: 0; }
.cand-text {
  font-size: 14px; line-height: 1.5; color: var(--text);
  max-height: 4.2em; overflow: hidden; word-break: break-word;
}
.cand-meta { display: flex; gap: 8px; margin-top: 5px; flex-wrap: wrap; }
.cand-tag {
  font-size: 11px; padding: 1px 7px; border-radius: 10px;
  background: var(--primary-l); color: var(--primary-d); font-weight: 600;
}
.cand-tag.metric { background: #fff4e5; color: #b9770b; }
.cand-tag.site { background: #e8f4ff; color: #2563eb; }
.cand-conf { font-size: 11px; color: var(--muted); }
.cand-conf.high { color: #16a34a; font-weight: 600; }
.cand-preview { font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.45; }
.cand-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--border); }
.cand-tip { font-size: 12px; color: var(--muted); margin:-4px 0 10px; }

/* 每个字段的「自然语言重新匹配」面板 */
.cand-rematch { margin-top: 8px; }
.cand-rematch-toggle {
  background: none; border: 1px dashed var(--border); color: var(--muted);
  font-size: 12px; padding: 4px 10px; border-radius: 6px; cursor: pointer;
}
.cand-rematch-toggle:hover { border-color: var(--primary); color: var(--primary); }
.cand-rematch-panel { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.cand-rematch-input {
  flex: 1; min-width: 220px; padding: 6px 10px; border: 1px solid var(--border);
  border-radius: 6px; font-size: 13px; background: var(--bg); color: var(--text);
}
.cand-rematch-input:focus { outline: none; border-color: var(--primary); }
.cand-rematch-status { font-size: 12px; color: var(--muted); }
.cand-rematch-status.ok { color: #16a34a; }
.cand-rematch-status.err { color: #dc2626; }
.cand-card.rematch-card { border-style: dashed; }
.cand-card.rematch-card.selected { border-style: solid; }

/* 空值选项：页面无此字段 */
.cand-card.null-card { border-style: dashed; border-color: var(--amber); background: var(--amber-l); cursor: pointer; }
.cand-card.null-card:hover { border-color: var(--red); background: var(--red-l); }
.cand-card.null-card.selected { border-color: var(--red); background: var(--red-l); }

/* PIN 解锁层 */
.pin-overlay {
  position: fixed; inset: 0; z-index: 999;
  background: rgba(0,0,0,0.35);
  display: flex; align-items: center; justify-content: center;
}
.pin-box {
  background: var(--card); border-radius: var(--radius);
  padding: 32px 36px; box-shadow: 0 8px 40px rgba(0,0,0,0.15);
  max-width: 400px; width: 90%; text-align: center;
}
.pin-box h3 { margin: 0 0 8px; font-size: 18px; }

