/* ============================================================
   WOLONG studio — light workspace, dark sidebar
   ============================================================ */

.app {
  --side-w: 220px;
  --surface: #ffffff;
  --surface-2: #fafafb;
  --canvas: #f5f5f7;
  --ink: #17161c;
  --ink-2: #6d6b78;
  --ink-3: #9a98a5;
  --stroke: #e9e9ef;
  --stroke-2: #dedee6;
  --accent: #2f6bff;
  --accent-2: #6f93ff;
  --accent-soft: #edf3ff;
  --accent-ink: #1f4fd0;
  --hot: #ff4d6d;
  --ok-bg: #e9f8f0;
  --ok-ink: #1c8a5a;
  --side-bg: #141219;
  --side-fg: #b7b3c2;
  --side-dim: #7c7887;
  --side-active: rgba(47, 107, 255, 0.22);
  --shadow-card: 0 1px 2px rgba(20, 20, 40, 0.04);
  --shadow-pop: 0 18px 44px -24px rgba(20, 20, 40, 0.35);
  --radius: 16px;

  display: grid;
  grid-template-columns: var(--side-w) minmax(0, 1fr);
  min-height: 100vh;
  background:
    radial-gradient(circle, rgba(84, 96, 130, 0.16) 1px, transparent 1.4px) 0 0 / 26px 26px,
    radial-gradient(820px 460px at 80% -12%, rgba(47, 107, 255, 0.14), transparent 70%),
    radial-gradient(640px 400px at 4% 108%, rgba(255, 59, 92, 0.10), transparent 70%),
    var(--canvas);
  color: var(--ink);
  font-size: 14px;
  position: relative;
  z-index: 1;
}

html[data-theme="dark"] .app {
  --surface: #14141c;
  --surface-2: #191922;
  --canvas: #0b0b10;
  --ink: #f2f2f7;
  --ink-2: #a3a1ae;
  --ink-3: #6f6d7a;
  --stroke: #24242f;
  --stroke-2: #2f2f3c;
  --accent-soft: #12203f;
  --accent-ink: #8fb0ff;
  --ok-bg: #11291f;
  --ok-ink: #5fd6a6;
  --side-bg: #08080c;
  --side-fg: #b0adbb;
  --shadow-card: none;
  --shadow-pop: 0 22px 50px -24px rgba(0, 0, 0, 0.9);
}

.app * { box-sizing: border-box; }

/* ---------- sidebar ---------- */

.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--side-w);
  z-index: 40;
  display: flex;
  flex-direction: column;
  padding: 22px 14px 16px;
  background: var(--side-bg);
  color: var(--side-fg);
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.sidebar::-webkit-scrollbar { width: 0; height: 0; display: none; }

.side-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px;
  margin-bottom: 30px;
  color: #fff;
}

.side-head { display: flex; align-items: center; gap: 8px; min-width: 0; margin-bottom: 22px; }
.side-head .side-logo { margin-bottom: 0; min-width: 0; }
.side-head-actions { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.side-head-actions .top-bell,
.side-head-actions .theme-toggle { width: 27px; height: 27px; color: var(--side-dim); border-radius: 7px; }
.side-head-actions .top-bell:hover,
.side-head-actions .theme-toggle:hover { background: rgba(255,255,255,.08); color: #fff; }
.side-head-actions .top-bell i { top: 0; right: -1px; min-width: 12px; height: 12px; padding: 0 3px; line-height: 12px; font-size: 8px; }

.side-logo-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(140deg, #3f7bff, #1f4fd0);
  box-shadow: 0 8px 18px -10px rgba(47, 107, 255, 0.95);
  flex: none;
}

.side-logo-mark svg { width: 19px; height: 19px; }

.side-logo-name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.side-group { margin-bottom: 22px; }

.side-label {
  display: block;
  padding: 0 10px;
  margin-bottom: 8px;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--side-dim);
}

.side-nav { display: grid; gap: 2px; }

.side-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  padding: 0 10px;
  border-radius: 9px;
  font-size: 13.5px;
  color: var(--side-fg);
  transition: background 0.18s var(--ease), color 0.18s var(--ease);
}

.side-item svg { width: 17px; height: 17px; flex: none; opacity: 0.9; }

.side-item:hover { background: rgba(255, 255, 255, 0.05); color: #fff; }

.side-item.active { background: var(--side-active); color: #e4deff; }
.side-item.active svg { color: #b9aaff; }

.side-promo {
  margin-top: auto;
  padding: 16px 14px 14px;
  border-radius: 14px;
  background: linear-gradient(160deg, rgba(47, 107, 255, 0.18), rgba(255, 59, 92, 0.05));
  border: 1px solid rgba(96, 140, 255, 0.22);
}

.promo-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: #d6e2ff;
}

.side-promo p {
  margin-top: 6px;
  font-size: 11.5px;
  line-height: 1.65;
  color: var(--side-dim);
}

.promo-btn {
  display: block;
  margin-top: 12px;
  padding: 9px 10px;
  border-radius: 9px;
  background: #eaf1ff;
  color: #1747c2;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  transition: background 0.2s var(--ease), transform 0.2s var(--ease);
}

.promo-btn:hover { background: #fff; transform: translateY(-1px); }

.promo-support {
  width: 100%;
  border: 1px solid rgba(23, 71, 194, 0.18);
  cursor: pointer;
  font-family: inherit;
}

.promo-support:hover { border-color: rgba(23, 71, 194, 0.32); }

.side-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 12px 6px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #2a2733;
  color: #d9d4ea;
  font-size: 12px;
  font-weight: 600;
  flex: none;
}

.user-meta { min-width: 0; display: grid; gap: 2px; }
.user-meta b {
  display: block;
  font-size: 11.5px;
  font-weight: 500;
  color: #d8d4e2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-meta span { font-size: 10.5px; color: var(--side-dim); }
.user-meta i { font-style: normal; color: #c9c2ff; }

.user-out { margin-left: auto; color: var(--side-dim); }
.user-out:hover { color: #fff; }

/* ---------- main / topbar ---------- */

.main {
  grid-column: 2;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  height: 72px;
  padding: 0 62px;
  background: var(--surface);
  border-bottom: 1px solid var(--stroke);
}

.crumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-3); }
.crumb b { color: var(--ink); font-weight: 500; }
.crumb-sep { color: var(--stroke-2); }

.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.top-bell {
  position: relative;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: var(--ink-2);
}

.top-bell:hover { background: var(--surface-2); color: var(--ink); }

.top-bell i {
  position: absolute;
  top: 3px;
  right: 2px;
  min-width: 15px;
  height: 15px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 9px;
  font-style: normal;
  line-height: 15px;
  text-align: center;
}

.topbar .theme-toggle {
  width: 34px;
  height: 34px;
  border-color: transparent;
  background: transparent;
  color: var(--ink-2);
}

.topbar .theme-toggle:hover { background: var(--surface-2); border-color: transparent; }

.support-btn { border-color: var(--stroke-2); background: var(--surface); color: var(--ink); }

/* The studio keeps utility controls compact; workspace context belongs in the sidebar. */
.app:not(.admin-app) .crumb { display: none; }
.app:not(.admin-app) .topbar { display: none; }

/* ---------- content ---------- */

.content {
  position: relative;
  z-index: 1;
  flex: 1;
  width: 100%;
  max-width: 1920px;
  margin: 0 auto;
  padding: 38px 40px 28px;
}

.page-foot {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 0 22px;
  font-size: 11.5px;
  color: var(--ink-3);
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 30px;
}

.eyebrow-mono {
  display: block;
  margin-bottom: 12px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--accent-ink);
  text-transform: uppercase;
}

.page-head h1 {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.page-head p { margin-top: 8px; font-size: 13.5px; color: var(--ink-2); }

/* ---------- cards ---------- */

.card {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}

.studio-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.96fr) minmax(0, 1.04fr);
  gap: 20px;
  align-items: stretch;
}

.form-card {
  padding: 26px 26px 24px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.step-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }

.step-num { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.04em; color: var(--accent); }

.step-head b { font-size: 15px; font-weight: 600; color: var(--ink); }

.step-opt { margin-left: auto; font-size: 11.5px; color: var(--ink-3); }

.step-hint { font-size: 11.5px; line-height: 1.7; color: var(--ink-3); margin-bottom: 8px; }

.step-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  font-size: 11px;
  color: var(--ink-3);
}

.step-foot b { color: var(--ink-2); font-weight: 500; }

.step-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

/* upload */

.upload {
  position: relative;
  display: block;
  min-height: 212px;
  padding: 24px;
  border: 1px dashed var(--stroke-2);
  border-radius: 12px;
  background: var(--surface-2);
  text-align: center;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.upload.tall { min-height: 220px; }

.upload:hover,
.upload.drag { border-color: var(--accent-2); background: var(--accent-soft); }

.dz-empty { display: grid; justify-items: center; gap: 5px; }

.dz-icon {
  width: 38px;
  height: 38px;
  margin-bottom: 4px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent);
}

.upload strong { font-size: 13.5px; font-weight: 500; color: var(--ink); }

.upload small,
.dz-link { font-size: 11.5px; color: var(--ink-3); }

.dz-actions { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 12px; }

.dz-btn {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--stroke-2);
  border-radius: 8px;
  background: var(--surface);
  font-size: 12px;
  color: var(--ink);
}

.upload img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.upload.filled .dz-empty { display: none; }

