/* Studio Try-On — 看板批量 + 单款画布 (Apple-style) */

:root {
  --bg: #f5f5f7;
  --canvas: #ececef;
  --surface: #fff;
  --ink: #1d1d1f;
  --ink2: #6e6e73;
  --ink3: #a1a1a6;
  --line: #e8e8ed;
  --line2: #d2d2d7;
  --blue: #0071e3;
  --green: #1d7d46;
  --green-bg: #e8f5ee;
  --orange: #b25000;
  --orange-bg: #fdf1e3;
  --red: #d70015;
  --red-bg: #fdeced;
  --gray-bg: #f0f0f2;
  --r-lg: 20px;
  --r-md: 14px;
  --r-sm: 10px;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 10px 30px rgba(0,0,0,.06);
  --shadow-lg: 0 24px 60px rgba(0,0,0,.16);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0; }
img { display: block; }
.muted { color: var(--ink3); font-size: 13px; }

/* ================= top bar ================= */

.tb {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 58px;
  padding: 0 clamp(14px, 2.5vw, 24px);
  background: rgba(251, 251, 253, 0.86);
  backdrop-filter: blur(20px) saturate(1.8);
  -webkit-backdrop-filter: blur(20px) saturate(1.8);
  border-bottom: 1px solid var(--line);
}

.tb-l { display: flex; align-items: center; gap: 14px; min-width: 0; }

.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; }
.logo i {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: #1d1d1f url("/static/brand-mark.svg?v=20260720a") center / cover no-repeat;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08), 0 1px 2px rgba(0,0,0,.12);
}

.tb .div { width: 1px; height: 22px; background: var(--line2); flex: none; }

.proj-wrap { display: flex; align-items: center; gap: 6px; min-width: 0; }

.proj-select {
  appearance: none;
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink);
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5l3.5 3.5 3.5-3.5' fill='none' stroke='%236e6e73' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center;
  border: 1px solid var(--line2);
  border-radius: 980px;
  padding: 7px 30px 7px 14px;
  max-width: 240px;
  text-overflow: ellipsis;
  cursor: pointer;
}

.icon-btn {
  flex: none;
  width: 32px; height: 32px;
  border: 1px solid var(--line2);
  border-radius: 50%;
  background: #fff;
  color: var(--ink2);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.icon-btn:hover { color: var(--ink); border-color: #b8b8bf; }

.tb-r { display: flex; align-items: center; gap: 8px; flex: none; }

.pill-btn {
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  border: 1px solid var(--line2);
  border-radius: 980px;
  background: #fff;
  padding: 7px 14px;
  cursor: pointer;
  white-space: nowrap;
}
.pill-btn:hover { border-color: #b8b8bf; }
.balance-pill {
  background: #1d1d1f;
  border-color: #1d1d1f;
  color: #fff;
}
.balance-pill:hover { border-color: #1d1d1f; background: #000; }

/* settings popover */
.settings { position: relative; }
.settings summary { display: inline-block; list-style: none; user-select: none; }
.settings summary::-webkit-details-marker { display: none; }
.settings-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: min(320px, calc(100vw - 28px));
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  padding: 18px;
  display: grid;
  gap: 16px;
  z-index: 70;
}
.config-line { font-size: 12px; color: var(--ink3); line-height: 1.6; }
.settings-form { display: grid; gap: 8px; }
.settings-form label { display: grid; gap: 6px; font-size: 12.5px; font-weight: 500; color: var(--ink2); }

/* ================= generic controls ================= */

input, select, textarea {
  appearance: none;
  width: 100%;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line2);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; }
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5l3.5 3.5 3.5-3.5' fill='none' stroke='%236e6e73' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  padding-right: 32px;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3.5px rgba(0, 113, 227, .16);
}
input::placeholder, textarea::placeholder { color: #a1a1a6; }

.btn {
  appearance: none;
  border: 0;
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1;
  border-radius: 980px;
  padding: 11px 20px;
  cursor: pointer;
  transition: background-color .15s, transform .05s;
  white-space: nowrap;
}
.btn:active { transform: scale(.98); }
.btn.dark { background: var(--ink); color: #fff; }
.btn.dark:hover { background: #333336; }
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid var(--line2); }
.btn.ghost:hover { background: var(--gray-bg); }
.btn.ghost.danger { color: var(--red); border-color: rgba(215, 0, 21, .25); }
.btn.ghost.danger:hover { background: var(--red-bg); }
.btn.danger { color: var(--red); border: 1px solid rgba(215, 0, 21, .25); background: var(--red-bg); }
.btn.danger:hover { border-color: rgba(215, 0, 21, .45); }
.btn.small { padding: 8px 14px; font-size: 12.5px; }
.btn.block { display: block; width: 100%; text-align: center; }
.btn:disabled { opacity: .45; cursor: default; }

/* status pill */
.status {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  padding: 6px 12px;
  border-radius: 980px;
  background: var(--gray-bg);
  color: var(--ink2);
}
.status.succeeded { background: var(--green-bg); color: var(--green); }
.status.running { background: var(--orange-bg); color: var(--orange); }
.status.failed { background: var(--red-bg); color: var(--red); }
.status.skipped { color: var(--ink3); }

.text-link {
  color: inherit;
  text-decoration: none;
}

/* ================= Model002 Comfy workbench ================= */

.model002-page {
  background: var(--canvas);
}

.model002-workbench {
  display: grid;
  grid-template-columns: 390px minmax(0, 1fr);
  gap: 18px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px;
}

.model002-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}

.model002-form {
  position: sticky;
  top: 78px;
  display: grid;
  gap: 14px;
  padding: 22px;
}

.model002-form h1 {
  font-size: 30px;
}

.model002-form label {
  display: grid;
  gap: 7px;
  color: var(--ink2);
  font-size: 12.5px;
  font-weight: 600;
}

.kicker {
  color: var(--ink3);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.model002-control-grid {
  display: grid;
  grid-template-columns: 1fr 92px 92px;
  gap: 10px;
  align-items: end;
}

.model002-check {
  align-self: stretch;
  grid-template-columns: auto 1fr;
  align-items: center;
  min-height: 42px;
  border: 1px solid var(--line2);
  border-radius: var(--r-sm);
  padding: 10px 12px;
}

.model002-check input {
  width: 18px;
  padding: 0;
}

.model002-results {
  overflow: hidden;
  min-height: calc(100vh - 106px);
}

.model002-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding: 22px 24px;
}

.model002-head h2 {
  font-size: 24px;
}

.model002-status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  border-bottom: 1px solid var(--line);
  background: #fbfbfd;
  padding: 18px 24px;
}

.model002-status-grid article {
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: #fff;
  padding: 13px;
}

.model002-status-grid small {
  display: block;
  color: var(--ink3);
  font-weight: 600;
  margin-bottom: 6px;
}

.model002-status-grid strong {
  display: block;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.model002-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding: 18px 24px;
}

.model002-preview-grid figure {
  display: grid;
  gap: 8px;
  margin: 0;
}

.model002-preview-grid img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--gray-bg);
}

