/* 新闻抓取台：沿用工作台的 light 主题变量 */
.news-body { background: var(--bg); }
.news-shell { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 18px; padding: 22px 26px 60px; max-width: 1720px; margin: 0 auto; align-items: start; }
.news-main, .news-side { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius-panel); background: var(--surface); box-shadow: var(--shadow-card); padding: 20px 22px; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.panel-head h1, .panel-head h2 { margin: 0; font-size: 20px; letter-spacing: -.4px; color: var(--ink); }
.panel-head.compact h2 { font-size: 15px; }
.panel-head p { margin: 5px 0 0; color: var(--ink-4); font-size: 12.5px; }
.panel-head.compact { margin-bottom: 10px; align-items: center; }
.chip { padding: 4px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); font-size: 11.5px; font-weight: 650; white-space: nowrap; }
.side-hint { margin: 0 0 12px; color: var(--ink-4); font-size: 12px; line-height: 1.6; }
.side-hint code { background: var(--bg-sunk); padding: 1px 4px; border-radius: 4px; font-size: 11px; }
.hint { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--line-soft); color: var(--ink-4); font-size: 12px; line-height: 1.7; }
.hint b { color: var(--accent-ink); }
.good { color: var(--ok); }
.bad { color: var(--danger); }
.muted { color: var(--ink-4); }
.small { font-size: 12px; }

/* 状态区 */
.status-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.stat { padding: 13px 14px; border: 1px solid var(--line-soft); border-radius: var(--radius-card); background: var(--surface-2); min-width: 0; }
.stat span { display: block; color: var(--ink-4); font-size: 11.5px; }
.stat b { display: block; margin-top: 5px; font-size: 19px; letter-spacing: -.5px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat small { display: block; margin-top: 2px; color: var(--ink-4); font-size: 11px; }
.last-result { margin-top: 12px; padding: 10px 13px; border-radius: var(--radius-control); background: var(--bg-sunk); color: var(--ink-3); font-size: 12.5px; line-height: 1.6; min-height: 38px; }
.last-result .sep { margin: 0 8px; color: var(--line-strong); }
.control-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 14px; }
.control-row button.primary, .control-row button.secondary { min-height: 38px; padding: 8px 14px; }
.field-inline { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-3); font-size: 12.5px; white-space: nowrap; }
.field-inline select, .filter-row select { border: 1px solid var(--line-strong); border-radius: var(--radius-control); background: var(--surface); color: var(--ink); padding: 7px 9px; outline: 0; font-size: 12.5px; }
.field-inline select:focus, .filter-row select:focus { border-color: var(--accent); }
.auto-poll { margin-left: auto; }
.switch { position: relative; width: 38px; height: 22px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--bg-muted); padding: 0; cursor: pointer; transition: background 160ms, border-color 160ms; flex: 0 0 auto; }
.switch span { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px #202a3026; transition: transform 160ms var(--ease); }
.switch.on { background: var(--accent); border-color: var(--accent); }
.switch.on span { transform: translateX(16px); }
.switch.small { width: 32px; height: 19px; }
.switch.small span { width: 13px; height: 13px; }
.switch.small.on span { transform: translateX(13px); }
.dot.busy { background: #d99127; box-shadow: 0 0 0 3px #d9912718; animation: pulse 1.4s infinite; }
.dot.paused { background: var(--ink-4); box-shadow: none; }
@keyframes pulse { 50% { opacity: .45; } }

/* 筛选区 */
.filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--radius-control); overflow: hidden; background: var(--surface); }
.seg button { border: 0; border-right: 1px solid var(--line-soft); background: transparent; color: var(--ink-3); padding: 8px 12px; font-size: 12.5px; cursor: pointer; white-space: nowrap; }
.seg button:last-child { border-right: 0; }
.seg button:hover { background: var(--bg-sunk); }
.seg button.active { background: var(--accent); color: #fff; font-weight: 650; }
.filter-row input[type=search] { flex: 1 1 220px; min-width: 160px; border: 1px solid var(--line-strong); border-radius: var(--radius-control); padding: 8px 11px; outline: 0; background: var(--surface); color: var(--ink); font-size: 13px; }
.filter-row input[type=search]:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.check { display: inline-flex; align-items: center; gap: 5px; color: var(--ink-3); font-size: 12.5px; white-space: nowrap; cursor: pointer; }
.check input { accent-color: var(--accent); }
.filter-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; color: var(--ink-4); font-size: 12px; }
.link-btn { border: 0; background: transparent; color: var(--accent-ink); font-size: 12px; font-weight: 620; cursor: pointer; padding: 3px 0; text-decoration: none; }
.link-btn:hover { text-decoration: underline; }

