:root {
  color-scheme: light;
  --bg: #f4f6f3;
  --surface: #ffffff;
  --surface-soft: #f8faf7;
  --ink: #17201b;
  --muted: #69736c;
  --line: #d9dfda;
  --line-strong: #bcc6be;
  --green: #266748;
  --green-soft: #e8f2ec;
  --amber: #9b6a19;
  --amber-soft: #f8efd9;
  --red: #a34242;
  --red-soft: #f8e9e9;
  --blue: #345d86;
  --blue-soft: #eaf0f6;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 14px;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
}
.topbar-inner {
  width: min(1440px, calc(100vw - 48px));
  height: 64px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 32px; height: 32px; background: var(--ink); color: white; border-radius: 6px; font-family: SimSun, serif; }
nav { display: flex; align-items: center; height: 100%; gap: 8px; }
nav a { position: relative; display: grid; place-items: center; height: 100%; padding: 0 14px; color: var(--muted); text-decoration: none; }
nav a[aria-current="page"] { color: var(--ink); font-weight: 700; }
nav a[aria-current="page"]::after { content: ""; position: absolute; right: 14px; bottom: 0; left: 14px; height: 3px; background: var(--green); }

.page-shell { width: min(1440px, calc(100vw - 48px)); min-height: calc(100vh - 148px); margin: 0 auto; padding: 34px 0 48px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.page-heading h1 { margin: 4px 0 6px; font-size: 30px; line-height: 1.2; }
.page-heading p { margin: 0; color: var(--muted); }
.eyebrow { color: var(--green) !important; font-size: 11px; font-weight: 800; }

.button { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 6px; padding: 9px 15px; font-weight: 700; text-decoration: none; cursor: pointer; }
.button.primary { background: var(--green); color: white; }
.button.secondary { border-color: var(--line-strong); background: var(--surface); color: var(--ink); }
.button:hover { filter: brightness(0.98); }
.button:disabled { cursor: not-allowed; opacity: 0.5; }
.button.full { width: 100%; }

.system-bar, .summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.system-bar > div, .summary-grid > div { min-width: 0; padding: 13px 16px; border-right: 1px solid var(--line); }
.system-bar > div:last-child, .summary-grid > div:last-child { border-right: 0; }
.system-bar span, .summary-grid span, .result-summary span, .record-facts span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 11px; }
.system-bar strong, .summary-grid strong { font-size: 14px; }
.positive { color: var(--green) !important; }
.summary-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.summary-grid strong { font-size: 26px; }