.model002-preview-grid img:not([src]) {
  visibility: hidden;
}

.model002-preview-grid figcaption {
  color: var(--ink3);
  font-size: 12.5px;
  font-weight: 600;
}

.model002-output {
  padding: 20px;
}

.model002-output .empty-card {
  min-height: 340px;
}

.model002-final a {
  display: block;
}

.model002-final img {
  width: 100%;
  max-height: 720px;
  object-fit: contain;
  border-radius: var(--r-md);
  background: var(--gray-bg);
}

/* ================= board ================= */

.board {
  max-width: 1440px;
  margin: 0 auto;
  padding: clamp(20px, 3vw, 34px) clamp(14px, 2.5vw, 34px) 140px;
}

.board-h {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.board-h h1 { font-size: clamp(22px, 2.6vw, 28px); font-weight: 700; letter-spacing: -0.02em; }
.board-h p { margin-top: 5px; font-size: 13px; color: var(--ink2); }
.board-actions { display: flex; gap: 10px; align-items: center; }

.prep-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 18px;
}
.prep-card {
  min-height: 126px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  border: 1px solid rgba(210, 210, 215, .84);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(248,248,250,.92));
  box-shadow: 0 12px 32px rgba(0,0,0,.04);
}
.prep-kicker {
  display: block;
  margin-bottom: 8px;
  color: var(--ink3);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.prep-card h2 {
  font-size: 18px;
  font-weight: 680;
}
.prep-card p {
  max-width: 520px;
  margin-top: 6px;
  color: var(--ink2);
  font-size: 13px;
  line-height: 1.55;
}
.prep-card .btn {
  white-space: nowrap;
}

.filter-select {
  width: auto;
  font-size: 13px;
  font-weight: 500;
  border-radius: 980px;
  padding: 9px 32px 9px 15px;
  cursor: pointer;
}

.board-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px;
}

.pcard {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
  cursor: pointer;
  position: relative;
  transition: box-shadow .18s, transform .18s;
}
.pcard:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.pcard.sel { outline: 2px solid var(--blue); outline-offset: -1px; }

.pcard .ph { position: relative; background: var(--gray-bg); }
.pcard .ph img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
.ph-empty {
  aspect-ratio: 3 / 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 16px;
  text-align: center;
  color: var(--ink2);
}
.ph-empty span { font-size: 14px; font-weight: 600; }
.ph-empty small { font-size: 11.5px; color: var(--ink3); }

