:root {
  --ink: #0d0d0d;
  --muted: #6b6b72;
  --soft: #f7f7f5;
  --panel: #ffffff;
  --line: #e9e9e7;
  --line-strong: #d8d8d4;
  --blue: #eaf7ff;
  --violet: #f2edff;
  --danger: #b42318;
  --success: #067647;
  --sidebar: 240px;
}

* { box-sizing: border-box; }
html { min-height: 100%; font-size: 16px; }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--panel);
  font-family: Inter, "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a:hover { color: inherit; }
button, input { font: inherit; }
code { color: #4b4b55; }

.app-frame { min-height: 100vh; }
.app-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  display: flex;
  width: var(--sidebar);
  flex-direction: column;
  padding: 22px 16px;
  background: var(--soft);
  border-right: 1px solid #f0f0ee;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 8px 26px;
  font-size: 17px;
  font-weight: 750;
  letter-spacing: -.02em;
}
.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: var(--ink);
  box-shadow: 0 8px 20px rgba(13,13,13,.14);
}
.sidebar-label {
  margin: 6px 10px 8px;
  color: #9a9a9f;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.side-nav { display: grid; gap: 5px; }
.side-link {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 42px;
  padding: 10px 12px;
  color: #3f3f45;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 560;
  transition: background .18s ease, box-shadow .18s ease, transform .18s ease;
}
.side-link:hover, .side-link.is-active {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  transform: translateX(1px);
}
.side-icon {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  font-size: 14px;
}
.sidebar-note {
  margin-top: auto;
  padding: 14px;
  color: #77777d;
  background: rgba(255,255,255,.72);
  border: 1px solid #ededeb;
  border-radius: 14px;
  font-size: 12px;
  line-height: 1.6;
}

.app-main {
  display: flex;
  min-height: 100vh;
  margin-left: var(--sidebar);
  flex-direction: column;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  height: 68px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 32px;
  background: rgba(255,255,255,.9);
  border-bottom: 1px solid rgba(238,238,236,.85);
  backdrop-filter: blur(16px);
}
.topbar-kicker { color: #8c8c92; font-size: 13px; }
.topbar-project { display: flex; min-width: 0; align-items: center; gap: 11px; }
.topbar-project > div { display: grid; min-width: 0; gap: 1px; }
.topbar-project strong {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topbar-project small { color: #8c8c92; font-size: 11px; }
.topbar-canvas-size {
  flex: 0 0 auto;
  margin-left: 4px;
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--soft);
  color: #555;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.topbar-back {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  font-size: 17px;
  transition: background .18s ease, transform .18s ease;
}
.topbar-back:hover { background: var(--soft); transform: translateX(-1px); }
.topbar-project-list { gap: 18px; }
.topbar-actions, .account-actions, .locale-switch {
  display: flex;
  align-items: center;
  gap: 8px;
}
.locale-switch {
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
}
.locale-button {
  min-width: 42px;
  padding: 6px 10px;
  color: #707078;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font-size: 12px;
  cursor: pointer;
}
.locale-button.is-active { color: #fff; background: var(--ink); }
.account-name {
  max-width: 190px;
  overflow: hidden;
  padding: 8px 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
}
.app-content {
  flex: 1 0 auto;
  width: min(100%, 1196px);
  min-height: 0;
  margin: 0 auto;
  padding: 42px 32px 92px;
}

.eyebrow {
  color: #72727a;
  font-size: 11px;
  font-weight: 760;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.hero-panel {
  position: relative;
  overflow: hidden;
  padding: 54px 48px 42px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    radial-gradient(circle at 15% 20%, rgba(212,241,255,.92), transparent 31%),
    radial-gradient(circle at 88% 12%, rgba(231,220,255,.88), transparent 30%),
    linear-gradient(180deg, #fff 0%, #fcfcff 100%);
}
.hero-panel::after {
  position: absolute;
  right: -60px;
  bottom: -90px;
  width: 260px;
  height: 260px;
  content: "";
  border: 1px solid rgba(120,130,210,.13);
  border-radius: 50%;
  box-shadow: 0 0 0 34px rgba(165,205,255,.05), 0 0 0 68px rgba(189,171,255,.04);
}
.hero-panel h1 {
  position: relative;
  z-index: 1;
  max-width: 830px;
  margin: 12px auto 16px;
  font-size: clamp(2.1rem, 4.2vw, 4rem);
  font-weight: 780;
  line-height: 1.08;
  letter-spacing: -.055em;
}
.hero-panel > p {
  position: relative;
  z-index: 1;
  max-width: 700px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.75;
}
.hero-actions {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 26px;
}
.btn {
  border-radius: 0;
  font-weight: 620;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-dark-pill, .btn-accent {
  padding: 10px 18px;
  color: #fff;
  background: var(--ink);
  border: 1px solid var(--ink);
  box-shadow: 0 7px 18px rgba(13,13,13,.12);
}
.btn-dark-pill:hover, .btn-accent:hover { color: #fff; background: #252525; }
.btn-soft, .btn-ghost {
  padding: 10px 18px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-strong);
}
.btn-soft:hover, .btn-ghost:hover { color: var(--ink); background: #fafafa; }
.btn-sm { padding: 7px 12px; font-size: 12px; }
.client-download-hint {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}
.owner-badge {
  display: inline-block;
  padding: 4px 10px;
  font-size: 12px;
  color: #1f7a4d;
  background: #e6f4ec;
  border: 1px solid #c9e6d4;
  border-radius: 999px;
}

.section-head, .page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin: 48px 0 18px;
}
.page-heading { align-items: center; margin: 4px 0 28px; }
.page-heading.compact { justify-content: flex-start; }
.section-head h2, .page-heading h1 {
  margin: 5px 0 0;
  font-weight: 750;
  letter-spacing: -.035em;
}
.page-heading h1 { font-size: clamp(1.9rem, 4vw, 3rem); }
.page-heading p { max-width: 700px; margin: 8px 0 0; color: var(--muted); line-height: 1.65; }

.pet-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.pet-card {
  display: flex;
  min-width: 0;
  min-height: 245px;
  flex-direction: column;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 4px 20px rgba(0,0,0,.025);
  transition: transform .2s ease, box-shadow .2s ease;
}
.pet-card:hover { transform: translateY(-3px); box-shadow: 0 14px 36px rgba(75,86,150,.09); }
.pet-preview {
  display: grid;
  height: 116px;
  place-items: center;
  overflow: hidden;
  margin-bottom: 15px;
  border-radius: 13px;
  background: #f6f7fb;
  border: 1px solid var(--line);
}
.pet-preview .project-pet-image, .pet-preview img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  padding: 7px;
  box-sizing: border-box;
  object-fit: contain;
}
.pet-orb {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  color: #fff;
  border-radius: 20px;
  background: var(--ink);
  box-shadow: 0 12px 24px rgba(13,13,13,.16);
  font-weight: 800;
}
.pet-card h3 { margin: 0; font-size: 16px; font-weight: 720; }
.pet-card code { display: block; margin-top: 3px; color: #8a8a91; font-size: 11px; }
.pet-card p {
  display: -webkit-box;
  overflow: hidden;
  margin: 9px 0 13px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
/* 紧凑卡片的标题 + 描述同一行 */
.pet-card-headline {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  margin: 4px 0 8px;
}
.pet-card-headline h3 {
  flex: 0 1 auto;
  max-width: 60%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pet-card-headline p {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  font-size: 11px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  -webkit-line-clamp: unset;
  -webkit-box-orient: unset;
  display: block;
}
.pet-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
}
.pet-card-footer small { color: #8b8b92; font-size: 11px; }
.pet-card-actions { display: flex; align-items: center; gap: 6px; }
.btn-delete {
  padding: 7px 11px;
  color: #a33a32;
  background: #fff;
  border: 1px solid #f0d8d5;
}
.btn-delete:hover { color: #8c2822; background: #fff5f4; }

/* ===== /create/Index：左右分栏（已发布 / 未发布）===== */
.app-content:has(.project-board) {
  width: min(100%, 1480px);
  padding-top: 26px;
}
.project-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}
.project-column {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.project-column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 4px 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}
.project-column-title {
  display: flex;
  align-items: center;
  gap: 10px;
}
.project-column-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 760;
  letter-spacing: -.02em;
}
.project-column-header small {
  color: var(--muted);
  font-size: 12px;
}
.project-column-tag {
  display: inline-block;
  padding: 3px 9px;
  font-size: 10px;
  font-weight: 760;
  letter-spacing: .14em;
  border-radius: 999px;
}
.project-column-tag-published {
  color: #1f7a4d;
  background: #e3f6ec;
  border: 1px solid #b6e2c9;
}
.project-column-tag-draft {
  color: #6b6b73;
  background: #f1f1f4;
  border: 1px solid #e0e0e6;
}
.project-column-empty {
  padding: 36px 18px;
  text-align: center;
  color: var(--muted);
  background: #fafafd;
  border: 1px dashed var(--line);
  border-radius: 14px;
}
.project-column-empty p { margin: 0; font-weight: 650; color: #6a6a72; }
.project-column-empty small { display: block; margin-top: 6px; font-size: 12px; }

/* 紧凑版卡片：每列内自适应 2 列 */
.pet-grid-compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.pet-card-compact {
  min-height: 0;
  padding: 12px;
  border-radius: 14px;
}
.pet-card-compact .pet-preview {
  height: 96px;
  margin-bottom: 8px;
  border-radius: 10px;
}
.pet-card-compact .pet-orb { width: 40px; height: 40px; border-radius: 14px; font-size: 11px; }
.pet-card-compact h3 { font-size: 14px; }
.pet-card-compact .pet-card-footer small { font-size: 10px; }
.pet-card-compact .btn-sm { padding: 5px 9px; font-size: 12px; }
.pet-card-compact .pet-card-actions { gap: 4px; }

/* 已发布卡片：左上角 revision 角标 + 绿色边框暗示 */
.pet-card-published {
  border-color: #c9e6d4;
  background: linear-gradient(180deg, #f6fdf8 0%, #fff 30%);
}
.pet-card-published:hover { box-shadow: 0 14px 36px rgba(31, 122, 77, .12); }
.pet-card-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 760;
  color: #1f7a4d;
  background: #fff;
  border: 1px solid #b6e2c9;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(31, 122, 77, .15);
}
.pet-card-compact { position: relative; }

@media (max-width: 1180px) {
  .project-board { grid-template-columns: 1fr; gap: 22px; }
}
@media (max-width: 560px) {
  .pet-grid-compact { grid-template-columns: 1fr; }
}
.empty-state {
  padding: 54px 24px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line-strong);
  border-radius: 18px;
  grid-column: 1 / -1;
}

.surface, .table-panel, .upload-panel, .bundle-guide, .json-grid section, .metric-grid > div {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
}
.table-panel { overflow: hidden; }
.table { --bs-table-bg: transparent; margin: 0; }
.table > :not(caption) > * > * { padding: 15px 18px; border-bottom-color: #f0f0ee; }
.table thead th {
  color: #8a8a91;
  background: #fafaf9;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.table tbody tr:last-child td { border-bottom: 0; }
.publish-layout { display: grid; grid-template-columns: 1.18fr .82fr; gap: 18px; }
.upload-panel, .bundle-guide { padding: 26px; }
.upload-dropzone {
  padding: 34px 22px;
  text-align: center;
  background: linear-gradient(180deg, #fbfdff, #fbfaff);
  border: 1px dashed #ccd5ea;
  border-radius: 16px;
}
.form-label { margin-bottom: 8px; color: #39393f; font-size: 13px; font-weight: 650; }
.form-control {
  min-height: 45px;
  border-color: var(--line-strong);
  border-radius: 12px;
  box-shadow: none !important;
}
.form-control:focus { border-color: var(--ink); }
.form-check-input:checked { background-color: var(--ink); border-color: var(--ink); }
.bundle-guide h2 { margin: 0 0 14px; font-size: 16px; }
.bundle-guide pre, .json-grid pre {
  margin: 0;
  padding: 18px;
  color: #e9e9ed;
  background: #151517;
  border-radius: 13px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.bundle-guide ul { margin: 18px 0 0; padding-left: 18px; color: var(--muted); font-size: 13px; line-height: 1.8; }
.validation-panel { margin-top: 16px; padding: 14px; color: var(--danger); background: #fff3f1; border-radius: 12px; }
.info-panel { margin-top: 16px; padding: 14px; color: #2f6a4a; background: #eafaf0; border-radius: 12px; }
.metric-grid { display: grid; margin-bottom: 16px; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.metric-grid > div { min-width: 0; padding: 16px; }
.metric-grid span { display: block; margin-bottom: 6px; color: #8a8a91; font-size: 11px; }
.metric-grid code { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.json-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.json-grid section { min-width: 0; padding: 16px; }
.json-grid h2 { margin: 0 0 12px; font-size: 14px; }
.json-grid pre { max-height: 620px; overflow: auto; font-size: 12px; }

.auth-shell { display: grid; min-height: calc(100vh - 220px); place-items: center; }
.auth-card {
  width: min(100%, 470px);
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 20px 70px rgba(63,68,110,.09);
}
.auth-mark {
  display: grid;
  width: 44px;
  height: 44px;
  margin-bottom: 22px;
  place-items: center;
  color: #fff;
  border-radius: 14px;
  background: var(--ink);
}
.auth-card h1 { margin: 0; font-size: 28px; font-weight: 760; letter-spacing: -.04em; }
.auth-card .lead-copy { margin: 8px 0 26px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.auth-card .form-row { margin-bottom: 16px; }
.auth-switch { margin: 20px 0 0; text-align: center; color: var(--muted); font-size: 13px; }
.auth-switch a { color: var(--ink); font-weight: 700; }
.auth-code-row { display: flex; gap: 8px; align-items: stretch; }
.auth-code-row .form-control { flex: 1 1 auto; min-width: 0; }
.auth-code-row .auth-code-btn {
  flex: 0 0 auto;
  padding: 0 16px;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 600;
}
.auth-code-btn.is-busy { opacity: .7; cursor: not-allowed; }
.auth-code-hint { display: block; margin-top: 6px; font-size: 12px; }
.auth-code-hint.text-success { color: #1a7f37 !important; }
.text-danger { color: var(--danger) !important; font-size: 12px; }
.alert { border: 0; border-radius: 13px; }
.alert-success { color: var(--success); background: #ecfdf3; }
.alert-danger { color: var(--danger); background: #fff3f1; }

.admin-page { width: 100%; }
.app-content:has(.admin-page) {
  width: 100%;
  max-width: none;
  padding-right: 24px;
  padding-left: 24px;
}
.admin-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line-strong);
}
.admin-tabs a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  font-size: 14px;
}
.admin-tabs a.is-active { color: var(--ink); border-bottom-color: var(--ink); font-weight: 700; }
.admin-tabs b {
  padding: 2px 7px;
  background: var(--soft);
  font-size: 11px;
}
.admin-table-panel td strong,
.admin-table-panel td small { display: block; }
.admin-table-panel td small { margin-top: 3px; color: var(--muted); }
.admin-table-panel { overflow-x: auto; }
.admin-table-panel .table { min-width: 1240px; }
.admin-table-panel th:last-child,
.admin-table-panel td:last-child {
  width: 570px;
  min-width: 570px;
}
.admin-row-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}
.admin-row-actions form { flex: 0 0 auto; margin: 0; }
.admin-row-actions .btn { white-space: nowrap; }
.admin-status {
  display: inline-block;
  padding: 4px 8px;
  color: var(--success);
  border: 1px solid #b6e2c9;
  background: #effaf4;
  font-size: 11px;
}
.admin-status.is-disabled { color: var(--danger); border-color: #f0c4bf; background: #fff4f2; }
.admin-status.is-admin { color: #4338ca; border-color: #c7d2fe; background: #eef2ff; }
.admin-pet-list { display: grid; gap: 12px; }
.admin-pet-card { padding: 18px; border: 1px solid var(--line); background: #fff; }
.admin-pet-card header { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.admin-pet-card header > div:first-child { min-width: 0; }
.admin-pet-card header strong { display: block; font-size: 16px; }
.admin-pet-card header small { display: block; margin-top: 4px; color: var(--muted); overflow-wrap: anywhere; }
.admin-pet-form {
  display: grid;
  grid-template-columns: minmax(150px, .7fr) minmax(240px, 1.5fr) auto auto auto;
  align-items: end;
  gap: 10px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.admin-pet-form label > span:first-child { display: block; margin-bottom: 6px; color: var(--muted); font-size: 11px; }
.admin-pet-form .form-check { display: flex; min-height: 45px; align-items: center; gap: 7px; margin: 0; white-space: nowrap; }
.admin-pet-form .form-check span { margin: 0; color: var(--ink); font-size: 13px; }
.admin-edit-notice {
  margin-bottom: 14px;
  padding: 10px 13px;
  color: #4338ca;
  border: 1px solid #c7d2fe;
  background: #eef2ff;
  font-size: 13px;
}

@media (max-width: 1050px) {
  .admin-pet-form { grid-template-columns: 1fr 1fr; }
  .admin-description-field { grid-column: 2; }
}

/* ===== Admin / actions tab：行为模板编辑 ===== */
.behavior-template-list { display: grid; gap: 16px; }
.behavior-template-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 14px 0;
}
.behavior-template-tabs a {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 9px 13px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
}
.behavior-template-tabs a small { font-size: 10px; opacity: .72; }
.behavior-template-tabs a.is-active {
  color: #fff;
  border-color: #111827;
  background: #111827;
}
.behavior-template-tabs .behavior-template-add-tab { color: #0369a1; border-style: dashed; }
.behavior-template-tabs .behavior-template-add-tab.is-active { color: #fff; border-style: solid; background: #0369a1; }
.behavior-create-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 120px;
  gap: 12px;
}
.behavior-create-grid .form-label { display: block; margin-bottom: 6px; }
.behavior-template-hint {
  margin: 0 0 4px;
  padding: 10px 14px;
  color: #4338ca;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.6;
}
.behavior-template-card {
  padding: 18px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
}
.behavior-template-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.behavior-template-header h3 { margin: 0; font-size: 16px; }
.behavior-template-header small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.behavior-enabled-toggle { display: flex; align-items: center; gap: 8px; margin: 0; white-space: nowrap; }
.behavior-template-body { padding-top: 14px; display: grid; gap: 14px; }
.behavior-template-field label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 12px; }
.behavior-phase-grid { display: grid; gap: 14px; }
.behavior-phase-row {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafafa;
}
.behavior-phase-label { margin-bottom: 8px; }
.behavior-phase-label strong { display: block; font-size: 13px; }
.behavior-phase-label small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.behavior-prompt-textarea {
  width: 100%;
  min-height: 220px;
  resize: vertical;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.6;
}
.behavior-phase-duration {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}
.behavior-phase-duration input { width: 80px; }
.behavior-params-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.behavior-params-grid label { display: block; margin-bottom: 5px; color: var(--muted); font-size: 11px; }
.behavior-params-grid small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.behavior-template-footer {
  padding-top: 14px;
  margin-top: 4px;
  border-top: 1px solid var(--line);
  text-align: right;
}
@media (max-width: 1050px) {
  .behavior-params-grid { grid-template-columns: 1fr 1fr; }
  .behavior-create-grid { grid-template-columns: 1fr 1fr; }
}

.site-footer {
  padding: 20px 32px 28px;
  color: #9a9aa0;
  text-align: center;
  font-size: 12px;
}

.project-pet-image {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 12px 18px rgba(56,65,120,.16));
}
.creator-narrow { width: min(100%, 760px); margin: 0 auto; }
.creator-form { padding: 28px; }
.creator-form .form-row { margin-bottom: 20px; }
.creator-prompt { min-height: 118px; resize: vertical; }
.canvas-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 18px; }
.form-select {
  min-height: 45px;
  border-color: var(--line-strong);
  border-radius: 12px;
  box-shadow: none !important;
}
.form-select:focus { border-color: var(--ink); }
.creator-workbench {
  display: grid;
  grid-template-columns: minmax(300px, 390px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.creator-stage-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 18px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--soft);
}
.creator-stage-tabs a {
  display: flex;
  min-height: 42px;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #74747b;
  border-radius: 10px;
  font-size: 13px;
}
.creator-stage-tabs a.is-active {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  font-weight: 700;
}
.creator-stage-tabs b {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  color: #777;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  font-size: 10px;
}
.creator-stage-tabs .is-active b { color: #fff; background: var(--ink); border-color: var(--ink); }
.creator-stage-tabs small { padding: 2px 6px; color: #888; background: #f0f0ee; border-radius: 999px; font-size: 9px; }
.creator-mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-bottom: 18px;
  padding: 4px;
  background: var(--soft);
  border-radius: 12px;
}
.creator-mode-tabs--three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.creator-mode-tabs button {
  padding: 9px;
  color: #777;
  border: 0;
  border-radius: 9px;
  background: transparent;
  font-size: 13px;
  cursor: pointer;
}
.creator-mode-tabs--three button {
  min-width: 0;
  padding-inline: 5px;
  line-height: 1.35;
}
.creator-mode-tabs button.is-active { color: var(--ink); background: #fff; box-shadow: 0 2px 7px rgba(0,0,0,.06); font-weight: 700; }
.master-analysis-status { margin-top: 10px; min-height: 20px; font-size: 13px; color: var(--muted); }
.master-analysis-status.is-error { color: #b42318; }
.master-analysis-status.is-ok { color: #087443; }
.master-timeline { margin-top: 14px; }
.master-timeline-header { display:flex; justify-content:space-between; gap:12px; align-items:baseline; margin-bottom:9px; }
.master-timeline-header small { color: var(--muted); }
.master-timeline-track { display:flex; height:32px; overflow:hidden; border-radius:8px; background:#eef2f7; border:1px solid #d8e0ea; }
.master-timeline-segment { min-width:3px; display:flex; align-items:center; justify-content:center; color:#fff; font-size:11px; font-weight:700; border-right:1px solid rgba(255,255,255,.75); overflow:hidden; white-space:nowrap; }
.master-timeline-segment:nth-child(6n+1) { background:#0f766e; } .master-timeline-segment:nth-child(6n+2) { background:#2563eb; }
.master-timeline-segment:nth-child(6n+3) { background:#9333ea; } .master-timeline-segment:nth-child(6n+4) { background:#c2410c; }
.master-timeline-segment:nth-child(6n+5) { background:#be123c; } .master-timeline-segment:nth-child(6n+6) { background:#4f46e5; }
.master-action-plans { display:grid; gap:10px; margin-top:12px; }
.master-action-plan { border:1px solid #dfe5ec; border-radius:10px; padding:11px 12px; background:#fff; }
.master-action-plan-header { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-bottom:8px; }
.master-action-plan-header strong { flex:1; min-width:130px; }
.master-action-plan-header input, .master-action-plan-header select { width:auto; min-width:110px; max-width:180px; }
.master-confidence { font-size:11px; color:#64748b; }
.master-phase-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
.master-phase { padding:8px; border-radius:8px; background:#f8fafc; border:1px solid #edf1f5; }
.master-phase.is-empty { display:none; }
.master-phase label { display:block; font-size:11px; color:#64748b; margin-bottom:4px; }
.master-phase .master-time-row { display:grid; grid-template-columns:1fr 1fr; gap:5px; }
.master-phase input[type=number] { min-width:0; font-size:12px; }
.master-phase small { display:block; margin-top:4px; color:#64748b; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.master-phase button { margin-top:6px; border:0; background:transparent; color:#2563eb; font-size:12px; padding:0; cursor:pointer; }
.master-preview-dialog { width:min(880px,94vw); padding:0; border:0; border-radius:14px; background:#fff; box-shadow:0 24px 70px rgba(15,23,42,.35); }
.master-preview-dialog::backdrop { background:rgba(15,23,42,.62); backdrop-filter:blur(2px); }
.master-preview-panel { display:grid; gap:0; }
.master-preview-panel header, .master-preview-panel footer { display:flex; align-items:center; justify-content:space-between; gap:14px; padding:13px 16px; }
.master-preview-panel header { border-bottom:1px solid var(--line); }
.master-preview-panel header button { border:0; background:transparent; color:#64748b; font-size:25px; line-height:1; cursor:pointer; }
.master-preview-panel video { display:block; width:100%; max-height:72vh; background:#0f172a; }
.master-preview-panel footer { border-top:1px solid var(--line); }
.master-preview-panel footer small { color:var(--muted); }
.master-watermark-options { display:flex; align-items:center; gap:12px; flex-wrap:wrap; margin:-4px 0 20px; padding:14px 16px; border:1px solid #dbe6ee; border-radius:10px; background:#f7fbfd; }
.master-watermark-options > div { flex:1 1 360px; display:grid; gap:3px; }
.master-watermark-options > div strong { font-size:13px; }
.master-watermark-options > div small { color:var(--muted); line-height:1.55; }
.master-crop-toggle { display:flex; align-items:center; gap:7px; font-size:13px; cursor:pointer; }
.master-crop-toggle input { accent-color:var(--ink); }
.master-crop-summary { flex:0 0 100%; color:#475467; font-size:12px; }
.master-crop-dialog { width:min(960px,96vw); padding:0; border:0; border-radius:14px; background:#fff; box-shadow:0 24px 70px rgba(15,23,42,.35); }
.master-crop-dialog::backdrop { background:rgba(15,23,42,.68); backdrop-filter:blur(2px); }
.master-crop-panel { display:grid; }
.master-crop-panel header, .master-crop-panel footer { display:flex; align-items:center; justify-content:space-between; gap:14px; padding:13px 16px; }
.master-crop-panel header { border-bottom:1px solid var(--line); }
.master-crop-panel header > div { display:grid; gap:3px; }
.master-crop-panel header small { color:var(--muted); font-weight:400; }
.master-crop-panel header > button { border:0; background:transparent; color:#64748b; font-size:25px; line-height:1; cursor:pointer; }
.master-crop-stage { position:relative; width:100%; max-height:68vh; margin:auto; overflow:hidden; background:#0f172a; touch-action:none; user-select:none; }
.master-crop-stage video { display:block; width:100%; height:100%; object-fit:fill; pointer-events:none; }
.master-crop-box { position:absolute; z-index:2; border:2px solid #38bdf8; box-shadow:0 0 0 9999px rgba(2,6,23,.25); cursor:move; touch-action:none; }
.master-crop-box::before { content:""; position:absolute; inset:0; outline:1px dashed rgba(255,255,255,.7); outline-offset:-5px; }
.master-crop-box > img { position:absolute; inset:0; width:100%; height:100%; object-fit:fill; opacity:0; pointer-events:none; transition:opacity .15s ease; }
.master-crop-box > img.is-visible { opacity:.5; }
.master-crop-size { position:absolute; top:6px; left:7px; padding:3px 6px; border-radius:4px; color:#fff; background:rgba(15,23,42,.72); font-size:11px; pointer-events:none; }
.master-crop-box i { position:absolute; right:-8px; bottom:-8px; width:18px; height:18px; border:2px solid #fff; border-radius:50%; background:#0ea5e9; cursor:nwse-resize; }
.master-crop-fields { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; padding:13px 16px; border-top:1px solid var(--line); }
.master-crop-fields label { display:grid; grid-template-columns:auto 1fr; align-items:center; gap:7px; color:var(--muted); font-size:12px; }
.master-crop-fields input { min-width:0; width:100%; padding:7px 8px; border:1px solid var(--line-strong); border-radius:7px; }
.master-crop-panel footer { border-top:1px solid var(--line); }
.master-crop-panel footer > div { display:flex; gap:8px; }
.master-crop-reference-toggle { display:flex; align-items:center; gap:5px; color:var(--muted); font-size:12px; cursor:pointer; }
.actions-page-heading--toolbar { justify-content:flex-end; }
@media (max-width: 700px) { .master-timeline-header { display:block; } .master-phase-grid { grid-template-columns:1fr; } }
@media (max-width: 600px) { .master-crop-fields { grid-template-columns:1fr 1fr; } .master-crop-panel footer { align-items:stretch; flex-direction:column; } }

/* 行为标签面板（预置框） */
.preset-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.preset-tag {
  display: inline-flex;
  align-items: center;
  padding: 5px 14px;
  font-size: 14px;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  cursor: pointer;
  user-select: none;
  transition: all .15s ease;
}
.preset-tag:hover { border-color: var(--ink); color: var(--ink); }
.preset-tag.is-selected {
  color: #fff;
  background: var(--ink);
  border-color: var(--ink);
  font-weight: 600;
}
.creator-section-grid {
  display: grid;
  width: 100%;
  grid-template-columns: minmax(340px, 420px) minmax(0, 1fr);
  align-items: start;
  gap: 18px;
}
.creator-section-grid--single {
  grid-template-columns: minmax(0, 1fr);
}
.creator-section-grid--list {
  grid-template-columns: minmax(0, 1fr);
}
.actions-page-heading {
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:20px;
  margin-bottom:18px;
}
.actions-page-heading h2 { margin:4px 0 3px; font-size:24px; }
.actions-page-heading p { margin:0; color:var(--muted); font-size:13px; }
.actions-page-heading .btn { flex:0 0 auto; }
.creator-section-grid .creator-form h2 { margin: 5px 0 7px; font-size: 22px; }
.creator-help { margin: 0 0 20px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.action-loop { display: flex; height: 45px; align-items: center; gap: 8px; margin-top: 26px; font-size: 13px; }
.action-loop input { accent-color: var(--ink); }
.action-builder .creator-mode-tabs { margin-top: 2px; }
.action-video-specs {
  display: grid;
  grid-template-columns: 88px auto 1fr;
  align-items: center;
  gap: 10px;
}
.action-video-specs span {
  color: var(--muted);
  font-size: 12px;
}
.action-video-specs b {
  justify-self: end;
  padding: 7px 10px;
  border: 1px solid var(--line);
  background: var(--soft);
  font-size: 12px;
  font-weight: 700;
}
.action-duration-grid {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.action-duration-field {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}
.action-duration-field input { width: 76px; }
.action-duration-field input:disabled { background: #f1f5f9; color: #cbd5e1; }
.action-duration-ratio {
  margin-left: auto;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
.image-paste-zone {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px dashed var(--line-strong);
  background: #fafafa;
  outline: none;
}
.image-paste-zone:focus-within,
.image-paste-zone:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}
.image-paste-zone > span,
.image-paste-zone > small {
  color: var(--muted);
  font-size: 12px;
}
.image-paste-zone > small:empty { display: none; }
.name-edit-button {
  display: inline-grid;
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  background: #fff;
  color: #63636b;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.name-edit-button:hover { color: #3730a3; border-color: #a5b4fc; }
.rename-dialog {
  position: fixed;
  z-index: 2200;
  inset: 0;
  display: none;
  place-items: center;
  padding: 20px;
}
.rename-dialog.is-open { display: grid; }
.rename-dialog-card {
  position: relative;
  width: min(100%, 420px);
  padding: 24px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(24,27,46,.22);
}
.rename-dialog-card h2 { margin: 0 0 18px; font-size: 18px; }
.rename-dialog-card .confirm-dialog-actions { margin-top: 20px; }
.profile-dialog {
  position: fixed;
  z-index: 2250;
  inset: 0;
  display: none;
  place-items: center;
  padding: 20px;
}
.profile-dialog.is-open { display: grid; }
.profile-dialog-card {
  position: relative;
  width: min(100%, 620px);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 26px;
  background: #fff;
  border: 1px solid #d9dde5;
  box-shadow: 0 24px 70px rgba(24,27,46,.24);
  animation: dialog-in .18s ease-out;
}
.profile-dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}
.profile-dialog-header h2 { margin: 3px 0 0; font-size: 22px; }
.profile-dialog-close {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid #d9dde5;
  background: #fff;
  color: #4b5563;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.profile-dialog-close:hover { border-color: #9ca3af; color: #111827; }
.profile-dialog-intro {
  margin: 9px 0 20px;
  color: var(--muted);
  font-size: 13px;
}
.profile-dialog-error {
  margin: 0 0 16px;
  padding: 10px 12px;
  border-left: 3px solid #dc2626;
  background: #fef2f2;
  color: #991b1b;
  font-size: 13px;
}
.profile-dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 22px;
}
.profile-dialog-actions .btn { justify-content: center; }
.rename-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0 0 12px;
}
.rename-presets[hidden] { display: none; }
.rename-preset-button {
  padding: 7px 11px;
  color: #4b5563;
  border: 1px solid #d7dbe2;
  background: #fff;
  font-size: 13px;
  cursor: pointer;
}
.rename-preset-button:hover,
.rename-preset-button.is-active {
  color: #3730a3;
  border-color: #818cf8;
  background: #eef2ff;
}
.action-method-note {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #fafbff;
}
.action-method-note strong { font-size: 14px; }
.action-method-note small { color: var(--muted); line-height: 1.55; }
.action-generation-status {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 16px;
  padding: 10px 12px;
  color: #475078;
  border-radius: 11px;
  background: #f0f3ff;
  font-size: 12px;
  flex-wrap: wrap;
}
.action-generation-status .phase-progress-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  width: 100%;
  margin-top: 6px;
}
.phase-progress-grid .phase-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 4px;
  border-radius: 7px;
  background: #ffffff;
  border: 1px solid #dfe3f0;
  font-size: 11px;
  color: #7c83a8;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.phase-progress-grid .phase-step.is-active {
  background: #1f2547;
  border-color: #1f2547;
  color: #ffffff;
}
.phase-progress-grid .phase-step.is-done {
  background: #e6f7e9;
  border-color: #b6dec3;
  color: #2a8f48;
}
.phase-progress-grid .phase-step .phase-step-name {
  font-weight: 600;
  letter-spacing: 0.04em;
}
.phase-progress-grid .phase-step .phase-step-pct {
  font-variant-numeric: tabular-nums;
  font-size: 10.5px;
  opacity: 0.85;
}
.creator-prompt-sm {
  min-height: 60px;
  font-size: 13px;
  line-height: 1.5;
  resize: vertical;
}
.creator-phase-hint {
  display: block;
  font-weight: 400;
  color: var(--muted);
  font-size: 11.5px;
  margin-top: 2px;
}

.creator-upload-source-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}
.creator-upload-source-row .btn { white-space: nowrap; }
.creator-library-selection {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.creator-library-selection.is-selected { color: #0369a1; font-weight: 700; }

.green-library-dialog:not([open]) { display: none; }
.green-library-dialog {
  position: fixed;
  inset: 0;
  width: 100vw;
  max-width: none;
  height: 100vh;
  max-height: none;
  margin: 0;
  padding: 5vh 16px;
  border: 0;
  box-sizing: border-box;
  background: transparent;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.green-library-dialog[open] { display: flex; }
.green-library-dialog::backdrop {
  background: rgba(15, 23, 42, 0.56);
  backdrop-filter: blur(4px);
}
.green-library-panel {
  width: min(1040px, 96vw);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 18px;
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.28);
}
.green-library-header {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--line);
}
.green-library-header h3 { margin: 0; font-size: 20px; }
.green-library-header p { margin: 5px 34px 0 0; color: var(--muted); font-size: 13px; }
.green-library-close {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: var(--soft);
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
.green-library-grid {
  min-height: 220px;
  padding: 20px 24px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-content: start;
  gap: 16px;
  overflow: auto;
}
.green-library-item {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 14px;
  background: #f8fafc;
  box-shadow: 0 0 0 1px var(--line);
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .15s;
  height: 180px;
}
.green-library-item:hover { transform: translateY(-1px); }
.green-library-item:focus-visible { outline: 3px solid rgba(14, 165, 233, .25); outline-offset: 2px; }
.green-library-item.is-selected {
  border-color: #0ea5e9;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, .16);
}
.green-library-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0f172a;
  overflow: hidden;
  cursor: pointer;
}
.green-library-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.green-library-play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(15, 23, 42, .55);
  font-size: 18px;
  cursor: pointer;
  transition: background .15s, transform .15s;
  z-index: 10;
}
.green-library-play:hover { background: rgba(15, 23, 42, .75); transform: scale(1.06); }
.green-library-thumb video {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #0f172a;
}
/* 播放中：隐藏封面与播放按钮，显示视频 */
.green-library-item.is-playing .green-library-play { display: none; }
.green-library-item.is-playing img { display: none; }
.green-library-item.is-playing video { display: block; }
.green-library-item-meta {
  display: grid;
  gap: 3px;
  padding: 11px 12px 12px;
}
.green-library-item-meta strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}
.green-library-item-meta span { color: var(--muted); font-size: 11px; }
.green-library-check {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 25px;
  height: 25px;
  display: none;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #0ea5e9;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(15, 23, 42, .3);
}
.green-library-item.is-selected .green-library-check { display: grid; }
.green-library-empty {
  grid-column: 1 / -1;
  align-self: center;
  padding: 48px 16px;
  text-align: center;
  color: var(--muted);
}
.green-library-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  border-top: 1px solid var(--line);
  background: #fff;
}
.green-library-footer > div { display: flex; gap: 10px; }

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

@media (max-width: 640px) {
  .creator-upload-source-row {
    grid-template-columns: 1fr;
  }
  .green-library-dialog { padding: 0; }
  .green-library-panel { width: 100vw; max-height: 100vh; height: 100vh; border-radius: 0; }
  .green-library-grid { grid-template-columns: 1fr; padding: 14px; }
  .green-library-header, .green-library-footer { padding-left: 16px; padding-right: 16px; }
  .green-library-footer { align-items: stretch; flex-direction: column-reverse; }
  .green-library-footer > div { display: grid; grid-template-columns: 1fr 1.5fr; }
}
.action-list {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}
.action-list .empty-state { padding: 20px 16px; }
.behavior-list {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}
.behavior-list .empty-state { padding: 20px 16px; }
.behavior-publish-footer {
  display: flex;
  justify-content: center;
  margin-top: 30px;
  padding: 0 0 8px;
}
.behavior-publish-footer .btn {
  min-width: 220px;
  min-height: 44px;
  border-radius: 0;
}
.action-card {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}
.action-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  transition: background 0.15s;
}
.action-row:last-child { border-bottom: none; }
.action-row:hover { background: #f8f9fb; }
.action-row.action-phase-frame {
  margin: 0 10px;
  border-left: 2px solid #ef4444;
  border-right: 2px solid #ef4444;
  background: #fffafa;
}
.action-row.action-phase-frame.is-first {
  margin-top: 10px;
  border-top: 2px solid #ef4444;
  border-radius: 10px 10px 0 0;
}
.action-row.action-phase-frame.is-last {
  margin-bottom: 10px;
  border-bottom: 2px solid #ef4444;
  border-radius: 0 0 10px 10px;
}
.action-row-preview {
  position: relative;
  flex-shrink: 0;
  width: 80px;
  height: 80px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.action-row-preview img,
.action-row-preview video {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.action-row-preview > span {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}
.action-row-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.action-row-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.action-row-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.action-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-shrink: 0;
  flex-wrap: wrap;
}
.action-row-actions .btn { white-space: nowrap; }

.action-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}
.action-list-toolbar {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:11px 16px;
  border-bottom:1px solid var(--line);
  background:#fafafd;
}
.action-list-toolbar > span { color:var(--muted); font-size:12px; }
.action-list-toolbar form { display:flex; align-items:center; gap:8px; }
.action-list-toolbar label { color:var(--muted); font-size:12px; white-space:nowrap; }
.action-list-toolbar select { width:auto; min-width:150px; }
.action-selection-toolbar { display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.action-select-all { display:flex; align-items:center; gap:6px; cursor:pointer; }
.action-selection-toolbar > span { color:var(--muted); font-size:12px; }
.action-select-checkbox { flex-shrink:0; cursor:pointer; }
.action-list-toolbar { flex-wrap:wrap; }
.action-row-usage {
  flex:0 0 72px;
  display:flex;
  justify-content:center;
}
.action-usage-status {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:62px;
  padding:4px 9px;
  border-radius:999px;
  font-size:11px;
  font-weight:700;
  white-space:nowrap;
}
.action-usage-status.is-used { color:#067647; background:#dcfae6; border:1px solid #abefc6; }
.action-usage-status.is-idle { color:#667085; background:#f2f4f7; border:1px solid #e4e7ec; }

/* 阶段徽章：ENTER / BASE / EXIT */
.phase-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  border-radius: 4px;
  background: #f1f1f4;
  color: var(--muted);
  border: 1px solid var(--line-strong);
}
.phase-badge.phase-enter { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.phase-badge.phase-base  { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.phase-badge.phase-exit  { background: #fff7ed; color: #c2410c; border-color: #fed7aa; }

.behavior-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  transition: background 0.15s;
}
.behavior-row:last-child { border-bottom: none; }
.behavior-row:hover { background: #f8f9fb; }
.behavior-row-trigger {
  flex-shrink: 0;
  min-width: 72px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  color: #4d5b79;
  background: #edf6ff;
  border-radius: 999px;
  text-align: center;
}
.behavior-row-trigger.is-state-idle {
  color: #6b4fbb;
  background: #f2edff;
}
.behavior-row-body {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.behavior-row-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.behavior-row-meta {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}
.behavior-row .btn-delete { flex-shrink: 0; }
.behavior-row > .js-delete-project { grid-column:4; grid-row:1; margin:0; }
.behavior-edit-toggle { grid-column:3; grid-row:1; white-space:nowrap; }
.behavior-row .behavior-edit-toggle,
.behavior-row .behavior-edit-toggle:hover,
.behavior-row .behavior-edit-toggle:focus-visible,
.behavior-row .behavior-edit-toggle:active { color:#0d0d0d; background:#fff; border-color:var(--line-strong); transform:none; }
.behavior-row .behavior-edit-toggle:hover { background:#edf1f5; }
.behavior-edit-form { grid-column:1 / -1; grid-row:2; display:grid; gap:12px; padding:16px; border:1px solid var(--line); border-radius:12px; }
.behavior-edit-form[hidden] { display:none; }
.behavior-edit-form .behavior-numbers { grid-template-columns:repeat(2,minmax(0,1fr)); }
.behavior-edit-form > button { justify-self:start; }
@media(max-width:720px) { .behavior-edit-form .behavior-numbers { grid-template-columns:1fr; } }
.action-preview {
  position: relative;
  display: grid;
  width: 112px;
  height: 88px;
  place-items: center;
  overflow: hidden;
  border-radius: 12px;
  background: #f6f7fb;
  border: 1px solid var(--line);
  color: #888;
  font-size: 11px;
}
.action-preview img, .action-preview video { display: block; max-width: 100%; max-height: 100%; object-fit: contain; }
.action-preview-controls {
  position: absolute;
  right: 3px;
  bottom: 3px;
  left: 3px;
  display: flex;
  gap: 3px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .15s ease, transform .15s ease;
}
.action-preview:hover .action-preview-controls,
.action-preview:focus-within .action-preview-controls {
  opacity: 1;
  transform: translateY(0);
}
.action-preview-button {
  min-width: 0;
  height: 25px;
  flex: 1;
  padding: 0 6px;
  color: #fff;
  border: 1px solid rgba(255,255,255,.65);
  border-radius: 2px;
  background: rgba(15,23,42,.82);
  font-size: 10px;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}
.action-preview-button:hover { background: rgba(15,23,42,.98); }
.action-preview-button:focus-visible {
  outline: 2px solid rgba(99,102,241,.55);
  outline-offset: 1px;
}
@media (hover: none) {
  .action-preview-controls {
    opacity: 1;
    transform: none;
  }
}
.action-preview-play {
  position: absolute;
  inset: 50% auto auto 50%;
  display: grid;
  width: 36px;
  height: 32px;
  place-items: center;
  padding: 0 0 0 2px;
  transform: translate(-50%, -50%);
  color: #fff;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 2px;
  background: rgba(15,23,42,.76);
  box-shadow: 0 4px 12px rgba(15,23,42,.24);
  font-size: 15px;
  cursor: pointer;
}
.action-preview-play:hover {
  background: rgba(15,23,42,.94);
}
.action-preview-play:focus-visible {
  outline: 3px solid rgba(99,102,241,.4);
  outline-offset: 2px;
}
.action-info { min-width: 0; }
.action-info h3 { margin: 0; font-size: 15px; }
.action-info p { margin: 0; color: var(--muted); font-size: 11px; }
.action-info-line {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex-wrap: nowrap;
  white-space: nowrap;
}
.action-info-line h3 {
  flex: 0 0 auto;
  overflow: hidden;
  max-width: 180px;
  text-overflow: ellipsis;
}
.action-status {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  min-height: 27px;
  padding: 3px 9px;
  color: #475569;
  border: 1px solid #dbe3ef;
  border-radius: 2px;
  background: #f8fafc;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}
.action-status.is-pending {
  color: #7c4a03;
  border-color: #fde68a;
  background: #fef3c7;
}
.action-status.is-ready {
  color: #1d4ed8;
  border-color: #bfdbfe;
  background: #eff6ff;
}
.action-status.is-video {
  color: #6d28d9;
  border-color: #ddd6fe;
  background: #f5f3ff;
}
.action-card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}
.action-card-actions .btn { white-space: nowrap; }
.action-card-actions .btn { border-radius: 0 !important; }
/* 行走/奔跑方向与标题、状态保持同一行 */
.action-meta-form {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  margin: 0;
}
.action-meta-field {
  display: flex;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}
.action-meta-field span { font-weight: 600; }
.action-meta-field .form-select-sm,
.action-meta-field .form-control-sm {
  padding: 3px 6px;
  font-size: 12px;
  height: auto;
  width: 64px;
}
.action-facing-select.form-select {
  width: 76px;
  min-width: 76px;
  height: 29px;
  padding: 3px 26px 3px 10px;
  color: #4338ca;
  border: 1px solid #c7d2fe;
  border-radius: 2px;
  background-color: #eef2ff;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  box-shadow: none;
}
.action-facing-select.form-select:hover {
  border-color: #818cf8;
  background-color: #e0e7ff;
}
.action-facing-select.form-select:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.14);
}
/* 方向选择复用朝向样式 */
.action-direction-select.form-select {
  width: 76px;
  min-width: 76px;
  height: 29px;
  padding: 3px 26px 3px 10px;
  color: #4338ca;
  border: 1px solid #c7d2fe;
  border-radius: 2px;
  background-color: #eef2ff;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  box-shadow: none;
}
.action-direction-select.form-select:hover { border-color: #818cf8; background-color: #e0e7ff; }
.action-direction-select.form-select:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.14);
}
/* 方向=无时隐藏速度输入 */
[data-action-speed-wrap][data-hidden="true"] { display: none !important; }
.behavior-numbers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.behavior-field-help {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}
.creator-controls, .creator-preview-panel {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
}

.dialog-open { overflow: hidden; }
.confirm-dialog {
  position: fixed;
  z-index: 2000;
  inset: 0;
  display: none;
  place-items: center;
  padding: 20px;
}
.confirm-dialog.is-open, .alert-dialog.is-open { display: grid; }
.alert-dialog {
  position: fixed;
  z-index: 2000;
  inset: 0;
  display: none;
  place-items: center;
  padding: 20px;
}
.confirm-dialog-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(25, 27, 39, .42);
  backdrop-filter: blur(4px);
}
.confirm-dialog-card {
  position: relative;
  width: min(100%, 390px);
  padding: 28px;
  border: 1px solid rgba(255,255,255,.75);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(24, 27, 46, .22);
  text-align: center;
  animation: dialog-in .18s ease-out;
}
.confirm-dialog-icon {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  margin: 0 auto 14px;
  color: #b42318;
  border-radius: 15px;
  background: #fff0ee;
  font-size: 21px;
  font-weight: 800;
}
.confirm-dialog-card h2 { margin: 0 0 9px; font-size: 19px; }
.confirm-dialog-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.confirm-dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 22px; }
.confirm-dialog-actions .btn { justify-content: center; }
@keyframes dialog-in {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* 动作预览大弹层 */
.action-preview-dialog {
  position: fixed;
  z-index: 2100;
  inset: 0;
  display: none;
  place-items: center;
  padding: 24px;
}
.action-preview-dialog.is-open { display: grid; }
.action-preview-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 20, 28, .6);
  backdrop-filter: blur(6px);
}
.action-preview-card {
  position: relative;
  width: min(100%, 720px);
  max-height: calc(100vh - 48px);
  padding: 22px 22px 24px;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(20, 22, 38, .28);
  animation: dialog-in .18s ease-out;
}
.action-preview-card.is-sequence {
  min-height: min(520px, calc(100vh - 48px));
}
.action-preview-card.is-sequence .action-preview-stage {
  min-height: min(420px, calc(100vh - 148px));
}
.action-preview-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 50%;
  background: #f1f1f3;
  color: #4a4a55;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background .15s ease;
}
.action-preview-close:hover { background: #e6e6ea; color: #1a1a22; }
.action-preview-title {
  margin: 0 0 16px;
  padding-right: 36px;
  font-size: 17px;
  font-weight: 600;
}
.action-preview-stage {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  max-height: calc(100vh - 180px);
  border-radius: 14px;
  overflow: hidden;
  min-height: 260px;
  background-color: #dce2e9;
  background-image:
    linear-gradient(45deg, #cbd3dc 25%, transparent 25%),
    linear-gradient(-45deg, #cbd3dc 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #cbd3dc 75%),
    linear-gradient(-45deg, transparent 75%, #cbd3dc 75%);
  background-size: 24px 24px;
  background-position: 0 0, 0 12px, 12px -12px, -12px 0;
  border: 2px solid #94a3b8;
}
.action-preview-frame-counter {
  min-width: 66px;
  padding: 4px 7px;
  color: #fff;
  border-radius: 2px;
  background: rgba(15,23,42,.72);
  font-size: 11px;
  text-align: center;
}
.action-preview-sequence-controls {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  display: grid;
  grid-template-columns: auto minmax(80px, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(15, 23, 42, .82);
  backdrop-filter: blur(6px);
}
.action-preview-play-button {
  border: 0;
  border-radius: 7px;
  padding: 6px 10px;
  color: #fff;
  background: #2563eb;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.action-preview-frame-progress {
  width: 100%;
  accent-color: #38bdf8;
  cursor: pointer;
}
.action-preview-stage video,
.action-preview-stage img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 180px);
  object-fit: contain;
}
.action-preview-sequence-image {
  box-sizing: border-box;
  border: 3px solid #2563eb;
  background: transparent;
  box-shadow: 0 0 0 1px rgba(255,255,255,.8), 0 12px 30px rgba(15,23,42,.2);
}
.action-preview-loading {
  width: min(82%, 420px);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 9px 14px;
  color: #334155;
  font-size: 13px;
}
.action-preview-loading strong { font-size: 14px; }
.action-preview-load-track {
  grid-column: 1 / -1;
  height: 10px;
  overflow: hidden;
  border-radius: 5px;
  background: #b7c2ce;
  box-shadow: inset 0 1px 2px rgba(15,23,42,.2);
}
.action-preview-load-track i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2563eb, #38bdf8);
  transition: width .12s ease;
}

.image-paste-preview {
  display: block;
  width: min(100%, 280px);
  aspect-ratio: 1;
  margin: 0 auto 14px;
  object-fit: contain;
  border: 2px solid #cbd5e1;
  background:
    linear-gradient(45deg, #eef1f5 25%, transparent 25%),
    linear-gradient(-45deg, #eef1f5 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #eef1f5 75%),
    linear-gradient(-45deg, transparent 75%, #eef1f5 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
}
.image-paste-preview[hidden] { display: none; }
.image-paste-zone.has-preview .image-paste-icon { display: none; }
.creator-step {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  color: #8a8a91;
  border-radius: 10px;
  font-size: 13px;
}
.creator-step b {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 11px;
}
.creator-step small { font-size: 10px; }
.creator-step.is-active { color: var(--ink); background: var(--soft); font-weight: 700; }
.creator-step.is-active b { color: #fff; background: var(--ink); border-color: var(--ink); }
.creator-tool { padding-top: 22px; margin-top: 16px; border-top: 1px solid var(--line); }
.creator-tool h2 { margin: 0 0 7px; font-size: 16px; }
.creator-tool p { margin: 0 0 13px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.creator-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 0;
  color: #aaaab0;
  font-size: 10px;
}
.creator-divider::before, .creator-divider::after { flex: 1; height: 1px; content: ""; background: var(--line); }
.creator-preview-toolbar { display: flex; justify-content: space-between; margin-bottom: 12px; font-size: 13px; font-weight: 700; }
.creator-preview-toolbar small { color: #929299; font-weight: 500; }
.creator-stage {
  position: relative;
  display: grid;
  min-height: 520px;
  place-items: center;
  overflow: hidden;
  border-radius: 16px;
  background-color: #f8fbff;
  background-image:
    linear-gradient(45deg, rgba(190,224,241,.32) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(190,224,241,.32) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(224,215,246,.38) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(224,215,246,.38) 75%);
  background-position: 0 0, 0 12px, 12px -12px, -12px 0;
  background-size: 24px 24px;
}
.creator-stage > img { max-width: 82%; max-height: 450px; object-fit: contain; filter: drop-shadow(0 18px 24px rgba(57,65,110,.18)); }
.creator-next-step {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  padding: 12px 16px;
  border: 1px solid var(--ink);
  border-radius: 14px;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease;
}
.creator-next-step b { font-size: 18px; transition: transform .18s ease; }
.creator-next-step:hover { color: #fff; transform: translateY(-1px); box-shadow: 0 10px 20px rgba(57,65,110,.22); }
.creator-next-step:hover b { transform: translateX(3px); }
/* 创作台三个顶层 TAB 使用一致的顶部和底部空间。 */
.app-content:has(.creator-stage-tabs) {
  width: 100%;
  max-width: none;
  padding-top: 18px;
  padding-bottom: 18px;
}
.creator-base-layout {
  grid-template-columns: minmax(520px, 1.12fr) minmax(420px, .88fr);
  gap: 22px;
}
.creator-base-controls { padding: 20px; }
.creator-base-method-card {
  min-width: 0;
  padding: 8px 6px 4px;
  border: 0;
  background: #fff;
}
.creator-base-form { display: flex; height: 100%; flex-direction: column; }
.creator-base-form h2 { margin: 7px 0 8px; font-size: 24px; letter-spacing: -.03em; }
.creator-base-form > p { min-height: 42px; margin: 0 0 18px; color: var(--muted); font-size: 13px; line-height: 1.65; }
.image-paste-zone-large {
  min-height: 300px;
  place-content: center;
  justify-items: center;
  padding: 30px;
  text-align: center;
  border: 2px dashed #c9c4ff;
  background: #fbfaff;
  cursor: pointer;
}
.image-paste-zone-large .image-paste-icon {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  margin-bottom: 10px;
  color: #312e81;
  background: #e9e7ff;
  font-size: 25px;
}
.image-paste-zone-large > strong { font-size: 16px; }
.image-paste-zone-large [data-paste-file] { display: none; }
.image-paste-zone-large [data-paste-status]:not(:empty) {
  margin-top: 10px;
  color: #4338ca;
  font-weight: 650;
}
.image-paste-zone-large.is-dragover {
  border-color: #4f46e5;
  background: #f0efff;
  box-shadow: inset 0 0 0 2px rgba(79,70,229,.12);
}
.creator-prompt-large {
  min-height: 300px;
  flex: 1 1 auto;
  padding: 20px;
  border: 2px solid #dedde5;
  border-radius: 0;
  background: #fcfcfd;
  font-size: 15px;
  line-height: 1.75;
}
.creator-base-preview { padding: 24px; }
.creator-base-layout .creator-preview-panel {
  overflow-anchor: none;
}
.creator-base-layout .creator-stage {
  height: 420px;
  min-height: 0;
  contain: layout paint;
  background: #f6f7fb;
  background-image: none;
}
.creator-base-layout .creator-stage > img {
  width: auto;
  height: auto;
  max-width: min(88%, 520px);
  max-height: 380px;
  object-fit: contain;
}
.creator-empty-preview { display: grid; justify-items: center; gap: 13px; color: #686870; text-align: center; }
.creator-empty-preview small { color: #96969d; }
.job-progress {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(8px);
}
.job-progress small { color: var(--muted); }
.job-spinner {
  width: 34px;
  height: 34px;
  border: 3px solid #ddd;
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: creator-spin .8s linear infinite;
}
@keyframes creator-spin { to { transform: rotate(360deg); } }

@media (max-width: 1050px) {
  .pet-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  :root { --sidebar: 0px; }
  .app-sidebar {
    position: static;
    width: 100%;
    padding: 12px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .brand { padding: 0 0 10px; }
  .sidebar-label, .sidebar-note { display: none; }
  .side-nav { display: flex; overflow-x: auto; }
  .side-link { flex: 0 0 auto; min-height: 38px; padding: 8px 10px; }
  .app-main { margin-left: 0; }
  .topbar { height: auto; min-height: 62px; padding: 9px 16px; }
  .topbar-kicker, .account-name { display: none; }
  .app-content { padding: 28px 18px 70px; }
  .hero-panel { padding: 42px 22px 30px; }
  .publish-layout, .json-grid { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: 1fr; }
  .creator-workbench { grid-template-columns: 1fr; }
  .creator-base-methods { grid-template-columns: 1fr; }
  .creator-section-grid { grid-template-columns: 1fr; }
  .creator-stage { min-height: 420px; }
}
@media (max-width: 600px) {
  .pet-grid { grid-template-columns: 1fr; }
  .section-head, .page-heading { align-items: flex-start; flex-direction: column; }
  .hero-actions { align-items: stretch; flex-direction: column; }
  .hero-actions .btn { width: 100%; }
  .locale-button { min-width: 36px; padding: 5px 8px; }
  .auth-card { padding: 26px 20px; }
  .canvas-fields { grid-template-columns: 1fr; }
  .behavior-numbers { grid-template-columns: 1fr; }
  .creator-stage-tabs span { display: none; }
  .action-card { grid-template-columns: 68px minmax(0, 1fr) auto; }
  .action-preview { width: 68px; }
  .action-row-preview { width: 56px; height: 56px; }
  .action-row-actions { flex-basis: 100%; justify-content: flex-start; }
  .table-panel { overflow-x: auto; }
  .table { min-width: 720px; }
}
