* {
  box-sizing: border-box;
}

:root {
  /* Foundation tokens: use semantic names in shared components. */
  --color-primary: #1f5fbf;
  --color-primary-strong: #174f9e;
  --color-success: #0c8b6b;
  --color-warning: #b87900;
  --color-danger: #c93652;
  --color-text: #26384f;
  --color-text-strong: #0b2440;
  --color-muted: #667994;
  --color-surface: #ffffff;
  --color-surface-subtle: #f8fbff;
  --color-border: #dde8f3;
  --font-size-xs: 12px;
  --font-size-sm: 13px;
  --font-size-md: 14px;
  --font-size-lg: 20px;
  --font-size-xl: 24px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 28px;
  --space-8: 32px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-pill: 999px;
  --shadow-panel: 0 18px 48px -36px rgba(11, 36, 64, 0.34);
  --shadow-floating: 0 24px 64px rgba(15, 23, 42, 0.24);
  --focus-ring: 0 0 0 3px rgba(31, 95, 191, 0.14);
  --breakpoint-mobile: 760px;
  --breakpoint-tablet: 900px;
  --breakpoint-navigation: 1180px;
  --bg: #f6f9fc;
  --surface: var(--color-surface);
  --surface-strong: var(--color-surface-subtle);
  --line: var(--color-border);
  --line-strong: #b9cbe0;
  --text: var(--color-text);
  --text-strong: var(--color-text-strong);
  --muted: var(--color-muted);
  --muted-soft: #94a3b8;
  --blue: var(--color-primary);
  --indigo: #2f75d6;
  --green: var(--color-success);
  --amber: var(--color-warning);
  --red: var(--color-danger);
  --radius: var(--radius-md);
  --shadow: var(--shadow-panel);
  --glow: 0 16px 34px -28px rgba(31, 95, 191, 0.46);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

html {
  scroll-padding-top: 112px;
  scrollbar-color: rgba(148, 163, 184, 0.28) transparent;
  scrollbar-width: thin;
}

[id] {
  scroll-margin-top: 112px;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(180deg, #f8fbff 0%, #f6f9fc 48%, #eef5fb 100%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  letter-spacing: 0;
}

.ui-icon {
  width: 1em;
  height: 1em;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body::-webkit-scrollbar,
.result pre::-webkit-scrollbar,
.report::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

body::-webkit-scrollbar-track,
.result pre::-webkit-scrollbar-track,
.report::-webkit-scrollbar-track {
  background: transparent;
}

body::-webkit-scrollbar-thumb,
.result pre::-webkit-scrollbar-thumb,
.report::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.22);
}

.login-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 28px;
  background: linear-gradient(180deg, #f7fbff 0%, #eef6ff 100%);
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(340px, 440px);
  width: min(980px, 100%);
  min-height: 540px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.login-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 54px;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(15, 39, 66, 0.02) 0%, rgba(15, 39, 66, 0.18) 42%, rgba(15, 39, 66, 0.72) 100%),
    url("/static/login-hero-news-agent.png") center / cover no-repeat,
    #eef6ff;
}

.login-brand::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(18, 32, 68, 0) 0%, rgba(18, 32, 68, 0.18) 100%),
    radial-gradient(circle at 20% 18%, rgba(147, 197, 253, 0.18), transparent 28%);
}

.login-brand-copy {
  position: relative;
  z-index: 1;
  max-width: 680px;
}

.login-brand span,
.login-kicker {
  color: #bfdbfe;
  font-size: 12px;
  font-weight: 650;
}

.login-brand h1 {
  max-width: 520px;
  margin: 14px 0;
  color: var(--text-strong);
  font-size: 34px;
  line-height: 1.2;
}

.login-brand h1,
.login-brand p {
  color: #ffffff;
}

.login-brand p,
.login-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.login-panel {
  display: grid;
  align-content: center;
  gap: 26px;
  padding: 46px;
}

.login-panel h2 {
  margin: 8px 0;
  color: var(--text-strong);
  font-size: 24px;
}

.login-form {
  display: grid;
  gap: 18px;
}

.login-form label {
  display: grid;
  gap: 7px;
}

.login-form label span {
  color: var(--muted);
  font-size: 13px;
}

.login-form input {
  width: 100%;
  min-height: 44px;
}

.login-form button {
  width: 100%;
  min-height: 44px;
}

.login-error {
  padding: 11px 13px;
  border: 1px solid rgba(220, 56, 85, 0.24);
  border-radius: 8px;
  background: #fff1f3;
  color: #be123c;
  font-size: 13px;
}

.page {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 36px 32px 56px;
}

.toast {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  color: var(--text);
  box-shadow: var(--shadow);
}

.toast-success {
  border-color: rgba(15, 159, 122, 0.24);
  background: #ecfdf7;
  color: #047857;
}

.toast-error {
  border-color: rgba(220, 56, 85, 0.24);
  background: #fff1f3;
  color: #be123c;
}

.send-status {
  margin: -6px 0 18px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.5;
}

.send-status-success {
  border-color: rgba(15, 159, 122, 0.24);
  background: #ecfdf7;
  color: #047857;
}

.send-status-error {
  border-color: rgba(220, 56, 85, 0.24);
  background: #fff1f3;
  color: #be123c;
}

.daily-diagnosis {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.daily-diagnosis strong {
  display: block;
  color: var(--text-strong);
  font-size: 15px;
}

.daily-diagnosis p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.daily-diagnosis > span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 13px;
}

.diagnosis-ok {
  border-color: rgba(52, 211, 153, 0.24);
  background: rgba(16, 185, 129, 0.08);
}

.diagnosis-warn {
  border-color: rgba(251, 191, 36, 0.26);
  background: rgba(251, 191, 36, 0.08);
}

.readiness-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -6px 0 16px;
}

.readiness-list span {
  padding: 4px 8px;
  border: 1px solid rgba(201, 133, 0, 0.22);
  border-radius: 999px;
  color: #9a5f00;
  background: #fff7df;
  font-size: 12px;
}

.ops-overview {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 14px;
  margin: 18px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fbff;
}

.ops-score {
  display: grid;
  align-content: center;
  gap: 3px;
  min-height: 118px;
  padding: 14px;
  border: 1px solid #dbe7f3;
  border-radius: 10px;
  background: #ffffff;
}

.ops-score strong {
  color: var(--text-strong);
  font-size: 34px;
  line-height: 1;
}

.ops-score span,
.ops-score em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.ops-items {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.ops-item {
  min-height: 118px;
  padding: 12px;
  border: 1px solid #dbe7f3;
  border-radius: 10px;
  background: #ffffff;
}

.ops-item span,
.ops-item em {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.45;
}

.ops-item strong {
  display: block;
  margin: 5px 0;
  color: var(--text-strong);
  font-size: 14px;
}

.ops-item p {
  margin: 0 0 6px;
  color: var(--text);
  font-size: 12px;
  line-height: 1.45;
}

.ops-ok strong {
  color: var(--green);
}

.ops-warn strong {
  color: var(--amber);
}

.wechat-refresh-status {
  border-color: rgba(31, 95, 191, 0.2);
}

.wechat-refresh-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.wechat-refresh-grid > div,
.wechat-refresh-detail > div {
  min-width: 0;
  padding: 14px;
  border: 1px solid #dbe7f3;
  border-radius: 10px;
  background: #fff;
}

.wechat-refresh-grid span,
.wechat-refresh-detail span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.wechat-refresh-grid strong,
.wechat-refresh-detail strong {
  display: block;
  margin-top: 6px;
  color: var(--text-strong);
  font-size: 20px;
  line-height: 1.35;
}

.wechat-refresh-grid .status-ok strong {
  color: var(--green);
}

.wechat-refresh-grid .status-warn strong {
  color: var(--amber);
}

.wechat-refresh-detail {
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(0, 1.3fr);
  gap: 10px;
  margin-top: 10px;
}

.wechat-refresh-detail strong {
  font-size: 14px;
}

.wechat-refresh-detail p {
  margin: 6px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wechat-refresh-issues {
  margin-top: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(184, 121, 0, 0.24);
  border-radius: 10px;
  background: #fff8e8;
}

.wechat-refresh-issues > strong {
  color: var(--amber);
  font-size: 13px;
}

.wechat-refresh-issues div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.wechat-refresh-issues span {
  color: var(--text);
  font-size: 12px;
}

.grid.two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.panel {
  position: relative;
  overflow: hidden;
  margin-bottom: 22px;
  padding: 28px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(252, 254, 255, 0.98));
  border: 1px solid rgba(185, 203, 224, 0.72);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transform: none;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.panel:hover {
  border-color: rgba(31, 95, 191, 0.26);
  box-shadow: 0 24px 58px -42px rgba(11, 36, 64, 0.48);
}

.panel h2 {
  margin: 0 0 18px;
  color: var(--text-strong);
  font-size: 22px;
  font-weight: 650;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(221, 232, 243, 0.82);
}

.section-head h2 {
  margin-bottom: 8px;
}

.section-head p {
  max-width: 760px;
  margin: 0;
  color: #5f728d;
  font-size: 14px;
  line-height: 1.6;
}

.section-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  max-width: 620px;
}

.section-actions form {
  margin: 0;
}

.compact-head {
  margin-bottom: 12px;
}

.compact-head h3 {
  margin: 0 0 6px;
  color: var(--text-strong);
  font-size: 17px;
}

.workbench-basket {
  margin: 10px 0 18px;
}

.basket-preview-list {
  display: grid;
  gap: 10px;
}

.basket-preview-card {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
}

.basket-preview-index {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #eef6ff;
  color: var(--blue);
  font-size: 13px;
  font-weight: 650;
}

.basket-preview-body {
  min-width: 0;
}

.basket-preview-body h4 {
  margin: 0 0 5px;
  color: var(--text-strong);
  font-size: 15px;
  line-height: 1.45;
}

.basket-preview-body h4 a {
  color: inherit;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.basket-preview-body h4 a:hover {
  color: var(--blue);
}

.basket-preview-body p {
  margin: 8px 0 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.6;
}

.basket-preview-remove {
  justify-self: end;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}

.tag-list span {
  padding: 2px 8px;
  border: 1px solid #dbe7f3;
  border-radius: 999px;
  background: #ffffff;
  color: #52657e;
  font-size: 12px;
}

.empty-workbench {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 28px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: #f8fbff;
  color: var(--muted);
  text-align: center;
}

.empty-workbench p {
  margin: 0;
}

.stats,
.status-grid {
  display: grid;
  gap: 14px;
}

.stats {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: 22px;
}

.status-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.stats div,
.status-grid div {
  min-height: 92px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.stats div:hover,
.status-grid div:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow: var(--glow);
}

.stats div:nth-child(1),
.stats div:nth-child(3) {
  background: #eef6ff;
}

.stats div:nth-child(2),
.stats div:nth-child(4) {
  background: #ecfdf7;
}

.stats div:nth-child(5) {
  background: #fff7df;
}

.status-grid .status-ok {
  border-color: rgba(15, 159, 122, 0.24);
  background: #ecfdf7;
}

.status-grid .status-warn {
  border-color: rgba(201, 133, 0, 0.24);
  background: #fff7df;
}

.stats strong,
.status-grid strong {
  display: block;
  color: var(--text-strong);
  line-height: 1.1;
  font-weight: 650;
}

.stats strong {
  font-size: 28px;
}

.status-grid strong {
  font-size: 21px;
}

.stats span,
.status-grid span {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.actions form,
.inline-form {
  margin: 0;
}

input,
select,
textarea,
button {
  min-height: 38px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  padding: 9px 12px;
  font: inherit;
}

input,
select,
textarea {
  color: var(--text);
  background: #ffffff;
}

input::placeholder,
textarea::placeholder {
  color: var(--muted-soft);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(31, 95, 191, 0.78);
  box-shadow: var(--focus-ring);
}

textarea {
  width: 100%;
  min-width: 280px;
  resize: vertical;
  line-height: 1.6;
}

button,
.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 9px 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(31, 95, 191, 0.24);
  background: #f2f7ff;
  color: var(--blue);
  cursor: pointer;
  text-decoration: none;
  font-size: 14px;
  white-space: nowrap;
  transition:
    transform 0.22s var(--ease),
    border-color 0.22s var(--ease),
    background-color 0.22s var(--ease),
    color 0.22s var(--ease),
    box-shadow 0.22s var(--ease);
}

button:hover,
.link-button:hover {
  transform: translateY(-1px);
  border-color: rgba(31, 95, 191, 0.36);
  background: #e7f0ff;
  box-shadow: 0 14px 28px -22px rgba(31, 95, 191, 0.72);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
  box-shadow: none;
}

button:disabled:hover {
  transform: none;
  border-color: var(--line);
  background: #eef6ff;
  box-shadow: none;
}

.primary-action {
  min-width: 178px;
  border-color: transparent;
  background: linear-gradient(135deg, #1e5db6 0%, #347de0 100%);
  color: #ffffff;
  box-shadow: 0 18px 34px -24px rgba(31, 95, 191, 0.95);
}

.primary-action:hover,
button.primary-action:hover,
a.primary-action:hover {
  border-color: transparent;
  background: linear-gradient(135deg, #174f9e 0%, #286fcf 100%);
  color: #ffffff;
  box-shadow: 0 18px 36px -24px rgba(23, 79, 158, 1);
}

.secondary-button {
  border-color: var(--line);
  background: #ffffff;
  color: #39506c;
}

.restore-button {
  border-color: rgba(15, 159, 122, 0.28);
  background: #ecfdf7;
  color: #047857;
}

.danger-button {
  border-color: rgba(220, 56, 85, 0.26);
  background: #fff1f3;
  color: #be123c;
}

.danger-button:hover {
  border-color: rgba(251, 113, 133, 0.56);
  background: #ffe4e8;
  box-shadow: 0 10px 24px -16px rgba(244, 63, 94, 0.75);
}

.review-form {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) 78px auto;
  gap: 8px;
  align-items: center;
  min-width: 280px;
}

.review-form select,
.review-form input,
.review-form button {
  min-height: 34px;
  padding: 7px 9px;
  font-size: 13px;
}

.review-gate {
  display: grid;
  grid-template-columns: minmax(140px, 0.4fr) minmax(240px, 1fr) auto;
  gap: 12px;
}

.review-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.review-flow div {
  position: relative;
  min-height: 118px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
}

.review-flow div::after {
  content: "";
  position: absolute;
  top: 28px;
  right: -13px;
  width: 13px;
  height: 2px;
  background: var(--line-strong);
}

.review-flow div:last-child::after {
  display: none;
}

.review-flow strong,
.review-flow span {
  display: block;
}

.review-flow strong {
  color: var(--text-strong);
  font-size: 15px;
}

.review-flow span {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.review-flow div:nth-child(1),
.review-flow div:nth-child(3) {
  background: #eef6ff;
}

.review-flow div:nth-child(2) {
  background: #ecfdf7;
}

.review-flow div:nth-child(4) {
  background: #fff7df;
}

.review-tabs,
.review-tags,
.article-quick-actions,
.review-all-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.review-tabs {
  margin-bottom: 14px;
}

.review-tabs a,
.review-tags a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: #42566f;
  text-decoration: none;
  font-size: 13px;
  font-weight: 650;
}

.review-tabs a.active,
.review-tags a.active {
  border-color: rgba(37, 99, 235, 0.34);
  background: #eef6ff;
  color: #1d4ed8;
}

.review-tags span,
.review-all-form span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.review-all-form {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.article-quick-actions {
  margin: 10px 0 8px;
}

.article-quick-actions form {
  margin: 0;
}

.article-quick-actions button {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 13px;
}

.summary-form {
  display: grid;
  gap: 8px;
  min-width: 320px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.filter-grid,
.bulk-actions {
  display: grid;
  gap: 12px;
  align-items: center;
}

.filter-grid {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.filter-grid input:first-child {
  grid-column: span 2;
}

.bulk-actions {
  grid-template-columns: minmax(130px, 0.8fr) minmax(130px, 0.8fr) minmax(160px, 1fr) 110px auto;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.fold-section summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 42px;
  cursor: pointer;
  list-style: none;
}

.fold-section summary::-webkit-details-marker {
  display: none;
}

.fold-section summary span {
  color: var(--text-strong);
  font-size: 19px;
  font-weight: 650;
}

.fold-section summary em {
  color: var(--muted);
  font-style: normal;
  font-size: 13px;
  text-align: right;
}

.fold-section summary::after {
  content: "+";
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #42566f;
  background: #f8fbff;
}

.fold-section[open] summary {
  margin-bottom: 18px;
}

.fold-section[open] summary::after {
  content: "-";
}

.settings-grid label {
  display: grid;
  gap: 8px;
}

.settings-grid label span {
  color: var(--muted);
  font-size: 12px;
}

.settings-wide {
  grid-column: span 2;
}

.settings-note {
  grid-column: span 2;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.settings-actions {
  display: flex;
  align-items: end;
}

.category-manager {
  display: grid;
  gap: var(--space-5);
}

.category-list,
.historical-category-list {
  display: grid;
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.category-row,
.historical-category-row {
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) auto minmax(300px, auto);
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-strong);
}

.category-order {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 48px;
  color: var(--muted);
}

.category-drag-handle {
  font-size: 18px;
  letter-spacing: -4px;
}

.category-summary {
  display: grid;
  gap: var(--space-1);
  min-width: 0;
}

.category-summary strong {
  color: var(--text-strong);
  font-size: 15px;
}

.category-summary span,
.historical-categories-note {
  color: var(--muted);
  font-size: var(--font-size-sm);
  line-height: 1.6;
}

.category-count {
  white-space: nowrap;
  color: var(--muted);
  font-size: var(--font-size-sm);
}

.category-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.category-actions button {
  white-space: nowrap;
}

.category-editor {
  position: relative;
}

.category-editor > summary {
  cursor: pointer;
  list-style: none;
}

.category-editor > summary::-webkit-details-marker {
  display: none;
}

.category-edit-form,
.category-merge-form {
  z-index: 5;
  position: absolute;
  top: calc(100% + var(--space-2));
  right: 0;
  display: grid;
  gap: var(--space-3);
  width: min(420px, calc(100vw - 48px));
  padding: var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-floating);
}

.category-edit-form label,
.category-merge-form label,
.category-new-form label,
.category-target-form label {
  display: grid;
  gap: var(--space-2);
}

.category-edit-form label span,
.category-merge-form label span,
.category-new-form label span,
.category-target-form label span {
  color: var(--muted);
  font-size: var(--font-size-xs);
}

.category-new-form {
  display: grid;
  grid-template-columns: minmax(180px, 0.7fr) minmax(280px, 1.3fr) auto;
  align-items: end;
  gap: var(--space-4);
}

.historical-categories > summary {
  cursor: pointer;
  color: var(--text-strong);
  font-size: 18px;
  font-weight: 650;
}

.historical-categories-note {
  margin: var(--space-3) 0 var(--space-4);
}

.historical-category-row {
  grid-template-columns: minmax(220px, 1fr) minmax(260px, 0.9fr) auto;
}

.category-target-form {
  display: flex;
  align-items: end;
  gap: var(--space-2);
}

.historical-filter-drawer {
  display: grid;
  gap: var(--space-2);
  margin-top: var(--space-2);
  padding-top: var(--space-2);
  border-top: 1px solid var(--line);
}

.historical-filter-drawer > summary {
  cursor: pointer;
  color: var(--muted);
  font-size: var(--font-size-sm);
  font-weight: 650;
}

.hs-history-filter {
  align-self: end;
  min-width: 150px;
}

.hs-history-filter[open] {
  grid-column: 1 / -1;
}

.reclassification-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.6fr);
  gap: var(--space-5);
}

.reclassification-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}

.reclassification-form label,
.reclassification-estimate form,
.reclassification-estimate label {
  display: grid;
  gap: var(--space-2);
}

.reclassification-form label span,
.reclassification-estimate span,
.reclassification-estimate label span {
  color: var(--muted);
  font-size: var(--font-size-xs);
}

.reclassification-form .wide-field {
  grid-column: 1 / -1;
}

.reclassification-estimate {
  display: grid;
  align-content: start;
  gap: var(--space-3);
  padding: var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-strong);
}

.reclassification-estimate strong {
  color: var(--text-strong);
  font-size: 22px;
}

.reclassification-estimate p {
  margin: 0;
  color: var(--muted);
}

.migration-status-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--space-3);
}