.pcard .st {
  position: absolute;
  top: 10px; left: 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 980px;
  padding: 5px 10px;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.st.done { color: var(--green); }
.st.run { color: var(--orange); }
.st.fail { color: var(--red); }
.st.todo { color: var(--ink2); }

.pcard .ck {
  position: absolute;
  top: 10px; right: 10px;
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,.95);
  background: rgba(0,0,0,.18);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.pcard.sel .ck { background: var(--blue); border-color: var(--blue); }
.pcard.sel .ck::after {
  content: "✓";
  color: #fff;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.pcard .quick {
  position: absolute;
  left: 10px; right: 10px; bottom: 10px;
  border: 0;
  border-radius: 980px;
  background: rgba(29,29,31,.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  padding: 9px 0;
  opacity: 0;
  transition: opacity .18s;
  cursor: pointer;
}
.pcard:hover .quick { opacity: 1; }

.pcard .pb { padding: 11px 13px; }
.pcard .pb b { display: block; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcard .pb span { font-size: 11.5px; color: var(--ink3); }
.card-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 6px;
}
.card-actions .link-btn {
  font-size: 11.5px;
  padding: 0;
}
.link-btn.danger {
  color: var(--red);
}
.model-actions {
  padding: 0 10px 10px;
  margin-top: -2px;
}

.board-empty { display: flex; justify-content: center; padding: 8vh 0; }
.empty-card {
  max-width: 420px;
  text-align: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  padding: 40px 34px;
  display: grid;
  gap: 12px;
  justify-items: center;
}
.empty-card h2 { font-size: 20px; }
.empty-card p { font-size: 13.5px; color: var(--ink2); }

/* ================= batch bar ================= */

.batch-bar {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(29,29,31,.93);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: #fff;
  border-radius: 980px;
  padding: 10px 10px 10px 22px;
  box-shadow: var(--shadow-lg);
  white-space: nowrap;
  max-width: calc(100vw - 24px);
}
.batch-bar span { font-size: 13.5px; }
.batch-bar em { font-style: normal; color: #9d9da3; font-size: 12.5px; }
.batch-clear {
  border: 0; background: transparent; color: #9d9da3;
  font: inherit; font-size: 13px; cursor: pointer; padding: 6px;
}
.batch-clear:hover { color: #fff; }
#batchGoBtn {
  border: 0;
  border-radius: 980px;
  background: var(--blue);
  color: #fff;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  padding: 11px 20px;
  cursor: pointer;
}
#batchGoBtn:hover { background: #0077ed; }
#batchGoBtn:disabled { opacity: .55; cursor: default; }

/* ================= detail / canvas ================= */

.detail { display: flex; min-height: calc(100vh - 58px); }

.stage {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--canvas);
  padding-bottom: 22px;
}

.stage-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px clamp(14px, 2.5vw, 26px) 0;
  flex-wrap: wrap;
}
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  padding: 8px 15px;
  border-radius: 980px;
  border: 1px solid var(--line2);
  background: #fff;
  color: var(--ink2);
  cursor: pointer;
}
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.spec-badge {
  font-size: 12px;
  color: var(--ink2);
  background: #fff;
  border: 1px solid var(--line2);
  border-radius: 980px;
  padding: 7px 13px;
  white-space: nowrap;
}

.stage-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px clamp(14px, 2.5vw, 26px);
  min-height: 340px;
}

.hero-img {
  display: block;
  height: min(58vh, 560px);
  aspect-ratio: 3 / 4;
  max-width: 100%;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: #dfdfe3;
  box-shadow: var(--shadow);
  position: relative;
}
.hero-img img { width: 100%; height: 100%; object-fit: cover; }

.hero-img.placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--ink2);
  text-align: center;
  padding: 20px;
}
.hero-img.placeholder b { font-size: 16px; }
.hero-img.placeholder.busy::before {
  content: "";
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--orange);
  animation: pulse 1.4s infinite;
  margin-bottom: 4px;
}
@keyframes pulse { 50% { opacity: .3; } }
.err-text { font-size: 11.5px; color: var(--red); max-width: 90%; word-break: break-word; }

.hero-img.source-preview img { object-fit: contain; background: #fff; }
.source-sheet-hero {
  display: block;
  width: min(100%, 1180px);
  aspect-ratio: 3 / 1;
  max-height: min(68vh, 620px);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: #dfdfe3;
  box-shadow: var(--shadow);
  position: relative;
}
.source-sheet-hero img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #e7e7ea;
}
.source-sheet-hero.placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--ink2);
  text-align: center;
  padding: 24px;
}
.source-sheet-hero.placeholder b { font-size: 18px; }
.source-sheet-hero.placeholder.busy::before {
  content: "";
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--orange);
  animation: pulse 1.4s infinite;
}
.source-sheet-hero.source-preview img {
  object-fit: contain;
  background: #fff;
}
.src-badge {
  position: absolute;
  left: 50%; bottom: 12px;
  transform: translateX(-50%);
  font-size: 11.5px;
  font-weight: 500;
  color: #fff;
  background: rgba(29,29,31,.75);
  backdrop-filter: blur(6px);
  border-radius: 980px;
  padding: 6px 13px;
  white-space: nowrap;
}

