.douyin-panel { max-width: 1440px; }
.douyin-head { align-items: center; }
.douyin-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 8px 0 24px;
  padding: 0;
  list-style: none;
  border-bottom: 1px solid var(--line, #dce4ef);
}
.douyin-steps li {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  color: #64748b;
  font-size: 13px;
}
.douyin-steps li::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: transparent;
  content: "";
}
.douyin-steps li.active { color: #0f172a; }
.douyin-steps li.complete { color: #166534; }
.douyin-steps li.active::after { background: #2563eb; }
.douyin-steps li > span {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid #cbd5e1;
  border-radius: 50%;
  background: #fff;
  font-weight: 700;
}
.douyin-steps li.active > span { border-color: #2563eb; color: #1d4ed8; }
.douyin-steps li.complete > span { border-color: #16a34a; background: #f0fdf4; color: #166534; }
.douyin-step-pane { display: none; }
.douyin-step-pane.active { display: block; }
.douyin-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 20px;
  max-width: 980px;
}
.douyin-form-grid .field-wide { grid-column: 1 / -1; }
.mode-field { margin: 0; padding: 0; border: 0; }
.mode-field legend { margin-bottom: 8px; color: #334155; font-size: 13px; font-weight: 650; }
.segmented-control { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding: 3px; border: 1px solid #d7e0eb; border-radius: 6px; background: #eef3f8; }
.segmented-control label { cursor: pointer; }
.segmented-control input { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); opacity: 0; pointer-events: none; }
.segmented-control span { display: block; padding: 9px 12px; border-radius: 4px; text-align: center; font-size: 13px; font-weight: 650; }
.segmented-control input:checked + span { background: #fff; color: #1d4ed8; box-shadow: 0 1px 3px rgb(15 23 42 / 12%); }
.douyin-status-legend { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; color: #64748b; font-size: 12px; }
.douyin-status-legend span { padding: 3px 8px; border: 1px solid #dbe3ed; border-radius: 999px; background: #f8fafc; }
.douyin-toolbar, .douyin-flow-head, .form-actions.spread { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.douyin-toolbar { margin-bottom: 14px; }
.douyin-toolbar h3, .douyin-flow-head h3 { margin: 0 0 4px; font-size: 16px; }
.douyin-toolbar p { margin: 0; color: #64748b; font-size: 13px; }
.douyin-table-wrap { margin-bottom: 24px; }
.douyin-table-wrap td { min-width: 120px; vertical-align: top; }
.douyin-table-wrap td:last-child { min-width: 190px; }
.douyin-cell-main { display: grid; gap: 4px; }
.douyin-cell-main small { color: #64748b; }
.source-badge { display: inline-flex; width: fit-content; padding: 3px 7px; border-radius: 999px; background: #eff6ff; color: #1d4ed8; font-size: 11px; font-weight: 700; }
.source-badge.confirmed { background: #ecfdf5; color: #047857; }
.source-badge.modified { background: #fff7ed; color: #c2410c; }
.source-badge.deleted { background: #fef2f2; color: #b91c1c; }
.douyin-flow-list { display: grid; gap: 8px; margin: 12px 0 20px; }
.douyin-flow-row { display: grid; grid-template-columns: minmax(180px, .8fr) minmax(280px, 1.8fr) auto; gap: 16px; align-items: center; min-height: 64px; padding: 10px 0; border-bottom: 1px solid #e5eaf1; }
.douyin-flow-path { color: #334155; line-height: 1.55; }
.douyin-flow-actions, .douyin-row-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.douyin-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin-bottom: 24px; border-top: 1px solid #dce4ef; }
.douyin-summary-item { min-height: 88px; padding: 16px 18px; border-right: 1px solid #e5eaf1; border-bottom: 1px solid #e5eaf1; }
.douyin-summary-item:nth-child(3n) { border-right: 0; }
.douyin-summary-item small { display: block; margin-bottom: 7px; color: #64748b; }
.douyin-summary-item strong { color: #0f172a; line-height: 1.45; }
.douyin-tabs { display: flex; gap: 2px; overflow-x: auto; margin-bottom: 18px; border-bottom: 1px solid #dce4ef; scrollbar-width: thin; }
.douyin-tabs button { flex: 0 0 auto; padding: 10px 12px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: #64748b; cursor: pointer; font: inherit; font-size: 13px; }
.douyin-tabs button[aria-selected="true"] { border-bottom-color: #2563eb; color: #1d4ed8; font-weight: 700; }
.douyin-result-panel { min-height: 280px; margin-bottom: 24px; }
.douyin-result-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.douyin-result-block { padding: 0 0 16px; border-bottom: 1px solid #e5eaf1; }
.douyin-result-block h3 { margin: 0 0 8px; font-size: 14px; }
.douyin-result-block p, .douyin-result-block pre { margin: 0; white-space: pre-wrap; line-height: 1.65; overflow-wrap: anywhere; }
.douyin-json { max-height: 520px; overflow: auto; padding: 14px; border: 1px solid #dce4ef; border-radius: 6px; background: #f8fafc; font: 12px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace; }
.douyin-empty { padding: 36px 0; color: #64748b; text-align: center; }
.model-provider-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; min-width: min(720px, 75vw); }
.model-provider-form .field-wide { grid-column: 1 / -1; }
.provider-status { display: grid; gap: 3px; }
.provider-status small { color: #64748b; }
@media (max-width: 900px) {
  .douyin-form-grid, .douyin-result-grid, .model-provider-form { grid-template-columns: 1fr; min-width: 0; }
  .douyin-form-grid .field-wide, .model-provider-form .field-wide { grid-column: auto; }
  .douyin-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .douyin-summary-item:nth-child(3n) { border-right: 1px solid #e5eaf1; }
  .douyin-summary-item:nth-child(2n) { border-right: 0; }
  .douyin-flow-row { grid-template-columns: 1fr; gap: 8px; }
}
@media (max-width: 620px) {
  .douyin-steps li { justify-content: center; }
  .douyin-steps strong { display: none; }
  .douyin-toolbar, .douyin-head, .form-actions.spread { align-items: stretch; flex-direction: column; }
  .douyin-summary { grid-template-columns: 1fr; }
  .douyin-summary-item, .douyin-summary-item:nth-child(2n), .douyin-summary-item:nth-child(3n) { border-right: 0; }
  .douyin-toolbar .button-row, .form-actions.spread > .button-row { display: grid; grid-template-columns: 1fr; }
}