.migration-status-grid > div {
  display: grid;
  gap: var(--space-1);
  padding: var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-strong);
}

.migration-status-grid strong {
  color: var(--text-strong);
  font-size: 18px;
}

.migration-status-grid span {
  color: var(--muted);
  font-size: var(--font-size-xs);
}

.migration-toolbar {
  display: flex;
  gap: var(--space-2);
  margin: var(--space-4) 0;
}

.migration-item-list,
.migration-run-list {
  display: grid;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.migration-item,
.migration-run-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.migration-item > div {
  display: grid;
  gap: var(--space-1);
}

.migration-item > div span,
.migration-run-row span {
  color: var(--muted);
  font-size: var(--font-size-xs);
}

.migration-item p,
.migration-review-form {
  grid-column: 1 / -1;
  margin: 0;
}

.migration-review-form {
  display: flex;
  gap: var(--space-2);
}

.migration-run-row {
  grid-template-columns: minmax(180px, 1fr) auto auto auto;
  color: inherit;
  text-decoration: none;
}

.migration-run-row:hover {
  border-color: var(--line-strong);
  background: var(--surface-strong);
}

.danger-text {
  color: var(--red);
}

@media (max-width: 1000px) {
  .reclassification-grid {
    grid-template-columns: 1fr;
  }

  .migration-status-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1000px) {
  .category-row,
  .historical-category-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .category-count {
    grid-column: 2;
  }

  .category-actions,
  .category-target-form {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .category-new-form {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 760px) {
  .reclassification-form,
  .migration-status-grid,
  .migration-item,
  .migration-run-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .migration-review-form {
    display: grid;
  }

  .category-row,
  .historical-category-row,
  .category-new-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .category-order,
  .category-count,
  .category-actions,
  .category-target-form {
    grid-column: 1;
  }

  .category-actions,
  .category-target-form {
    align-items: stretch;
  }

  .category-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .category-actions > form,
  .category-actions > details,
  .category-actions button {
    width: 100%;
  }

  .category-target-form {
    display: grid;
  }

  .category-edit-form,
  .category-merge-form {
    position: fixed;
    inset: auto 16px 16px;
    width: auto;
  }
}

.share-config {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 14px;
}

.share-config > div {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fbff;
}

.share-config span {
  color: var(--muted);
  font-size: 12px;
}

.share-config strong,
.share-config code {
  overflow-wrap: anywhere;
}

.share-config strong {
  color: var(--text-strong);
  font-size: 15px;
}

.share-config p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.check-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.check-list span {
  padding: 4px 8px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 999px;
  color: #42566f;
  background: #ffffff;
}

.share-url-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.share-config code {
  display: block;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: #1d4ed8;
  font-size: 12px;
  line-height: 1.45;
}

.share-settings-form {
  display: grid;
  gap: 8px;
}

.share-settings-form input,
.share-settings-form select,
.share-settings-form button {
  width: 100%;
}

.mini-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -8px 0 18px;
}

.mini-status-row span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--muted);
  font-size: 12px;
}

.mini-status-row .ok {
  color: #047857;
  border-color: rgba(15, 159, 122, 0.28);
}

.mini-status-row .warn {
  color: #9a5f00;
  border-color: rgba(201, 133, 0, 0.28);
}

.mini-status-row .error {
  color: #be123c;
  border-color: rgba(220, 56, 85, 0.28);
}

.source-action-list {
  display: grid;
  gap: 10px;
  margin: -2px 0 18px;
  padding: 12px;
  border: 1px solid rgba(201, 133, 0, 0.22);
  border-radius: 12px;
  background: #fff7df;
}

.source-action-list > strong {
  color: #9a5f00;
  font-size: 13px;
}

.source-action-item {
  display: grid;
  gap: 5px;
}

.source-action-item div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
}

.source-action-item span {
  color: var(--text);
  font-weight: 650;
}

.source-action-item em,
.source-action-item p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.5;
}