.strip-wrap {
  position: relative;
  padding: 0 clamp(14px, 2.5vw, 26px) 14px;
}
.strip {
  display: flex;
  gap: 12px;
  justify-content: flex-start;
  padding: 4px 44px 8px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-behavior: smooth;
  cursor: grab;
  user-select: none;
  scrollbar-width: thin;
}
.strip.dragging { cursor: grabbing; scroll-behavior: auto; }
.strip img { pointer-events: none; }
.strip-nav {
  position: absolute;
  top: 4px;
  bottom: 22px;
  z-index: 5;
  width: 34px;
  border: 1px solid rgba(210, 210, 215, .85);
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--ink2);
  border-radius: 999px;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,.08);
}
.strip-nav:hover { color: var(--ink); background: #fff; }
.strip-nav.left { left: clamp(14px, 2.5vw, 26px); }
.strip-nav.right { right: clamp(14px, 2.5vw, 26px); }
.thumb {
  flex: none;
  width: 72px;
  aspect-ratio: 3 / 4;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  outline: 2px solid transparent;
  outline-offset: 2px;
  transition: outline-color .15s;
  background: #e2e2e6;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.on { outline-color: var(--ink); }
.thumb b {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  font-size: 10px;
  font-weight: 500;
  color: #fff;
  text-align: center;
  padding: 10px 0 4px;
  background: linear-gradient(transparent, rgba(0,0,0,.45));
}
.thumb.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--ink2);
}
.thumb.empty span { font-size: 11px; font-weight: 600; }
.thumb.empty small { font-size: 10px; color: var(--ink3); }
.thumb.empty.fail { background: var(--red-bg); }
.thumb.empty.fail small { color: var(--red); }
.thumb.empty.busy small { color: var(--orange); }
.source-thumb {
  flex: none;
  width: 150px;
  aspect-ratio: 3 / 1;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  outline: 2px solid transparent;
  outline-offset: 2px;
  transition: outline-color .15s;
  background: #e2e2e6;
}
.source-thumb.on { outline-color: var(--ink); }
.source-thumb img { width: 100%; height: 100%; object-fit: cover; }
.source-thumb b {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  text-align: center;
  padding: 12px 0 5px;
  background: linear-gradient(transparent, rgba(0,0,0,.55));
}
.source-thumb-empty {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--ink2);
}
.source-thumb.fail { background: var(--red-bg); }
.source-thumb.busy .source-thumb-empty { color: var(--orange); }
.source-thumb.expired { background: #ececf1; }
.source-thumb.expired .source-thumb-empty { color: var(--muted); }
.source-strip-empty {
  font-size: 12.5px;
  color: var(--ink3);
  padding: 14px 0;
}

.stage-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 clamp(14px, 2.5vw, 26px);
  padding: 12px 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.task-actions-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.job-links { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.job-links a { font-size: 13px; font-weight: 500; color: var(--blue); text-decoration: none; }
.job-links a:hover { text-decoration: underline; }

.export-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 12px clamp(14px, 2.5vw, 26px) 0;
}
.export-row input { flex: 1 1 260px; background: #fff; }
.job-picker { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink2); white-space: nowrap; }
.job-picker select { width: auto; font-size: 12.5px; padding: 8px 30px 8px 12px; border-radius: 980px; }

/* right panel */

.panel {
  width: 372px;
  flex: none;
  background: #fff;
  border-left: 1px solid var(--line);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.sec { display: flex; flex-direction: column; gap: 12px; }
.sec-h { display: flex; align-items: baseline; justify-content: space-between; }
.sec-h h3 { font-size: 12.5px; font-weight: 600; color: var(--ink2); letter-spacing: .02em; }
.sec-h a { font-size: 12.5px; color: var(--blue); text-decoration: none; font-weight: 500; }

.model-row { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 2px; }
.model-row .mcard { flex: 0 0 46%; }

.mcard {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  cursor: pointer;
  position: relative;
  background: #fff;
}
.mcard.on { outline: 2px solid var(--ink); outline-offset: -1px; }
.mcard img { width: 100%; aspect-ratio: 1 / 1.05; object-fit: cover; object-position: top; background: var(--gray-bg); }
.mcard-ph {
  width: 100%;
  aspect-ratio: 1 / 1.05;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 600;
  color: var(--ink3);
  background: var(--gray-bg);
}
.mcard .mi { padding: 9px 11px; }
.mcard .mi b { display: block; font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mcard .mi span { font-size: 11px; color: var(--ink3); }
.mcard .tick {
  position: absolute;
  top: 8px; right: 8px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  z-index: 1;
}
.mcard.add {
  display: flex;
  align-items: center;
  justify-content: center;
  border-style: dashed;
  color: var(--ink3);
  font-size: 12.5px;
  min-height: 110px;
}

.gcard { display: flex; gap: 12px; border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px; }
.gcard img { width: 66px; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 9px; background: var(--gray-bg); }
.g-ph {
  width: 66px;
  aspect-ratio: 3 / 4;
  border-radius: 9px;
  background: var(--gray-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--ink3);
}
.gcard .gi { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; justify-content: center; }
.gcard .gi b { font-size: 13.5px; font-weight: 600; }
.g-desc { font-size: 12px; color: var(--ink2); }
.tags { display: flex; flex-wrap: wrap; gap: 5px; }
.tag { font-size: 11px; color: var(--ink2); background: var(--gray-bg); border-radius: 6px; padding: 3px 8px; }
.tag.strong { background: var(--ink); color: #fff; }
.asset-box {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: #fff;
}
.asset-box-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 650;
}
.asset-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.link-btn {
  border: 0;
  background: transparent;
  color: var(--blue);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  padding: 0;
}
.asset-thumbs {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  margin-bottom: 7px;
}
.asset-thumbs a {
  display: block;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  background: var(--gray-bg);
}
.asset-thumbs img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.asset-box p {
  color: var(--ink3);
  font-size: 11.5px;
  line-height: 1.45;
}

.opt-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  gap: 10px;
}
.opt-row:last-child { border-bottom: 0; }
.opt-row .v { color: var(--ink2); font-size: 12.5px; display: flex; align-items: center; gap: 6px; }
.opt-row .v.soon { color: var(--ink3); }
.soon-badge { font-size: 10px; color: var(--orange); background: var(--orange-bg); border-radius: 5px; padding: 2px 6px; }
.views4 { display: flex; gap: 5px; width: 168px; }
.v4 { flex: 1; text-align: center; font-size: 11px; font-weight: 500; padding: 6px 0; border-radius: 8px; background: var(--ink); color: #fff; }

.cta {
  border: 0;
  border-radius: 980px;
  background: var(--ink);
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  padding: 16px;
  cursor: pointer;
  transition: background-color .15s;
}
.cta:hover { background: #333336; }
.cta:disabled { opacity: .45; cursor: default; }
.cta-sub { text-align: center; font-size: 12px; color: var(--ink3); }

.source-card {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: #fbfbfd;
  padding: 10px;
  display: grid;
  gap: 10px;
}
.source-card.active { border-color: rgba(178, 80, 0, .24); background: #fffaf4; }
.source-preview-wide {
  display: block;
  aspect-ratio: 3 / 1;
  border-radius: 10px;
  overflow: hidden;
  background: #e6e6ea;
}
.source-preview-wide img { width: 100%; height: 100%; object-fit: cover; }
.source-preview-wide.empty {
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--ink2);
}
.source-preview-wide.empty b { font-size: 13px; }
.source-preview-wide.empty span { font-size: 11.5px; color: var(--ink3); }
.source-preview-wide.empty.busy b::before {
  content: "";
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--orange);
  margin-right: 7px;
  animation: pulse 1.3s infinite;
}
.source-meta,
.source-actions,
.source-links {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.source-meta { justify-content: space-between; font-size: 11.5px; color: var(--ink3); }
.source-links a { font-size: 12px; color: var(--blue); text-decoration: none; font-weight: 500; }
.source-links a:hover { text-decoration: underline; }
.source-actions .btn { flex: 1 1 118px; justify-content: center; }
.source-choice { font-size: 11.5px; color: var(--ink2); font-weight: 600; }
.source-retention {
  font-size: 11.5px;
  color: var(--ink3);
  line-height: 1.35;
}
.source-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 8px;
}
.source-controls label {
  display: grid;
  gap: 5px;
  font-size: 11.5px;
  color: var(--ink3);
}
.source-controls select {
  width: 100%;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  padding: 0 10px;
  font-size: 12px;
  outline: none;
}
.source-controls select:focus {
  border-color: rgba(0, 122, 255, .65);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, .12);
}
.source-note-box {
  display: grid;
  gap: 6px;
  font-size: 11.5px;
  color: var(--ink3);
}
.source-note-box textarea {
  width: 100%;
  min-height: 70px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  padding: 10px;
  font-size: 12px;
  line-height: 1.45;
  outline: none;
}
.source-note-box textarea:focus {
  border-color: rgba(0, 122, 255, .65);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, .12);
}
.source-quick {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.mini-chip {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink2);
  border-radius: 999px;
  padding: 6px 9px;
  font-size: 11.5px;
  cursor: pointer;
}
.mini-chip:hover { border-color: var(--ink); color: var(--ink); }
.source-note { font-size: 11.5px; color: var(--ink3); line-height: 1.45; }
.recover-box {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(215, 0, 21, .16);
  border-radius: 12px;
  background: rgba(253, 236, 237, .38);
}
.recover-box p {
  font-size: 11.5px;
  color: var(--ink2);
}
.recover-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.recover-file {
  position: relative;
  overflow: hidden;
}
.recover-file input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.recover-url-row {
  display: flex;
  gap: 8px;
}
.recover-url-row input {
  min-width: 0;
  height: 34px;
  font-size: 12px;
  border-radius: 999px;
}
.source-progress {
  height: 4px;
  border-radius: 999px;
  background: rgba(178, 80, 0, .12);
  overflow: hidden;
}
.source-progress i {
  display: block;
  width: 42%;
  height: 100%;
  border-radius: inherit;
  background: var(--orange);
  animation: sourceSlide 1.4s ease-in-out infinite;
}
@keyframes sourceSlide {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(260%); }
}

