:root {
  --bg: #faf9f6; --bg-sunk: #f3f3ef; --bg-muted: #e9ede9; --surface: #fff; --surface-2: #fdfdfb; --sidebar: #fdfdfb;
  --ink: #202a30; --ink-2: #303c42; --ink-3: #59656b; --ink-4: #657176;
  --line: #dfe4e1; --line-strong: #d1d9d5; --line-soft: #e9ede9;
  --accent: #176b75; --accent-ink: #145f68; --accent-soft: #176b7514; --accent-softer: #176b750d; --accent-contrast: #fff;
  --danger: #b8414f; --danger-soft: #b8414f12; --ok: #16865c; --ok-soft: #16865c12;
  --radius-control: 8px; --radius-card: 12px; --radius-panel: 14px;
  --shadow-card: 0 1px 2px #202a3006; --shadow-hover: 0 3px 12px #202a300e; --ease: cubic-bezier(.25, 1, .5, 1);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--bg); font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "HarmonyOS Sans SC", "Microsoft YaHei", sans-serif; font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.topbar { position: sticky; top: 0; z-index: 40; height: 70px; display: flex; align-items: center; gap: 22px; padding: 0 28px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(12px); }
.brand { font-size: 24px; font-weight: 800; letter-spacing: -.8px; color: var(--ink); }
.subtitle { padding-left: 22px; border-left: 1px solid var(--line-strong); color: var(--ink-4); }
.guardrail { color: var(--danger); font-weight: 650; }
.run-meta { margin-left: auto; color: var(--ink-4); white-space: nowrap; }
.dot { display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: #25a875; box-shadow: 0 0 0 3px #25a87512; }
.shell { display: grid; grid-template-columns: 180px minmax(0, 1fr); min-height: calc(100vh - 70px); }
.sidebar { position: sticky; top: 70px; align-self: start; height: calc(100vh - 70px); overflow-y: auto; padding: 28px 12px 18px; border-right: 1px solid var(--line); background: var(--sidebar); }
.nav { display: flex; align-items: center; gap: 10px; height: 42px; margin: 2px 0; padding: 0 10px; border-radius: var(--radius-control); color: var(--ink-3); font-size: 14px; font-weight: 520; text-decoration: none; transition: background 150ms, color 150ms, transform 150ms; }
.nav:hover { background: var(--bg-sunk); color: var(--ink); }
.nav:active { transform: translateY(1px); }
.nav.active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; }
.nav-icon { display: grid; place-items: center; width: 22px; flex: 0 0 22px; color: currentColor; }
.nav-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.side-note { margin: 34px 10px 0; padding-top: 16px; border-top: 1px solid var(--line); color: var(--ink-4); font-size: 12px; line-height: 1.75; }
.workspace { display: grid; grid-template-columns: minmax(650px, 1fr) minmax(410px, 520px); min-width: 0; }
.queue { min-width: 0; padding: 26px 28px 48px; background: var(--bg); }
.inspector { position: sticky; top: 70px; align-self: start; height: calc(100vh - 70px); overflow-y: auto; padding: 26px 28px 100px; border-left: 1px solid var(--line); background: var(--surface-2); scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.section-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 22px; }
.section-head h1 { margin: 0 0 4px; color: var(--ink); font-size: 30px; line-height: 1.2; letter-spacing: -1px; }
.section-head p, .inspector-head p { margin: 0; color: var(--ink-4); }
.head-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 10px; }
.head-actions form { margin: 0; }
.head-actions button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.button-icon { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.head-actions .primary { border-color: var(--accent); background: var(--surface); color: var(--accent-ink); box-shadow: none; }
.head-actions .primary:hover { background: var(--accent-softer); }
.button-link { display: inline-flex; align-items: center; text-decoration: none; }
.utility-link { color: var(--ink-4); font-size: 12px; border-bottom: 1px solid var(--line-strong); }
.utility-link:hover { color: var(--accent); border-color: var(--accent); }
.primary, .secondary, .approve { min-height: 42px; border-radius: var(--radius-control); padding: 9px 16px; font-weight: 680; cursor: pointer; transition: transform 140ms var(--ease), box-shadow 180ms, background 150ms, border-color 150ms; }
.primary { border: 1px solid var(--accent); background: var(--accent); color: var(--accent-contrast); white-space: nowrap; box-shadow: var(--shadow-card); }
.primary:hover { background: var(--accent-ink); box-shadow: var(--shadow-hover); }
.secondary { border: 1px solid color-mix(in srgb, var(--accent) 72%, var(--line)); background: var(--surface); color: var(--accent-ink); }
.secondary:hover { border-color: var(--accent); background: var(--accent-softer); }
.approve { border: 1px solid var(--accent); background: var(--accent); color: var(--accent-contrast); }
.primary:active, .secondary:active, .approve:active { transform: translateY(1px); }
button:disabled { opacity: .48; cursor: default; transform: none; }
.notice { padding: 11px 14px; margin-bottom: 14px; border: 1px solid; border-radius: var(--radius-control); line-height: 1.55; }
.notice.success { border-color: #a8d6c1; background: var(--ok-soft); color: #126b4c; }
.notice.error { border-color: #e2b7bd; background: var(--danger-soft); color: #8e2937; }
.notice.info { border-color: #a8c9cd; background: var(--accent-softer); color: var(--accent-ink); }
.ops-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; margin-top: 22px; }
.op-card { padding: 15px 16px; border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--surface); box-shadow: var(--shadow-card); }
.op-card strong { font-size: 14px; color: var(--ink-2); }
.op-card p { margin: 4px 0 12px; color: var(--ink-4); font-size: 12px; }
.inline-form { display: flex; gap: 8px; }
.inline-form input { min-width: 0; flex: 1; }
.op-card input, .edit-panel input, .edit-panel textarea, .feedback-panel textarea, .generate select { width: 100%; border: 1px solid var(--line-strong); border-radius: var(--radius-control); padding: 9px 11px; outline: 0; background: var(--surface); color: var(--ink); transition: border-color 150ms, box-shadow 150ms; }
.op-card input:focus, .edit-panel input:focus, .edit-panel textarea:focus, .feedback-panel textarea:focus, .generate select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.op-card button { min-height: 39px; padding: 7px 13px; }
.source-health { margin-top: 12px; border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--surface); box-shadow: var(--shadow-card); }
.source-health summary, .edit-panel summary { padding: 12px 14px; cursor: pointer; color: var(--ink-2); font-weight: 680; }
.health-list { padding: 4px 14px; border-top: 1px solid var(--line); }
.health-list > div { padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.health-list > div:last-child { border: 0; }
.health-list small { display: block; margin-top: 4px; color: var(--ink-4); }
.scope { margin-left: 8px; padding: 2px 6px; border-radius: 4px; background: var(--accent-soft); color: var(--accent-ink); font-size: 11px; }
.batch-line { margin-top: 10px; color: var(--ink-4); font-size: 12px; }
.batch-line span { display: inline-block; margin-left: 8px; }
.tabs { display: flex; gap: 34px; margin-top: 26px; border-bottom: 1px solid var(--line); }
.tab { padding: 12px 2px; color: var(--ink-3); }
.tab.active { margin-bottom: -1px; border-bottom: 2px solid var(--accent); color: var(--ink); font-weight: 720; }
.tab b { margin-left: 3px; padding: 2px 7px; border-radius: 5px; background: var(--bg-muted); color: var(--ink-2); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: separate; border-spacing: 0; white-space: nowrap; }
th { padding: 10px 6px; border-bottom: 1px solid var(--line); background: transparent; color: var(--ink-4); font-size: 11px; font-weight: 600; text-align: left; }
td { padding: 11px 6px; border-bottom: 1px solid var(--line-soft); color: var(--ink-3); transition: background 150ms; }
tbody tr { position: relative; cursor: pointer; }
tbody tr:hover td { background: var(--accent-softer); }
tbody tr.selected td { background: var(--accent-soft); }
tbody tr.selected td:first-child { box-shadow: inset 3px 0 0 var(--accent); border-radius: var(--radius-control) 0 0 var(--radius-control); }
tbody tr.selected td:last-child { border-radius: 0 var(--radius-control) var(--radius-control) 0; }
.topic { max-width: 270px; overflow: hidden; color: var(--ink); font-weight: 650; text-overflow: ellipsis; }
.score { color: var(--ink); font-weight: 800; }
.mobile-meta { display: none; }
.status { display: inline-block; padding: 4px 8px; border-radius: 5px; background: var(--danger-soft); color: var(--danger); font-size: 12px; font-weight: 650; white-space: nowrap; }
.status.muted { background: var(--bg-muted); color: var(--ink-3); }
.status.warn { background: var(--danger-soft); color: var(--danger); }
.inspector-head { display: flex; align-items: flex-start; gap: 12px; }
.inspector-head > div { min-width: 0; }
.inspector-head h2 { margin: 0 0 7px; color: var(--ink); font-size: 21px; line-height: 1.38; letter-spacing: -.25px; }
.inspector-head .status { flex: none; margin-left: auto; }
.block { padding: 20px 0; border-bottom: 1px solid var(--line); }
.block-title { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.block-title h3 { margin: 0; color: var(--ink); font-size: 15px; }
.block-title span { color: var(--ink-4); font-size: 12px; }
.block p { color: var(--ink-3); line-height: 1.75; }
.source-list, .suggestions { margin: 0; padding-left: 23px; }
.source-list li, .suggestions li { padding: 7px 0; color: var(--ink-3); }
.source-list a { color: #1771d0; text-decoration: none; }
.source-list a:hover { text-decoration: underline; }
.source-list small { display: block; margin-top: 3px; color: var(--ink-4); }
.original-title { margin-top: 7px; color: var(--ink-4); font-size: 12px; }
.original-title summary { cursor: pointer; user-select: none; }
.original-title span { display: block; margin-top: 5px; line-height: 1.5; overflow-wrap: anywhere; }
.image-candidates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.image-candidate { display: flex; min-width: 0; flex-direction: column; gap: 8px; padding: 8px; border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--surface); box-shadow: var(--shadow-card); }
.image-candidate > a { display: block; aspect-ratio: 16 / 10; overflow: hidden; border-radius: var(--radius-control); background: var(--bg-sunk); }
.image-candidate img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 240ms var(--ease); }
.image-candidate:hover img { transform: scale(1.025); }
.image-candidate b { display: block; overflow: hidden; color: var(--ink-2); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.image-candidate small { display: block; margin-top: 3px; color: var(--ink-4); font-size: 11px; line-height: 1.4; overflow-wrap: anywhere; }
.image-candidate form { display: inline-block; margin-right: 5px; }
.image-candidate button { min-height: 32px; padding: 5px 8px; font-size: 11px; }
.block h4 { margin: 0 0 10px; font-size: 16px; }
.article { max-height: 300px; overflow: auto; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--bg-sunk); color: var(--ink-2); line-height: 1.85; white-space: pre-line; }
.metrics { display: grid; grid-template-columns: repeat(5, 1fr); overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--surface); }
.metrics div { padding: 10px 5px; border-right: 1px solid var(--line); text-align: center; }
.metrics div:last-child { border: 0; }
.metrics span { display: block; min-height: 32px; color: var(--ink-4); font-size: 11px; }
.metrics b { color: var(--ok); font-size: 16px; }
.feedback-panel { margin: 18px 0 4px; padding: 16px; border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); border-radius: var(--radius-card); background: var(--accent-softer); }
.feedback-panel p { margin: 0 0 12px; color: var(--ink-3); font-size: 13px; line-height: 1.65; }
.feedback-panel label, .edit-panel label { display: grid; gap: 6px; margin: 9px 0; color: var(--ink-3); font-size: 12px; }
.feedback-panel textarea, .edit-panel textarea { resize: vertical; line-height: 1.65; }
.feedback-panel button { width: 100%; margin-top: 12px; }
.feedback-panel .check-line, .edit-panel .check-line { display: flex; align-items: center; gap: 8px; margin: 10px 0; color: var(--ink-3); }
.feedback-panel .check-line input, .edit-panel .check-line input { width: auto; margin: 0; }
.edit-panel { border-bottom: 1px solid var(--line); }
.edit-panel form { padding: 0 0 18px; }
.preference-memory ol { margin: 0; padding-left: 20px; }
.preference-memory li { padding: 8px 0; border-bottom: 1px solid var(--line-soft); line-height: 1.55; }
.preference-memory li:last-child { border: 0; }
.preference-memory form { display: inline; margin-left: 8px; }
.text-button { padding: 2px 5px; border: 0; background: transparent; color: var(--danger); cursor: pointer; text-decoration: underline; }
.feedback-history { margin: 0; padding: 0 0 15px; list-style: none; }
.feedback-history li { display: grid; gap: 4px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.feedback-history span { color: var(--ink-3); line-height: 1.55; }
.actions { position: sticky; bottom: -100px; z-index: 10; display: flex; flex-wrap: wrap; gap: 8px; padding: 16px 0 0; background: linear-gradient(to bottom, transparent, var(--surface-2) 16px); }
.actions form { flex: 1 1 calc(50% - 4px); }
.actions button { width: 100%; min-height: 42px; padding: 8px 10px; }
.generate { position: sticky; bottom: -100px; z-index: 10; margin-top: 22px; padding-top: 14px; background: var(--surface-2); }
.generate label { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.generate select { width: auto; min-width: 140px; }
.generate button { width: 100%; }
.empty, .empty-inspector { padding: 54px 20px; color: var(--ink-4); text-align: center; }
.empty-inspector h2 { color: var(--ink); }
@media (max-width: 1220px) {
  .workspace { grid-template-columns: minmax(570px, 1fr) minmax(380px, 46%); }
  .queue, .inspector { padding-left: 22px; padding-right: 22px; }
  .utility-link { display: none; }
}
@media (max-width: 980px) {
  .workspace { display: block; }
  .inspector { position: static; height: auto; max-height: none; border-top: 1px solid var(--line); border-left: 0; }
}
@media (max-width: 720px) {
  body { font-size: 14px; padding-bottom: env(safe-area-inset-bottom); }
  .topbar { height: 64px; padding: 0 16px; gap: 10px; }
  .brand { font-size: 22px; }
  .subtitle, .guardrail { display: none; }
  .run-meta { min-width: 0; max-width: none; flex: 1; overflow: hidden; font-size: 11px; text-align: right; text-overflow: ellipsis; }
  .shell { display: block; min-height: calc(100vh - 64px); }
  .sidebar { position: sticky; top: 64px; z-index: 35; display: flex; width: 100%; height: 52px; gap: 3px; padding: 5px 10px; overflow-x: auto; overflow-y: hidden; border-right: 0; border-bottom: 1px solid var(--line); scrollbar-width: none; }
  .sidebar::-webkit-scrollbar { display: none; }
  .nav { flex: 0 0 auto; height: 42px; padding: 0 13px; white-space: nowrap; }
  .nav-icon { display: none; }
  .nav.active { border-bottom: 2px solid var(--accent); border-radius: 0; background: transparent; }
  .side-note { display: none; }
  .queue { padding: 18px 14px 26px; }
  .section-head { display: block; }
  .section-head h1 { font-size: 25px; }
  .section-head p { font-size: 13px; }
  .head-actions { display: grid; grid-template-columns: 1fr 1fr; margin-top: 16px; }
  .head-actions form, .head-actions button { width: 100%; }
  .head-actions button { padding: 8px 9px; font-size: 13px; }
  .utility-link { display: none; }
  .ops-grid { grid-template-columns: 1fr; }
  .op-card, .source-health, .batch-line { display: none; }
  .tabs { position: sticky; top: 116px; z-index: 20; justify-content: space-between; gap: 0; margin: 18px -14px 0; padding: 0 14px; background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(10px); }
  .tab { padding: 13px 4px; }
  .table-wrap { width: 100%; max-height: 292px; overflow-x: hidden; overflow-y: auto; border-bottom: 1px solid var(--line); scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
  table, tbody { display: block; width: 100%; max-width: 100%; white-space: normal; }
  thead { display: none; }
  tbody { border-top: 1px solid var(--line); }
  tbody tr { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; width: 100%; max-width: 100%; min-height: 72px; overflow: hidden; border-bottom: 1px solid var(--line); }
  tbody tr:hover { background: transparent; }
  tbody tr.selected { margin: 8px 0; border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line)); border-radius: var(--radius-card); background: var(--accent-softer); box-shadow: inset 4px 0 0 var(--accent); }
  tbody tr.selected td { background: transparent; }
  td { display: none; border: 0; background: transparent; }
  td:nth-child(1) { display: block; grid-column: 1; padding: 12px 6px 12px 13px; color: var(--ink-4); font-size: 16px; }
  td.topic-cell { display: block; grid-column: 2; min-width: 0; padding: 12px 8px; }
  td:nth-child(8) { display: block; grid-column: 3; padding: 12px 12px 12px 4px; }
  .topic { max-width: 100%; overflow: hidden; font-size: 14px; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-meta { display: flex; align-items: center; gap: 11px; margin-top: 5px; overflow: hidden; color: var(--ink-4); font-size: 11px; white-space: nowrap; }
  .mobile-meta b { color: var(--ink-2); }
  .status { font-size: 11px; }
  .inspector { margin-top: 8px; padding: 30px 16px 92px; border: 1px solid var(--line); border-right: 0; border-left: 0; border-radius: 24px 24px 0 0; background: var(--surface); box-shadow: 0 -5px 24px #202a300b; }
  .inspector::before { display: block; width: 44px; height: 5px; margin: -17px auto 22px; border-radius: 99px; background: var(--line-strong); content: ""; }
  .inspector-head h2 { font-size: 21px; }
  .source-list { max-height: 230px; overflow: auto; }
  .image-candidates { display: flex; gap: 10px; margin-right: -16px; padding-right: 16px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .image-candidates::-webkit-scrollbar { display: none; }
  .image-candidate { flex: 0 0 210px; scroll-snap-align: start; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .actions { position: fixed; right: 0; bottom: 0; left: 0; z-index: 60; display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; padding: 9px 10px calc(9px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 96%, transparent); box-shadow: 0 -6px 20px #202a3010; backdrop-filter: blur(12px); }
  .actions form { min-width: 0; }
  .actions button { min-height: 40px; padding: 7px 6px; font-size: 12px; }
  .generate { position: fixed; right: 0; bottom: 0; left: 0; z-index: 60; display: grid; grid-template-columns: minmax(118px, .85fr) minmax(0, 1.65fr); align-items: end; gap: 8px; margin: 0; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 96%, transparent); box-shadow: 0 -6px 20px #202a3010; backdrop-filter: blur(12px); }
  .generate label { display: grid; gap: 3px; margin: 0; color: var(--ink-4); font-size: 10px; line-height: 1.2; }
  .generate select { width: 100%; min-width: 0; height: 44px; padding: 6px 28px 6px 9px; background: var(--surface); color: var(--ink); font-size: 13px; }
  .generate button { min-width: 0; min-height: 44px; padding-right: 8px; padding-left: 8px; font-size: 13px; }
}