.dz-tag {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 2;
  padding: 4px 9px;
  border-radius: 7px;
  background: rgba(10, 10, 16, 0.72);
  color: #fff;
  font-size: 10.5px;
  max-width: calc(100% - 20px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* inputs */

.input-area {
  width: 100%;
  min-height: 132px;
  padding: 12px 14px;
  border: 1px solid var(--stroke-2);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 13.5px;
  line-height: 1.8;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.input-area::placeholder,
.input::placeholder { color: var(--ink-3); }

.input-area:focus,
.input:focus,
.sel:focus,
.model-select:focus {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(47, 107, 255, 0.12);
}

.input {
  width: 100%;
  min-width: 0;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--stroke-2);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  font-size: 12.5px;
  outline: none;
}

.sel {
  min-width: 0;
  height: 38px;
  padding: 0 30px 0 12px;
  border: 1px solid var(--stroke-2);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  font-size: 12.5px;
  outline: none;
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%239a98a5' stroke-width='1.3' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

/* model row */

.model-row {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 54px;
  padding: 0 12px;
  border: 1px solid var(--stroke-2);
  border-radius: 10px;
  background: var(--surface);
}

.model-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  flex: none;
}

.model-select {
  flex: 1;
  min-width: 0;
  height: 40px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  outline: none;
  cursor: pointer;
  appearance: none;
}

.model-cost { font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-3); white-space: nowrap; }

.badge-ok {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border-radius: 6px;
  background: var(--ok-bg);
  color: var(--ok-ink);
  font-size: 10.5px;
  white-space: nowrap;
}

.badge-soft {
  display: inline-flex;
  align-items: center;
  height: 19px;
  padding: 0 7px;
  margin-left: 6px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 10.5px;
}

/* segmented */

.seg {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--stroke);
}

.seg button {
  flex: 1;
  height: 30px;
  border-radius: 7px;
  color: var(--ink-2);
  font-size: 12px;
  transition: background 0.18s var(--ease), color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.seg button:hover { color: var(--ink); }

.seg button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(20, 20, 40, 0.12);
  font-weight: 500;
}

.chips { display: flex; flex-wrap: wrap; gap: 6px; }

.chip {
  height: 28px;
  padding: 0 11px;
  border: 1px solid var(--stroke-2);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 11.5px;
}

.chip:hover { border-color: var(--accent-2); color: var(--ink); }

.chip.on { border-color: transparent; background: var(--accent-soft); color: var(--accent-ink); }

/* form foot */

.form-foot { display: grid; gap: 10px; padding-top: 18px; border-top: 1px solid var(--stroke); }

.cost-line { display: flex; align-items: baseline; gap: 4px; font-size: 12px; color: var(--ink-3); }

.cost-line b { font-family: var(--font-mono); font-size: 14px; color: var(--ink); font-weight: 600; }

/* buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 42px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease), transform 0.2s var(--ease);
}

.btn-sm { height: 34px; padding: 0 13px; font-size: 12.5px; }
.btn-block { width: 100%; }

.btn-primary {
  background: linear-gradient(120deg, #2f6bff, #1f4fd0);
  color: #fff;
  box-shadow: 0 8px 18px -12px rgba(47, 107, 255, 0.9);
}

.btn-primary:hover { background: linear-gradient(120deg, #3f7bff, #2a5be8); }

.btn-primary:disabled { background: #c9c2ff; color: #fff; box-shadow: none; cursor: not-allowed; }

html[data-theme="dark"] .btn-primary:disabled { background: #3a3560; }

.btn-ghost { border-color: var(--stroke-2); background: var(--surface); color: var(--ink); }
.btn-ghost:hover { background: var(--surface-2); }

.btn-outline { border-color: var(--stroke-2); background: transparent; color: var(--ink); }
.btn-outline:disabled { color: var(--ink-3); cursor: not-allowed; }

.btn-soft { border-color: transparent; background: var(--accent-soft); color: var(--accent-ink); }
.btn-soft:disabled { opacity: 0.75; }

.icon-btn {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--ink-3);
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}

.icon-btn:hover { background: var(--surface-2); color: var(--ink); }

/* ---------- records ---------- */

.records-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 1128px;
  align-self: stretch;
  min-height: 0;
}

.records-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 22px 14px;
}

.records-title { display: flex; align-items: baseline; gap: 8px; }
.records-title b { font-size: 16px; font-weight: 600; color: var(--ink); }
.records-title span { font-size: 11.5px; color: var(--ink-3); }

.records-tabs { display: flex; align-items: center; gap: 4px; }

.records-tabs button { height: 28px; padding: 0 11px; border-radius: 7px; font-size: 12px; color: var(--ink-2); }
.records-tabs button:hover { background: var(--surface-2); }
.records-tabs button.on { background: var(--accent-soft); color: var(--accent-ink); }
.records-tabs .icon-btn { width: 30px; padding: 0; }

.records-tools {
  display: flex;
  gap: 8px;
  padding: 0 22px 16px;
  border-bottom: 1px solid var(--stroke);
}

.records-tools .input { flex: 1; min-width: 0; }
.records-tools .sel { width: 108px; }

.record-bulk-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 22px;
  border-bottom: 1px solid var(--stroke);
  color: var(--ink-3);
  font-size: 11.5px;
}
.record-bulk-tools label { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); }
.record-bulk-tools input { accent-color: var(--accent); }
.record-bulk-tools small { color: var(--ink-3); }
.record-bulk-tools .danger { color: var(--hot); border-color: rgba(224, 36, 69, .35); }
.record-bulk-tools .danger:disabled { color: var(--ink-3); border-color: var(--stroke); }

.records-empty {
  flex: 1 1 auto;
  min-height: 210px;
  display: grid;
  place-content: start center;
  justify-items: center;
  gap: 10px;
  padding: 48px 24px 38px;
  text-align: center;
}

.empty-icon {
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 6px;
}

.records-empty b { font-size: 15px; font-weight: 600; color: var(--ink-2); }
.records-empty p { max-width: 320px; font-size: 12.5px; line-height: 1.8; color: var(--ink-3); }

.records-grid {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 16px 22px 20px;
}

.record { border: 1px solid var(--stroke); border-radius: 11px; overflow: hidden; background: var(--surface); }

.record-media { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: #0b0b12; }
.record-media img { width: 100%; height: 100%; object-fit: cover; }

.record-media .state {
  position: absolute;
  top: 8px;
  left: 36px;
  height: 20px;
  padding: 0 7px;
  border-radius: 6px;
  background: rgba(10, 10, 16, 0.62);
  color: #fff;
  font-size: 10px;
  line-height: 20px;
  backdrop-filter: blur(6px);
}

.record-media .state.done { background: rgba(31, 153, 102, 0.85); }

.record-select {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 3;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: rgba(10, 10, 16, .62);
  cursor: pointer;
  backdrop-filter: blur(6px);
}
.record-select input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.record-select span { width: 12px; height: 12px; border: 1px solid rgba(255,255,255,.72); border-radius: 3px; }
.record-select input:checked + span { border-color: var(--accent); background: var(--accent); box-shadow: inset 0 0 0 2px rgba(10,10,16,.58); }
.record-select input:disabled + span { opacity: .36; }

.record-media .bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, 0.2); }
.record-media .bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.3s linear; }

.record-body { padding: 10px 12px 12px; }
.record-body b { display: block; font-size: 12px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.record-body span { display: block; margin-top: 4px; font-size: 10.5px; color: var(--ink-3); }

.records-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 22px;
  border-top: 1px solid var(--stroke);
  font-size: 11.5px;
  color: var(--ink-3);
}

.records-foot > label { display: inline-flex; align-items: center; gap: 5px; }
.records-foot > label { margin-left: auto; }
.records-foot .pager { margin-left: 4px; }
.records-foot .pager span { min-width: 18px; text-align: center; }

/* ---------- notices ---------- */

.notice {
  padding: 10px 12px;
  margin-bottom: 14px;
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1.7;
}

.cost-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 42px;
  padding: 0 12px;
  margin: 18px 0 10px;
  border: 1px solid var(--stroke);
  border-radius: 9px;
  background: var(--surface-2);
  font-size: 12.5px;
  color: var(--ink-2);
}

.cost-box b { color: var(--ink); font-weight: 500; }

/* ---------- canvas ---------- */

.canvas-card { overflow: hidden; }

.canvas-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border-bottom: 1px solid var(--stroke);
}

.zoom-read { min-width: 48px; text-align: center; font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-2); }
.toolbar-sep { width: 1px; height: 16px; background: var(--stroke); margin: 0 4px; }
.toolbar-spacer { margin-left: auto; }
.canvas-toolbar .mono { font-size: 9.5px; color: var(--ink-3); }
.canvas-toolbar .mono b { color: var(--ink-2); font-weight: 500; }

.canvas-wrap {
  position: relative;
  height: calc(100vh - 300px);
  min-height: 420px;
  overflow: hidden;
  background-color: var(--surface-2);
  background-image: radial-gradient(circle, rgba(120, 118, 140, 0.28) 1px, transparent 1.4px);
  background-size: 24px 24px;
  cursor: grab;
  touch-action: none;
}

.canvas-wrap.dragging { cursor: grabbing; }
.canvas-inner { position: absolute; inset: 0; transform-origin: 0 0; }

.canvas-edges { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.canvas-edges path { fill: none; stroke: rgba(47, 107, 255, 0.6); stroke-width: 1.6; }
.canvas-edges path.hot { stroke: rgba(255, 77, 109, 0.6); }

.node {
  position: absolute;
  width: 192px;
  border: 1px solid var(--stroke-2);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 14px 30px -22px rgba(20, 20, 40, 0.5);
  user-select: none;
  cursor: grab;
}

.node:hover { border-color: var(--accent-2); }
.node.active { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47, 107, 255, 0.14); }