/* ================= modals ================= */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(0,0,0,.36);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}
.modal {
  width: min(540px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  background: #fff;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  padding: 24px;
}
.modal-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.modal-h h2 { font-size: 19px; }
.modal-x {
  border: 0;
  background: var(--gray-bg);
  width: 30px; height: 30px;
  border-radius: 50%;
  font-size: 16px;
  color: var(--ink2);
  cursor: pointer;
  line-height: 1;
}
.modal-form { display: grid; gap: 14px; }
.modal-form > label { display: grid; gap: 6px; font-size: 13px; font-weight: 500; color: var(--ink2); }

.history-modal {
  width: min(1120px, 100%);
  padding: 22px;
}
.history-modal .modal-h {
  align-items: flex-start;
}
.auth-modal {
  width: min(500px, 100%);
}
.auth-form + .modal-divider {
  margin-top: 16px;
}
.account-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.history-toolbar {
  position: sticky;
  top: -22px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 -22px 18px;
  padding: 12px 22px;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.history-mode {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink3);
  font-size: 12px;
  font-weight: 600;
}
.history-mode select {
  height: 34px;
  min-width: 180px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  padding: 0 32px 0 12px;
  font-size: 13px;
  outline: none;
}
.history-mode select:focus {
  border-color: rgba(0, 122, 255, .55);
  box-shadow: 0 0 0 4px rgba(0, 122, 255, .12);
}
.history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
}
.history-card {
  position: relative;
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: #fff;
}
.history-card.selected {
  outline: 2px solid var(--ink);
  outline-offset: -1px;
}
.history-card.disabled {
  opacity: .72;
}
.account-modal {
  width: min(620px, 100%);
}
.account-profile {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: #fff;
}
.account-avatar {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: #1d1d1f;
  color: #fff;
  font-weight: 700;
  letter-spacing: 0;
}
.account-profile-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}
.account-profile-main b {
  font-size: 17px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.account-profile-main span,
.account-profile-meta small,
.account-project span,
.account-project small {
  color: var(--muted);
  font-size: 12px;
}
.account-profile-meta {
  display: grid;
  gap: 5px;
  justify-items: end;
}
.account-profile-meta span {
  padding: 5px 9px;
  border-radius: 999px;
  background: #f2f2f4;
  color: var(--ink2);
  font-size: 12px;
  font-weight: 650;
}
.account-project {
  display: grid;
  gap: 5px;
  padding: 13px 14px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: #fbfbfd;
}
.account-project b {
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.account-balance {
  display: grid;
  gap: 7px;
  padding: 18px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: linear-gradient(135deg, #f8f8fa, #fff);
}
.account-balance span {
  color: var(--ink2);
  font-size: 13px;
  font-weight: 600;
}
.account-balance b {
  font-size: 34px;
  line-height: 1;
  letter-spacing: 0;
}
.account-balance small {
  color: var(--muted);
  font-size: 12px;
}
.payment-help {
  margin: -4px 0 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: #fbfbfd;
  color: var(--ink2);
  font-size: 12.5px;
  line-height: 1.55;
}
.recharge-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
}
.recharge-form label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink2);
}
.recharge-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 18px;
}
.recharge-presets button {
  border: 1px solid var(--line);
  border-radius: 980px;
  background: #fff;
  padding: 8px 12px;
  cursor: pointer;
  color: var(--ink);
}
.recharge-presets button:hover { border-color: #b8b8bf; }
.recharge-order-list {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}
.recharge-order {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: #fff;
}
.recharge-order.pending {
  border-color: rgba(255, 149, 0, .32);
  background: #fffaf2;
}
.recharge-order.paid {
  border-color: rgba(52, 199, 89, .26);
  background: #f5fff8;
}
.recharge-order > div:first-child,
.recharge-order-meta {
  display: grid;
  gap: 4px;
}
.recharge-order b {
  font-size: 14px;
}
.recharge-order span,
.recharge-order small {
  color: var(--muted);
  font-size: 12px;
}
.recharge-order-meta {
  justify-items: end;
  text-align: right;
}
.btn.tiny {
  min-height: 0;
  padding: 6px 10px;
  font-size: 12px;
}
.credit-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 10px;
}
.credit-head h3 {
  font-size: 15px;
}
.credit-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.credit-list {
  display: grid;
  gap: 8px;
}
.credit-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: #fff;
}
.credit-row > div:first-child {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.credit-row b {
  font-size: 14px;
}
.credit-row span,
.credit-row small {
  color: var(--muted);
  font-size: 12px;
}
.credit-amount {
  display: grid;
  gap: 3px;
  text-align: right;
  white-space: nowrap;
}
.credit-amount strong {
  font-size: 14px;
}
.credit-row.plus .credit-amount strong { color: #07883f; }
.credit-row.minus .credit-amount strong { color: #1d1d1f; }
.credit-empty {
  color: var(--muted);
  font-size: 13px;
  padding: 16px;
  border: 1px dashed var(--line2);
  border-radius: var(--r-md);
  text-align: center;
}
.account-security {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.password-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 10px;
  align-items: end;
}
.password-form label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--ink2);
  font-size: 13px;
  font-weight: 600;
}
.danger-zone {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid rgba(215, 0, 21, .16);
  border-radius: var(--r-md);
  background: #fffafa;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.danger-zone h3 {
  font-size: 14px;
  letter-spacing: 0;
}
.danger-zone p {
  margin-top: 3px;
  line-height: 1.45;
}
.history-check {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 1;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.78);
  background: rgba(29,29,31,.34);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,.14);
}
.history-check.on {
  background: var(--ink);
}
.history-check:disabled {
  cursor: default;
  background: rgba(160,160,166,.45);
}
.history-img {
  aspect-ratio: 3 / 1;
  border-radius: 12px;
  overflow: hidden;
  background: var(--gray-bg);
  cursor: zoom-in;
}
.history-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.history-img span {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink3);
  font-weight: 600;
}
.history-info {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.history-info b {
  font-size: 13px;
  font-weight: 650;
}
.history-info span,
.history-info small {
  color: var(--ink3);
  font-size: 11.5px;
  line-height: 1.45;
}
.history-info small {
  color: var(--ink2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.history-empty {
  grid-column: 1 / -1;
  padding: 28px 0;
  text-align: center;
}

.modal-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 14px;
  font-size: 12px;
  color: var(--ink3);
}
.modal-divider::before, .modal-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.legal-links {
  margin-top: 14px;
  color: var(--ink3);
  font-size: 12px;
  text-align: center;
}
.legal-links a,
.legal-back {
  color: var(--blue);
  text-decoration: none;
}
.legal-links a:hover,
.legal-back:hover {
  text-decoration: underline;
}

.legal-body {
  background: #f5f5f7;
}
.legal-shell {
  width: min(860px, calc(100vw - 32px));
  margin: 34px auto 70px;
}
.legal-doc {
  padding: clamp(22px, 4vw, 42px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
}
.legal-doc h1 {
  margin: 8px 0 26px;
  font-size: clamp(28px, 4vw, 42px);
  letter-spacing: 0;
}
.legal-doc section {
  padding: 22px 0;
  border-top: 1px solid var(--line);
}
.legal-doc h2 {
  margin-bottom: 10px;
  font-size: 18px;
  letter-spacing: 0;
}
.legal-doc p {
  color: var(--ink2);
  line-height: 1.75;
}
.legal-doc p + p {
  margin-top: 10px;
}

.model-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.model-source-action {
  display: grid;
  gap: 7px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: #fafafc;
}
.model-source-action p {
  color: var(--ink3);
  font-size: 12px;
  line-height: 1.45;
}

.dropzone {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 4px;
  text-align: center;
  padding: 26px 16px;
  border: 1.5px dashed var(--line2);
  border-radius: var(--r-md);
  background: #fafafc;
  cursor: pointer;
  transition: border-color .15s, background-color .15s;
}
.dropzone:hover { border-color: var(--blue); background: #f4f8fd; }
.dropzone.dragover,
body.dragging-files .board-empty .empty-card {
  border-color: var(--blue);
  background: #f4f8fd;
  box-shadow: 0 0 0 4px rgba(0, 113, 227, .08);
}
.dropzone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone.slim { padding: 16px; }
.dz-title { font-size: 14px; font-weight: 500; color: var(--ink); }
.dz-hint { font-size: 12px; color: var(--ink3); }
.dz-preview {
  width: min(360px, 100%);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(78px, 1fr));
  gap: 8px;
  margin: 8px 0 2px;
}
.dz-preview:empty { display: none; }
.dz-thumb,
.dz-more {
  aspect-ratio: 3 / 4;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
}
.dz-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.dz-more {
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink2);
}
.dz-list { font-size: 12px; color: var(--blue); word-break: break-all; }

/* ================= admin ================= */

.admin-body {
  min-height: 100vh;
  background: #f5f5f7;
}

.admin-title {
  font-size: 15px;
  font-weight: 650;
  white-space: nowrap;
}

.admin-shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 28px auto 56px;
  display: grid;
  gap: 18px;
}

.admin-notice {
  border-radius: var(--r-md);
  padding: 13px 16px;
  font-size: 13px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink2);
}
.admin-notice.warning {
  border-color: rgba(178, 80, 0, .2);
  background: var(--orange-bg);
  color: var(--orange);
}
.admin-notice.error {
  border-color: rgba(215, 0, 21, .18);
  background: var(--red-bg);
  color: var(--red);
}
.admin-locked .admin-kpis,
.admin-locked .admin-grid {
  display: none;
}

