@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&family=Work+Sans:wght@400;500;600&display=swap');

:root {
  --ink: #171719;
  --muted: #6e7077;
  --line: #e6e5e2;
  --paper: #faf9f7;
  --card: #ffffff;
  --pink: #ec4899;
  --pink-light: #fdf2f8;
  --green: #14856b;
  --green-light: #ecfdf5;
  --soft: #f1f2ee;
  --danger: #ef4444;
  --blue: #3b82f6;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 14px rgba(0,0,0,0.08);
  --shadow-xl: 0 20px 45px rgba(0,0,0,0.18);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Work Sans', sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

button, input, select, textarea { font: inherit; }

/* Skip Link */
.skip-link { position: absolute; left: -999px; }
.skip-link:focus { left: 16px; top: 12px; background: #fff; padding: 8px; z-index: 99; }

/* Topbar */
.topbar {
  height: 64px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 36px;
  background: #ffffff;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-left { display: flex; align-items: center; gap: 36px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: Outfit; }
.brand-mark {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  background: var(--ink); color: #fff;
  font-size: 11px; font-weight: 700;
  letter-spacing: .05em; border-radius: var(--radius-sm);
}
.brand strong { display: block; font-size: 15px; letter-spacing: .02em; }
.brand small { display: block; font-size: 9px; letter-spacing: .15em; color: #909097; }

.main-nav { display: flex; gap: 6px; }
.nav-item {
  border: 0; background: transparent;
  padding: 7px 13px; font-size: 13px; font-weight: 500;
  color: var(--muted); cursor: pointer;
  border-radius: var(--radius-sm); transition: all .15s;
}
.nav-item:hover, .nav-item.active { background: var(--soft); color: var(--ink); font-weight: 600; }
.nav-item.active { border-bottom: 2px solid var(--pink); }

.task-badge {
  background: var(--pink); color: #fff; font-size: 10px;
  padding: 1px 6px; border-radius: 10px; margin-left: 4px;
}

.topbar-right { display: flex; align-items: center; gap: 16px; }

.wallet-pill {
  display: flex; align-items: center; gap: 8px;
  background: var(--soft); padding: 5px 12px; border-radius: 20px;
  font-size: 12px;
}
.wallet-label { color: var(--muted); }
.wallet-val { font-family: Outfit; font-weight: 700; color: var(--green); font-size: 14px; }
.btn-recharge {
  border: 0; background: var(--green); color: #fff;
  padding: 3px 8px; border-radius: 12px; cursor: pointer; font-size: 11px;
}

.user-pill { display: flex; align-items: center; }
.user-dropdown-wrap { display: flex; align-items: center; gap: 8px; }
.user-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--pink); color: #fff; display: grid; place-items: center;
  font-size: 12px; font-weight: 600; font-family: Outfit;
}
.user-name { font-size: 13px; font-weight: 500; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 8px 16px; font-size: 13px; font-weight: 500;
  border-radius: var(--radius-sm); border: 1px solid transparent;
  cursor: pointer; transition: all .2s;
}
.btn-primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-primary:hover { background: #333; }
.btn-outline { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-outline:hover { border-color: var(--ink); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-link { background: none; border: 0; color: var(--muted); cursor: pointer; text-decoration: underline; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-xs { padding: 3px 8px; font-size: 11px; border-radius: 3px; }
.btn-lg { padding: 12px 20px; font-size: 15px; font-weight: 600; }
.btn-block { width: 100%; }

/* Shell */
.shell { max-width: 1540px; margin: auto; padding: 32px 36px; }

/* Intro */
.intro { display: flex; justify-content: space-between; align-items: flex-end; padding-bottom: 28px; }
.eyebrow { font-size: 10px; font-weight: 600; letter-spacing: .17em; color: var(--green); margin: 0 0 8px; }
.intro h1 { font: 600 clamp(28px, 3.5vw, 48px)/1.05 Outfit; margin: 0; letter-spacing: -.02em; }
.intro h1 em { font-style: normal; color: var(--pink); }
.lede { color: var(--muted); margin: 12px 0 0; line-height: 1.5; font-size: 14px; }
.stat-grid { display: flex; gap: 32px; }
.stat-grid div { border-left: 1px solid var(--line); padding-left: 16px; min-width: 68px; }
.stat-grid strong { display: block; font: 600 28px Outfit; }
.stat-grid span { color: var(--muted); font-size: 12px; }

/* Workspace (两栏首页 WEB-01) */
.workspace.two-col {
  display: grid;
  grid-template-columns: 205px minmax(0, 1fr);
  min-height: 650px;
  border-top: 1px solid var(--ink);
  gap: 0;
}

.sidebar { border-right: 1px solid var(--line); padding: 22px 18px 0 0; }
.side-head { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 12px; }
.side-head span:first-child { color: var(--ink); font-weight: 600; }
.mode-switch {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
  padding: 4px; margin-bottom: 20px; background: var(--soft); border-radius: var(--radius-sm);
}
.mode {
  border: 0; background: transparent; padding: 8px 6px;
  text-align: left; color: var(--muted); font-size: 12px; cursor: pointer; border-radius: 3px;
}
.mode b { float: right; font-size: 10px; color: #aaa; font-weight: 500; }
.mode.active { background: #fff; color: var(--ink); font-weight: 600; box-shadow: var(--shadow-sm); }

.category {
  width: 100%; border: 0; background: none; padding: 9px 10px;
  text-align: left; display: flex; justify-content: space-between; cursor: pointer;
  color: #6d6e73; font-size: 13px; border-radius: var(--radius-sm);
}
.category b { font-size: 11px; color: #aaa; font-weight: 500; }
.category:hover, .category.active { background: var(--soft); color: var(--ink); }
.category.active { font-weight: 600; border-left: 2px solid var(--pink); padding-left: 8px; }

/* Catalog */
.catalog { padding: 22px 0 22px 28px; }
.catalog-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 20px; }
.catalog h2 { font: 600 24px Outfit; margin: 0; }
.search {
  height: 36px; width: 260px; display: flex; align-items: center; gap: 8px;
  border-bottom: 1px solid #b9b8b5;
}
.search svg { width: 16px; stroke: #777; fill: none; stroke-width: 1.7; }
.search input { border: 0; outline: 0; background: transparent; width: 100%; font-size: 13px; color: var(--ink); }

/* Card Grid (全宽多列自适应) */
.cards.wide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.prompt-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-sm); cursor: pointer;
  transition: transform .2s, border-color .2s, box-shadow .2s;
  overflow: hidden; display: flex; flex-direction: column;
}
.prompt-card:hover {
  border-color: var(--ink); transform: translateY(-3px); box-shadow: var(--shadow-md);
}

.card-img { aspect-ratio: 1.45; background: #e9eae6; overflow: hidden; position: relative; }
.card-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.card-body { padding: 14px; flex: 1; display: flex; flex-direction: column; }
.card-cat { font-size: 10px; color: var(--green); letter-spacing: .05em; font-weight: 600; }
.card-title {
  font: 600 16px/1.3 Outfit; margin: 6px 0 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-desc {
  font-size: 12px; color: var(--muted); line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  margin: 0; flex: 1;
}
.card-foot {
  display: flex; justify-content: space-between; align-items: center;
  color: #a0a0a0; font-size: 11px; margin-top: 14px; padding-top: 8px; border-top: 1px solid #f2f2ef;
}
.card-btn-action { color: var(--pink); font-weight: 600; font-size: 12px; }

/* Pager */
.pager { display: flex; justify-content: center; align-items: center; gap: 16px; padding: 28px 0 10px; }
.pager button {
  border: 1px solid var(--line); background: #fff; width: 34px; height: 34px;
  border-radius: var(--radius-sm); cursor: pointer; font-size: 14px;
}
.pager button:hover:not(:disabled) { border-color: var(--ink); }
.pager button:disabled { opacity: 0.35; cursor: not-allowed; }
.pager span { font-size: 12px; color: var(--muted); font-family: Outfit; font-weight: 500; }

/* ============================================================== */
/* Modals */
/* ============================================================== */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(15, 15, 17, 0.75); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.modal-backdrop[hidden] { display: none !important; }

.modal-dialog {
  background: #fff; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl); max-height: 92vh; display: flex;
  flex-direction: column; overflow: hidden; width: 100%;
}
.modal-sm { max-width: 440px; }
.modal-lg { max-width: 860px; }
.modal-xl { max-width: 1180px; }

.modal-header {
  padding: 18px 24px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title-wrap { display: flex; align-items: center; gap: 12px; }
.modal-header h3 { margin: 0; font: 600 20px Outfit; }
.modal-close {
  background: none; border: 0; font-size: 24px; line-height: 1;
  color: var(--muted); cursor: pointer; padding: 4px;
}
.modal-close:hover { color: var(--ink); }

.modal-body { padding: 24px; overflow-y: auto; flex: 1; }

.badge {
  display: inline-block; padding: 2px 8px; border-radius: 4px;
  font-size: 11px; font-weight: 600; background: var(--soft); color: var(--ink);
}
.badge-success { background: var(--green-light); color: var(--green); }

/* Step Views */
.step-view { display: none; }
.step-view.active { display: block; }

.btn-back {
  background: none; border: 1px solid var(--line); padding: 4px 10px;
  border-radius: var(--radius-sm); font-size: 12px; cursor: pointer;
}
.btn-back:hover { border-color: var(--ink); }

/* Step 1: Prompt Detail View */
.detail-header-panel {
  display: flex; gap: 24px; align-items: flex-start;
  padding-bottom: 20px; border-bottom: 1px solid var(--line);
}
.detail-meta { flex: 1; }
.detail-cat-tag { font-size: 11px; font-weight: 600; color: var(--green); text-transform: uppercase; }
.detail-meta h2 { font: 600 24px Outfit; margin: 6px 0 8px; }
.detail-desc { color: var(--muted); margin: 0; font-size: 13px; line-height: 1.6; }
.detail-cover-box { width: 120px; height: 120px; flex: 0 0 120px; background: var(--soft); border-radius: var(--radius-sm); overflow: hidden; }
.detail-cover-box img { width: 100%; height: 100%; object-fit: contain; }

.detail-section { padding: 20px 0; border-bottom: 1px solid var(--line); }
.section-title-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.detail-section h4 { font: 600 12px Outfit; letter-spacing: .1em; text-transform: uppercase; margin: 0; color: var(--muted); }

.prompt-box {
  background: #f7f7f5; padding: 14px; font: 13px/1.65 'Work Sans';
  border-radius: var(--radius-sm); white-space: pre-wrap; word-break: break-all;
}

.var-list { display: flex; flex-direction: column; gap: 8px; }
.var-item {
  display: grid; grid-template-columns: 140px 1fr; gap: 12px;
  padding: 8px 12px; background: var(--soft); border-radius: var(--radius-sm); font-size: 12px;
}
.var-item-key { font-family: monospace; color: var(--pink); font-weight: 600; }
.var-item-desc { color: var(--ink); }

.example-list { display: flex; flex-direction: column; gap: 20px; }
.example-card { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px; background: #fafaf9; }
.example-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.example-title { font-weight: 600; font-size: 13px; }
.example-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin-top: 10px; }
.example-gallery img { width: 100%; aspect-ratio: 1; object-fit: contain; background: #eee; border-radius: 4px; cursor: zoom-in; }

/* Step 2: Generation Form View (两步大弹窗 GEN-01) */
.gen-form-grid {
  display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(320px, 1fr);
  gap: 28px;
}
.gen-form-fields { display: flex; flex-direction: column; gap: 16px; }
.form-banner {
  background: var(--pink-light); border-left: 3px solid var(--pink);
  padding: 10px 14px; font-size: 12px; color: var(--ink); border-radius: var(--radius-sm);
}
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 12px; font-weight: 600; color: var(--ink); }
.form-label small { font-weight: normal; color: var(--muted); }
.required { color: var(--danger); }
.form-control {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 8px 12px; font-size: 13px; background: #fff; width: 100%;
}
.form-control:focus { outline: none; border-color: var(--ink); }

.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

.dynamic-var-inputs { display: flex; flex-direction: column; gap: 10px; }
.var-input-row { display: flex; flex-direction: column; gap: 4px; }
.var-input-row label { font-size: 12px; font-weight: 500; }
.var-input-row span.code { font-family: monospace; color: var(--pink); font-size: 11px; }

/* Number Stepper */
.number-stepper { display: flex; align-items: center; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.number-stepper button { width: 34px; height: 34px; border: 0; background: var(--soft); cursor: pointer; font-size: 16px; }
.number-stepper input { width: 100%; border: 0; text-align: center; font-weight: 600; font-family: Outfit; font-size: 14px; outline: none; }

/* Resolution Pill Radio Group */
.res-pill-group {
  display: flex;
  gap: 8px;
}
.res-pill {
  flex: 1;
  padding: 8px 12px;
  border: 1.5px solid var(--line);
  border-radius: 20px;
  background: #ffffff;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: all .15s ease;
  text-align: center;
  font-family: 'Outfit', sans-serif;
}
.res-pill:hover {
  border-color: var(--ink);
  color: var(--ink);
  background: var(--soft);
}
.res-pill.active {
  border-color: var(--ink);
  background: var(--ink);
  color: #ffffff;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

/* Aspect Ratio Card Radio Grid */
.ratio-card-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
.ratio-card {
  background: #ffffff;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  padding: 10px 4px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all .15s ease;
  color: var(--muted);
}
.ratio-card:hover {
  border-color: var(--ink);
  color: var(--ink);
  background: var(--soft);
}
.ratio-card.active {
  border-color: var(--ink);
  color: var(--ink);
  background: #ffffff;
  font-weight: 600;
  box-shadow: 0 0 0 1.5px var(--ink);
}
.ratio-icon-wrap {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ratio-label {
  font-size: 11px;
  line-height: 1;
  font-family: 'Outfit', sans-serif;
  color: inherit;
}
.ratio-wireframe {
  border: 1.5px solid currentColor;
  border-radius: 2px;
  background: transparent;
  transition: border-color .15s;
}
.ratio-card.active .ratio-wireframe {
  background: rgba(23, 23, 25, 0.08);
}
/* Individual wireframe sizes */
.rf-1-1  { width: 20px; height: 20px; }
.rf-2-3  { width: 15px; height: 22px; }
.rf-3-2  { width: 22px; height: 15px; }
.rf-4-3  { width: 22px; height: 17px; }
.rf-3-4  { width: 17px; height: 22px; }
.rf-16-9 { width: 26px; height: 15px; }
.rf-9-16 { width: 15px; height: 26px; }
.rf-21-9 { width: 30px; height: 13px; }
.rf-9-21 { width: 13px; height: 30px; }
.auto-txt {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .02em;
  color: inherit;
}

/* Dropzone */
.upload-dropzone {
  border: 2px dashed var(--line); border-radius: var(--radius-sm);
  padding: 18px; text-align: center; cursor: pointer; transition: all .15s; background: #fafaf9;
}
.upload-dropzone:hover { border-color: var(--pink); background: var(--pink-light); }
.upload-icon { font-size: 24px; }
.dropzone-hint p { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.dropzone-preview { display: flex; align-items: center; justify-content: space-between; }
.dropzone-preview img { width: 64px; height: 64px; object-fit: cover; border-radius: 4px; }

/* Right Calculation Card */
.preview-card {
  background: var(--soft); border-radius: var(--radius-md); padding: 18px;
  display: flex; flex-direction: column; gap: 16px;
}
.preview-card h4 { font: 600 13px Outfit; text-transform: uppercase; margin: 0; letter-spacing: .08em; }
.prompt-preview-box {
  background: #fff; padding: 12px; border-radius: var(--radius-sm);
  font: 12px/1.5 'Work Sans'; max-height: 120px; overflow-y: auto; white-space: pre-wrap;
  border: 1px solid var(--line);
}

.calc-card { background: #fff; border-radius: var(--radius-sm); padding: 14px; border: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; font-size: 12px; }
.calc-row { display: flex; justify-content: space-between; align-items: center; }
.calc-divider { height: 1px; background: var(--line); margin: 4px 0; }
.calc-row.highlight { font-size: 14px; }
.total-price { color: var(--pink); font-family: Outfit; font-size: 20px; font-weight: 700; }

.alert-box { padding: 10px 14px; border-radius: var(--radius-sm); font-size: 12px; display: flex; align-items: center; justify-content: space-between; }
.alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fcd34d; }

.task-created-panel { text-align: center; padding: 40px 20px; }
.success-icon { font-size: 48px; margin-bottom: 12px; }
.btn-group-center { display: flex; justify-content: center; gap: 14px; margin-top: 24px; }

/* ============================================================== */
/* Auth Modal */
/* ============================================================== */
.auth-tabs { display: flex; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.auth-tab {
  flex: 1; padding: 10px; background: none; border: 0;
  border-bottom: 2px solid transparent; cursor: pointer; font-weight: 500; color: var(--muted);
}
.auth-tab.active { color: var(--ink); border-color: var(--pink); font-weight: 600; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form[hidden] { display: none !important; }

/* ============================================================== */
/* Wallet & Recharge */
/* ============================================================== */
.wallet-overview-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 24px; }
.wallet-stat-card {
  background: var(--soft); padding: 16px; border-radius: var(--radius-sm);
  display: flex; flex-direction: column; gap: 6px;
}
.wallet-stat-card span { font-size: 11px; color: var(--muted); }
.stat-amt { font: 700 24px Outfit; }
.text-green { color: var(--green); }
.text-pink { color: var(--pink); }

.package-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 10px; }
.package-card {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 16px; text-align: center; cursor: pointer; transition: all .15s; background: #fff;
}
.package-card:hover { border-color: var(--ink); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.pkg-price { font: 700 22px Outfit; color: var(--ink); margin: 6px 0; }
.pkg-bonus { font-size: 11px; color: var(--green); font-weight: 600; }

.mock-cashier-card {
  background: #fdf2f8; border: 1px solid #fbcfe8; border-radius: var(--radius-md);
  padding: 18px; margin: 20px 0;
}
.cashier-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.cashier-head h5 { margin: 0; font-size: 15px; }
.cashier-price-row { display: flex; gap: 16px; font-size: 14px; margin: 12px 0 16px; }
.cashier-actions { display: flex; gap: 10px; }

.table-responsive { overflow-x: auto; margin-top: 10px; }
.tx-table, .admin-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.tx-table th, .admin-table th {
  background: var(--soft); padding: 10px 12px; text-align: left;
  font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--line);
}
.tx-table td, .admin-table td {
  padding: 10px 12px; border-bottom: 1px solid #f0efed;
}

/* ============================================================== */
/* Tasks & History */
/* ============================================================== */
.tasks-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.task-list-container { display: flex; flex-direction: column; gap: 14px; }
.task-card {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 16px; background: #fff; display: flex; flex-direction: column; gap: 10px;
}
.task-card-header { display: flex; justify-content: space-between; align-items: center; }
.task-card-title { font-weight: 600; font-size: 14px; }
.btn-download-task {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
  transition: opacity 0.15s ease;
}
.btn-download-task:hover { opacity: 0.9; }
.btn-download-task:disabled { opacity: 0.6; cursor: not-allowed; }
.task-grid-sub { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.task-img-box {
  aspect-ratio: 1; background: var(--soft); border-radius: 4px;
  overflow: hidden; position: relative; display: grid; place-items: center;
}
.task-img-box img { width: 100%; height: 100%; object-fit: contain; cursor: zoom-in; }
.task-img-status { font-size: 10px; color: var(--muted); text-align: center; padding: 4px; }

.history-gallery-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.gallery-card {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  overflow: hidden; background: #fff; transition: all .15s;
}
.gallery-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--ink); }
.gallery-card-img { aspect-ratio: 1; background: var(--soft); overflow: hidden; cursor: zoom-in; }
.gallery-card-img img { width: 100%; height: 100%; object-fit: contain; }
.gallery-card-info { padding: 10px; font-size: 11px; }
.gallery-card-info h5 { margin: 0 0 4px; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gallery-params {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 6px 0 8px;
  max-height: 52px;
  overflow-y: auto;
}
.gallery-chip {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 2px 6px;
  font-size: 10px;
  line-height: 1.3;
  color: var(--muted);
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gallery-chip strong {
  color: var(--ink);
  font-weight: 600;
}

/* Admin */
.admin-stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.admin-card { background: var(--soft); padding: 14px; border-radius: var(--radius-sm); }
.admin-card span { font-size: 11px; color: var(--muted); }
.admin-card strong { display: block; font: 700 22px Outfit; margin-top: 4px; }
.admin-tabs { display: flex; gap: 8px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.admin-tab {
  background: none; border: 0; padding: 8px 14px; font-size: 13px;
  cursor: pointer; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent;
}
.admin-tab.active { color: var(--ink); border-color: var(--pink); font-weight: 600; }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-items: center; padding: 40px;
  background: rgba(13, 13, 15, .92); cursor: zoom-out;
}
.lightbox[hidden] { display: none !important; }
.lightbox img {
  max-width: 92vw; max-height: 86vh; width: auto; height: auto;
  object-fit: contain; cursor: default; box-shadow: var(--shadow-xl);
  border-radius: 4px;
}
.lightbox-close {
  position: absolute; top: 18px; right: 24px;
  width: 44px; height: 44px; border: 1px solid rgba(255,255,255,.45);
  border-radius: 50%; background: transparent; color: #fff;
  font-size: 28px; line-height: 1; cursor: pointer;
  display: grid; place-items: center;
  transition: all .15s ease;
}
.lightbox-close:hover {
  background: rgba(255,255,255,.2);
}
.lightbox-raw-link {
  position: absolute;
  bottom: 24px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.lightbox-raw-link:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.7);
  color: #fff;
  transform: translateY(-1px);
}
.lightbox-raw-link[hidden] { display: none !important; }

/* Toast */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 300; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--ink); color: #fff; padding: 10px 18px;
  border-radius: var(--radius-sm); font-size: 13px; box-shadow: var(--shadow-md);
  animation: slideIn .2s ease-out;
}
.toast.toast-error { background: var(--danger); }
.toast.toast-success { background: var(--green); }
@keyframes slideIn { from { transform: translateY(12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

@media (max-width: 900px) {
  .workspace.two-col { grid-template-columns: 1fr; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); padding-bottom: 16px; }
  .catalog { padding-left: 0; }
  .gen-form-grid { grid-template-columns: 1fr; }
  .wallet-overview-grid { grid-template-columns: 1fr; }
  .admin-stats-grid { grid-template-columns: 1fr 1fr; }
}