.table-edit-form {
  display: grid;
  grid-template-columns: minmax(130px, 1.1fr) minmax(110px, 0.8fr) minmax(100px, 0.8fr) minmax(90px, 0.6fr) minmax(180px, 1.4fr) minmax(120px, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.entity-edit-form {
  grid-template-columns: minmax(130px, 1.1fr) minmax(110px, 0.8fr) minmax(110px, 0.8fr) minmax(90px, 0.6fr) minmax(120px, 1fr) minmax(120px, 1fr) auto;
}

.table-edit-form input,
.table-edit-form select,
.table-edit-form button {
  min-height: 34px;
  padding: 7px 9px;
  font-size: 13px;
}

.row-actions,
.row-action-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.row-action-line {
  margin-top: 8px;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 10px;
  font-size: 13px;
}

th,
td {
  padding: 13px 12px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

tbody tr {
  background: #ffffff;
  border: 1px solid var(--line);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

tbody tr:hover {
  transform: translateY(-1px);
  background: #f8fbff;
  box-shadow: var(--glow);
}

tbody td:first-child {
  border-top-left-radius: 10px;
  border-bottom-left-radius: 10px;
}

tbody td:last-child {
  border-top-right-radius: 10px;
  border-bottom-right-radius: 10px;
}

td {
  color: var(--text);
  line-height: 1.6;
}

td:first-child,
td:nth-child(2) {
  color: var(--text);
}

td a {
  color: #1d4ed8;
  text-decoration: none;
}

td a:hover {
  color: #0f2742;
  text-decoration: underline;
}

.url {
  max-width: 300px;
  overflow-wrap: anywhere;
  color: var(--muted);
}

.muted-row {
  opacity: 0.48;
}

.meta-pill {
  display: inline-block;
  margin-left: 8px;
  padding: 3px 7px;
  border: 1px solid rgba(15, 159, 122, 0.22);
  border-radius: 999px;
  background: #ecfdf7;
  color: #047857;
  font-size: 12px;
  white-space: nowrap;
}

.meta-pill.pill-ok {
  border-color: rgba(15, 159, 122, 0.28);
  background: #ecfdf7;
  color: #047857;
}

.meta-pill.pill-error {
  border-color: rgba(220, 56, 85, 0.26);
  background: #fff1f3;
  color: #be123c;
}

.meta-pill.pill-warn {
  border-color: rgba(201, 133, 0, 0.28);
  background: #fff7df;
  color: #9a5f00;
}

.meta-pill.pill-neutral {
  border-color: #dbe7f3;
  background: #f8fbff;
  color: #64758b;
}

.small-meta,
.status-message {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.text-warn {
  color: #9a5f00;
}

.status-message {
  max-width: 360px;
}

.source-summary-stats {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  margin-bottom: 0;
}

.wechat-diagnostic {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(220px, 0.9fr) minmax(0, 1fr) auto;
  gap: 14px;
  align-items: stretch;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 8px;
  background: rgba(239, 246, 255, 0.72);
}

.wechat-diagnostic > div {
  padding: 2px 0;
}

.wechat-diagnostic span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  margin-bottom: 6px;
}

.wechat-diagnostic strong {
  display: block;
  color: var(--text-strong);
  font-size: 1rem;
  line-height: 1.35;
  word-break: break-word;
}

.wechat-diagnostic p,
.wechat-diagnostic em {
  display: block;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
  font-style: normal;
}

.wechat-diagnostic.wechat-ok {
  border-color: rgba(20, 184, 166, 0.22);
  background: rgba(240, 253, 250, 0.72);
}

.wechat-diagnostic.wechat-warn {
  border-color: rgba(245, 158, 11, 0.28);
  background: rgba(255, 251, 235, 0.78);
}

.wechat-diagnostic.wechat-failed {
  border-color: rgba(244, 63, 94, 0.26);
  background: rgba(255, 241, 242, 0.78);
}

.wechat-chip-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.wechat-chip-line b {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.22);
  color: var(--text-strong);
  font-size: 0.78rem;
  font-weight: 700;
}

.compact-source-actions {
  margin: 16px 0 0;
}

.source-filter-grid {
  margin-bottom: 14px;
}

.source-create-form {
  margin: 18px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.source-table-wrap {
  height: 680px;
  max-height: 72vh;
  overflow-x: auto;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.source-table {
  min-width: 980px;
  border-spacing: 0;
}

.source-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fbff;
}

.source-table tbody tr {
  box-shadow: inset 0 -1px 0 var(--line);
}

.source-table th:nth-child(1) {
  width: 30%;
}

.source-table th:nth-child(2),
.source-table th:nth-child(5),
.source-table th:nth-child(6) {
  width: 96px;
}

.source-table strong {
  color: var(--text-strong);
}

.source-needs-attention {
  box-shadow: inset 3px 0 0 rgba(201, 133, 0, 0.55);
}

.source-url {
  max-width: 420px;
  margin-top: 5px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-details summary {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
  color: #1d4ed8;
  cursor: pointer;
  font-size: 13px;
}

.source-details[open] summary {
  margin-bottom: 12px;
}

.source-edit-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 12px;
  min-width: 560px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fbff;
}

.source-edit-form label {
  display: grid;
  gap: 7px;
}

.source-edit-form label span {
  color: var(--muted);
  font-size: 12px;
}

.source-detail-note {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
}

.source-detail-note strong {
  color: var(--text-strong);
}

.source-detail-note p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.source-edit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.article-table .select-cell {
  width: 104px;
}

.select-all-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.article-title-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
  font-size: 15px;
  font-weight: 600;
}

.article-summary-preview {
  max-width: 980px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-details {
  margin-top: 8px;
}

.article-details summary {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
  color: #42566f;
  cursor: pointer;
  font-size: 13px;
}

.article-details[open] summary {
  margin-bottom: 12px;
  border-color: rgba(99, 102, 241, 0.35);
  color: #1d4ed8;
}

.article-edit-form {
  display: grid;
  gap: 12px;
}

.article-edit-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.article-edit-grid label {
  display: grid;
  gap: 7px;
}

.article-edit-grid label span {
  color: var(--muted);
  font-size: 12px;
}

.article-edit-grid input,
.article-edit-grid select,
.article-edit-grid textarea {
  min-width: 0;
}

.wide-field {
  grid-column: span 3;
}

.entity-layout {
  display: grid;
  grid-template-columns: minmax(260px, 360px) 1fr;
  gap: 18px;
}

.entity-layout > .panel {
  min-width: 0;
}

.entity-create-form {
  align-items: stretch;
}

.entity-list,
.compact-list {
  display: grid;
  gap: 10px;
}

.entity-list-item,
.compact-list a {
  display: grid;
  gap: 5px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-strong);
  color: var(--text);
  text-decoration: none;
}

.entity-list-item:hover,
.compact-list a:hover {
  border-color: var(--line-strong);
  background: #eef6ff;
}

.entity-list-item.active {
  border-color: rgba(37, 99, 235, 0.5);
  background: #edf5ff;
}

.entity-list-item strong,
.compact-list strong {
  color: var(--text-strong);
}

.entity-list-item span,
.entity-list-item small,
.compact-list span {
  color: var(--muted);
}

.entity-answer {
  margin-top: 18px;
}

.entity-card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 12px;
}

.entity-card {
  display: block;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-strong);
  color: var(--text);
  text-decoration: none;
  position: relative;
  transition: border-color 0.15s, background 0.15s;
}

.entity-card:hover {
  border-color: var(--line-strong);
  background: #eef6ff;
}

.entity-card.active {
  border-color: rgba(37, 99, 235, 0.5);
  background: #edf5ff;
}

.entity-card-name {
  font-weight: 600;
  color: var(--text-strong);
  margin-bottom: 4px;
  padding-right: 36px;
}

.entity-card-meta {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}

.entity-card-stats {
  font-size: 12px;
  color: var(--muted);
}

.entity-card-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  background: #d1fae5;
  color: #065f46;
  font-weight: 500;
}

@media (max-width: 900px) {
  .entity-card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Single-row application navigation */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  box-sizing: border-box;
  height: 72px;
  gap: 0;
  padding: 0 24px;
  border-bottom: 1px solid #dfe7ef;
  background: #ffffff;
}

.brand-lockup {
  min-width: 0;
  flex: 0 0 260px;
  margin-right: auto;
}

.topbar h1 {
  margin: 0;
  color: #0c2b4a;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.2;
}

.topbar p {
  margin: 3px 0 0;
  color: #5f7285;
  font-size: 10px;
  line-height: 1.2;
}

.app-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.nav-primary,
.nav-secondary {
  display: flex;
  align-items: center;
  gap: 2px;
}

.topbar .nav-primary-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  min-height: 38px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #405b76;
  box-shadow: none;
  font-size: 15px;
  font-weight: 400;
  line-height: 1;
  text-decoration: none;
  transform: none;
  white-space: nowrap;
}

.topbar .nav-primary-link:hover,
.topbar .nav-primary-link.active {
  border: 0;
  background: #eaf3ff;
  color: #1261b6;
  box-shadow: none;
  transform: none;
}

.topbar .nav-primary-link.active {
  font-weight: 700;
}

.topbar .nav-primary-link.active::after {
  position: absolute;
  right: 12px;
  bottom: -17px;
  left: 12px;
  height: 2px;
  background: #2c74c7;
  content: "";
}

.nav-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  margin-left: 4px;
  padding: 0 4px;
  border-radius: 999px;
  background: #edf2f7;
  color: #586d80;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.nav-divider {
  width: 1px;
  height: 24px;
  margin: 0 8px;
  background: #e0e8f0;
}

.nav-dropdown {
  position: relative;
  min-width: 0;
}

.topbar .nav-dropdown-trigger,
.topbar .nav-avatar-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  min-height: 36px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #516a82;
  box-shadow: none;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  transform: none;
  white-space: nowrap;
}

.topbar .nav-dropdown-trigger:hover,
.nav-dropdown.active > .nav-dropdown-trigger,
.nav-dropdown-trigger[aria-expanded="true"],
.topbar .nav-avatar-trigger:hover,
.nav-account.active > .nav-avatar-trigger,
.nav-avatar-trigger[aria-expanded="true"] {
  border-color: #bfd5ec;
  background: #f2f7fd;
  color: #175d9f;
  box-shadow: none;
  transform: none;
}

.nav-chevron {
  margin-left: 5px;
  color: #8295a8;
  font-size: 9px;
  line-height: 1;
}

.topbar .nav-avatar-trigger {
  width: 36px;
  padding: 0;
}

.nav-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #173f68;
  color: #ffffff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.nav-dropdown-panel {
  position: absolute;
  top: 44px;
  right: 0;
  z-index: 30;
  display: grid;
  width: 210px;
  padding: 8px;
  border: 1px solid #d5e1ec;
  border-radius: 11px;
  background: #ffffff;
  box-shadow: 0 16px 36px rgba(16, 45, 75, 0.18);
}

.nav-dropdown-panel[hidden] {
  display: none;
}

.nav-dropdown-title {
  display: block;
  padding: 8px 10px 6px;
  color: #5f7285;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.topbar .nav-dropdown-panel a,
.topbar .nav-dropdown-panel .nav-logout button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 34px;
  padding: 9px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #334f6a;
  box-shadow: none;
  font-size: 13px;
  line-height: 1.2;
  text-align: left;
  text-decoration: none;
  transform: none;
}

.topbar .nav-dropdown-panel a:hover,
.topbar .nav-dropdown-panel a.active,
.topbar .nav-dropdown-panel .nav-logout button:hover {
  border: 0;
  background: #eef5fc;
  color: #185f9f;
  box-shadow: none;
  transform: none;
}

.topbar .nav-dropdown-panel a.active {
  font-weight: 700;
}

.nav-dropdown-panel small {
  margin-left: 8px;
  color: #586d80;
  font-size: 11px;
  font-weight: 400;
  white-space: nowrap;
}

.nav-menu-divider {
  display: block;
  height: 1px;
  margin: 5px 6px;
  background: #e7edf3;
}

.nav-logout {
  width: 100%;
  margin: 0;
}

.topbar .nav-dropdown-panel .nav-logout button,
.topbar .nav-dropdown-panel .nav-logout button:hover {
  color: #b64747;
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: auto;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid #bfd0e0;
  border-radius: 8px;
  background: #ffffff;
  color: #274d70;
  box-shadow: none;
  font-size: 12px;
  font-weight: 700;
}

/* Human-first workbench */

.workbench-task-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.task-card {
  display: flex;
  min-width: 0;
  min-height: 210px;
  flex-direction: column;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 2px);
  background: var(--surface-strong);
}

.task-card-primary {
  border-color: rgba(31, 95, 191, 0.32);
  background: #f2f7ff;
}

.task-card > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.task-card > strong {
  margin-top: 10px;
  color: var(--text-strong);
  font-size: 30px;
  line-height: 1.1;
}

.task-card > p {
  flex: 1;
  margin: 12px 0 18px;
  color: var(--muted);
  line-height: 1.6;
}

.task-card .link-button {
  align-self: flex-start;
}

.operations-disclosure > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
  list-style: none;
}

.operations-disclosure > summary::-webkit-details-marker {
  display: none;
}

.operations-disclosure > summary span:first-child {
  display: grid;
  gap: 4px;
}

.operations-disclosure > summary strong {
  color: var(--text-strong);
  font-size: 18px;
}

.operations-disclosure > summary small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}

.disclosure-action {
  color: var(--blue);
  font-weight: 700;
}

.operations-disclosure[open] > summary {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 14px;
}

.pagination .page-indicator {
  color: var(--muted);
  font-size: 14px;
}

.pagination .disabled {
  opacity: 0.4;
  pointer-events: none;
}

@media (max-width: 1180px) {
  .topbar {
    align-items: center;
    height: auto;
    min-height: 72px;
    flex-wrap: wrap;
    padding: 12px 20px;
  }

  .brand-lockup {
    flex: 1 1 auto;
    margin-right: 0;
  }

  .nav-toggle {
    display: inline-flex;
    margin-left: auto;
  }

  .app-nav {
    display: none;
    width: 100%;
    align-items: stretch;
    flex: 1 0 100%;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #dfe7ef;
  }

  .app-nav.is-open {
    display: grid;
  }

  .nav-primary,
  .nav-secondary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .nav-divider {
    display: none;
  }

  .topbar .nav-primary-link,
  .topbar .nav-dropdown-trigger,
  .topbar .nav-avatar-trigger {
    justify-content: center;
    width: 100%;
    min-height: 42px;
    height: 42px;
    border: 1px solid #d5e1ec;
    background: #ffffff;
  }

  .topbar .nav-primary-link.active::after {
    display: none;
  }

  .nav-dropdown-panel {
    position: static;
    width: 100%;
    margin-top: 6px;
    box-shadow: none;
  }

  .nav-account {
    min-width: 0;
  }

  .nav-logout {
    width: 100%;
  }
}

@media (max-width: 760px) {
  .topbar {
    align-items: center;
    flex-direction: row;
    gap: 8px;
    padding: 12px 14px;
  }

  .brand-lockup {
    min-width: 0;
    flex: 1 1 auto;
  }

  .topbar h1 {
    overflow: hidden;
    font-size: 16px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .topbar p {
    display: none;
  }

  .nav-toggle {
    flex: 0 0 auto;
    margin-left: 0;
  }

  .app-nav {
    flex-basis: 100%;
    max-height: calc(100vh - 72px);
    overflow-x: hidden;
    overflow-y: auto;
  }

  .nav-primary,
  .nav-secondary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .nav-dropdown {
    min-width: 0;
  }

  .workbench-task-grid {
    grid-template-columns: 1fr;
  }

  .task-card {
    min-height: 0;
    padding: 16px;
  }

  .operations-disclosure > summary {
    align-items: flex-start;
    flex-direction: column;
  }
}

.toast-warning {
  border-color: rgba(217, 119, 6, 0.28);
  background: #fffbeb;
  color: #a16207;
}

.toast-close {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: currentColor;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.toast-close:hover,
.toast-close:focus-visible {
  background: rgba(15, 23, 42, 0.08);
}

.app-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.5);
}

.app-confirm-overlay[hidden] {
  display: none;
}

.app-confirm-dialog {
  width: min(440px, 100%);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.24);
}

.app-confirm-dialog h2 {
  margin: 0 0 10px;
  font-size: 20px;
}

.app-confirm-dialog p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.app-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

[data-row-href]:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.28);
  outline-offset: -3px;
}

@media (max-width: 520px) {
  .entity-card-grid {
    grid-template-columns: 1fr;
  }
}

.review-return-actions,
.final-report-form {
  margin-top: 12px;
}

.report-editor-details summary {
  cursor: pointer;
  color: var(--text-strong);
  font-weight: 650;
}