.node header {
  display: flex;
  justify-content: space-between;
  padding: 7px 9px;
  border-bottom: 1px solid var(--stroke);
  font-size: 9.5px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.node header b { color: var(--ink-2); font-weight: 500; }
.node .nbody { padding: 9px; }
.node .nthumb { height: 84px; border-radius: 7px; overflow: hidden; border: 1px solid var(--stroke); }
.node .nthumb img { width: 100%; height: 100%; object-fit: cover; }
.node p { font-size: 10.5px; line-height: 1.7; color: var(--ink-2); margin-top: 7px; }
.node .nfoot { display: flex; justify-content: space-between; margin-top: 8px; font-size: 9px; color: var(--ink-3); }

.canvas-hint {
  position: absolute;
  left: 12px;
  bottom: 12px;
  padding: 6px 10px;
  border-radius: 7px;
  background: var(--surface);
  border: 1px solid var(--stroke);
  font-size: 10px;
  color: var(--ink-3);
  pointer-events: none;
}

/* ---------- workshop ---------- */

.tools-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }

.tool-card { border: 1px solid var(--stroke); border-radius: 14px; overflow: hidden; background: var(--surface); }

.tool-media {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 190px;
  height: 190px;
  overflow: hidden;
  gap: 1px;
  background: var(--stroke);
}

.tool-media img { width: 100%; height: 100%; object-fit: cover; }
.tool-media.muted img { filter: grayscale(0.5); }

.tool-tag {
  position: absolute;
  left: 10px;
  bottom: 10px;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(10, 10, 16, 0.62);
  color: #fff;
  font-size: 10px;
}

.tool-tag.right { left: auto; right: 10px; }

.tool-soon {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 9px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.9);
  color: #4a4653;
  font-size: 10.5px;
}

.tool-body { padding: 16px; }
.tool-body h3 { font-size: 15px; font-weight: 600; }
.tool-body p { margin: 8px 0 14px; font-size: 12px; line-height: 1.75; color: var(--ink-2); min-height: 42px; }

/* ---------- tasks ---------- */

.tabs-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.pill-tabs {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 9px;
  background: var(--surface-2);
  border: 1px solid var(--stroke);
}

.pill-tabs button { height: 30px; padding: 0 12px; border-radius: 7px; font-size: 12.5px; color: var(--ink-2); }
.pill-tabs button:hover { color: var(--ink); }

.pill-tabs button.on {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(20, 20, 40, 0.1);
  font-weight: 500;
}

.search { max-width: 280px; }

.list-meta { font-size: 12px; color: var(--ink-3); margin-bottom: 10px; }
.list-meta b { color: var(--ink-2); font-weight: 500; }

.table-card { overflow: hidden; }

/* ---------- 账单与订单 ---------- */
.billing-card { margin-top: 18px; }
.billing-card .price-head { padding: 16px 18px 10px; }
.billing-stats { margin-bottom: 2px; }
.ledger-positive { color: var(--ok-ink) !important; }
.ledger-negative { color: var(--hot) !important; }
.billing-card .row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.billing-card .btn.danger { color: var(--hot); border-color: rgba(224, 36, 69, .35); }
.billing-card .btn.danger:hover { color: #fff; background: var(--hot); }

.table { width: 100%; border-collapse: collapse; font-size: 12px; }

.table th {
  padding: 12px 14px;
  text-align: left;
  font-weight: 500;
  color: var(--ink-3);
  background: var(--surface-2);
  border-bottom: 1px solid var(--stroke);
  white-space: nowrap;
}

.table td { padding: 14px; border-bottom: 1px solid var(--stroke); color: var(--ink-2); }
.table tr:last-child td { border-bottom: 0; }

.table .empty-row td { padding: 96px 14px; text-align: center; color: var(--ink-3); }

.table-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 12px;
  font-size: 11.5px;
  color: var(--ink-3);
}

.pager { display: flex; align-items: center; gap: 8px; }
.pager button { width: 26px; height: 26px; border: 1px solid var(--stroke-2); border-radius: 7px; color: var(--ink-3); }
.pager button:disabled { opacity: 0.5; }

/* ---------- assets ---------- */

.storage-card {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 0;
  margin-bottom: 20px;
}

.storage-col { padding: 18px 20px; }
.storage-col + .storage-col { border-left: 1px solid var(--stroke); }

.storage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12.5px;
  color: var(--ink-2);
}

.storage-head em {
  font-style: normal;
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--ink-3);
  font-size: 10.5px;
}

.storage-big { display: flex; align-items: baseline; gap: 6px; margin-top: 12px; }
.storage-big b { font-size: 26px; font-weight: 600; color: var(--ink); letter-spacing: -0.02em; }
.storage-big span { font-size: 12px; color: var(--ink-3); }

.meter { height: 5px; border-radius: 5px; background: var(--surface-2); overflow: hidden; margin: 12px 0 8px; }
.meter i { display: block; height: 100%; border-radius: 5px; background: var(--accent); }

.storage-note { margin-top: 8px; font-size: 11.5px; line-height: 1.6; color: var(--ink-3); }
.storage-col .btn { margin-top: 12px; height: 36px; font-size: 12px; }

.assets-card { padding: 14px 20px 20px; }

.assets-tools {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--stroke);
  font-size: 12px;
  color: var(--ink-2);
}

.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }

.check input {
  appearance: none;
  width: 15px;
  height: 15px;
  margin: 0;
  border: 1px solid var(--stroke-2);
  border-radius: 4px;
  background: var(--surface);
}

.check input:checked { background: var(--accent); border-color: var(--accent); box-shadow: inset 0 0 0 3px var(--surface); }

.muted { color: var(--ink-3); }

.assets-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding-top: 16px;
}

