:root {
  color-scheme: light;
  --ink: #1c272d;
  --muted: #647278;
  --subtle: #8a969b;
  --line: #dfe5e7;
  --canvas: #f4f6f7;
  --white: #fff;
  --teal: #087f78;
  --teal-dark: #056a64;
  --amber: #a65c12;
  --red: #a71927;
  --green: #18794e;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); font: 14px/1.5 "Segoe UI", "Microsoft YaHei", sans-serif; }
button, input { font: inherit; }
button { cursor: pointer; }
.topbar { height: 58px; padding: 0 32px; display: flex; align-items: center; justify-content: space-between; background: var(--white); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 650; }
.brand-mark { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 5px; background: var(--teal); color: white; font: 700 15px/1 Georgia, serif; }
.topbar-meta { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.local-dot, .state-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.app-shell { width: min(1060px, calc(100% - 48px)); margin: 37px auto 0; }
.page-heading { display: flex; align-items: end; justify-content: space-between; margin-bottom: 26px; }
.eyebrow { margin: 0 0 5px; color: var(--teal); font-size: 10px; font-weight: 750; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin: 0; font-size: 25px; line-height: 1.25; font-weight: 680; }
.live-state { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid var(--line); background: white; color: var(--muted); font-size: 12px; }
.live-state.busy .state-dot { background: var(--amber); animation: pulse 1.3s infinite; }
.live-state.error .state-dot { background: var(--red); }
.live-state.success .state-dot { background: var(--green); }
.content-grid { display: grid; grid-template-columns: minmax(0, 1fr) 294px; gap: 34px; align-items: start; }
.main-column { min-width: 0; }
.workflow-section { display: grid; grid-template-columns: 185px minmax(0, 1fr); padding: 22px 0 25px; border-top: 1px solid var(--line); }
.workflow-section:last-child { border-bottom: 1px solid var(--line); }
.section-title { display: flex; align-items: flex-start; gap: 11px; }
.step-number { width: 27px; height: 27px; display: grid; place-items: center; flex: 0 0 27px; border: 1px solid #cfd9db; border-radius: 50%; color: var(--subtle); font-size: 10px; }
.section-title h2 { margin: 1px 0 3px; font-size: 14px; font-weight: 650; }
.section-title p { margin: 0; color: var(--subtle); font-size: 11px; }
.section-body { min-width: 0; }
.field-label { display: block; margin-bottom: 6px; color: #46545a; font-size: 12px; font-weight: 600; }
input[type="text"], input[type="password"], input[type="number"] { width: 100%; height: 39px; padding: 0 11px; border: 1px solid #cbd5d8; border-radius: 4px; outline: none; background: white; color: var(--ink); }
input:focus { border-color: var(--teal); box-shadow: 0 0 0 2px rgba(8, 127, 120, .12); }
input:disabled { background: #f3f5f5; color: var(--muted); opacity: 1; }
.field-note { margin: 8px 0 0; color: var(--subtle); font-size: 11px; }
.count-row { display: flex; align-items: end; gap: 13px; margin-top: 18px; }
.count-field { width: min(180px, 45%); }
.number-input { height: 39px; display: flex; align-items: center; border: 1px solid #cbd5d8; border-radius: 4px; background: white; }
.number-input input { height: 37px; border: 0; box-shadow: none; }
.number-input span { padding-right: 10px; color: var(--muted); font-size: 12px; }
.button { min-height: 39px; display: inline-flex; align-items: center; justify-content: center; gap: 18px; padding: 0 13px; border: 1px solid transparent; border-radius: 4px; font-size: 12px; font-weight: 650; transition: background .15s, border-color .15s, color .15s; }
.button:disabled { cursor: not-allowed; opacity: .48; }
.button-primary { min-width: 156px; background: var(--teal); color: white; }
.button-primary:hover:not(:disabled) { background: var(--teal-dark); }
.button-secondary { border-color: #b9c9cb; background: white; color: var(--ink); }
.button-secondary:hover:not(:disabled) { border-color: var(--teal); color: var(--teal-dark); }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th, td { padding: 9px 8px; border-bottom: 1px solid #edf0f1; text-align: left; vertical-align: top; overflow-wrap: anywhere; }
th { color: var(--muted); font-size: 11px; font-weight: 600; }
td { color: #435158; }
.empty-row { padding: 24px 8px; color: var(--subtle); text-align: center; }
.error-cell { color: var(--red); }
.result-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 13px; }
.result-actions > span { min-width: 0; color: var(--subtle); font-size: 11px; overflow-wrap: anywhere; }
.side-column { padding-top: 5px; }
.status-panel { padding: 0 0 17px; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--line); }
.panel-heading { display: flex; align-items: baseline; justify-content: space-between; padding: 15px 0 9px; }
.panel-heading h2 { margin: 0; font-size: 14px; font-weight: 650; }
.panel-heading > span { color: var(--subtle); font: 10px/1.2 Consolas, monospace; }
.status-message { min-height: 40px; margin: 0; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; white-space: pre-wrap; }
.status-message.error { color: var(--red); }
.activity-heading { display: flex; align-items: baseline; justify-content: space-between; margin-top: 13px; padding: 11px 0 7px; border-top: 1px solid var(--line); }
.activity-heading h3 { margin: 0; font-size: 12px; font-weight: 650; }
.activity-heading span { color: var(--subtle); font-size: 10px; }
.activity-list { max-height: 300px; overflow: auto; margin: 0; padding: 0; list-style: none; }
.activity-list li { position: relative; padding: 7px 0 7px 14px; border-left: 1px solid #cbd9d8; color: #526167; font-size: 11px; overflow-wrap: anywhere; }
.activity-list li::before { position: absolute; top: 12px; left: -3px; width: 5px; height: 5px; border-radius: 50%; background: var(--teal); content: ""; }
.activity-time { display: block; margin-bottom: 2px; color: var(--subtle); font: 10px/1.2 Consolas, monospace; }
.empty-activity { border: 0 !important; color: var(--subtle) !important; }
.empty-activity::before { display: none; }
.privacy-note { margin: 14px 0 0; color: var(--muted); font-size: 11px; }
.footer { display: flex; justify-content: space-between; margin-top: 27px; padding: 14px 0 22px; border-top: 1px solid var(--line); color: var(--subtle); font-size: 10px; }
.toast { position: fixed; right: 24px; bottom: 22px; max-width: min(400px, calc(100vw - 32px)); padding: 10px 14px; border: 1px solid #e3aaaa; background: white; color: var(--red); box-shadow: 0 8px 25px rgba(26, 40, 44, .12); font-size: 12px; opacity: 0; pointer-events: none; transform: translateY(6px); transition: .18s; }
.toast.show { opacity: 1; transform: translateY(0); }
[hidden] { display: none !important; }
@keyframes pulse { 50% { box-shadow: 0 0 0 4px rgba(166, 92, 18, .14); } }

@media (max-width: 1000px) {
  .content-grid { grid-template-columns: minmax(0, 1fr) 260px; gap: 24px; }
  .workflow-section { grid-template-columns: minmax(0, 1fr); gap: 15px; }
}

@media (max-width: 760px) {
  .topbar { height: 54px; padding: 0 17px; }
  .app-shell { width: min(100% - 30px, 560px); margin-top: 25px; }
  .page-heading { align-items: center; margin-bottom: 21px; }
  h1 { font-size: 21px; }
  .live-state { padding: 5px 7px; font-size: 10px; }
  .content-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .workflow-section { gap: 15px; padding: 19px 0 21px; }
  .section-title { align-items: center; }
  .section-title p { display: none; }
  .side-column { padding-top: 0; }
  .status-message { min-height: 0; }
}

@media (max-width: 420px) {
  .brand { font-size: 13px; }
  .count-row { align-items: stretch; flex-direction: column; }
  .count-field, .button-primary { width: 100%; }
  .result-actions { align-items: stretch; flex-direction: column; }
  .result-actions .button { align-self: flex-start; }
  table { min-width: 520px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

.login-shell { max-width: 520px; padding-top: 64px; }
.result-actions { flex-wrap: wrap; }
.topbar-meta { gap: 12px; }