.report-edit-form {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.report-edit-form label {
  display: grid;
  gap: 7px;
}

.report-edit-form label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.report-edit-form textarea {
  min-height: 420px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.entity-refresh-form {
  margin-bottom: 14px;
}

.article-actions {
  display: flex;
  justify-content: flex-end;
}

.workflow-console {
  margin-top: 22px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  overflow: hidden;
}

.workflow-console-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
  background: #f8fbff;
}

.workflow-console-head strong,
.workflow-console-head span {
  display: block;
}

.workflow-console-head strong {
  color: var(--text-strong);
  font-size: 17px;
}

.workflow-console-head span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.workflow-track {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.workflow-track-5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.workflow-stage {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 250px;
  padding: 18px 14px;
  border-right: 1px solid var(--line);
  background: #ffffff;
}

.workflow-stage:last-child {
  border-right: 0;
}

.workflow-stage::after {
  content: "";
  position: absolute;
  top: 31px;
  left: 44px;
  right: -18px;
  height: 2px;
  background: var(--line);
  z-index: 0;
}

.workflow-stage:last-child::after {
  display: none;
}

.stage-marker {
  position: relative;
  z-index: 1;
  margin-bottom: 14px;
}

.stage-marker span {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid #bfd7ff;
  background: #ffffff;
  color: var(--blue);
  font-weight: 800;
}

.stage-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.stage-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.stage-topline strong {
  color: var(--text-strong);
  font-size: 15px;
}

.stage-topline em {
  flex: 0 0 auto;
  padding: 4px 7px;
  border-radius: 999px;
  background: #eef4ff;
  color: var(--blue);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}

.stage-body p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.stage-meta {
  margin-top: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f8fafc;
  color: var(--text);
  font-size: 12px;
  line-height: 1.4;
}

.stage-progress {
  --stage-progress: 0%;
  margin-top: 12px;
  display: grid;
  gap: 7px;
}

.stage-progress-bar {
  position: relative;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7edf7;
}

.stage-progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  display: block;
  width: var(--stage-progress);
  height: 100%;
  border-radius: inherit;
  background: #b8c7dc;
  transition: width 0.35s ease;
  will-change: width;
}

.stage-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
  white-space: nowrap;
}

.stage-progress-percent {
  color: var(--text-strong);
  font-weight: 800;
}

.stage-progress-timer {
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
}

.stage-live-message {
  margin-top: 10px;
  min-height: 34px;
  padding: 8px 10px;
  overflow: hidden;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #f8fbff;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  text-overflow: ellipsis;
}

.stage-action {
  margin-top: auto;
  padding-top: 14px;
}

.stage-action form {
  margin: 0;
}

.stage-action button,
.stage-action .link-button {
  width: 100%;
  justify-content: center;
  min-height: 38px;
}

.stage-success .stage-marker span {
  border-color: rgba(15, 159, 122, 0.4);
  background: #e9fbf5;
  color: var(--green);
}

.stage-success .stage-progress-fill {
  background: var(--green);
}

.stage-running {
  background: #f2f7ff;
}

.stage-running .stage-marker span {
  border-color: rgba(37, 99, 235, 0.45);
  background: #eaf2ff;
  color: var(--blue);
  box-shadow: 0 0 0 5px rgba(37, 99, 235, 0.08);
}

.stage-running .stage-progress-fill {
  background: var(--blue);
}

.stage-warning .stage-marker span,
.stage-skipped .stage-marker span {
  border-color: rgba(201, 133, 0, 0.38);
  background: #fff7df;
  color: var(--amber);
}

.stage-warning .stage-progress-fill,
.stage-skipped .stage-progress-fill {
  background: var(--amber);
}

.stage-failed .stage-marker span {
  border-color: rgba(220, 56, 85, 0.38);
  background: #fff1f3;
  color: var(--red);
}

.stage-failed .stage-progress-fill {
  background: var(--red);
}

.stage-success .stage-topline em {
  background: #e9fbf5;
  color: var(--green);
}

.stage-running .stage-topline em {
  background: #eaf2ff;
  color: var(--blue);
}

.stage-warning .stage-topline em,
.stage-skipped .stage-topline em {
  background: #fff7df;
  color: var(--amber);
}

.stage-failed .stage-topline em {
  background: #fff1f3;
  color: var(--red);
}

.result,
.run-card {
  margin-top: 20px;
  border-radius: 12px;
  overflow: hidden;
}

.result {
  border: 1px solid var(--line);
  background: #ffffff;
}

.run-card {
  padding: 18px;
  border: 1px solid rgba(99, 102, 241, 0.34);
  background: #f8fbff;
  box-shadow: 0 12px 30px -24px rgba(31, 95, 191, 0.8);
}

.run-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.run-head strong {
  display: block;
  color: var(--text-strong);
  font-size: 16px;
}

.run-head span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.step-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.step-list.compact {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.step-row {
  min-height: 112px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
}

.step-row b {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-bottom: 10px;
  border-radius: 999px;
  border: 1px solid rgba(31, 95, 191, 0.22);
  color: var(--blue);
  background: #f8fbff;
  font-size: 12px;
  font-weight: 800;
}

.step-row span,
.step-row em {
  display: block;
}

.step-row span {
  color: var(--text);
  font-weight: 600;
}

.step-row em {
  margin-top: 8px;
  width: fit-content;
  padding: 3px 7px;
  border-radius: 999px;
  background: #eef4ff;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}

.step-row small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.step-running {
  border-color: rgba(99, 102, 241, 0.46);
  background: #eef6ff;
}

.step-running em {
  color: var(--blue);
  background: #dbeafe;
}

.step-success {
  border-color: rgba(15, 159, 122, 0.28);
  background: #ecfdf7;
}

.step-success b,
.step-success em {
  color: #047857;
  border-color: rgba(15, 159, 122, 0.24);
  background: #d8f8ed;
}

.step-failed {
  border-color: rgba(220, 56, 85, 0.26);
  background: #fff1f3;
}

.step-failed b,
.step-failed em {
  color: #be123c;
  border-color: rgba(220, 56, 85, 0.22);
  background: #ffe4e8;
}

.step-warning {
  border-color: rgba(201, 133, 0, 0.28);
  background: #fff7df;
}

.step-warning b,
.step-warning em {
  color: #9a5f00;
  border-color: rgba(201, 133, 0, 0.24);
  background: #ffefbf;
}

.step-ready {
  border-color: rgba(37, 99, 235, 0.28);
  background: #eff6ff;
}

.step-ready b,
.step-ready em {
  color: var(--blue);
  border-color: rgba(37, 99, 235, 0.24);
  background: #dbeafe;
}

.step-skipped {
  border-color: rgba(148, 163, 184, 0.28);
  background: #f8fbff;
}

.result.success {
  border-color: rgba(52, 211, 153, 0.24);
}

.result.warning {
  border-color: rgba(251, 191, 36, 0.28);
}

.result.error {
  border-color: rgba(251, 113, 133, 0.28);
}

.result-title {
  padding: 12px 14px;
  color: var(--text);
  background: #f8fbff;
  font-weight: 650;
}

.result.success .result-title {
  color: #047857;
  background: #ecfdf7;
}

.result.warning .result-title {
  color: #9a5f00;
  background: #fff7df;
}

.result.error .result-title {
  color: #be123c;
  background: #fff1f3;
}

.result pre {
  max-height: 340px;
  margin: 0;
  padding: 14px;
  overflow: auto;
  color: #334155;
  white-space: pre-wrap;
  font: 12px/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.raw-log {
  border-top: 1px solid var(--line);
}

.raw-log summary {
  cursor: pointer;
  padding: 12px 14px;
  color: var(--muted);
  font-size: 13px;
}

.raw-log pre {
  border-top: 1px solid var(--line);
}

.report {
  max-height: calc(100vh - 220px);
  margin: 0;
  overflow: auto;
  color: #334155;
  white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.75;
}

.report-hero,
.report-shell {
  margin-bottom: 22px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.report-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 30px;
  border-radius: var(--radius);
  background: rgba(248, 250, 252, 0.96);
  color: #0f172a;
}

.report-hero h2 {
  margin: 12px 0 10px;
  font-size: 28px;
  line-height: 1.25;
  color: #0f172a;
}

.report-hero p {
  max-width: 720px;
  margin: 0;
  color: #475569;
  line-height: 1.65;
}

.report-shell {
  padding: 38px;
  border-radius: var(--radius);
  background: #f8fafc;
}

.report-digest {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.35fr);
  gap: 18px;
  margin-bottom: 22px;
}

.digest-card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(248, 250, 252, 0.96);
  color: #0f172a;
  box-shadow: var(--shadow);
}

.digest-card h3 {
  margin: 0 0 14px;
  color: #0f172a;
  font-size: 18px;
}

.digest-card ul,
.digest-card ol {
  margin: 0;
  padding-left: 20px;
}

.digest-card li {
  margin: 9px 0;
  color: #334155;
  line-height: 1.65;
}

.highlight-card li {
  padding-left: 4px;
}

.report-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 920px;
  margin: 0 auto 12px;
  color: #475569;
  font-size: 13px;
  font-weight: 650;
}

.report-column-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.report-column-nav span {
  padding: 4px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  color: #475569;
  background: #ffffff;
  font-size: 12px;
  font-weight: 500;
}

.report-readable {
  max-width: 920px;
  margin: 0 auto;
  padding: 34px 40px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 50px -36px rgba(15, 23, 42, 0.45);
}

.empty-text {
  color: var(--muted);
  line-height: 1.6;
}