.workspace { display: grid; grid-template-columns: minmax(360px, 0.78fr) minmax(620px, 1.42fr); gap: 18px; align-items: start; }
.tool-panel, .result-panel, .history-panel { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.section-head { display: flex; min-height: 58px; align-items: center; justify-content: space-between; gap: 16px; padding: 0 18px; border-bottom: 1px solid var(--line); }
.section-head > div { display: flex; align-items: center; gap: 10px; }
.section-head h2 { margin: 0; font-size: 16px; }
.step { color: var(--green); font-size: 11px; font-weight: 800; }
.state-tag { display: inline-flex; align-items: center; min-height: 25px; border: 1px solid var(--line); border-radius: 4px; padding: 3px 8px; color: var(--muted); background: var(--surface-soft); font-size: 11px; font-weight: 700; white-space: nowrap; }
.state-tag.positive, .state-tag.automatic, .state-tag.draft, .state-tag.submitted { border-color: #a8c7b3; background: var(--green-soft); color: var(--green); }
.state-tag.manual, .state-tag.uploading { border-color: #b7c9dc; background: var(--blue-soft); color: var(--blue); }
.state-tag.ready { border-color: #a8c7b3; background: var(--green-soft); color: var(--green); }
.state-tag.not_uploaded { border-color: #e1cd9e; background: var(--amber-soft); color: var(--amber); }
.state-tag.failed { border-color: #dfb6b6; background: var(--red-soft); color: var(--red); }
.state-tag.attention, .state-tag.creator_login_required, .state-tag.creator_verification_required { border-color: #dfc98f; background: var(--amber-soft); color: var(--amber); }

form { margin: 0; }
.tool-panel > form { display: grid; gap: 16px; padding: 18px; }
label { display: grid; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 700; }
input, select, textarea { width: 100%; border: 1px solid var(--line-strong); border-radius: 6px; background: white; color: var(--ink); padding: 10px 11px; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(38, 103, 72, 0.1); }
textarea { min-height: 270px; resize: vertical; line-height: 1.75; }
.form-grid { display: grid; gap: 12px; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.segmented { display: grid; grid-template-columns: repeat(2, 1fr); width: 100%; padding: 3px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-soft); }
.segmented label { display: block; }
.segmented input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.segmented span { display: grid; min-height: 34px; place-items: center; border-radius: 4px; color: var(--muted); cursor: pointer; }
.segmented input:checked + span { border: 1px solid var(--line); background: white; color: var(--ink); }
.form-actions { display: flex; align-items: end; gap: 10px; padding-top: 2px; }
.form-actions .compact-field { flex: 1; }
.form-note { margin: -4px 0 0; color: var(--muted); font-size: 12px; }
.form-note.warning { color: var(--red); }
.progress-box, .job-status, .status-message { display: flex; align-items: center; gap: 10px; border: 1px solid #dfc98f; border-radius: 6px; background: var(--amber-soft); color: var(--amber); padding: 11px 12px; }
.progress-box[hidden] { display: none; }
.spinner { width: 16px; height: 16px; flex: 0 0 16px; border: 2px solid rgba(155, 106, 25, 0.24); border-top-color: var(--amber); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.job-status { margin: 0 18px 18px; }
.job-status.done { border-color: #a8c7b3; background: var(--green-soft); color: var(--green); }
.job-status.error, .alert { border-color: #dfb6b6; background: var(--red-soft); color: var(--red); }
.alert { margin-bottom: 18px; border-style: solid; border-width: 1px; border-radius: 6px; padding: 12px 14px; }

.result-layout { display: grid; grid-template-columns: minmax(230px, 0.72fr) minmax(360px, 1.28fr); gap: 18px; padding: 18px; }
.media-column { display: grid; align-content: start; gap: 10px; }
.media-actions { display: grid; gap: 8px; }
.media-actions form { width: 100%; }
video, .cover-preview { display: block; width: 100%; max-height: 700px; border: 1px solid var(--line); border-radius: 6px; background: #0c0d0c; object-fit: contain; }
.cover-preview { aspect-ratio: 9 / 16; object-fit: cover; }
.result-content { display: grid; align-content: start; gap: 14px; min-width: 0; }
.result-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 6px; }
.result-summary > div { padding: 10px 12px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.result-summary > div:nth-child(2n) { border-right: 0; }
.result-summary > div:nth-last-child(-n + 2) { border-bottom: 0; }
.result-summary strong, .record-facts strong { display: block; overflow-wrap: anywhere; font-size: 13px; }
.status-message { border-color: #d7dfd9; background: var(--surface-soft); color: var(--muted); line-height: 1.6; }
.detail-list { border-top: 1px solid var(--line); }
.detail-list section { padding: 13px 2px; border-bottom: 1px solid var(--line); }
.detail-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 7px; }
.detail-head h3 { margin: 0; font-size: 12px; color: var(--muted); }
.detail-head button { border: 0; background: transparent; color: var(--green); cursor: pointer; padding: 3px; }
.detail-list p { margin: 0; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.script-text { max-height: 300px; overflow: auto; }
.empty-state { display: grid; min-height: 320px; place-content: center; gap: 6px; padding: 32px; text-align: center; }
.empty-state span { color: var(--muted); }

.history-panel { overflow: hidden; }
.filters { display: grid; grid-template-columns: repeat(3, minmax(160px, 1fr)) auto; gap: 12px; align-items: end; padding: 16px; border-bottom: 1px solid var(--line); background: var(--surface-soft); }
.filter-actions { display: flex; gap: 8px; }
.record-list { display: grid; }
.record-row { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: 16px; align-items: start; padding: 16px; border-bottom: 1px solid var(--line); }
.record-row:last-child { border-bottom: 0; }
.record-row:hover { background: #fbfcfa; }
.record-cover { display: block; width: 76px; aspect-ratio: 9 / 16; border-radius: 5px; overflow: hidden; background: #e7ebe7; }
.record-cover img { width: 100%; height: 100%; object-fit: cover; }
.record-main { min-width: 0; }
.record-title-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.record-title-line > a { min-width: 0; max-width: 100%; font-size: 15px; font-weight: 800; text-decoration: none; overflow-wrap: anywhere; }
.record-facts { display: grid; grid-template-columns: 1fr 1.2fr 1.1fr 1fr 1fr; gap: 14px; margin-top: 13px; }
.record-message { margin: 12px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.record-actions { display: flex; gap: 8px; }

.success-banner { margin-bottom: 18px; border: 1px solid #a8c7b3; border-radius: 6px; padding: 12px 14px; background: var(--green-soft); color: var(--green); }
.daily-layout { display: grid; grid-template-columns: minmax(520px, 1.2fr) minmax(360px, 0.8fr); gap: 18px; align-items: start; }
.daily-settings > form { display: grid; gap: 18px; padding: 18px; }
.task-log-panel { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); padding-bottom: 16px; color: var(--ink); }
.switch-row > span:first-child { display: grid; gap: 4px; }
.switch-row small, .slot-option small { color: var(--muted); font-weight: 400; }
.switch { position: relative; display: block; width: 44px; height: 24px; flex: 0 0 44px; }
.switch input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.switch > span { position: absolute; inset: 0; border-radius: 12px; background: #c7cec9; cursor: pointer; }
.switch > span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: white; transition: transform 160ms ease; }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(20px); }
.field-label { color: var(--muted); font-size: 12px; font-weight: 700; }
.slot-selector { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.slot-option { position: relative; display: block; }
.slot-option > input { position: absolute; top: 12px; right: 12px; z-index: 1; width: 18px; height: 18px; accent-color: var(--green); }
.slot-option > span { display: grid; gap: 8px; min-height: 126px; border: 1px solid var(--line); border-radius: 6px; padding: 13px; background: var(--surface-soft); }
.slot-option > input:checked + span { border-color: #8eb49c; background: var(--green-soft); }
.slot-option input[type="time"] { margin-top: 3px; background: white; }
.task-count { border: 1px solid var(--line); border-radius: 6px; padding: 11px 12px; background: var(--surface-soft); color: var(--muted); }
.task-count strong { color: var(--ink); font-size: 18px; }
.form-actions.end { justify-content: flex-end; }
.task-log { display: grid; grid-template-columns: 1fr 1fr; margin: 0; padding: 18px; }
.task-log > div { min-width: 0; padding: 12px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.task-log > div:nth-child(2n) { border-right: 0; }
.task-log > div.wide { grid-column: 1 / -1; border-right: 0; }
.task-log dt { margin-bottom: 6px; color: var(--muted); font-size: 11px; }
.task-log dd { margin: 0; overflow-wrap: anywhere; font-weight: 700; line-height: 1.55; }
.task-boundary { display: grid; gap: 7px; margin: 0 18px 18px; border-left: 3px solid var(--green); padding: 11px 13px; background: var(--surface-soft); color: var(--muted); font-size: 12px; line-height: 1.6; }
.task-boundary strong { color: var(--ink); }
.task-status-bar { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.creator-session-actions { margin: 0 18px 18px; }
.creator-login-panel { display: grid; gap: 12px; margin: 0 18px 18px; border: 1px solid var(--line); border-radius: 6px; padding: 14px; background: var(--surface-soft); }
.creator-login-panel img { display: block; width: min(100%, 520px); max-height: 520px; margin: 0 auto; border: 1px solid var(--line); border-radius: 6px; object-fit: contain; background: white; }
.creator-login-panel p { margin: 0; color: var(--muted); line-height: 1.6; }

.publish-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 18px; border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; background: var(--surface); }
.publish-filters { display: flex; align-items: end; gap: 10px; }
.publish-filters label { min-width: 180px; }
.worker-indicator { display: flex; max-width: 420px; align-items: center; gap: 10px; color: var(--muted); }
.worker-indicator > div { display: grid; gap: 3px; }
.worker-indicator strong { color: var(--ink); font-size: 12px; }
.worker-indicator small { overflow-wrap: anywhere; line-height: 1.45; }
.worker-dot { width: 9px; height: 9px; flex: 0 0 9px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 4px var(--red-soft); }
.worker-dot.online { background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.publish-queue { overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.publish-list { display: grid; }
.publish-row { display: grid; grid-template-columns: 92px minmax(0, 1fr) 190px; gap: 18px; align-items: start; padding: 18px; border-bottom: 1px solid var(--line); }
.publish-row:last-child { border-bottom: 0; }
.publish-media { position: relative; width: 92px; aspect-ratio: 9 / 16; overflow: hidden; border-radius: 6px; background: #151815; }
.publish-media img { width: 100%; height: 100%; object-fit: cover; }
.publish-media span { position: absolute; right: 6px; bottom: 6px; left: 6px; border-radius: 4px; padding: 4px 5px; background: rgba(0, 0, 0, 0.72); color: white; text-align: center; font-size: 11px; font-weight: 700; }
.publish-info { min-width: 0; }
.publish-title-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.publish-title-line h3 { margin: 0; font-size: 17px; overflow-wrap: anywhere; }
.publish-info dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 16px 0 0; }
.publish-info dl > div { min-width: 0; border-left: 2px solid var(--line); padding-left: 9px; }
.publish-info dt { margin-bottom: 4px; color: var(--muted); font-size: 11px; }
.publish-info dd { margin: 0; overflow-wrap: anywhere; font-weight: 700; line-height: 1.45; }
.publish-info p { margin: 13px 0 0; color: var(--muted); line-height: 1.6; }
.publish-info .publish-warning { color: var(--amber); }
.publish-actions { display: grid; gap: 8px; }
.publish-actions form, .publish-actions .button { width: 100%; }
.publish-boundary { display: flex; align-items: center; gap: 10px; margin-top: 14px; border-left: 3px solid var(--green); padding: 11px 13px; background: var(--surface); color: var(--muted); font-size: 12px; line-height: 1.6; }
.publish-boundary strong { flex: 0 0 auto; color: var(--ink); }
.publish-inspect-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(320px, .75fr); gap: 18px; align-items: start; }
.publish-inspect-preview, .publish-inspect-details { overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.publish-page-shot { display: block; max-height: 72vh; overflow: auto; border-top: 1px solid var(--line); background: #151815; }
.publish-page-shot img { display: block; width: 100%; height: auto; }
.publish-inspect-details { position: sticky; top: 82px; }
.inspect-facts { display: grid; grid-template-columns: 1fr; gap: 0; margin: 0; padding: 0 18px; }
.inspect-facts > div { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.inspect-facts dt { color: var(--muted); font-size: 11px; }
.inspect-facts dd { margin: 0; overflow-wrap: anywhere; font-weight: 700; line-height: 1.5; }
.inspect-copy { display: grid; gap: 14px; padding: 18px; }
.inspect-copy > div { display: grid; gap: 6px; }
.inspect-copy span { color: var(--muted); font-size: 11px; }
.inspect-copy strong, .inspect-copy p { margin: 0; overflow-wrap: anywhere; line-height: 1.65; white-space: pre-wrap; }
.inspect-status, .publish-inspect-details .publish-warning { margin: 0 18px 14px; color: var(--muted); line-height: 1.6; }
.publish-inspect-details .publish-warning { color: var(--amber); }
.inspect-actions { display: grid; gap: 8px; padding: 0 18px 18px; }
.inspect-actions form, .inspect-actions .button { width: 100%; }
.locked-publish-center { display: grid; width: min(560px, 100%); min-height: 460px; place-content: center; justify-items: start; gap: 14px; margin: 40px auto; border: 1px solid var(--line); border-radius: 8px; padding: 48px; background: var(--surface); }
.locked-publish-center h1 { margin: 0; font-size: 26px; }
.locked-publish-center p { margin: 0; color: var(--muted); line-height: 1.75; }

.site-footer { width: min(1440px, calc(100vw - 48px)); margin: 0 auto; padding: 18px 0 28px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 20px; color: var(--muted); font-size: 11px; }
.site-footer a { text-decoration: none; }

@media (max-width: 1080px) {
  .workspace { grid-template-columns: 1fr; }
  .daily-layout { grid-template-columns: 1fr; }
  .publish-row { grid-template-columns: 80px minmax(0, 1fr); }
  .publish-media { width: 80px; }
  .publish-actions { grid-column: 2; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .record-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .topbar-inner, .page-shell, .site-footer { width: calc(100vw - 24px); }
  .page-shell { padding-top: 24px; }
  .page-heading { align-items: flex-start; }
  .system-bar, .summary-grid { grid-template-columns: 1fr 1fr; }
  .system-bar > div:nth-child(2), .summary-grid > div:nth-child(2) { border-right: 0; }
  .system-bar > div, .summary-grid > div { border-bottom: 1px solid var(--line); }
  .system-bar > div:last-child, .summary-grid > div:nth-last-child(-n + 2) { border-bottom: 0; }
  .form-grid.three, .form-grid.two, .result-layout, .filters { grid-template-columns: 1fr; }
  .slot-selector { grid-template-columns: 1fr; }
  .publish-toolbar, .publish-filters { align-items: stretch; flex-direction: column; }
  .publish-inspect-layout { grid-template-columns: 1fr; }
  .publish-inspect-details { position: static; }
  .publish-filters label { min-width: 0; }
  .publish-info dl { grid-template-columns: 1fr; }
  .publish-actions { grid-template-columns: 1fr; }
  .record-row { grid-template-columns: 58px minmax(0, 1fr); }
  .record-cover { width: 58px; }
  .record-actions { grid-column: 2; }
  .record-facts { grid-template-columns: 1fr 1fr; }
  .form-actions { align-items: stretch; flex-direction: column; }
}
@media (max-width: 480px) {
  .brand > span:last-child { display: none; }
  nav a { padding: 0 9px; }
  .page-heading { display: grid; }
  .page-heading .button { width: 100%; }
  .system-bar, .summary-grid, .result-summary { grid-template-columns: 1fr; }
  .system-bar > div, .summary-grid > div, .result-summary > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .system-bar > div:last-child, .summary-grid > div:last-child, .result-summary > div:last-child { border-bottom: 0; }
  .record-facts { grid-template-columns: 1fr; }
  .site-footer { display: grid; }
  .publish-row { grid-template-columns: 64px minmax(0, 1fr); gap: 12px; padding: 14px; }
  .publish-media { width: 64px; }
  .locked-publish-center { min-height: 380px; padding: 28px; }
}