.asset { margin: 0; border: 1px solid var(--stroke); border-radius: 10px; overflow: hidden; background: var(--surface); }
.asset img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.asset figcaption { padding: 8px 10px; font-size: 11.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- api ---------- */

.api-tabs { margin-bottom: 16px; }
.api-tabs button.on { background: linear-gradient(120deg, #2f6bff, #1f4fd0); color: #fff; box-shadow: 0 8px 18px -14px rgba(47, 107, 255, 0.9); }
.api-card { padding: 22px; }

.api-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 6px; }
.api-head b { font-size: 16px; font-weight: 600; margin-right: 8px; }

.key-card { margin-top: 16px; padding: 16px; border: 1px solid var(--stroke); border-radius: 11px; background: var(--surface); }
.key-top { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.key-top b { font-size: 13px; font-weight: 600; }

.key-line {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 4px 4px 12px;
  border: 1px solid var(--stroke);
  border-radius: 8px;
  background: var(--surface-2);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-2);
}

.key-line span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.key-meta { display: flex; gap: 16px; margin-top: 12px; font-size: 11.5px; color: var(--ink-3); }
.key-stats { display: flex; gap: 18px; margin-top: 8px; font-size: 11.5px; color: var(--ink-3); }
.key-stats b { color: var(--ink-2); font-weight: 500; }
.key-actions { display: flex; gap: 8px; margin-top: 14px; }

/* ---------- account / usage ---------- */
.account-stats { margin-bottom: 18px; }
.account-grid { display: grid; grid-template-columns: minmax(260px, .85fr) minmax(360px, 1.15fr); gap: 18px; }
.account-panel { padding: 18px 20px 20px; }
.account-profile { display: flex; align-items: center; gap: 12px; margin: 18px 0 14px; }
.account-avatar { width: 44px; height: 44px; font-size: 16px; background: linear-gradient(145deg, #426bff, #725cff); color: #fff; }
.account-profile div { display: grid; gap: 4px; min-width: 0; }
.account-profile b { color: var(--ink); font-size: 14px; }
.account-profile span { color: var(--ink-3); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; }
.account-actions { margin-top: 8px; flex-wrap: wrap; }
.account-activity { margin-top: 18px; }
.account-activity .price-head button { margin-left: auto; }
.account-feed { display: grid; gap: 0; border-top: 1px solid var(--stroke); }
.account-feed-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--stroke); }
.account-feed-row span { display: grid; gap: 3px; min-width: 0; }
.account-feed-row b { color: var(--ink-2); font-size: 12px; font-weight: 600; }
.account-feed-row em { color: var(--ink-3); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-feed-row strong { font: 600 12px var(--font-mono); }
.account-feed-row small { color: var(--ink-3); font: 10.5px var(--font-mono); white-space: nowrap; }
.usage-chart { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 7px; align-items: end; height: 132px; padding: 8px 0 0; border-bottom: 1px solid var(--stroke); }
.usage-day { display: grid; grid-template-rows: 1fr auto; align-items: end; gap: 6px; min-width: 0; height: 100%; }
.usage-bars { display: flex; align-items: end; justify-content: center; gap: 2px; height: 100%; min-height: 70px; }
.usage-bars i { width: 5px; min-height: 3px; border-radius: 3px 3px 0 0; display: block; }
.usage-task { background: #4d70ff; }
.usage-spend { background: #a78bfa; }
.usage-api { background: #2bb8a8; }
.usage-day small { text-align: center; color: var(--ink-3); font: 9px var(--font-mono); white-space: nowrap; overflow: hidden; }
.usage-legend { display: flex; gap: 14px; margin-top: 10px; color: var(--ink-3); font-size: 10.5px; }
.usage-legend i { display: inline-block; width: 7px; height: 7px; border-radius: 2px; margin-right: 4px; background: #4d70ff; }
.usage-legend span:nth-child(2) i { background: #a78bfa; }
.usage-legend span:nth-child(3) i { background: #2bb8a8; }
.api-usage { margin-top: 16px; padding: 13px 14px; border: 1px solid var(--stroke); border-radius: 10px; background: var(--surface-2); }
.api-usage-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.api-usage-head b { font-size: 12.5px; color: var(--ink-2); }
.api-usage-head span { font-size: 10.5px; color: var(--ink-3); }
.api-usage-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; margin-top: 10px; }
.api-usage-item { display: grid; gap: 3px; min-width: 0; }
.api-usage-item span, .api-usage-item em { color: var(--ink-3); font-size: 10.5px; font-style: normal; }
.api-usage-item b { color: var(--ink); font: 600 15px var(--font-mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notice-feed { display: grid; gap: 0; margin-top: 14px; border-top: 1px solid var(--stroke); }
.notice-feed-row { display: flex; gap: 9px; padding: 11px 0; border-bottom: 1px solid var(--stroke); }
.notice-feed-row > div { display: grid; gap: 3px; min-width: 0; }
.notice-feed-row b { color: var(--ink-2); font-size: 12px; }
.notice-feed-row small { color: var(--ink-3); line-height: 1.5; }
.notice-feed-row em { color: var(--ink-3); font: 10px var(--font-mono); font-style: normal; }
.notice-feed-dot { width: 7px; height: 7px; margin-top: 5px; border-radius: 50%; background: var(--accent); flex: none; }
.notice-feed-dot.success { background: #2ba36b; }
.notice-feed-dot.warning { background: #e08b2b; }

@media (max-width: 720px) {
  .account-grid { grid-template-columns: 1fr; }
  .api-usage-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .usage-chart { gap: 3px; }
  .usage-bars i { width: 3px; }
  .account-feed-row { grid-template-columns: minmax(0, 1fr) auto; }
  .account-feed-row small { grid-column: 1 / -1; }
}

/* ---------- toast ---------- */

.toast-zone { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: grid; gap: 8px; }

.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 14px;
  border: 1px solid var(--stroke);
  border-left: 2px solid var(--accent);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-pop);
  font-size: 12px;
  animation: toastIn 0.3s var(--ease) both;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ---------- views ---------- */

.view { display: none; }
.view.active { display: block; animation: viewIn 0.35s var(--ease); }

@keyframes viewIn {
  from { transform: translateY(6px); }
  to { transform: none; }
}

/* ---------- responsive ---------- */

@media (max-width: 1240px) {
  .studio-grid { grid-template-columns: 1fr 1fr; }
  .content { padding: 28px 28px; }
  .topbar { padding: 0 24px; }
}

@media (max-width: 1080px) {
  .studio-grid { grid-template-columns: minmax(0, 1fr); }
  .records-card { height: auto; max-height: none; }
  .tools-grid { grid-template-columns: 1fr 1fr; }
  .storage-card { grid-template-columns: 1fr; }
  .storage-col + .storage-col { border-left: 0; border-top: 1px solid var(--stroke); }
  .assets-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  .app { --side-w: 76px; }
  .sidebar { padding: 18px 10px 14px; align-items: center; }
  .side-head { width: 100%; justify-content: center; }
  .side-head-actions { display: none; }
  .side-logo { padding: 0; margin-bottom: 22px; }
  .side-logo-name, .side-label, .side-promo p, .promo-title,
  .side-item span, .user-meta, .user-out { display: none; }
  .side-group { width: 100%; margin-bottom: 12px; }
  .side-item { justify-content: center; height: 42px; padding: 0; }
  .side-promo { width: 100%; padding: 10px; text-align: center; }
  .promo-btn { font-size: 10px; padding: 7px 4px; }
  .side-user { width: 100%; justify-content: center; padding: 10px 0 0; }
  .studio-grid { grid-template-columns: 1fr; }
  .topbar { padding: 0 20px; }
}

@media (max-width: 720px) {
  .app { --side-w: 0px; grid-template-columns: 1fr; padding-bottom: 72px; overflow-x: hidden; }
  .page-head { flex-wrap: wrap; }
  .page-head > .btn { display: none; }
  .page-head h1 { font-size: 24px; }
  .sidebar {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 64px;
    flex-direction: row;
    padding: 6px 8px;
    overflow: visible;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }
  .side-head, .side-logo, .side-label, .side-promo, .side-user { display: none; }
  .sidebar { overflow-x: auto; overflow-y: hidden; gap: 4px; }
  .side-group { margin: 0; width: auto; flex: none; }
  .side-nav { display: flex; gap: 2px; }
  .side-item { width: 54px; height: 100%; flex-direction: column; gap: 3px; justify-content: center; font-size: 9px; white-space: nowrap; }
  .side-item span { display: block; }
  .side-item svg { width: 18px; height: 18px; }
  .main { grid-column: 1; }
  .content { padding: 20px 16px 10px; }
  .page-head h1 { font-size: 24px; }
  .step-cols { grid-template-columns: 1fr; }
  .records-card { min-height: 320px; }
  .records-grid { grid-template-columns: 1fr 1fr; }
  .records-tools { flex-wrap: wrap; }
  .records-tools .sel { width: 100%; }
  .records-foot { flex-wrap: wrap; }
  .records-foot > label { margin-left: 0; }
  .tools-grid { grid-template-columns: 1fr; }
  .assets-grid { grid-template-columns: 1fr 1fr; }
  .page-foot { padding: 16px; }
  .topbar { height: 56px; padding: 0 14px; }
  .support-btn { display: none; }
}


/* ambient star dust in the dark sidebar */
.sidebar { isolation: isolate; }

.sidebar::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.55;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='320' height='320'><g fill='%23ffffff'><circle cx='24' cy='46' r='1.2' opacity='.7'/><circle cx='96' cy='18' r='.8' opacity='.5'/><circle cx='168' cy='88' r='1.4' opacity='.8'/><circle cx='248' cy='42' r='.9' opacity='.5'/><circle cx='286' cy='134' r='1.1' opacity='.6'/><circle cx='52' cy='158' r='.9' opacity='.5'/><circle cx='134' cy='206' r='1.3' opacity='.7'/><circle cx='214' cy='172' r='.7' opacity='.4'/><circle cx='292' cy='238' r='1.2' opacity='.6'/><circle cx='36' cy='268' r='1' opacity='.55'/><circle cx='118' cy='300' r='.8' opacity='.45'/><circle cx='206' cy='286' r='1.4' opacity='.75'/></g></svg>");
  background-size: 320px 320px;
}

.sidebar::after {
  content: "";
  position: absolute;
  left: -30%;
  top: -14%;
  width: 160%;
  height: 44%;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(50% 50% at 50% 50%, rgba(47, 107, 255, 0.22), transparent 70%);
  filter: blur(28px);
}

.sidebar > * { position: relative; z-index: 1; }

/* ============================================================
   功能接入后追加的零件（价格表 / 素材操作 / 任务状态 / Key）
   ============================================================ */

/* ---------- 价格 ---------- */
.price-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.price-card { padding: 18px 20px 20px; }
.price-card + .price-card { margin-top: 0; }
.price-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.price-head b { font-size: 15px; font-weight: 600; color: var(--ink); }
.price-head span { font-size: 11.5px; color: var(--ink-3); }
.price-table { font-size: 12px; }
.price-table th { padding: 8px 10px; }
.price-table td { padding: 11px 10px; }
.price-table tr:last-child td { border-bottom: 0; }
.price-table .mono-cell { font-family: var(--font-mono); color: var(--ink); }
.price-note { margin-top: 12px; font-size: 11.5px; line-height: 1.7; color: var(--ink-3); }
.package-card { margin-top: 18px; padding: 18px 20px 20px; }
.packages { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.pkg { border: 1px solid var(--stroke); border-radius: 12px; padding: 14px 16px; background: var(--surface-2); }
.pkg.hot { border-color: var(--accent-2); box-shadow: 0 0 0 3px var(--accent-soft); }
.pkg b { display: block; font-size: 13px; color: var(--ink); }
.pkg .pkg-price { margin-top: 8px; font-family: var(--font-mono); font-size: 20px; font-weight: 600; color: var(--ink); }
.pkg .pkg-price em { font-style: normal; font-size: 11px; color: var(--ink-3); margin-left: 4px; }
.pkg .pkg-credits { margin-top: 4px; font-size: 11.5px; color: var(--ink-2); }
.pkg .pkg-bonus { margin-top: 2px; font-size: 11px; color: var(--hot); }
.pkg .btn { margin-top: 12px; width: 100%; height: 34px; font-size: 12px; }

/* ---------- 在线充值 ---------- */
.recharge-card { width: 100%; max-width: none; }
.recharge-card .price-head { flex-wrap: wrap; }
.recharge-card .price-head span:last-child { margin-left: auto; }
.recharge-notice { margin: 4px 0 18px; padding: 12px 14px; color: var(--ink-3); background: var(--surface-2); font-size: 12px; }
.recharge-order-link { border: 0; padding: 0; margin-left: 14px; color: var(--accent); background: transparent; cursor: pointer; font: inherit; }
.recharge-methods { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; font-size: 12px; color: var(--ink-3); }
.recharge-methods button, .recharge-presets button { border: 1px solid var(--stroke); border-radius: 8px; padding: 8px 16px; color: var(--ink-2); background: var(--surface); cursor: pointer; font: inherit; }
.recharge-methods button.on, .recharge-presets button.on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.recharge-amount { display: flex; align-items: center; gap: 18px; font-size: 12px; color: var(--ink-2); }
.recharge-input { position: relative; display: block; flex: 1; max-width: 620px; }
.recharge-input i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-style: normal; color: var(--ink-3); }
.recharge-input input { width: 100%; padding-left: 32px; font-size: 20px; font-family: var(--font-mono); }
.recharge-hint { margin: 7px 0 10px 78px; font-size: 11px; color: var(--ink-3); }
.recharge-presets { display: flex; flex-wrap: wrap; gap: 8px; margin-left: 78px; }
.recharge-total { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--stroke); }
.recharge-total span { color: var(--ink-2); font-size: 13px; }
.recharge-total b { margin-left: 10px; color: var(--accent); font: 600 24px var(--font-mono); }
.recharge-total .btn { min-width: 142px; }
@media (max-width: 640px) {
  .recharge-amount { align-items: flex-start; flex-direction: column; gap: 8px; }
  .recharge-input { max-width: none; width: 100%; }
  .recharge-hint, .recharge-presets { margin-left: 0; }
  .recharge-total { align-items: flex-start; flex-direction: column; }
  .recharge-total .btn { width: 100%; }
}

/* ---------- 任务表 ---------- */
.task-state { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--ink-2); }
.task-state i { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); }
.task-state.run i { background: var(--accent); animation: taskPulse 1.2s infinite; }
.task-state.done i { background: var(--ok-ink); }
.task-state.fail i { background: var(--hot); }
@keyframes taskPulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
.task-prog { display: flex; align-items: center; gap: 8px; min-width: 96px; }
.task-prog .bar { flex: 1; height: 4px; border-radius: 4px; background: var(--stroke); overflow: hidden; }
.task-prog .bar i { display: block; height: 100%; background: var(--accent); transition: width .3s linear; }
.task-prog b { font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-3); font-weight: 500; }
.table td.mono { font-family: var(--font-mono); font-size: 11px; }
.table .thumb { width: 34px; height: 34px; border-radius: 8px; object-fit: cover; background: #0b0b12; display: block; }
.table .row-meta { display: flex; align-items: center; gap: 8px; }

/* ---------- 素材 ---------- */
.asset { position: relative; }
.asset .asset-check { position: absolute; top: 8px; left: 8px; z-index: 2; width: 18px; height: 18px; border-radius: 5px; accent-color: var(--accent); cursor: pointer; }
.asset .asset-tools { position: absolute; top: 8px; right: 8px; z-index: 2; display: flex; gap: 6px; opacity: 0; transition: opacity .18s; }
.asset:hover .asset-tools { opacity: 1; }
.asset .asset-tools button { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: rgba(10, 10, 18, .68); color: #fff; backdrop-filter: blur(6px); }
.asset .asset-tools button:hover { background: var(--hot); }
.asset .asset-tools button.fav.on { background: rgba(255, 77, 109, .9); }
.asset.playing img { opacity: 0; }
.asset .asset-cap { display: flex; justify-content: space-between; gap: 8px; }
.asset .asset-cap em { font-style: normal; color: var(--ink-3); font-size: 10px; flex: none; }
.assets-empty { padding: 56px 12px; text-align: center; color: var(--ink-3); font-size: 12.5px; }

/* ---------- API Key ---------- */
.key-fresh { margin-top: 14px; padding: 14px 16px; border-radius: 11px; border: 1px dashed var(--accent-2); background: var(--accent-soft); }
.key-fresh b { display: block; font-size: 12px; color: var(--accent-ink); }
.key-fresh code { display: block; margin-top: 8px; padding: 9px 11px; border-radius: 8px; background: var(--surface); font-family: var(--font-mono); font-size: 12px; word-break: break-all; color: var(--ink); }
.key-fresh .row { display: flex; gap: 8px; margin-top: 10px; }
.api-doc { margin-top: 18px; border-top: 1px solid var(--stroke); padding-top: 14px; }
.api-doc summary { cursor: pointer; font-size: 12.5px; color: var(--ink-2); }
.code-block { margin-top: 10px; padding: 14px; border-radius: 10px; background: #0c0d16; color: #cdd6ff; font-family: var(--font-mono); font-size: 11.5px; line-height: 1.85; overflow-x: auto; white-space: pre; }
.key-line span.masked { font-family: var(--font-mono); }

/* ---------- 记录卡（真实产物） ---------- */
.record-media img { background: #0b0b12; }
.record-media .spin { position: absolute; inset: 0; display: grid; place-items: center; }
.record-media .spin::after { content: ""; width: 22px; height: 22px; border-radius: 50%; border: 2px solid rgba(255,255,255,.22); border-top-color: var(--accent-2); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Failed jobs show the provider's reason instead of an endless loading state. */
.record.is-failed .record-media { background: #090a12; }
.record-media .record-fail {
  position: absolute;
  inset: 12px 14%;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 14px;
  background: transparent;
  color: #fff;
  text-align: center;
  overflow: hidden;
}
.record-fail span {
  max-width: 100%;
  color: #ff6672;
  font-size: 12px;
  line-height: 1.6;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}
.record.is-failed .record-media .bar { display: none; }

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

/* 记录卡里的产物按原比例完整显示（竖屏 9:16 不再被裁掉台词框） */
.records-grid .record-media img { object-fit: contain; background: #0b0b12; }
.asset video { width: 100%; height: 100%; object-fit: cover; display: block; }
.record-media .state.fail { background: rgba(224, 36, 69, .85); }
.record-media .state { max-width: 78%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ============================================================
   工具弹窗 / 大图预览 / 画布提示（功能补齐）
   ============================================================ */
.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px; background: rgba(8, 8, 14, .55); backdrop-filter: blur(6px); }
.modal[hidden] { display: none; }
.modal-card { width: min(660px, 100%); max-height: 86vh; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--stroke); border-radius: 16px; box-shadow: var(--shadow-pop); overflow: hidden; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 15px 18px; border-bottom: 1px solid var(--stroke); }
.modal-head b { font-size: 14.5px; }
.modal-body { padding: 16px 18px; overflow: auto; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { display: flex; align-items: center; gap: 10px; padding: 13px 18px; border-top: 1px solid var(--stroke); background: var(--surface-2); }
.modal-note { margin-right: auto; font-size: 11.5px; color: var(--ink-3); }
.modal .field { display: flex; flex-direction: column; gap: 6px; }
.modal .field > span { font-size: 11.5px; color: var(--ink-3); }
.modal select, .modal textarea, .modal input[type="text"], .modal input[type="url"] {
  width: 100%; border: 1px solid var(--stroke); border-radius: 10px; padding: 9px 11px;
  font-size: 12.5px; background: var(--surface); color: var(--ink); font-family: var(--font-body); outline: none;
}
.modal select:focus, .modal textarea:focus, .modal input:focus { border-color: var(--accent-2); }
.modal textarea { min-height: 84px; resize: vertical; line-height: 1.55; }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; max-height: 224px; overflow: auto; }
.pick { position: relative; border: 1px solid var(--stroke); border-radius: 10px; overflow: hidden; cursor: pointer; background: var(--surface-2); }
.pick img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block; }
.pick input { position: absolute; top: 6px; left: 6px; width: 15px; height: 15px; accent-color: var(--accent); }
.pick small { display: block; padding: 4px 6px; font-size: 10px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.tool-hint { font-size: 11.5px; line-height: 1.75; color: var(--ink-3); }

.lightbox { position: fixed; inset: 0; z-index: 90; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 26px; background: rgba(6, 6, 10, .88); }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: min(92vw, 940px); max-height: 74vh; border-radius: 12px; box-shadow: 0 30px 80px -30px #000; }
.lightbox-close { position: absolute; top: 18px; right: 20px; width: 34px; height: 34px; border-radius: 10px; color: #fff; background: rgba(255, 255, 255, .14); font-size: 13px; }
.lightbox-bar { display: flex; align-items: center; gap: 14px; font-size: 12px; color: #cfd3e6; }
.lightbox-bar .btn { color: #cfd3e6; border-color: rgba(255, 255, 255, .2); }
.record { cursor: pointer; }
.record:hover { border-color: var(--accent-2); }
.node .nbody p[contenteditable="true"] { outline: 1px dashed var(--accent-2); border-radius: 6px; padding: 2px 4px; }
.canvas-saved { font-family: var(--font-mono); font-size: 10px; color: var(--ink-3); }

/* 弹窗/大图在 .app 之外，需要自己带一套主题变量（.app 里的变量在这里取不到） */
.modal, .lightbox {
  --surface: #ffffff;
  --surface-2: #fafafb;
  --ink: #17161c;
  --ink-2: #6d6b78;
  --ink-3: #9a98a5;
  --stroke: #e9e9ef;
  --stroke-2: #dedee6;
  --accent: #2f6bff;
  --accent-2: #6f93ff;
  --accent-soft: #edf3ff;
  --accent-ink: #1f4fd0;
  --shadow-pop: 0 18px 44px -24px rgba(20, 20, 40, .35);
}
html[data-theme="dark"] .modal,
html[data-theme="dark"] .lightbox {
  --surface: #14141c;
  --surface-2: #191922;
  --ink: #f2f2f7;
  --ink-2: #a3a1ae;
  --ink-3: #6f6d7a;
  --stroke: #24242f;
  --stroke-2: #2f2f3c;
  --accent-soft: #12203f;
  --accent-ink: #8fb0ff;
  --shadow-pop: 0 22px 50px -24px rgba(0, 0, 0, .9);
}
.modal-card { color: var(--ink); }
.modal-head b { color: var(--ink); }

/* 画布：连线中的节点高亮 + 提示 */
.node.linking { outline: 2px dashed var(--accent); outline-offset: 3px; }
.node .nfoot .plus { cursor: pointer; }
.node .nfoot .plus:hover { color: var(--accent); }

/* ---------- 外置画布（infinite-canvas-3d 之类的整页应用） ---------- */
.canvas-external { padding: 0; overflow: hidden; }
.canvas-external iframe { display: block; width: 100%; height: min(78vh, 860px); border: 0; background: var(--canvas); }
.canvas-external[hidden] { display: none; }

/* 账号设置弹窗里的两列小表单 */
.modal .form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.modal input[disabled] { opacity: .65; }
.side-user { cursor: pointer; }
.side-user:hover .user-meta b { color: #fff; }

.canvas-head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.canvas-external iframe { height: min(84vh, 900px); }
#canvasTip { margin-top: 12px; }

/* ---------- 画布页：整块铺满，只留右上角浮动控制 ---------- */
#view-canvas { padding: 0 !important; }
#view-canvas .canvas-full {
  position: relative;
  height: calc(100vh - 116px);
  min-height: 520px;
  border-radius: 14px;
  overflow: hidden;
  background: #0b0b10;
  border: 1px solid var(--stroke);
}
#view-canvas .canvas-full iframe { display: block; width: 100%; height: 100%; border: 0; background: #0b0b10; }
.canvas-float {
  position: absolute; top: 10px; right: 12px; z-index: 3;
  display: flex; align-items: center; gap: 8px;
  padding: 5px 9px; border-radius: 10px;
  background: rgba(12, 12, 20, .55);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  color: #e9eaf5; font-size: 11.5px;
}
.canvas-float .canvas-saved { color: rgba(233, 234, 245, .8); }
.canvas-float .canvas-saved::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: #5fd6a6; vertical-align: middle; }
.canvas-mini {
  height: 24px; padding: 0 9px; border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, .22);
  background: transparent; color: #e9eaf5; font-size: 11.5px; cursor: pointer;
  text-decoration: none; display: inline-flex; align-items: center;
}
.canvas-mini:hover { background: rgba(255, 255, 255, .12); }
.canvas-tip {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  z-index: 2; max-width: 460px; padding: 16px 18px; border-radius: 12px;
  background: rgba(12, 12, 20, .82); border: 1px solid rgba(224, 36, 69, .35);
  color: #ffd7de; font-size: 12.5px; line-height: 1.8; text-align: center;
}
.canvas-tip code { font-family: var(--font-mono); font-size: 11.5px; padding: 1px 5px; border-radius: 5px; background: rgba(255, 255, 255, .1); }
@media (max-width: 900px) {
  #view-canvas .canvas-full { height: calc(100vh - 168px); border-radius: 10px; }
  .canvas-float { top: 6px; right: 6px; padding: 4px 7px; }
}

/* 浮动控制挪到右下角，别盖住画布自己的设置/主题按钮 */
.canvas-float { top: auto; bottom: 10px; right: 12px; opacity: .92; }
.canvas-float:hover { opacity: 1; }

/* 浮动控制放左下角，避开画布自己的底部工具栏与右上角图标 */
.canvas-float { top: auto !important; bottom: 10px !important; right: auto !important; left: 10px !important; }

.notice-tabs { display: flex; align-items: center; gap: 4px; margin: 14px 0 12px; border-bottom: 1px solid var(--stroke); }
.notice-tabs button[role="tab"] { border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--ink-3); padding: 7px 10px; font: inherit; font-size: 12px; cursor: pointer; }
.notice-tabs button[role="tab"].on { color: var(--ink); border-bottom-color: var(--accent); }
.notice-tabs .icon-btn { margin-left: auto; margin-bottom: 3px; }
.notice-feed-row { display: flex; gap: 9px; padding: 11px 0; border-bottom: 1px dashed var(--stroke); }
.notice-feed-row:last-child { border-bottom: 0; }
.notice-feed-dot { flex: none; width: 7px; height: 7px; margin-top: 6px; border-radius: 50%; background: var(--accent); }
.notice-feed-dot.warning { background: #e39a35; }.notice-feed-dot.success { background: #38aa73; }
.notice-feed-row b, .notice-feed-row small, .notice-feed-row em { display: block; }
.notice-feed-row b { color: var(--ink); font-size: 12px; }.notice-feed-row small { margin-top: 3px; color: var(--ink-2); font-size: 11.5px; line-height: 1.6; }.notice-feed-row em { margin-top: 3px; color: var(--ink-3); font-size: 10px; font-style: normal; }

/* ---------- 价格编辑（管理员在工作台内直接改价） ---------- */
.price-actions { display: flex; align-items: center; gap: 8px; }
.price-editor { margin-bottom: 16px; padding: 16px 20px 18px; }
.price-editor .price-head { margin-bottom: 12px; }
#priceEditorBody { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.price-edit-group { display: flex; flex-direction: column; gap: 8px; }
.price-edit-title { font-size: 12px; color: var(--ink-2); padding-bottom: 4px; border-bottom: 1px dashed var(--stroke); }
.price-edit-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--ink-2); }
.price-edit-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.price-edit-row input {
  width: 96px; height: 30px; padding: 0 9px; border-radius: 8px;
  border: 1px solid var(--stroke); background: var(--surface);
  color: var(--ink); font-size: 12px; font-family: var(--font-mono); text-align: right;
}
.price-edit-row input:focus { border-color: var(--accent-2); outline: none; }
.price-editor-foot { display: flex; align-items: center; gap: 10px; margin-top: 16px; }
.price-save-state { font-size: 11.5px; color: var(--ink-3); }

/* ---------- 账号积分明细 / 任务详情 ---------- */
.acc-block { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--stroke); }
.acc-block-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.acc-block-head b { font-size: 12.5px; color: var(--ink); }
.acc-block-head span { font-size: 11px; color: var(--ink-3); }
.acc-credits { max-height: 200px; overflow: auto; display: flex; flex-direction: column; gap: 2px; }
.acc-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; font-size: 12px; color: var(--ink-2); border-bottom: 1px dashed var(--stroke); }
.acc-row:last-child { border-bottom: 0; }
.acc-row span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-row em { font-style: normal; color: var(--ink-3); font-size: 10.5px; margin-left: 8px; }
.acc-row b { font-family: var(--font-mono); font-size: 12px; font-weight: 600; }
.acc-row b.plus { color: var(--ok-ink); }
.acc-row b.minus { color: var(--hot); }
.acc-empty { padding: 10px 0; font-size: 12px; color: var(--ink-3); }

.task-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.task-field { display: flex; flex-direction: column; gap: 4px; padding: 9px 11px; border: 1px solid var(--stroke); border-radius: 10px; background: var(--surface-2); }
.task-field span { font-size: 10.5px; color: var(--ink-3); }
.task-field b { font-size: 12px; color: var(--ink); word-break: break-all; }
.task-outputs { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin-top: 12px; }
.task-output { display: block; border: 1px solid var(--stroke); border-radius: 10px; overflow: hidden; text-decoration: none; background: var(--surface-2); }
.task-output img { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; background: #0b0b12; }
.task-output span { display: block; padding: 5px 7px; font-size: 10.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#taskRows tr[data-task] { cursor: pointer; }
#taskRows tr[data-task]:hover td { background: var(--surface-2); }

.acc-redeem { display: flex; gap: 8px; align-items: center; }
.acc-redeem .input { flex: 1; height: 32px; font-family: var(--font-mono); font-size: 12px; letter-spacing: .5px; }

.notice-body { font-size: 13.5px; line-height: 1.9; color: var(--ink); white-space: pre-wrap; }

/* ---------- 充值 / 订单 ---------- */
.order-pay { margin-top: 14px; padding: 12px 14px; border: 1px dashed var(--stroke-2); border-radius: 12px; background: var(--surface-2); }
.order-pay-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.order-pay-head b { font-size: 12.5px; color: var(--ink); }
.order-pay-head span { font-size: 11px; color: var(--ink-3); }
.order-payinfo { margin: 0; padding: 10px 12px; border-radius: 10px; background: #0c0d16; color: #cdd6ff; font-family: var(--font-mono); font-size: 11.5px; line-height: 1.8; white-space: pre-wrap; word-break: break-all; }
.acc-orders { display: flex; flex-direction: column; gap: 2px; }
.acc-orders .acc-row b { font-family: var(--font-body); font-size: 11.5px; }

/* ---------- 模型卡片列表 ---------- */
.model-list { display: flex; flex-direction: column; gap: 6px; max-height: 264px; overflow-y: auto; padding-right: 4px; margin-top: 2px; }
.model-card {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 10px 12px; border: 1px solid var(--stroke); border-radius: 11px;
  background: var(--surface); text-align: left; cursor: pointer; transition: .15s;
}
.model-card:hover { border-color: var(--accent-2); background: var(--surface-2); }
.model-card.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); background: var(--accent-soft); }
.mc-icon { flex: none; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; background: var(--surface-2); color: var(--accent); font-size: 13px; }
.model-card.on .mc-icon { background: #fff; }
.mc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mc-main b { font-size: 12.5px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-main em { font-style: normal; font-size: 10.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-price { flex: none; font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-2); }
.mc-state { flex: none; font-size: 10px; padding: 2px 7px; border-radius: 999px; }
.mc-state.ok { color: #1c8a5a; background: #e9f8f0; }
.mc-state.busy { color: #b23a1f; background: #fdeee9; }
html[data-theme="dark"] .mc-state.ok { color: #5fd6a6; background: rgba(95,214,166,.12); }
html[data-theme="dark"] .mc-state.busy { color: #ff9b82; background: rgba(255,120,90,.12); }
.mc-check { flex: none; color: var(--accent); font-size: 12px; }
.model-empty { padding: 14px; border: 1px dashed var(--stroke); border-radius: 10px; text-align: center; color: var(--ink-3); font-size: 12px; }

/* ---------- 参考图缩略图 ---------- */
.ref-thumbs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; justify-content: flex-start; text-align: left; }
.ref-thumbs:empty { display: none; }
.ref-thumb { position: relative; width: 104px; min-width: 104px; height: 98px; display: flex; flex-direction: column; gap: 3px; overflow: visible; border: 0; }
.ref-thumb-frame { position: relative; display: block; width: 70px; height: 64px; overflow: hidden; border-radius: 10px; border: 1px solid var(--stroke); background: var(--surface); }
.ref-thumb-media { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.ref-audio { display: grid; place-items: center; color: var(--accent); font-size: 24px; background: var(--accent-soft); }
.ref-thumb button {
  position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; border-radius: 50%;
  background: rgba(10,10,16,.7); color: #fff; font-size: 11px; line-height: 1; border: 0; cursor: pointer;
}
.ref-label { display: block; padding: 0 2px; color: var(--ink-3); font: 10px/1.2 var(--font-mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ref-name { display: block; max-width: 104px; padding: 0 2px; color: var(--ink-2); font-size: 10px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick-audio { display: grid; place-items: center; width: 100%; aspect-ratio: 1; color: var(--accent); background: var(--accent-soft); font-size: 24px; }
.assets-more { display: flex; justify-content: center; padding: 12px 0 0; }

/* ============================================================
   2026-10-24 · 死件接线：记录卡操作 / API 面板 / 客服弹层
   ============================================================ */

/* hidden 在 .card 上也要立即生效 */
.api-panel[hidden], .modal[hidden], .lightbox[hidden] { display: none !important; }

/* ---- 记录卡上的收藏 / 下载 ---- */
.record-media .rec-acts {
  position: absolute; top: 6px; right: 6px; display: flex; gap: 4px;
  opacity: 1; z-index: 2;
}
.record:hover .rec-media .rec-acts,
.record:hover .rec-acts,
.record .rec-acts:focus-within { opacity: 1; }
.rec-acts button {
  width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px;
  border: 1px solid rgba(255,255,255,.22); background: rgba(10,10,16,.62); color: #fff;
  font-size: 12px; line-height: 1; cursor: pointer; backdrop-filter: blur(6px);
}
.rec-acts button:hover { background: rgba(10,10,16,.85); }
.rec-acts button.on { color: #ff5b7f; border-color: rgba(255,91,127,.5); }
.record.is-fav { border-color: rgba(255,91,127,.45); }

/* ---- API 对接面板 ---- */
.api-panel { display: block; }
.api-sec { margin-top: 22px; }
.api-sec:first-child { margin-top: 4px; }
.api-sec > h3 {
  margin: 0 0 10px; font-size: 14px; font-weight: 600; color: var(--ink);
  display: flex; align-items: center; gap: 8px;
}
.api-sec > p { margin: 0 0 10px; font-size: 12.5px; line-height: 1.8; color: var(--ink-3); }

.api-route {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 12px; border: 1px solid var(--stroke); border-radius: 10px;
  background: var(--surface); margin-bottom: 8px;
}
.api-route .method {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .06em;
  padding: 3px 7px; border-radius: 6px; border: 1px solid var(--stroke); color: var(--ink-2);
}
.api-route .method.post { color: #1f7a4d; border-color: rgba(31,153,102,.35); background: rgba(31,153,102,.08); }
.api-route .method.get { color: #1f4fd0; border-color: rgba(47,107,255,.3); background: rgba(47,107,255,.07); }
.api-route code { font-family: var(--font-mono); font-size: 12px; color: var(--ink); }
.api-route span.desc { font-size: 11.5px; color: var(--ink-3); margin-left: auto; }

.api-params { width: 100%; border-collapse: collapse; margin: 6px 0 4px; }
.api-params th, .api-params td {
  text-align: left; padding: 7px 9px; border-bottom: 1px solid var(--stroke);
  font-size: 11.5px; color: var(--ink-2); vertical-align: top;
}
.api-params th { color: var(--ink-3); font-weight: 500; font-size: 11px; }
.api-params td code { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink); }
.api-params td.req { color: #d9483b; font-size: 11px; }

.api-code { position: relative; margin: 8px 0 0; }
.api-code .code-block { margin-top: 0; padding-right: 74px; }
.api-code .api-copy {
  position: absolute; top: 8px; right: 8px; height: 26px; padding: 0 10px;
  border-radius: 7px; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.08);
  color: #cdd6ff; font-size: 11px; cursor: pointer;
}
.api-code .api-copy:hover { background: rgba(255,255,255,.16); }

.api-try {
  margin-top: 14px; padding: 14px 16px; border-radius: 12px;
  border: 1px dashed var(--accent-2); background: var(--accent-soft);
  display: flex; flex-direction: column; gap: 10px;
}
.api-try .row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.api-try .row .input, .api-try .row .sel { flex: 1; min-width: 140px; }
.api-try textarea { min-height: 82px; }
.api-try .api-out {
  margin: 0; padding: 12px; border-radius: 9px; background: #0c0d16; color: #cdd6ff;
  font-family: var(--font-mono); font-size: 11.5px; line-height: 1.8;
  max-height: 260px; overflow: auto; white-space: pre-wrap;
}
.api-try .api-out:empty { display: none; }
.api-hint { font-size: 11.5px; color: var(--ink-3); }
.api-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px;
  border-radius: 999px; border: 1px solid var(--stroke); font-size: 11.5px; color: var(--ink-2);
  background: var(--surface);
}
.api-chip i { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); }
.api-chip.ok i { background: #1f9966; }
.api-chip.off i { background: #d9483b; }

/* ---- 客服弹层 ---- */
.support-list { display: flex; flex-direction: column; gap: 8px; }
.support-row {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  border: 1px solid var(--stroke); border-radius: 10px; background: var(--surface);
  font-size: 12.5px;
}
.support-row > span { width: 44px; color: var(--ink-3); font-size: 11.5px; }
.support-row > b { flex: 1; font-weight: 500; font-family: var(--font-mono); color: var(--ink); }
.support-links { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }

/* 记录网格：条数多了就在卡内滚动，别把页面撑成一堵墙 */
.records-card .records-grid { max-height: none; overflow-y: auto; align-content: start; }
.records-card .records-grid::-webkit-scrollbar { width: 8px; }
.records-card .records-grid::-webkit-scrollbar-thumb { background: var(--stroke); border-radius: 8px; }
@media (max-width: 720px) {
  .records-card .records-grid { grid-template-columns: 1fr; max-height: 480px; }
}

/* 行高必须由内容决定，否则卡内滚动会把卡片压扁 */
.records-card .records-grid { grid-auto-rows: max-content; }

/* ---- 表单里的「AI 写分镜」小按钮 + 弹层 ---- */
.step-head .step-ai { margin-left: auto; font-size: 11.5px; height: 26px; padding: 0 9px; }
.script-row { display: flex; gap: 8px; align-items: center; margin: 10px 0; flex-wrap: wrap; }
.script-row .sel { flex: 1; min-width: 150px; }
.script-out {
  margin: 0; padding: 12px; border-radius: 9px; background: #0c0d16; color: #cdd6ff;
  font-family: var(--font-mono); font-size: 11.5px; line-height: 1.85;
  max-height: 260px; overflow: auto; white-space: pre-wrap;
}
.script-out:empty { display: none; }
.modal-card .field textarea { min-height: 78px; }

/* ---- 价格/模型没读到时占位（不再是空白死区） ---- */
.pricing-offline {
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  padding: 18px 16px; border: 1px dashed var(--stroke); border-radius: 11px;
  background: var(--surface-2, rgba(0,0,0,.02));
}
.pricing-offline b { font-size: 13px; color: var(--ink); }
.pricing-offline p { margin: 0; font-size: 12px; line-height: 1.8; color: var(--ink-3); }
.seg-hint { font-size: 11.5px; color: var(--ink-3); padding: 4px 2px; }

/* ---- 顶部服务离线横幅（比只看模型区更醒目） ---- */
.svc-banner {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin: 0 0 14px; padding: 10px 14px; border-radius: 11px;
  border: 1px solid rgba(217, 72, 59, 0.35);
  background: rgba(217, 72, 59, 0.08); color: #b03a2e;
  font-size: 12.5px;
}
.svc-banner[hidden] { display: none !important; }
.svc-banner span { flex: 1; min-width: 0; }
.svc-banner .btn { color: inherit; border-color: rgba(217, 72, 59, 0.45); }
[data-theme="dark"] .svc-banner { color: #ff9d92; background: rgba(217, 72, 59, 0.16); }

/* ---- 提示词反推 ---- */
.reverse-out {
  margin: 14px 22px 0; padding: 14px 16px; border-radius: 11px;
  background: #0c0d16; color: #cdd6ff; font-family: var(--font-mono);
  font-size: 11.5px; line-height: 1.9; white-space: pre-wrap; word-break: break-word;
  max-height: 460px; overflow: auto; flex: 1; min-height: 0;
}
.reverse-actions { display: flex; gap: 8px; flex-wrap: wrap; padding: 14px 22px 20px; }
.pick .pick-video { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 8px; background: #0b0b12; }

/* ---- 提交前确认弹层 ---- */
.confirm-list { display: flex; flex-direction: column; gap: 2px; margin-bottom: 14px; }
.confirm-row {
  display: flex; align-items: baseline; gap: 12px; padding: 7px 2px;
  border-bottom: 1px dashed var(--stroke); font-size: 12.5px;
}
.confirm-row span { width: 84px; flex: none; color: var(--ink-3); }
.confirm-row b { flex: 1; min-width: 0; font-weight: 500; color: var(--ink); word-break: break-word; }
.confirm-cost {
  display: flex; align-items: baseline; gap: 10px; padding: 12px 14px;
  border-radius: 11px; background: var(--accent-soft); color: var(--accent-ink);
  font-size: 12.5px;
}
.confirm-cost b { font-family: var(--font-mono); font-size: 18px; }
.confirm-cost em { font-style: normal; margin-left: auto; font-size: 11.5px; opacity: .8; }
.ref-thumb video { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }

/* ---- 对齐参考站：记录区底部一行、画质分段、放大编辑 ---- */
.list-foot-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 2px 0; font-size: 12px; color: var(--ink-3);
}
.sel-xs { height: 26px; width: auto; padding: 0 6px; font-size: 12px; }
.modal-card-wide { max-width: 760px; width: 92vw; }
.expand-area { min-height: 320px; height: 46vh; font-size: 13px; line-height: 1.9; }
.step-cols.three, .step-cols { flex-wrap: wrap; }
.step-cols > div { min-width: 150px; }

/* ============================================================
   按 Fnko 的页面骨架重排（配色字体仍用我们的）
   01/02/03 区块标题 · 上传区 · @ 文本框 · 单选模型行 · 参数下拉
   ============================================================ */

/* 区块标题：编号 + 名称 + 右侧小标签 */
.form-card .step { padding: 0 0 10px; }
.form-card .step + .step { border-top: 1px solid var(--stroke); padding-top: 8px; }
.form-card .step-head {
  display: flex; align-items: baseline; gap: 8px;
  font-size: 13.5px; margin-bottom: 8px;
}
.form-card .step-head b { font-weight: 600; color: var(--ink); }
.form-card .step-head .step-num {
  font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-3);
  min-width: 18px;
}
.form-card .step-head .step-opt { margin-left: auto; font-size: 11.5px; color: var(--ink-3); }

/* 上传区：居中竖排 + 两个按钮 */
.form-card .upload { min-height: 200px; display: flex; }
.form-card .dz-empty { gap: 8px; }
.form-card .dz-actions { display: flex; gap: 8px; margin-top: 6px; }
.form-card .dz-btn, .form-card .dz-link {
  display: inline-flex; align-items: center; justify-content: center;
  height: 33px; padding: 0 14px; border-radius: 9px; font-size: 12.5px;
  border: 1px solid var(--stroke); background: var(--surface); color: var(--ink-2);
  cursor: pointer;
}
.form-card .dz-btn { color: var(--accent-ink); border-color: var(--accent-2); background: var(--accent-soft); }

/* Keep the main prompt areas comfortable on every creation page. */
.form-card .input-area { min-height: 190px; }

/* @ 文本框 */
.mention-wrap { position: relative; }
.mention-rich {
  position: absolute;
  left: 44px;
  right: 14px;
  top: 10px;
  bottom: 10px;
  z-index: 1;
  overflow: auto;
  color: var(--ink);
  font-size: 13.5px;
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-word;
  pointer-events: none;
}
.mention-wrap.has-rich .input-area { color: transparent; caret-color: var(--ink); }
.mention-inline {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  vertical-align: middle;
  margin: 1px 3px 1px 0;
  padding: 2px 7px 2px 3px;
  border: 1px solid var(--accent-2);
  border-radius: 7px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  line-height: 1.35;
}
.mention-inline img, .mention-inline video {
  width: 26px;
  height: 26px;
  border-radius: 5px;
  object-fit: cover;
  background: var(--surface-2);
}
.mention-inline b { font: 600 11px/1.2 var(--font-mono); }
.mention-menu {
  position: absolute; left: 8px; right: 8px; top: calc(100% - 4px); z-index: 12;
  display: flex; flex-direction: column; gap: 3px; max-height: 180px; overflow-y: auto;
  padding: 6px; border: 1px solid var(--stroke-2); border-radius: 9px;
  background: var(--surface); box-shadow: 0 12px 26px rgba(0,0,0,.24);
}
.mention-menu[hidden] { display: none !important; }
.mention-option {
  display: flex; align-items: center; gap: 9px; width: 100%; min-height: 46px; padding: 6px 8px; border: 0; border-radius: 6px;
  background: transparent; color: var(--ink-2); text-align: left;
  font: 11.5px/1.3 var(--font-mono); cursor: pointer;
}
.mention-option:hover, .mention-option.active { background: var(--accent-soft); color: var(--accent-ink); }
.mention-thumb { flex: none; width: 34px; height: 34px; object-fit: cover; border-radius: 6px; border: 1px solid var(--stroke); background: var(--surface-2); }
.mention-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow: hidden; }
.mention-head { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.mention-copy b { font-weight: 600; color: inherit; }
.mention-copy em { font-style: normal; color: var(--ink-3); font: 10px/1.2 var(--font-body); }
.mention-copy small { display: block; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-3); font: 10px/1.25 var(--font-body); }
.mention-wrap .mention-at {
  position: absolute; top: 8px; left: 8px; z-index: 2;
  width: 28px; height: 28px; display: grid; place-items: center;
  border-radius: 8px; border: 1px solid var(--stroke);
  background: var(--surface); color: var(--ink-2);
  font-family: var(--font-mono); font-size: 13px; cursor: pointer;
}
.mention-wrap .mention-at:hover { color: var(--accent-ink); border-color: var(--accent-2); }
.mention-wrap .input-area { padding-left: 44px; min-height: 210px; }

/* 模型行：一张卡（≈56 高）+ 参考上限行 */
#modelList, #imageModelList { max-height: none; overflow: visible; }
#modelList .model-card, #imageModelList .model-card {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  min-height: 56px; padding: 10px 12px; margin-bottom: 6px;
}
#modelList .model-card .mc-health, #imageModelList .model-card .mc-health {
  flex-basis: 100%; order: 9; font-size: 11px; color: var(--ink-3); margin-top: 2px;
}
#modelList .model-card .mc-state, #imageModelList .model-card .mc-state {
  display: inline-flex; align-items: center; gap: 5px;
}
#modelList .model-card .mc-state i, #imageModelList .model-card .mc-state i {
  width: 7px; height: 7px; border-radius: 50%; background: #1f9966; display: inline-block;
}
#modelList .model-card .mc-state.busy i, #imageModelList .model-card .mc-state.busy i { background: #d9483b; }
.real-badge {
  display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 6px;
  font-size: 10.5px; color: #1f7a4d; background: rgba(31, 153, 102, .12);
  border: 1px solid rgba(31, 153, 102, .3);
}

/* 参数：下拉式按钮（显示当前值，点开选） */
.seg { position: relative; display: flex; flex-wrap: wrap; gap: 6px; }
.seg button {
  height: 38px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--stroke);
  background: var(--surface); color: var(--ink-2); font-size: 12.5px;
}
.seg button[aria-pressed="true"] { border-color: var(--accent-2); background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.seg button[aria-pressed="true"]::after { content: " ▾"; font-size: 10px; opacity: .7; }
.seg:not(.open) button[aria-pressed="false"] { display: none; }
.seg.open { gap: 6px; }
.seg.open button { display: inline-flex; }
.step-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.form-card .parameter-grid { padding-bottom: 6px; }
.step-cols > div:nth-child(3) { grid-column: 1 / -1; }

/* 费用拆解 + 说明 */
.fee-line { margin: 8px 0 0; font-size: 11.5px; color: var(--ink-3); }
.gen-disclaimer { margin: 4px 0 0; font-size: 11px; color: var(--ink-3); opacity: .85; }
.generation-disclaimer { margin: 4px 0 0; font-size: 11px; line-height: 1.5; color: var(--ink-3); opacity: .85; }
.form-foot { gap: 8px; padding-top: 8px; }
.form-foot .btn { min-height: 40px; }
.form-foot .cost-line { display: none; }


/* 模型选择器：收起时只显示已选那一张 */
#modelList:not(.open) .model-card:not(.on),
#imageModelList:not(.open) .model-card:not(.on) { display: none; }
#modelList .model-card.on::after,
#imageModelList .model-card.on::after { content: none; }

/* 模型选择器：默认是一行 combobox，展开后浮出 listbox，不挤开下面的参数。 */
#modelList, #imageModelList {
  position: relative;
  display: block;
  max-height: none;
  overflow: visible;
  padding-right: 0;
  z-index: 6;
}
#modelList > .model-card, #imageModelList > .model-card {
  margin-bottom: 0;
  min-height: 56px;
}
#modelList .model-name, #imageModelList .model-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
}
#modelList .model-meta, #imageModelList .model-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex: none;
}
#modelList .model-price, #imageModelList .model-price {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-2);
  white-space: nowrap;
}
#modelList .model-badge, #imageModelList .model-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border: 1px solid rgba(31,153,102,.55);
  border-radius: 999px;
  color: #5fd6a6;
  font-size: 10px;
  white-space: nowrap;
}
#modelList .model-badge.busy, #imageModelList .model-badge.busy {
  border-color: rgba(255,120,90,.65);
  color: #ff9b82;
}
#modelList .model-badge i, #imageModelList .model-badge i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
#modelList .model-check, #imageModelList .model-check { color: var(--accent); font-size: 13px; }
#modelList .model-chevron, #imageModelList .model-chevron { color: var(--ink-3); font-size: 15px; margin-left: 2px; }
.model-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  max-height: 360px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--stroke-2);
  border-radius: 11px;
  background: var(--surface);
  box-shadow: 0 16px 34px rgba(0,0,0,.28);
  z-index: 20;
}
.model-list.open .model-menu { display: flex; flex-direction: column; gap: 4px; }
.model-option {
  display: flex;
  flex-wrap: wrap;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.model-option:hover, .model-option.selected { border-color: var(--accent-2); background: var(--accent-soft); }
.model-option-main { display: flex; align-items: center; gap: 9px; width: 100%; min-width: 0; }
.model-option-main .model-name { font-weight: 500; }
.model-option-limits { width: 100%; margin-top: 4px; padding-left: 31px; font-size: 10.5px; line-height: 1.5; color: var(--ink-3); }
.model-option .model-badge { margin-left: auto; }
.model-option .model-check, .model-option .model-chevron { display: none; }
.auto-submit {
  display: flex; align-items: center; gap: 6px; margin-top: 4px;
  font-size: 11px; color: var(--ink-3); cursor: pointer;
}
.auto-submit input { width: 13px; height: 13px; }