@media (max-width: 1080px) {
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .status-grid,
  .step-list,
  .workflow-track {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workflow-stage:nth-child(2n) {
    border-right: 0;
  }

  .workflow-stage::after {
    display: none;
  }
}

@media (max-width: 900px) {
  [id] {
    scroll-margin-top: 280px;
  }

  .login-page {
    padding: 16px;
  }

  .login-shell {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .login-brand {
    min-height: 230px;
    padding: 32px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .login-brand h1 {
    font-size: 27px;
  }

  .login-panel {
    padding: 32px;
  }

  .page {
    padding: 24px 16px 40px;
  }

  .panel {
    padding: 22px;
  }

  .grid.two,
  .form-grid,
  .settings-grid,
  .share-config,
  .table-edit-form,
  .entity-edit-form,
  .entity-layout,
  .source-edit-form,
  .article-edit-grid,
  .review-flow,
  .review-gate,
  .stats,
  .status-grid,
  .ops-overview,
  .ops-items,
  .wechat-diagnostic,
  .trial-readiness-grid,
  .step-list,
  .workflow-track {
    grid-template-columns: 1fr;
  }

  .trial-readiness-head {
    flex-direction: column;
  }

  .workflow-console-head {
    align-items: stretch;
    flex-direction: column;
  }

  .workflow-stage {
    min-height: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .workflow-stage:last-child {
    border-bottom: 0;
  }

  .section-head {
    flex-direction: column;
  }

  .report-hero {
    flex-direction: column;
  }

  .report-digest {
    grid-template-columns: 1fr;
  }

  .report-shell {
    padding: 18px;
  }

  .report-readable {
    padding: 24px 18px;
  }

  .report-section-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .section-actions {
    justify-content: flex-start;
    max-width: 100%;
  }

  .settings-wide {
    grid-column: span 1;
  }

  .review-form {
    grid-template-columns: 1fr;
    min-width: 0;
  }

  .review-flow div::after {
    display: none;
  }

  .summary-form,
  textarea {
    min-width: 0;
  }

  .source-table {
    min-width: 860px;
  }

  .source-url {
    max-width: 280px;
  }

  .report-body {
    max-width: 100%;
  }
}

/* ================================================================
   Report Body — 简报正文渲染
   ================================================================ */

.report-body {
  max-width: 860px;
  font-family: Georgia, Cambria, "Times New Roman", Times, serif;
  font-size: 16px;
  line-height: 1.85;
  color: #1a1a2e;
}

.report-body * {
  min-width: 0;
}

.report-body h1 {
  margin: 0 0 32px;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0;
  color: #0f172a;
  border-bottom: 2px solid #1e3a8a;
  padding-bottom: 16px;
}

.report-body h2 {
  margin: 36px 0 16px;
  font-size: 22px;
  font-weight: 700;
  color: #1e3a8a;
  letter-spacing: 0;
}

.report-body h3 {
  margin: 24px 0 8px;
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
}

.report-body p {
  margin: 12px 0;
  color: #374151;
}

.report-body blockquote {
  margin: 16px 0;
  padding: 12px 20px;
  border-left: 3px solid #fde68a;
  background: #fefce8;
  color: #92400e;
  font-size: 14px;
  font-style: italic;
}

.report-body ul {
  margin: 8px 0;
  padding-left: 20px;
  list-style: none;
}

.report-body ul li {
  position: relative;
  padding: 4px 0 4px 16px;
  color: #374151;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.report-body ul li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: #94a3b8;
}

.report-body img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 16px 0;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
}

.report-body a {
  color: #1e3a8a;
  text-decoration: none;
  border-bottom: 1px solid #93c5fd;
  transition: border-color 0.2s ease;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* ================================================================
   UI Polish — 政务清爽蓝 + 克制微动效
   ================================================================ */

@keyframes surface-enter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse-ring {
  0% {
    box-shadow: 0 0 0 0 rgba(31, 95, 191, 0.2);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(31, 95, 191, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(31, 95, 191, 0);
  }
}

.page {
  padding-top: 34px;
}

.panel:nth-of-type(2) {
  animation-delay: 0.05s;
}

.panel:nth-of-type(3) {
  animation-delay: 0.1s;
}

.panel h2,
.section-head h2 {
  letter-spacing: 0;
}

.stats,
.status-grid {
  gap: 12px;
}

.stats div,
.status-grid div,
.ops-score,
.ops-item,
.review-flow div,
.step-row,
.share-config > div,
.entity-list-item,
.compact-list a {
  border-radius: 8px;
  border-color: rgba(221, 232, 243, 0.92);
  background: #ffffff;
  box-shadow: 0 12px 30px -28px rgba(11, 36, 64, 0.3);
}

.stats div:hover,
.status-grid div:hover,
.review-flow div:hover,
.entity-list-item:hover,
.compact-list a:hover {
  transform: translateY(-2px);
  border-color: rgba(31, 95, 191, 0.24);
  box-shadow: 0 18px 42px -32px rgba(31, 95, 191, 0.45);
}

.stats div:nth-child(1),
.stats div:nth-child(3),
.stats div:nth-child(5) {
  background:
    linear-gradient(180deg, #ffffff 0%, #f4f8ff 100%);
}

.stats div:nth-child(2),
.stats div:nth-child(4) {
  background:
    linear-gradient(180deg, #ffffff 0%, #f3fbf8 100%);
}

.stats strong,
.status-grid strong {
  color: #0c2d52;
  letter-spacing: 0;
}

.review-tabs a,
.review-tags a,
.article-details summary,
.source-details summary {
  transition:
    transform 0.22s var(--ease),
    border-color 0.22s var(--ease),
    background-color 0.22s var(--ease),
    color 0.22s var(--ease),
    box-shadow 0.22s var(--ease);
}

.review-gate button,
.bulk-actions button[type="submit"],
.report-edit-form button[type="submit"],
.entity-create-form button,
.table-edit-form button[type="submit"] {
  border-color: transparent;
  background: linear-gradient(135deg, #1e5db6 0%, #347de0 100%);
  color: #ffffff;
  box-shadow: 0 18px 34px -24px rgba(31, 95, 191, 0.95);
}

.review-gate button:hover,
.bulk-actions button[type="submit"]:hover,
.report-edit-form button[type="submit"]:hover,
.entity-create-form button:hover,
.table-edit-form button[type="submit"]:hover {
  border-color: transparent;
  background: linear-gradient(135deg, #174f9e 0%, #286fcf 100%);
  color: #ffffff;
  box-shadow: 0 18px 36px -24px rgba(23, 79, 158, 1);
}

.workflow-console {
  border-radius: 8px;
  border-color: rgba(185, 203, 224, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.workflow-console-head {
  background:
    linear-gradient(135deg, #f8fbff 0%, #eef5ff 100%);
}

.workflow-track {
  background: #ffffff;
}

.workflow-stage {
  background:
    linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  transition:
    background-color 0.28s var(--ease),
    transform 0.28s var(--ease);
}

.workflow-stage:hover {
  transform: translateY(-2px);
  background: #f7fbff;
}

.stage-marker span {
  border-color: rgba(31, 95, 191, 0.24);
  color: var(--blue);
}

.stage-running .stage-marker span {
  animation: pulse-ring 1.8s ease-out infinite;
}

.stage-topline em,
.meta-pill,
.review-tabs a,
.review-tags a,
.report-column-nav span {
  border-radius: 999px;
}

.stage-progress-bar {
  height: 7px;
  background: #e7eef8;
}

.stage-progress-fill {
  transition: width 0.45s var(--ease);
}

.review-flow div {
  background: #ffffff;
}

.review-flow div:nth-child(1),
.review-flow div:nth-child(3),
.review-flow div:nth-child(2),
.review-flow div:nth-child(4) {
  background:
    linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
}

.review-tabs a:hover,
.review-tags a:hover {
  transform: translateY(-1px);
  border-color: rgba(31, 95, 191, 0.28);
  background: #f2f7ff;
}

.review-tabs a.active,
.review-tags a.active {
  border-color: rgba(31, 95, 191, 0.36);
  background: #eaf3ff;
  color: var(--blue);
  box-shadow: inset 0 0 0 1px rgba(31, 95, 191, 0.08);
}

table {
  border-spacing: 0 8px;
}

th {
  color: #71839a;
  letter-spacing: 0;
  text-transform: none;
}

tbody tr {
  box-shadow: 0 10px 26px -26px rgba(11, 36, 64, 0.32);
}

tbody tr:hover {
  transform: translateY(-1px);
  background: #f7fbff;
  box-shadow: 0 16px 34px -30px rgba(31, 95, 191, 0.48);
}

.report-hero {
  border-color: rgba(185, 203, 224, 0.78);
  background:
    linear-gradient(135deg, #ffffff 0%, #f4f8ff 62%, #eef5ff 100%);
}

.report-hero h2 {
  color: #0b2440;
  letter-spacing: 0;
}

.report-shell,
.digest-card,
.report-readable {
  border-color: rgba(221, 232, 243, 0.94);
}

.report-shell {
  background:
    linear-gradient(180deg, #f8fbff 0%, #f4f7fb 100%);
}

.digest-card {
  border-radius: 8px;
  background: #ffffff;
}

.report-readable {
  border-radius: 8px;
  box-shadow: 0 22px 58px -42px rgba(11, 36, 64, 0.46);
}

.report-body {
  letter-spacing: 0;
}

.report-body h1,
.report-body h2 {
  letter-spacing: 0;
}

.toast,
.send-status,
.daily-diagnosis,
.source-action-list,
.result,
.run-card {
  border-radius: 8px;
}

.dashboard-hero,
.review-hero,
.ops-hero {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.99) 0%, rgba(248, 251, 255, 0.99) 100%);
}

.today-command,
.review-command-strip,
.ops-command-strip,
.report-review-summary {
  display: grid;
  gap: 12px;
  margin: 0 0 22px;
}

.today-command {
  grid-template-columns: minmax(0, 1.45fr) repeat(2, minmax(220px, 0.8fr));
}

.command-primary,
.command-secondary,
.review-command-strip > div,
.ops-command-strip > div,
.report-review-summary > div {
  min-width: 0;
  padding: 16px;
  border: 1px solid rgba(221, 232, 243, 0.96);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 14px 32px -30px rgba(11, 36, 64, 0.34);
}

.command-primary {
  background:
    linear-gradient(135deg, #f8fbff 0%, #eef5ff 100%);
  border-color: rgba(31, 95, 191, 0.2);
}

.command-ok {
  border-color: rgba(12, 139, 107, 0.22);
  background:
    linear-gradient(135deg, #ffffff 0%, #f1fbf8 100%);
}

.command-warn {
  border-color: rgba(184, 121, 0, 0.24);
  background:
    linear-gradient(135deg, #ffffff 0%, #fff8e8 100%);
}

.today-command span,
.review-command-strip span,
.ops-command-strip span,
.report-review-summary span {
  display: block;
  color: #71839a;
  font-size: 12px;
  font-weight: 700;
}

.today-command strong,
.review-command-strip strong,
.ops-command-strip strong,
.report-review-summary strong {
  display: block;
  margin-top: 7px;
  color: #0b2440;
  font-size: 18px;
  line-height: 1.35;
}

.command-primary strong {
  font-size: 22px;
}

.today-command p,
.ops-command-strip p,
.command-primary em {
  display: block;
  margin: 8px 0 0;
  color: #5f728d;
  font-size: 13px;
  font-style: normal;
  line-height: 1.55;
}

.trial-readiness {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 8px;
  background: rgba(248, 251, 255, 0.92);
}

.trial-readiness-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(221, 232, 243, 0.82);
}

.trial-readiness-head h3,
.trial-readiness-grid h4 {
  margin: 0;
  color: var(--text-strong);
}

.trial-readiness-head p {
  margin: 6px 0 0;
  color: var(--muted);
}

.trial-readiness-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.trial-readiness-grid h4 {
  margin-bottom: 10px;
  font-size: 15px;
}

.readiness-card {
  min-height: 106px;
  margin-top: 10px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.readiness-card span {
  display: inline-flex;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.readiness-card strong {
  display: block;
  color: var(--text-strong);
  font-size: 14px;
}

.readiness-card p,
.readiness-card em {
  display: block;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  font-style: normal;
}

.readiness-link {
  margin-top: 10px;
}

.readiness-ok {
  border-color: rgba(20, 184, 166, 0.22);
  background: rgba(240, 253, 250, 0.76);
}

.readiness-warn {
  border-color: rgba(245, 158, 11, 0.3);
  background: rgba(255, 251, 235, 0.82);
}

.today-command .link-button,
.review-command-strip .link-button {
  margin-top: 14px;
}

.review-command-strip {
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  align-items: stretch;
}

.review-flow-panel .review-flow {
  gap: 0;
}

.review-flow-panel .review-flow div {
  border-radius: 0;
  border-left-width: 0;
}

.review-flow-panel .review-flow div:first-child {
  border-left-width: 1px;
  border-top-left-radius: 8px;
  border-bottom-left-radius: 8px;
}

.review-flow-panel .review-flow div:last-child {
  border-top-right-radius: 8px;
  border-bottom-right-radius: 8px;
}

.review-filter-panel .section-head,
.review-bulk-panel .section-head,
.article-list-panel .section-head {
  margin-bottom: 16px;
}

.filter-grid {
  grid-template-columns: minmax(220px, 2fr) repeat(4, minmax(132px, 1fr));
}

.filter-grid input:first-child {
  grid-column: span 2;
}

.bulk-actions {
  grid-template-columns: minmax(150px, 0.9fr) minmax(140px, 0.8fr) minmax(160px, 1fr) minmax(112px, 0.7fr) minmax(180px, 1.1fr) auto;
}

.review-all-form {
  background: #fbfdff;
  border-top-color: rgba(221, 232, 243, 0.94);
}

.article-list-panel table {
  border-spacing: 0 12px;
}

.article-table .select-cell {
  width: 150px;
}

.article-table tbody tr {
  outline: 1px solid rgba(221, 232, 243, 0.92);
  outline-offset: -1px;
}

.article-table tbody tr:hover {
  outline-color: rgba(31, 95, 191, 0.24);
}

.article-title-line a {
  color: #0b2440;
}

.article-quick-actions {
  padding: 10px 0 2px;
}

.article-details summary:hover,
.source-details summary:hover {
  border-color: rgba(31, 95, 191, 0.28);
  background: #eef5ff;
  color: var(--blue);
}

.report-detail-hero {
  align-items: center;
}

.report-review-panel {
  background:
    linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.report-review-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.report-review-summary > div {
  padding: 14px 16px;
}

.report-review-summary strong {
  font-size: 17px;
}

.report-editor-panel details {
  padding: 14px;
  border: 1px solid rgba(221, 232, 243, 0.92);
  border-radius: 8px;
  background: #fbfdff;
}

.report-history {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(221, 232, 243, 0.9);
}

.report-history h3 {
  margin: 0 0 12px;
  color: var(--text-strong);
  font-size: 17px;
}

.history-list {
  display: grid;
  gap: 10px;
}

.history-item {
  display: grid;
  grid-template-columns: minmax(150px, 0.55fr) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: baseline;
  padding: 12px;
  border: 1px solid rgba(221, 232, 243, 0.94);
  border-radius: 8px;
  background: #ffffff;
}

.history-item span,
.history-item em,
.history-item p {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.history-item strong {
  color: var(--text-strong);
  font-size: 13px;
}

.history-item p {
  grid-column: 1 / -1;
  margin: 0;
  line-height: 1.5;
}

.quality-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.quality-item {
  padding: 12px;
  border: 1px solid rgba(221, 232, 243, 0.94);
  border-radius: 8px;
  background: #ffffff;
}

.quality-item span,
.quality-item p {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.quality-item strong {
  display: block;
  margin: 6px 0;
  color: var(--text-strong);
  font-size: 14px;
}

.quality-item p {
  margin: 0;
  line-height: 1.5;
}

.quality-ok {
  border-color: rgba(12, 139, 107, 0.22);
  background: #f3fbf8;
}

.quality-warn {
  border-color: rgba(184, 121, 0, 0.24);
  background: #fff8e8;
}

.quality-block {
  border-color: rgba(201, 54, 82, 0.24);
  background: #fff6f8;
}

.ops-command-strip {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ops-detail-toggle {
  margin-top: 16px;
}

.ops-detail-toggle summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 44px;
  padding: 0 0 14px;
  border-bottom: 1px solid rgba(221, 232, 243, 0.82);
  cursor: pointer;
  list-style: none;
}

.ops-detail-toggle summary::-webkit-details-marker {
  display: none;
}

.ops-detail-toggle summary span {
  color: var(--text-strong);
  font-size: 16px;
  font-weight: 700;
}

.ops-detail-toggle summary em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

.ops-detail-toggle .status-grid {
  margin-top: 16px;
}

@media (max-width: 900px) {
  .page {
    padding-top: 24px;
  }

  .panel {
    margin-bottom: 16px;
  }

  .section-head {
    gap: 14px;
    margin-bottom: 18px;
  }

  .stats div,
  .status-grid div {
    min-height: 86px;
  }

  .workflow-stage:hover,
  .panel:hover,
  .stats div:hover,
  .status-grid div:hover {
    transform: none;
  }

  .today-command,
  .review-command-strip,
  .ops-command-strip,
  .wechat-refresh-grid,
  .wechat-refresh-detail,
  .report-review-summary,
  .filter-grid,
  .bulk-actions {
    grid-template-columns: 1fr;
  }

  .review-command-strip .link-button {
    width: 100%;
  }

  .review-flow-panel .review-flow {
    gap: 10px;
  }

  .review-flow-panel .review-flow div,
  .review-flow-panel .review-flow div:first-child,
  .review-flow-panel .review-flow div:last-child {
    border-left-width: 1px;
    border-radius: 8px;
  }

  .filter-grid input:first-child {
    grid-column: span 1;
  }

  .article-table,
  .article-table thead,
  .article-table tbody,
  .article-table tr,
  .article-table th,
  .article-table td {
    display: block;
    width: 100%;
  }

  .article-table thead {
    display: none;
  }

  .article-table tr {
    padding: 14px;
    border-radius: 8px;
  }

  .article-table td {
    padding: 0;
  }

  .article-table .select-cell {
    width: 100%;
    margin-bottom: 12px;
  }

  .article-quick-actions form,
  .article-quick-actions button {
    width: 100%;
  }

  .report-detail-hero .section-actions,
  .report-detail-hero .section-actions .link-button {
    width: 100%;
  }

  .history-item {
    grid-template-columns: 1fr;
  }

  .quality-list {
    grid-template-columns: 1fr;
  }

  .ops-detail-toggle summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .daily-diagnosis {
    align-items: stretch;
    flex-direction: column;
  }

  .daily-diagnosis .link-button {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .page {
    padding-inline: 16px;
  }
}

@media (max-width: 760px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  .panel {
    padding: 18px;
  }

  .section-head,
  .report-hero,
  .hs-card-foot,
  .basket-preview-card,
  .basket-head {
    align-items: stretch;
    flex-direction: column;
  }

  .section-actions,
  .section-actions .link-button,
  .section-actions form,
  .section-actions button,
  .settings-actions,
  .settings-actions button,
  .primary-action,
  .link-button {
    width: 100%;
  }

  .source-table-wrap,
  .directory-table-wrap,
  .panel > table,
  table {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .panel > table th,
  .panel > table td,
  table th,
  table td {
    min-width: 108px;
    white-space: nowrap;
  }

  .settings-grid,
  .review-gate,
  .report-edit-form,
  .inline-form {
    grid-template-columns: 1fr;
  }

  .inline-form,
  .inline-form input,
  .inline-form button {
    width: 100%;
  }

  .hs-form,
  .hs-actions,
  .basket-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .hs-form label,
  .hs-form input,
  .hs-form select,
  .hs-form button,
  .hs-actions button,
  .basket-actions form,
  .basket-actions button {
    width: 100%;
  }

  .basket-preview-card {
    display: grid;
    grid-template-columns: 1fr;
  }

  .basket-preview-index {
    place-self: start;
  }

  .basket-preview-remove,
  .basket-preview-remove button {
    width: 100%;
  }

  .hs-card-head {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .hs-card-title,
  .basket-card h3 a {
    overflow-wrap: anywhere;
  }

  .report {
    max-width: 100%;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}

.report-body a:hover {
  border-bottom-color: #1e3a8a;
}

.report-body strong {
  color: #0f172a;
  font-weight: 650;
}

[id] {
  scroll-margin-top: 112px;
}

.source-create-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.source-create-split .source-create-form {
  align-content: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
}

.source-create-form h3 {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--ink);
  font-size: 17px;
}

.source-mode-help {
  grid-column: 1 / -1;
  line-height: 1.6;
}

@media (max-width: 900px) {
  .source-create-split {
    grid-template-columns: 1fr;
  }
}

.kb-query-shell {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 8px 10px 8px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}
.kb-query-shell svg,
.directory-search svg,
.source-icon svg,
.page-link svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.kb-query-icon {
  display: inline-flex;
  color: var(--muted);
  flex: 0 0 auto;
}
.kb-query-shell .kb-search-input {
  flex: 1;
  min-width: 180px;
  height: 44px;
  border: 0;
  padding: 0;
  font-size: 15px;
  outline: none;
  background: transparent;
}
.kb-query-shell select {
  height: 40px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  outline: none;
}
.kb-query-divider {
  width: 1px;
  height: 28px;
  background: var(--line);
  flex: 0 0 auto;
}
.kb-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}
.kb-examples a,
.category-tab {
  border-radius: 999px;
  text-decoration: none;
}
.kb-examples a {
  padding: 6px 10px;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 600;
}
.category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 4px 0 16px;
}
.category-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 13px;
  background: #f1f5f9;
  color: var(--text);
  font-weight: 700;
}
.category-tab em {
  font-style: normal;
  color: var(--muted);
  font-weight: 600;
}
.category-tab.active {
  background: #2563eb;
  color: #fff;
}
.category-tab.active em {
  color: rgba(255, 255, 255, 0.82);
}
.directory-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 160px auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}
.directory-search {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--muted);
}
.directory-search input {
  width: 100%;
  border: 0;
  outline: none;
  color: var(--text);
  background: transparent;
}
.directory-table-wrap {
  overflow-x: auto;
}
.directory-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 13px;
}
.directory-table thead tr {
  background: var(--surface-strong);
  color: var(--muted);
  text-align: left;
}
.directory-table th { padding: 8px 10px; font-weight: 500; }
.directory-table th.num, .directory-table td.num { text-align: right; }
.directory-table tbody tr {
  border-top: 1px solid var(--line);
  cursor: pointer;
}
.directory-table tbody tr:hover,
.directory-table tbody tr.active {
  background: #eff6ff;
}
.directory-table td {
  padding: 9px 10px;
  vertical-align: middle;
}
.directory-table td strong {
  display: block;
  color: var(--text-strong);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.directory-table td small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.src-cell {
  display: flex;
  gap: 6px;
  align-items: center;
}
.source-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #eff6ff;
  color: #2563eb;
}
.industry-chip {
  display: inline-flex;
  max-width: 100%;
  padding: 5px 9px;
  border-radius: 999px;
  background: #f8fafc;
  color: #334155;
  font-size: 12px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.directory-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
}
.page-links {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.page-link,
.page-number,
.page-ellipsis {
  min-width: 34px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 9px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  background: #f8fafc;
}
.page-number.active {
  color: #fff;
  background: #2563eb;
}
.page-link.disabled {
  opacity: 0.42;
  pointer-events: none;
}
.source-with-action {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
}
.source-with-action > a { flex: 1; }

@media (max-width: 900px) {
  .kb-query-shell {
    align-items: stretch;
    flex-wrap: wrap;
  }
  .kb-query-shell .kb-search-input {
    flex-basis: calc(100% - 32px);
  }
  .kb-query-divider {
    display: none;
  }
  .directory-toolbar {
    grid-template-columns: 1fr;
  }
  .directory-pagination {
    align-items: flex-start;
    flex-direction: column;
  }
  .page-links {
    justify-content: flex-start;
  }
}

/* Page-specific styles moved from templates (T16). */

.flex-spacer { flex:1; }
.compact-sidebar { padding:12px 10px; }
.compact-danger-action { padding:2px 8px 4px; }
.centered-reset { display:block; text-align:center; font-size:var(--font-size-xs); }
.card-select { flex-shrink:0; margin-top:2px; }
.ai-reason { color:#0369a1; }
.article-edit-form-spaced { margin-top:var(--space-2); }
.empty-panel { padding:40px; color:var(--muted); text-align:center; }
.bulk-select-label { display:flex; align-items:center; flex-shrink:0; gap:6px; font-size:var(--font-size-sm); cursor:pointer; }
.source-status-note { margin:0 0 10px; }
.source-contact-note { margin:0 0 8px; }
.wf-row-muted { color:var(--muted); }

/* articles.html block 1 */
/* ── 顶部栏 ── */
.rv-topbar { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:16px; }
.rv-topbar h2 { margin:0; font-size:20px; font-weight:500; }
.rv-chip { font-size:12px; padding:3px 10px; border-radius:999px; border:1px solid var(--line,#e2e8f0); color:var(--muted,#64748b); }
.rv-chip.blue { background:#eff6ff; border-color:#bfdbfe; color:#1d4ed8; font-weight:500; }
.rv-chip.green { background:#f0fdf4; border-color:#bbf7d0; color:#15803d; font-weight:500; }

/* ── 三栏布局 ── */
.rv-layout { display:flex; gap:16px; align-items:flex-start; }
.rv-sidebar { width:176px; flex-shrink:0; position:sticky; top:68px; max-height:calc(100vh - 84px); overflow-y:auto; padding-bottom:24px; }
.rv-main { flex:1; min-width:0; }

/* ── 左侧控制栏 ── */
.rv-sidebar-section { margin-bottom:16px; }
.rv-sidebar-label { font-size:11px; font-weight:600; color:var(--muted,#64748b); text-transform:uppercase; letter-spacing:.05em; padding:0 6px; margin-bottom:4px; display:block; }
.rv-filter-btn { display:flex; align-items:center; justify-content:space-between; width:100%; padding:5px 8px; border-radius:6px; font-size:13px; color:var(--text,#1e293b); text-decoration:none; background:none; border:none; cursor:pointer; line-height:1.4; }
.rv-filter-btn:hover { background:var(--hover,#f1f5f9); }
.rv-filter-btn.active { background:#eff6ff; color:#1d4ed8; font-weight:500; }
.rv-count { font-size:11px; padding:1px 6px; border-radius:999px; flex-shrink:0; }
.rv-count.green { background:#dcfce7; color:#15803d; }
.rv-count.red { background:#fee2e2; color:#b91c1c; }
.rv-count.gray { background:var(--surface,#f1f5f9); color:var(--muted,#64748b); }
.rv-sidebar-divider { border:none; border-top:1px solid var(--line,#e2e8f0); margin:10px 0; }
.rv-search-form { display:flex; flex-direction:column; gap:6px; padding:0 2px; }
.rv-search-form input,
.rv-search-form select { width:100%; font-size:12px; padding:5px 8px; border-radius:6px; border:1px solid var(--line,#e2e8f0); background:var(--card-bg,#fff); color:var(--text,#1e293b); box-sizing:border-box; }
.rv-search-form button { font-size:12px; padding:5px 0; border-radius:6px; background:#2563eb; color:#fff; border:none; cursor:pointer; width:100%; }
.rv-search-form button:hover { background:#1d4ed8; }
.rv-one-click { font-size:11px; color:#b91c1c; text-decoration:none; margin-left:4px; padding:0; border:0; background:none; cursor:pointer; }
.rv-one-click:hover { text-decoration:underline; }
.rv-b10-hint { font-size:11px; color:var(--muted,#64748b); padding:0 6px; line-height:1.5; margin:0; }

/* ── 文章卡片 ── */
.rv-card { border:1px solid var(--line,#e2e8f0); border-radius:8px; padding:11px 14px 10px; margin-bottom:8px; background:var(--card-bg,#fff); }
.rv-card.rec-recommended { border-left:3px solid #16a34a; padding-left:12px; }
.rv-card.rec-excluded { border-left:3px solid #d97706; padding-left:12px; }
.rv-card.row-reviewed { background:var(--surface,#f8fafc); }
.rv-card-header { display:flex; align-items:baseline; gap:7px; margin-bottom:3px; flex-wrap:wrap; }
.rv-card-seq { font-size:12px; font-weight:500; color:var(--muted,#64748b); flex-shrink:0; min-width:20px; }
.rv-card-title { font-size:14px; font-weight:500; color:var(--text,#1e293b); text-decoration:none; flex:1; line-height:1.4; min-width:0; }
.rv-card-title:hover { text-decoration:underline; }
.rv-ai-badge { font-size:11px; padding:1px 6px; border-radius:999px; background:#dcfce7; color:#15803d; flex-shrink:0; }
.rv-ai-badge.excluded { background:#fee2e2; color:#b91c1c; }
.rv-reviewed-badge { font-size:11px; background:var(--surface,#f1f5f9); color:var(--muted,#64748b); border-radius:6px; padding:1px 7px; flex-shrink:0; }
.rv-decision-state { display:flex; flex-wrap:wrap; gap:6px; margin:7px 0; }
.rv-decision-state span { padding:3px 8px; border:1px solid var(--line,#e2e8f0); border-radius:999px; font-size:11px; }
.rv-decision-state .pill-ok { border-color:#bbf7d0; background:#f0fdf4; color:#15803d; }
.rv-decision-state .pill-warn { border-color:#fde68a; background:#fffbeb; color:#a16207; }
.rv-decision-state .pill-error { border-color:#fecdd3; background:#fff1f2; color:#be123c; }
.rv-decision-state .pill-neutral { background:#f8fafc; color:#475569; }
.rv-tag-list { display:flex; gap:6px; flex-wrap:wrap; margin:5px 0 3px; }
.rv-tag { font-size:11px; padding:2px 8px; border-radius:999px; background:#f8fafc; border:1px solid #dbe3ef; color:#475569; text-decoration:none; line-height:1.35; }
.rv-tag:hover { background:#eff6ff; border-color:#93c5fd; color:#1d4ed8; }
.rv-card-summary { font-size:12px; color:var(--muted,#64748b); margin:3px 0 6px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.rv-card-footer { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.rv-card-meta { font-size:12px; color:var(--muted,#64748b); flex:1; min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.rv-card-actions { display:flex; gap:5px; flex-shrink:0; }
.rv-card-actions form { margin:0; }
.rv-btn-approve { font-size:12px; padding:3px 10px; border-radius:6px; background:#f0fdf4; border:1px solid #bbf7d0; color:#15803d; cursor:pointer; white-space:nowrap; }
.rv-btn-approve:hover { background:#dcfce7; }
.rv-btn-pass { font-size:12px; padding:3px 10px; border-radius:6px; background:var(--surface,#f8fafc); border:1px solid var(--line,#e2e8f0); color:var(--text,#1e293b); cursor:pointer; white-space:nowrap; }
.rv-btn-pass:hover { background:var(--hover,#f1f5f9); }
.rv-btn-reject { font-size:12px; padding:3px 10px; border-radius:6px; background:#fff1f2; border:1px solid #fecdd3; color:#be123c; cursor:pointer; white-space:nowrap; }
.rv-btn-reject:hover { background:#ffe4e6; }
.rv-card-edit { margin-top:8px; border-top:1px solid var(--line,#e2e8f0); padding-top:8px; }
.rv-card-edit > summary { font-size:12px; color:var(--muted,#64748b); cursor:pointer; user-select:none; }
.field-hint { display:block; margin-top:4px; font-size:11px; line-height:1.4; color:var(--muted,#64748b); }
.article-tag-editor { border:1px solid var(--line,#e2e8f0); border-radius:8px; background:#fff; padding:10px; }
.article-tag-editor-title { display:block; font-size:11px; font-weight:600; color:#64748b; margin:0 0 6px; }
.article-tag-current { display:flex; flex-wrap:wrap; gap:7px; min-height:30px; margin-bottom:10px; }
.article-tag-empty { font-size:12px; color:#94a3b8; padding:5px 0; }
.article-tag-pill { display:inline-flex; align-items:center; gap:7px; border:1px solid #bfdbfe; background:#eff6ff; color:#1d4ed8; border-radius:999px; padding:5px 6px 5px 10px; font-size:12px; cursor:default; line-height:1.3; }
.article-tag-pill:hover { background:#dbeafe; border-color:#93c5fd; }
.article-tag-pill-remove { display:inline-flex; align-items:center; justify-content:center; width:16px; height:16px; border-radius:999px; border:0; background:rgba(37,99,235,.1); color:#2563eb; font-size:12px; line-height:1; cursor:pointer; padding:0; }
.article-tag-pill-remove:hover { background:#fee2e2; color:#be123c; }
.article-tag-add-row { display:grid; grid-template-columns:minmax(160px,1fr) auto; gap:8px; }
.article-tag-add-row input { width:100%; }
.article-tag-add-row button { border:1px solid #bfdbfe; background:#eff6ff; color:#1d4ed8; border-radius:6px; padding:5px 12px; cursor:pointer; white-space:nowrap; }
.article-tag-add-row button:hover { background:#dbeafe; }
.article-tag-suggestions { display:flex; flex-wrap:wrap; gap:7px; margin-top:7px; max-height:105px; overflow-y:auto; padding-right:4px; }
.article-tag-suggestion-title { display:block; font-size:11px; font-weight:600; color:#64748b; margin:8px 0 0; }
.tag-chip { display:inline-flex; align-items:center; border:1px solid #dbe3ef; background:#f8fafc; color:#475569; border-radius:999px; overflow:hidden; }
.tag-chip-button { border:0; background:transparent; color:inherit; padding:4px 8px 4px 10px; font-size:11px; cursor:pointer; line-height:1.4; }
.tag-chip-remove { border:0; border-left:1px solid #e2e8f0; background:transparent; color:#94a3b8; width:22px; align-self:stretch; cursor:pointer; font-size:12px; line-height:1; }
.tag-chip:hover { background:#eff6ff; border-color:#93c5fd; color:#1d4ed8; }
.tag-chip-remove:hover { background:#fee2e2; color:#be123c; border-left-color:#fecdd3; }

/* ── 批量浮动栏 ── */
.rv-bulk-float { position:fixed; bottom:0; left:0; right:0; background:var(--card-bg,#fff); border-top:1px solid var(--line,#e2e8f0); padding:10px 24px; display:none; align-items:center; gap:12px; z-index:200; box-shadow:0 -2px 8px rgba(0,0,0,.08); }
.rv-bulk-float.visible { display:flex; }
.rv-bulk-count { font-size:13px; color:var(--muted,#64748b); white-space:nowrap; }
.rv-bulk-spacer { flex:1; }

/* ── 确认对话框 ── */
.rv-confirm-overlay { position:fixed; inset:0; background:rgba(0,0,0,.35); z-index:300; display:none; align-items:center; justify-content:center; }
.rv-confirm-overlay.visible { display:flex; }
.rv-confirm-box { background:var(--card-bg,#fff); border-radius:12px; padding:24px 28px; max-width:400px; width:90%; border:1px solid var(--line,#e2e8f0); }
.rv-confirm-box h3 { margin:0 0 10px; font-size:16px; font-weight:500; }
.rv-confirm-box p { font-size:14px; color:var(--muted,#64748b); margin:0 0 20px; line-height:1.6; }
.rv-confirm-actions { display:flex; gap:8px; justify-content:flex-end; }
.rv-confirm-actions form { margin:0; }

@media (max-width: 768px) {
  .rv-layout { flex-direction:column; }
  .rv-sidebar { width:100%; position:static; max-height:none; }
  .rv-main { width:100%; max-width:100%; }
  .rv-card-footer { align-items:stretch; }
  .rv-card-meta { flex-basis:100%; }
  .rv-card-actions { display:grid; grid-template-columns:1fr; width:100%; }
  .rv-card-actions form,
  .rv-card-actions button { width:100%; }
  .rv-card-actions button { min-height:36px; white-space:normal; }
  .rv-bulk-float { flex-wrap:wrap; padding:10px 16px; }
  .rv-bulk-spacer { display:none; }
}


/* feedback.html block 1 */
.feedback-shell { display:grid; gap:18px; }
.feedback-form-grid { display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:12px; }
.feedback-form-grid label { display:flex; flex-direction:column; gap:6px; color:var(--muted,#64748b); font-size:12px; }
.feedback-form-grid input,
.feedback-form-grid select,
.feedback-form-grid textarea { width:100%; box-sizing:border-box; border:1px solid var(--line,#dbe3ef); border-radius:8px; padding:10px 12px; background:#fff; color:var(--text,#0f172a); font-size:14px; }
.feedback-form-grid textarea { min-height:138px; resize:vertical; }
.feedback-wide { grid-column:1 / -1; }
.feedback-screenshot-row { display:grid; grid-template-columns:minmax(0, 1fr) minmax(0, 1fr); gap:12px; }
.feedback-file-input { border:1px dashed #bfdbfe !important; background:#f8fbff !important; }
.feedback-actions { display:flex; justify-content:flex-end; margin-top:14px; }
.feedback-list { display:grid; gap:12px; }
.feedback-card { display:grid; grid-template-columns:minmax(0, 1fr) 220px; gap:14px; border:1px solid var(--line,#dbe3ef); border-radius:8px; padding:14px; background:#fff; }
.feedback-card-main { min-width:0; display:grid; gap:10px; }
.feedback-card-head { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.feedback-role { color:#0f172a; font-weight:700; }
.feedback-page-pill { display:inline-flex; align-items:center; min-height:24px; padding:0 9px; border-radius:999px; background:#eff6ff; color:#1d4ed8; font-size:12px; }
.feedback-content { color:#334155; font-size:14px; line-height:1.65; white-space:pre-wrap; }
.feedback-meta { display:flex; gap:10px; flex-wrap:wrap; color:#64748b; font-size:12px; }
.feedback-side { display:grid; gap:10px; align-content:start; }
.feedback-thumb { display:block; border:1px solid #dbe3ef; border-radius:8px; overflow:hidden; background:#f8fafc; text-decoration:none; }
.feedback-thumb img { display:block; width:100%; max-height:150px; object-fit:cover; }
.feedback-thumb span { display:block; padding:9px 10px; color:#2563eb; font-size:12px; word-break:break-all; }
.feedback-status-form { display:grid; grid-template-columns:minmax(0, 1fr) auto; gap:8px; align-items:center; }
.feedback-status-form select { min-width:0; border:1px solid var(--line,#dbe3ef); border-radius:7px; padding:8px 9px; background:#fff; }
.feedback-empty { padding:34px; border:1px dashed #bfdbfe; border-radius:8px; color:#64748b; text-align:center; background:#f8fbff; }
@media (max-width: 900px) {
  .feedback-form-grid,
  .feedback-screenshot-row,
  .feedback-card { grid-template-columns:1fr; }
  .feedback-actions { justify-content:stretch; }
  .feedback-actions button { width:100%; }
}


/* history.html block 1 */
.hs-top { display:flex; align-items:baseline; gap:10px; flex-wrap:wrap; margin-bottom:12px; }
.hs-top h2 { margin:0; font-size:20px; font-weight:500; }
.hs-count { font-size:13px; color:var(--muted,#64748b); }
.hs-form { display:flex; gap:8px; flex-wrap:wrap; align-items:flex-end; margin-bottom:14px; }
.hs-form label { display:flex; flex-direction:column; gap:3px; font-size:12px; color:var(--muted,#64748b); }
.hs-form input, .hs-form select { font-size:13px; padding:5px 8px; border-radius:6px; border:1px solid var(--line,#e2e8f0); background:var(--card-bg,#fff); color:var(--text,#1e293b); }
.hs-form button { font-size:13px; padding:6px 14px; border-radius:6px; background:#2563eb; color:#fff; border:none; cursor:pointer; }
.hs-form button:hover { background:#1d4ed8; }
.hs-actions { display:flex; gap:8px; flex-wrap:wrap; align-items:center; margin:10px 0 14px; min-height:34px; }
.hs-entity { font-size:12px; background:#eff6ff; border:1px solid #bfdbfe; color:#1d4ed8; border-radius:999px; padding:2px 10px; }
.hs-basket { font-size:12px; background:#f0fdf4; border:1px solid #bbf7d0; color:#15803d; border-radius:999px; padding:2px 10px; }
.hs-basket-link { position:relative; }
.hs-basket-bubble { position:absolute; top:-8px; right:-8px; min-width:18px; height:18px; padding:0 5px; border-radius:999px; background:#ef4444; color:#fff; border:2px solid #fff; font-size:11px; font-weight:700; line-height:16px; text-align:center; box-shadow:0 2px 7px rgba(239,68,68,.25); box-sizing:border-box; }
.hs-floating-basket { position:fixed; right:24px; bottom:24px; z-index:30; display:flex; align-items:center; gap:10px; padding:10px; border:1px solid #bfdbfe; border-radius:8px; background:rgba(255,255,255,.96); box-shadow:0 14px 36px rgba(15,23,42,.18); backdrop-filter:blur(10px); }
.hs-floating-copy { display:flex; flex-direction:column; gap:1px; min-width:118px; flex:0 0 auto; }
.hs-floating-title { font-size:12px; font-weight:600; color:#0f172a; white-space:nowrap; }
.hs-floating-meta { font-size:11px; color:#64748b; }
.hs-floating-basket .primary-action { min-height:38px; padding:0 18px; border-radius:7px; white-space:nowrap; }
.hs-floating-link { position:relative; display:inline-flex; align-items:center; justify-content:center; min-height:38px; padding:0 12px; border:1px solid #bfdbfe; border-radius:7px; color:#2563eb; text-decoration:none; background:#eff6ff; font-size:13px; font-weight:600; white-space:nowrap; }
.hs-floating-basket .hs-basket-bubble { top:-7px; right:-7px; }
.hs-floating-basket.is-empty .primary-action { opacity:.58; cursor:not-allowed; }
.rv-card { border:1px solid var(--line,#e2e8f0); border-radius:8px; padding:11px 14px 10px; margin-bottom:8px; background:var(--card-bg,#fff); }
.rv-card.rec-recommended { border-left:3px solid #16a34a; padding-left:12px; }
.rv-card.rec-excluded { opacity:.72; }
.rv-card-header { display:flex; align-items:baseline; gap:7px; margin-bottom:3px; flex-wrap:wrap; }
.rv-card-seq { font-size:12px; font-weight:500; color:var(--muted,#64748b); flex-shrink:0; min-width:20px; }
.rv-card-title { font-size:14px; font-weight:500; color:var(--text,#1e293b); text-decoration:none; flex:1; line-height:1.4; min-width:0; }
.rv-card-title:hover { text-decoration:underline; }
.rv-ai-badge { font-size:11px; padding:1px 6px; border-radius:999px; background:#dcfce7; color:#15803d; flex-shrink:0; }
.rv-ai-badge.excluded { background:#fee2e2; color:#b91c1c; }
.rv-basket-badge { font-size:11px; padding:1px 7px; border-radius:999px; background:#fff1f2; color:#e11d48; border:1px solid #fecdd3; flex-shrink:0; }
.rv-reviewed-badge { font-size:11px; background:var(--surface,#f1f5f9); color:var(--muted,#64748b); border-radius:6px; padding:1px 7px; flex-shrink:0; }
.rv-card-summary { font-size:12px; color:var(--muted,#64748b); margin:3px 0 6px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.rv-tag-list { display:flex; gap:6px; flex-wrap:wrap; margin:5px 0 3px; }
.rv-tag { font-size:11px; padding:2px 8px; border-radius:999px; background:#f8fafc; border:1px solid #dbe3ef; color:#475569; text-decoration:none; line-height:1.35; }
.rv-tag:hover { background:#eff6ff; border-color:#93c5fd; color:#1d4ed8; }
.rv-card-footer { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.rv-card-meta { font-size:12px; color:var(--muted,#64748b); flex:1; min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.rv-card-edit { margin-top:8px; border-top:1px solid var(--line,#e2e8f0); padding-top:8px; }
.rv-card-edit > summary { font-size:12px; color:var(--muted,#64748b); cursor:pointer; user-select:none; }
.article-edit-grid { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:8px; }
.article-edit-grid label { display:flex; flex-direction:column; gap:4px; font-size:12px; color:var(--muted,#64748b); }
.article-edit-grid input,
.article-edit-grid select,
.article-edit-grid textarea { border:1px solid var(--line,#e2e8f0); border-radius:6px; padding:6px 8px; font-size:13px; background:#fff; color:var(--text,#1e293b); box-sizing:border-box; }
.article-edit-grid .wide-field { grid-column:1 / -1; }
.article-actions { display:flex; justify-content:flex-end; margin-top:10px; }
.field-hint { display:block; margin-top:4px; font-size:11px; line-height:1.4; color:var(--muted,#64748b); }
.article-tag-editor { border:1px solid var(--line,#e2e8f0); border-radius:8px; background:#fff; padding:10px; }
.article-tag-editor-title { display:block; font-size:11px; font-weight:600; color:#64748b; margin:0 0 6px; }
.article-tag-current { display:flex; flex-wrap:wrap; gap:7px; min-height:30px; margin-bottom:10px; }
.article-tag-empty { font-size:12px; color:#94a3b8; padding:5px 0; }
.article-tag-pill { display:inline-flex; align-items:center; gap:7px; border:1px solid #bfdbfe; background:#eff6ff; color:#1d4ed8; border-radius:999px; padding:5px 6px 5px 10px; font-size:12px; cursor:default; line-height:1.3; }
.article-tag-pill-remove { display:inline-flex; align-items:center; justify-content:center; width:16px; height:16px; border-radius:999px; border:0; background:rgba(37,99,235,.1); color:#2563eb; font-size:12px; line-height:1; cursor:pointer; padding:0; }
.article-tag-pill-remove:hover { background:#fee2e2; color:#be123c; }
.article-tag-add-row { display:grid; grid-template-columns:minmax(160px,1fr) auto; gap:8px; }
.article-tag-add-row input { width:100%; }
.article-tag-add-row button { border:1px solid #bfdbfe; background:#eff6ff; color:#1d4ed8; border-radius:6px; padding:5px 12px; cursor:pointer; white-space:nowrap; }
.article-tag-suggestion-title { display:block; font-size:11px; font-weight:600; color:#64748b; margin:8px 0 0; }
.article-tag-suggestions { display:flex; flex-wrap:wrap; gap:7px; margin-top:7px; max-height:105px; overflow-y:auto; padding-right:4px; }
.tag-chip { display:inline-flex; align-items:center; border:1px solid #dbe3ef; background:#f8fafc; color:#475569; border-radius:999px; overflow:hidden; }
.tag-chip-button { border:0; background:transparent; color:inherit; padding:4px 8px 4px 10px; font-size:11px; cursor:pointer; line-height:1.4; }
.tag-chip-remove { border:0; border-left:1px solid #e2e8f0; background:transparent; color:#94a3b8; width:22px; align-self:stretch; cursor:pointer; font-size:12px; line-height:1; }
.tag-chip:hover { background:#eff6ff; border-color:#93c5fd; color:#1d4ed8; }
.tag-chip-remove:hover { background:#fee2e2; color:#be123c; border-left-color:#fecdd3; }
.hs-pager { display:flex; gap:8px; align-items:center; justify-content:center; margin-top:14px; font-size:13px; }
.hs-pager a { color:#2563eb; text-decoration:none; padding:4px 10px; border:1px solid var(--line,#e2e8f0); border-radius:6px; }
.hs-pager a.disabled { color:var(--muted,#cbd5e1); pointer-events:none; }
@media (max-width: 720px) {
  .hs-floating-basket { left:12px; right:12px; bottom:12px; justify-content:space-between; }
  .hs-floating-copy { min-width:52px; width:52px; }
  .hs-floating-title { font-size:11px; }
  .hs-floating-meta { font-size:10px; line-height:1.25; }
  .hs-floating-link { width:44px; padding:0 8px; flex:0 0 auto; }
  .hs-floating-basket .primary-action { padding:0 14px; flex:1 1 auto; min-width:0; }
}


/* report_basket.html block 1 */
.basket-head { display:flex; gap:10px; align-items:baseline; flex-wrap:wrap; margin-bottom:14px; }
.basket-head h2 { margin:0; font-size:20px; font-weight:500; }
.basket-count { color:var(--muted,#64748b); font-size:13px; }
.basket-list { display:grid; gap:8px; }
.basket-card { border:1px solid var(--line,#e2e8f0); border-radius:8px; padding:12px 14px; background:var(--card-bg,#fff); }
.basket-card h3 { margin:0 0 4px; font-size:15px; font-weight:500; }
.basket-card h3 a { color:var(--text,#1e293b); text-decoration:none; }
.basket-card h3 a:hover { text-decoration:underline; }
.basket-meta { font-size:12px; color:var(--muted,#64748b); margin-bottom:4px; }
.basket-summary { font-size:13px; color:#475569; line-height:1.55; margin:0 0 8px; }
.basket-actions { display:flex; gap:8px; flex-wrap:wrap; justify-content:flex-end; }
.basket-generate-form { margin:0; }
.basket-generate-form button { min-width:132px; }
@media (max-width:768px) {
  .basket-actions { justify-content:flex-start; }
}


/* report_detail.html block 1 */
  .review-stepper { display:flex; gap:0; margin:4px 0 12px; flex-wrap:wrap; align-items:flex-start; }
  .review-stepper .rs-step { display:inline-flex; flex-direction:column; align-items:center; gap:3px; font-size:13px; color:var(--text-muted,#64748b); }
  .review-stepper .rs-step-row { display:inline-flex; align-items:center; gap:6px; }
  .review-stepper .rs-step + .rs-step { margin-left:10px; }
  .review-stepper .rs-step + .rs-step > .rs-step-row::before { content:"→"; margin-right:10px; color:var(--border,#cbd5e1); }
  .review-stepper .rs-step.done { color:var(--accent,#2563eb); font-weight:600; }
  .review-stepper .rs-step.warn { color:#d97706; font-weight:600; }
  .review-stepper .rs-step.current { color:var(--text,#1e293b); font-weight:700; }
  .review-stepper .rs-mark { display:inline-flex; width:18px; height:18px; align-items:center; justify-content:center; border-radius:50%; border:1px solid currentColor; font-size:11px; }
  .review-stepper .rs-hint { font-size:11px; font-weight:400; color:var(--text-muted,#94a3b8); max-width:90px; text-align:center; line-height:1.3; }
  .review-next { background:var(--surface,#f1f5f9); border-radius:8px; padding:10px 14px; margin-bottom:14px; font-size:14px; }


/* report_detail.html block 2 */
  .column-cards { display:flex; flex-wrap:wrap; gap:10px; margin-top:8px; }
  .column-card { background:var(--surface,#f8fafc); border:1px solid var(--border,#e2e8f0); border-radius:8px; padding:10px 14px; min-width:180px; flex:1; }
  .column-card strong { display:block; font-size:14px; margin-bottom:4px; }
  .column-card span { font-size:12px; color:var(--text-muted,#64748b); line-height:1.4; }


/* report_preview.html block 1 */
.topic-report-field[hidden] { display:none !important; }
.report-type-form { margin-bottom:var(--space-4); }
.report-type-form .wide-field { grid-column:1 / -1; }
.report-preview-rendered { margin-top:var(--space-6); }
.report-preview-paper { max-width:900px; margin:0 auto; padding:clamp(24px, 5vw, 56px); background:#fff; }
@media (max-width:760px) {
  .report-type-form { grid-template-columns:minmax(0, 1fr) !important; }
  .report-type-form > * { min-width:0; }
}


/* sources.html block 1 */
.source-tabs { display: flex; gap: 0; margin-bottom: 16px; border-bottom: 2px solid var(--border, #e2e8f0); }
.source-subtabs { display:flex; flex-wrap:wrap; gap:8px; margin:0 0 14px; }
.source-tab { padding: 8px 20px; text-decoration: none; color: var(--text-muted, #64748b); font-weight: 500; font-size: 15px; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: color .15s, border-color .15s; }
.source-tab:hover { color: var(--text, #1e293b); }
.source-tab.active { color: var(--accent, #2563eb); font-weight: 600; border-bottom-color: var(--accent, #2563eb); }
.source-subtab { display:inline-flex; align-items:center; min-height:32px; padding:6px 12px; border:1px solid var(--line,#e2e8f0); border-radius:999px; color:var(--text-muted,#64748b); text-decoration:none; font-size:13px; }
.source-subtab.active { border-color:rgba(37,99,235,.35); background:#eff6ff; color:#1d4ed8; font-weight:600; }
.filter-check { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 14px; }
.pagination .page-indicator { color: var(--text-muted, #64748b); font-size: 14px; }
.pagination .disabled { opacity: .4; pointer-events: none; }
.source-detail-actions { margin-bottom: 10px; }
td .source-details > summary { cursor: pointer; font-size: 20px; line-height: 1; padding: 2px 8px; }
.toggle-on { border-color: var(--accent, #2563eb); }
.source-add-btn { text-decoration:none; cursor:pointer; }
.source-add-btn:hover { opacity:.9; }
.source-status-strips { display:grid; gap:8px; margin-top:14px; }
.source-status-strip { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:9px 12px; border:1px solid var(--border,#e2e8f0); border-radius:8px; background:var(--bg-subtle,#f8fafc); }
.source-status-strip div { min-width:0; }
.source-status-strip span { display:block; color:var(--text-muted,#64748b); font-size:12px; }
.source-status-strip strong { display:block; font-size:14px; overflow-wrap:anywhere; }
.source-status-strip p, .source-status-strip em { margin:2px 0 0; color:var(--text-muted,#64748b); font-size:12px; font-style:normal; }
.source-status-strip .link-button { flex-shrink:0; }
.source-inline-status { display:flex; align-items:center; justify-content:space-between; gap:12px; margin:0 0 10px; padding:8px 10px; border:1px solid var(--border,#e2e8f0); border-radius:8px; background:var(--bg-subtle,#f8fafc); font-size:13px; }
.source-inline-status strong { overflow-wrap:anywhere; }
.source-inline-status .link-button { flex-shrink:0; }


/* sources.html block 2 */
    .source-create-split { display:grid; grid-template-columns:minmax(0, 1.25fr) minmax(0, 0.95fr); gap:16px; align-items:start; }
    .source-pane { display:flex; flex-direction:column; gap:12px; min-width:0; border:1px solid var(--border,#e2e8f0); border-radius:12px; background:var(--bg-card,#fff); padding:16px; box-shadow:0 1px 2px rgba(15, 23, 42, .04); }
    .source-pane h3 { margin:0; font-size:18px; line-height:1.2; }
    .source-create-form { display:flex; flex-direction:column; gap:10px; min-width:0; }
    .source-form-step { border:1px solid var(--border,#e2e8f0); border-radius:10px; padding:12px; background:var(--bg-subtle,#f8fafc); }
    .source-form-step h4 { margin:0 0 10px; font-size:14px; color:var(--text,#1e293b); }
    .source-step-grid { display:grid; grid-template-columns:minmax(0, 1fr) minmax(0, 1fr); gap:8px; }
    .source-step-grid input, .source-step-grid select { min-width:0; }
    .source-wide-field { grid-column:1/-1; }
    .source-submit-grid { align-items:center; }
    .source-submit-grid p { margin:0; }
    .source-contact-section { margin-top:10px; border-top:1px solid var(--border,#e2e8f0); padding-top:10px; }
    .source-subfield { display:flex; flex-direction:column; gap:6px; }
    .source-subfield-title { font-size:12px; color:var(--text-muted,#64748b); font-weight:600; }
    .wechat-import-panel { gap:10px; }
    .wechat-import-panel h3 { margin:0; }
    .wechat-import-control { display:flex; flex-direction:column; gap:6px; font-size:13px; color:var(--text-muted,#64748b); }
    .wechat-import-control span { font-weight:600; color:var(--text,#1e293b); }
    .wechat-import-control select,
    .wechat-import-control input { width:100%; padding:9px 10px; border:1px solid var(--border,#e2e8f0); border-radius:8px; font-size:14px; }
    .wechat-import-list { max-height:340px; overflow-y:auto; border:1px solid var(--border,#e2e8f0); border-radius:10px; background:#fff; }
    .wechat-import-footnote { margin-top:2px; }
    .wf-row { display:flex; align-items:center; justify-content:space-between; padding:8px 12px; border-bottom:1px solid var(--border,#f1f5f9); font-size:14px; gap:8px; }
    .wf-row:last-child { border-bottom:none; }
    .wf-row.added { color:var(--text-muted,#64748b); }
    .wf-name { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
    .wf-badge { font-size:11px; color:#16a34a; background:#dcfce7; border-radius:4px; padding:2px 6px; flex-shrink:0; }
    .wf-btn { font-size:12px; padding:4px 10px; border:1px solid var(--accent,#2563eb); color:var(--accent,#2563eb); border-radius:5px; background:none; cursor:pointer; flex-shrink:0; white-space:nowrap; }
    .wf-btn:hover { background:var(--accent,#2563eb); color:#fff; }
    @media (max-width: 720px) {
      .source-create-split { grid-template-columns:1fr; }
      .source-step-grid { grid-template-columns:1fr; }
      .source-wide-field { grid-column:auto; }
    }


/* wechat.html block 1 */
.wechat-header { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:12px; margin-bottom:16px; }
.wechat-status-bar { display:flex; align-items:center; gap:10px; font-size:14px; }
.wechat-dot { width:10px; height:10px; border-radius:50%; flex-shrink:0; }
.wechat-dot.ok { background:#16a34a; }
.wechat-dot.off { background:#d97706; }
.wechat-frame-wrap { border:1px solid var(--border,#e2e8f0); border-radius:10px; overflow:hidden; height:calc(100vh - 160px); min-height:500px; background:var(--surface,#f8fafc); }
.wechat-frame-wrap iframe { width:100%; height:100%; border:none; display:block; }
.wechat-offline { display:flex; flex-direction:column; align-items:center; justify-content:center; height:100%; gap:16px; color:var(--text-muted,#64748b); text-align:center; padding:32px; }
.wechat-offline h3 { font-size:17px; color:var(--text,#1e293b); margin:0; }
.wechat-offline code { background:var(--surface,#f1f5f9); border:1px solid var(--border,#e2e8f0); border-radius:5px; padding:10px 16px; font-size:13px; display:block; text-align:left; white-space:pre; }
.wechat-offline .step { font-size:13px; line-height:1.8; }
.wechat-offline .secondary { font-size:12px; line-height:1.7; opacity:.82; }
.wechat-maintenance { margin:0 0 14px; padding:12px 14px; border:1px solid #fde68a; border-radius:8px; background:#fffbeb; color:#92400e; font-size:13px; line-height:1.6; }
.wechat-maintenance strong { color:#78350f; }
.wechat-loading { display:flex; align-items:center; justify-content:center; height:100%; color:var(--text-muted,#64748b); font-size:14px; }