.admin-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.admin-kpis article,
.admin-panel {
  background: rgba(255,255,255,.82);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 1px 2px rgba(0,0,0,.03), 0 16px 45px rgba(0,0,0,.05);
}
.admin-kpis article {
  padding: 18px;
  display: grid;
  gap: 8px;
}
.admin-kpis span {
  color: var(--ink3);
  font-size: 12.5px;
}
.admin-kpis b {
  font-size: 28px;
  line-height: 1;
  letter-spacing: 0;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.admin-panel {
  padding: 18px;
  display: grid;
  gap: 15px;
  min-height: 220px;
}
.admin-panel-wide {
  grid-column: 1 / -1;
}

.admin-panel-h {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.admin-panel-h > div {
  min-width: 0;
}
.admin-panel-actions {
  flex: none !important;
  display: flex !important;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.admin-note {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfbfd;
  color: var(--ink2);
  font-size: 12.5px;
}
.admin-panel-h h2 {
  font-size: 17px;
  letter-spacing: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}
.admin-panel-h p {
  margin-top: 4px;
  color: var(--ink3);
  font-size: 12.5px;
  line-height: 1.45;
}

.admin-select {
  appearance: none;
  min-width: 116px;
  max-width: 180px;
  border: 1px solid var(--line2);
  border-radius: 980px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  padding: 7px 28px 7px 12px;
  cursor: pointer;
}

.admin-list {
  display: grid;
  gap: 10px;
}

.admin-storage {
  display: grid;
  gap: 12px;
}
.storage-summary {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfbfd;
}
.storage-summary span,
.storage-summary em {
  color: var(--ink3);
  font-size: 12px;
}
.storage-summary b {
  font-size: 20px;
}
.storage-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.storage-card {
  display: grid;
  gap: 5px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  min-width: 0;
}
.storage-card.missing {
  background: #fafafa;
}
.storage-card.warning {
  border-color: #efc18d;
  background: #fff9f2;
}
.storage-card span,
.storage-card small,
.storage-card em,
.storage-url {
  color: var(--ink3);
  font-size: 12px;
}
.storage-card b {
  font-size: 17px;
}
.storage-card small {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.storage-card em {
  font-style: normal;
}
.storage-url a {
  color: var(--blue);
}

.admin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfbfd;
}
.admin-row > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}
.admin-row b {
  font-size: 13.5px;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-row span,
.admin-row small {
  color: var(--ink3);
  font-size: 12px;
  line-height: 1.4;
}
.admin-row small {
  color: var(--ink2);
}
.admin-row em {
  flex: none;
  min-width: 64px;
  text-align: right;
  color: var(--ink2);
  font-style: normal;
  font-size: 12px;
}
.admin-row.ok em,
.admin-row.paid em {
  color: var(--green);
}
.admin-row.warning,
.admin-row.pending {
  background: #fffaf4;
  border-color: rgba(178, 80, 0, .16);
}
.admin-row.warning em,
.admin-row.pending em {
  color: var(--orange);
}
.admin-row.error {
  background: #fff7f7;
  border-color: rgba(215, 0, 21, .16);
}
.admin-row.error em,
.admin-row.failed em {
  color: var(--red);
}
.admin-error-text {
  color: var(--red) !important;
  overflow-wrap: anywhere;
}
.admin-actions {
  flex: none;
  display: flex !important;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}
.admin-link {
  color: var(--blue);
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
}
.admin-link:hover {
  text-decoration: underline;
}
.admin-recover {
  margin-top: 8px;
  display: flex;
  gap: 8px;
  align-items: center;
}
.admin-recover input {
  min-height: 30px;
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 10px;
}

.admin-status-block {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfbfd;
  display: grid;
  gap: 10px;
}
.admin-status-block b {
  font-size: 13.5px;
}
.admin-status-block div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.admin-status-block span {
  padding: 6px 10px;
  border-radius: 980px;
  background: var(--gray-bg);
  color: var(--ink2);
  font-size: 12px;
}

.admin-empty {
  padding: 26px 16px;
  border: 1px dashed var(--line2);
  border-radius: 14px;
  color: var(--ink3);
  text-align: center;
  font-size: 13px;
}

/* ================= toast ================= */

.toast {
  position: fixed;
  left: 50%;
  bottom: 90px;
  transform: translateX(-50%);
  z-index: 200;
  max-width: min(520px, calc(100vw - 32px));
  background: rgba(29,29,31,.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fff;
  font-size: 13.5px;
  padding: 12px 20px;
  border-radius: 980px;
  box-shadow: var(--shadow-lg);
}

/* ================= responsive ================= */

@media (max-width: 1024px) {
  .detail { flex-direction: column; min-height: 0; }
  .panel { width: auto; border-left: 0; border-top: 1px solid var(--line); }
  .hero-img { height: min(52vh, 480px); }
  .admin-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-grid { grid-template-columns: 1fr; }
  .storage-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .model002-workbench { grid-template-columns: 1fr; }
  .model002-form { position: static; }
}

@media (max-width: 720px) {
  .tb { gap: 8px; }
  .logo span { display: none; }
  .tb .div { display: none; }
  .proj-select { max-width: 150px; }

  .board { padding-bottom: 170px; }
  .board-h { align-items: stretch; flex-direction: column; }
  .board-actions { justify-content: space-between; }
  .prep-grid { grid-template-columns: 1fr; }
  .prep-card { align-items: stretch; flex-direction: column; min-height: 0; }
  .board-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .pcard .quick { opacity: 1; font-size: 11.5px; padding: 8px 0; }
  .pcard .pb { padding: 9px 11px; }

  .batch-bar {
    left: 12px; right: 12px;
    transform: none;
    justify-content: space-between;
    padding-left: 16px;
  }
  .batch-bar em { display: none; }

  .stage-top { flex-direction: column; align-items: stretch; }
  .stage-top .spec-badge { display: none; }
  .chips { justify-content: center; }
  .hero-img { height: auto; width: min(100%, 340px); }
  .stage-foot { flex-direction: column; align-items: stretch; }
  .model-grid { grid-template-columns: repeat(2, 1fr); }
  .toast { bottom: 100px; }

  .admin-shell {
    width: min(100% - 20px, 720px);
    margin-top: 16px;
  }
  .admin-kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .admin-kpis article { padding: 14px; }
  .admin-kpis b { font-size: 22px; }
  .storage-grid { grid-template-columns: 1fr; }
  .storage-summary { display: grid; gap: 5px; }
  .admin-panel { padding: 14px; border-radius: 16px; }
  .admin-panel-h { grid-template-columns: 1fr; }
  .admin-select { width: 100%; }
  .admin-row {
    align-items: flex-start;
    flex-direction: column;
  }
  .admin-row em { text-align: left; }
  .danger-zone {
    align-items: stretch;
    flex-direction: column;
  }
  .danger-zone .btn {
    width: 100%;
  }
  .account-profile {
    grid-template-columns: 44px minmax(0, 1fr);
  }
  .account-avatar {
    width: 44px;
    height: 44px;
    border-radius: 14px;
  }
  .account-profile-meta {
    grid-column: 1 / -1;
    justify-items: start;
  }
  .password-form,
  .recharge-form {
    grid-template-columns: 1fr;
  }
  .password-form .btn {
    width: 100%;
  }
  .model002-workbench {
    padding: 14px;
  }
  .model002-control-grid,
  .model002-status-grid,
  .model002-preview-grid {
    grid-template-columns: 1fr;
  }
  .model002-head {
    align-items: flex-start;
    flex-direction: column;
  }
}