/* 新闻列表 */
.list-panel { padding: 6px 0 12px; }
.news-list { display: flex; flex-direction: column; }
.news-card { padding: 16px 22px; border-bottom: 1px solid var(--line-soft); }
.news-card:last-child { border-bottom: 0; }
.news-card:hover { background: var(--surface-2); }
.news-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; font-size: 15px; line-height: 1.5; }
.news-title a { color: var(--ink); font-weight: 650; text-decoration: none; }
.news-title a:hover { color: var(--accent-ink); text-decoration: underline; }
.badge { display: inline-block; padding: 1px 6px; border-radius: 4px; font-size: 10.5px; font-weight: 700; letter-spacing: .3px; white-space: nowrap; }
.badge.new { background: #b8414f14; color: #b8414f; }
.badge.updated { background: #176b7514; color: var(--accent-ink); }
.badge.warn { background: #d9912718; color: #9a6412; }
.badge.muted { background: var(--bg-muted); color: var(--ink-4); }
.news-excerpt { margin: 7px 0 0; color: var(--ink-3); font-size: 12.5px; line-height: 1.65; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.news-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 9px; color: var(--ink-4); font-size: 11.5px; }
.news-meta .src { color: var(--accent-ink); font-weight: 650; }
.empty { padding: 46px 24px; text-align: center; }
.empty h3 { margin: 0 0 8px; font-size: 16px; color: var(--ink-2); }
.empty p { margin: 0 auto; max-width: 460px; color: var(--ink-4); font-size: 12.5px; line-height: 1.7; }
.load-more { padding: 10px 22px 2px; text-align: center; }
.load-more button { min-height: 34px; padding: 6px 16px; }

/* 侧栏 */
.news-side .panel { padding: 16px 18px; }
.source-list { display: flex; flex-direction: column; gap: 9px; max-height: 430px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.source-card { padding: 10px 12px; border: 1px solid var(--line-soft); border-radius: var(--radius-control); background: var(--surface-2); }
.source-top { display: flex; align-items: center; gap: 10px; }
.source-name { min-width: 0; }
.source-name b { display: block; font-size: 13px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.source-name small { display: block; color: var(--ink-4); font-size: 10.5px; }
.source-meta { display: flex; flex-wrap: wrap; gap: 5px 10px; margin-top: 7px; color: var(--ink-4); font-size: 11px; }
.source-meta span:first-child { font-weight: 650; }
.source-error { margin-top: 6px; color: var(--danger); font-size: 11px; line-height: 1.5; word-break: break-word; }
.source-actions { display: flex; gap: 14px; margin-top: 7px; }
.side-form { margin-bottom: 10px; }
.side-form input { min-width: 0; flex: 1; border: 1px solid var(--line-strong); border-radius: var(--radius-control); padding: 8px 10px; outline: 0; font-size: 12px; background: var(--surface); color: var(--ink); }
.side-form input:focus { border-color: var(--accent); }
.side-form button { min-height: 34px; padding: 6px 12px; }
.manual-list { display: flex; flex-direction: column; gap: 6px; max-height: 180px; overflow-y: auto; }
.manual-row { display: flex; align-items: center; gap: 8px; font-size: 11.5px; }
.manual-url { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-3); }
.module-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.module-stats div { padding: 8px; border-radius: var(--radius-control); background: var(--bg-sunk); text-align: center; }
.module-stats b { display: block; font-size: 15px; color: var(--ink); }
.module-stats span { display: block; margin-top: 2px; font-size: 10.5px; color: var(--ink-4); }
.module-item { padding: 6px 0; border-bottom: 1px solid var(--line-soft); font-size: 11.5px; line-height: 1.5; }
.module-item a { color: var(--ink-2); text-decoration: none; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.module-item a:hover { color: var(--accent-ink); }
.module-item small { color: var(--ink-4); font-size: 10.5px; }
.side-actions { display: flex; gap: 8px; margin-top: 10px; }
.side-actions button { flex: 1; min-height: 32px; padding: 5px 8px; font-size: 12px; }
.module-detail { margin-top: 10px; border-top: 1px solid var(--line-soft); padding-top: 8px; }
.module-detail summary { cursor: pointer; color: var(--ink-3); font-size: 12px; font-weight: 620; }
.run-history, #module-runs { display: flex; flex-direction: column; gap: 4px; max-height: 220px; overflow-y: auto; }
.run-row { display: grid; grid-template-columns: 52px 1fr auto; gap: 6px; align-items: center; font-size: 11px; color: var(--ink-4); padding: 4px 0; border-bottom: 1px solid var(--line-soft); }
.run-row span:first-child { font-weight: 700; }
.run-row span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.run-row span:last-child { white-space: nowrap; }
.sizes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.sizes div { padding: 7px 9px; border-radius: var(--radius-control); background: var(--bg-sunk); }
.sizes span { display: block; font-size: 10.5px; color: var(--ink-4); }
.sizes b { font-size: 14px; color: var(--ink-2); }

.toast { position: fixed; right: 24px; bottom: 24px; z-index: 90; max-width: 380px; padding: 12px 16px; border-radius: var(--radius-control); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); box-shadow: var(--shadow-hover); font-size: 13px; opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity 200ms, transform 200ms; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.good { border-color: #a8d6c1; background: var(--ok-soft); color: #126b4c; }
.toast.bad { border-color: #e2b7bd; background: var(--danger-soft); color: #8e2937; }

@media (max-width: 1180px) {
  .news-shell { grid-template-columns: minmax(0, 1fr); padding: 18px 16px 48px; }
  .news-side { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .status-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .topbar { padding: 0 16px; gap: 12px; }
  .subtitle, .guardrail { display: none; }
  .news-side { grid-template-columns: minmax(0, 1fr); }
  .status-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auto-poll { margin-left: 0; }
}
