:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #f8fbff;
  --ink: #0f172a;
  --text: #364151;
  --muted: #6b7280;
  --line: #d1dae5;
  --line-strong: #b8c5d6;
  --blue: #0067ff;
  --blue-deep: #005ee9;
  --blue-soft: #e7f6ff;
  --green: #107a57;
  --green-soft: #e7f8f0;
  --amber: #a15c07;
  --amber-soft: #fff6e6;
  --red-soft: #fff1f2;
  --shadow-soft: 0 16px 50px rgba(15, 23, 42, .08);
  --shadow-tiny: 0 1px 2px rgba(15, 23, 42, .06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 0;
  background:
    radial-gradient(circle at 12% -8%, rgba(0, 103, 255, .13), transparent 30%),
    radial-gradient(circle at 84% -10%, rgba(16, 122, 87, .10), transparent 28%),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 380px),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  letter-spacing: 0;
}

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

h1, h2, h3, p { margin: 0; }

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 28px;
  background: rgba(255, 255, 255, .76);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .7) inset;
  backdrop-filter: blur(22px) saturate(1.25);
  position: sticky;
  top: 0;
  z-index: 10;
}

.request-tabbar {
  height: 44px;
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding: 0 14px;
  background: rgba(248, 251, 255, .82);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 72px;
  z-index: 9;
  backdrop-filter: blur(20px) saturate(1.2);
}

.request-tabs {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: flex-end;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.request-tab {
  height: 38px;
  min-width: 150px;
  max-width: 260px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: 18px 14px;
  align-items: center;
  column-gap: 8px;
  border: 1px solid rgba(209, 218, 229, .9);
  border-bottom-color: transparent;
  border-radius: 8px 8px 0 0;
  background: rgba(231, 246, 255, .72);
  color: #364151;
  padding: 5px 8px 5px 12px;
  cursor: pointer;
  text-align: left;
}

.request-tab.active {
  height: 42px;
  background: #fff;
  color: var(--ink);
  border-color: rgba(0, 103, 255, .28);
  border-bottom-color: #fff;
  box-shadow: 0 -8px 24px rgba(0, 103, 255, .08);
}

.request-tab span,
.request-tab small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.request-tab span {
  font-size: 12px;
  font-weight: 850;
}

.request-tab small {
  grid-column: 1 / 2;
  color: var(--muted);
  font-size: 10px;
  font-weight: 720;
}

.request-tab i {
  grid-row: 1 / 3;
  grid-column: 2;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #667085;
  font-style: normal;
  font-size: 14px;
  line-height: 1;
}

.request-tab i:hover {
  background: #edf0f5;
  color: var(--ink);
}

.new-request-tab {
  width: 36px;
  height: 36px;
  margin-bottom: 4px;
  border-radius: 999px;
  border: 1px solid rgba(0, 103, 255, .22);
  background: #fff;
  color: var(--blue);
  cursor: pointer;
  font-size: 20px;
  font-weight: 760;
  line-height: 1;
}

.brand-block,
.top-actions,
.meta-row,
.asset-actions,
.rail-actions,
.dialog-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.auth-area {
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-form {
  display: flex;
  align-items: center;
  gap: 6px;
}

.auth-form.register {
  max-width: min(760px, 62vw);
  flex-wrap: wrap;
  justify-content: flex-end;
}

.auth-form input {
  width: 154px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .9);
  color: var(--ink);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 650;
}

.auth-form.register input {
  width: 138px;
}

/* 登录区配色对齐整站蓝色风格:主按钮(登录/发送确认邮件)由黑改品牌蓝;输入框聚焦蓝光晕、占位淡灰 */
.auth-form .button.dark {
  background: linear-gradient(135deg, #0067ff, #3b82f6);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 16px rgba(0, 103, 255, .24);
}
.auth-form .button.dark:hover { box-shadow: 0 9px 22px rgba(0, 103, 255, .38); }
.auth-form input { background: #fbfcff; color: var(--ink); }
.auth-form input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0, 103, 255, .12); outline: none; }
.auth-form input::placeholder { color: #b4bdcb; }

.auth-note {
  width: 100%;
  text-align: right;
  color: var(--muted);
  font-size: 11px;
  font-weight: 720;
}

.auth-user {
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.auth-user.admin {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #0f766e;
}

.auth-user em {
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(15, 118, 110, .1);
  color: #0f766e;
  font-style: normal;
  font-size: 10px;
  font-weight: 860;
}

.logo {
  width: 132px;
  min-width: 132px;
  height: 42px;
  display: flex;
  align-items: center;
}

.logo img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 42px;
  object-fit: contain;
}

.brand-divider {
  width: 1px;
  height: 30px;
  margin: 0 2px;
  background: linear-gradient(180deg, transparent, var(--line-strong) 22%, var(--line-strong) 78%, transparent);
}

.brand-block {
  align-items: flex-start;
}

.brand-block .logo,
.brand-block .brand-divider {
  align-self: center;
}

.brand-lockup {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-top: 2px;
}

.brand-wordmark {
  display: flex;
}

.wordmark-svg {
  height: 28px;
  width: auto;
  display: block;
}

.wordmark-spark {
  transform-box: fill-box;
  transform-origin: center;
  animation: spark-twinkle 3s ease-in-out infinite;
}

.brand-sub {
  display: flex;
  align-items: center;
  gap: 6px;
}

.brand-mascot {
  display: inline-flex;
}

.mascot-svg {
  height: 44px;
  width: auto;
  display: block;
  margin: -8px -3px -7px -5px;
  filter: drop-shadow(0 4px 7px rgba(0, 103, 255, .26));
  animation: mascot-bob 3.4s ease-in-out infinite;
  transform-origin: center bottom;
}

.mascot-spark {
  transform-box: fill-box;
  transform-origin: center;
  animation: spark-twinkle 2.6s ease-in-out infinite;
}

.brand-sub p {
  margin-top: 0;
  font-size: 12.5px;
  font-weight: 640;
  color: var(--muted);
  letter-spacing: .2px;
}

@keyframes mascot-bob {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-3px) rotate(-2.5deg); }
}

@keyframes spark-twinkle {
  0%, 100% { opacity: .55; transform: scale(.82); }
  50% { opacity: 1; transform: scale(1.12); }
}

.version-tag {
  align-self: flex-start;
  margin-top: 2px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 21px;
  padding: 0 9px 0 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 820;
  letter-spacing: .3px;
  color: var(--blue-deep);
  background: linear-gradient(180deg, #f1f9ff, var(--blue-soft));
  border: 1px solid rgba(0, 94, 233, .26);
  box-shadow: 0 1px 2px rgba(0, 94, 233, .12), 0 0 0 2px rgba(0, 103, 255, .05);
  white-space: nowrap;
}

.version-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--blue);
  box-shadow: 0 0 0 0 rgba(0, 103, 255, .45);
  animation: version-pulse 2.4s ease-out infinite;
}

@keyframes version-pulse {
  0% { box-shadow: 0 0 0 0 rgba(0, 103, 255, .45); }
  70% { box-shadow: 0 0 0 5px rgba(0, 103, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 103, 255, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .version-dot,
  .mascot-svg,
  .wordmark-spark,
  .mascot-spark { animation: none; }
}

.site-footer {
  margin-top: auto;
  padding: 18px 32px 24px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, .55);
  backdrop-filter: blur(10px) saturate(1.15);
}

.footer-mascot {
  display: flex;
  align-items: center;
  gap: 18px;
  width: 100%;
}

.footer-wishy {
  flex: 0 0 auto;
}

.footer-wishy svg {
  height: 52px;
  width: auto;
  display: block;
  filter: drop-shadow(0 3px 6px rgba(0, 103, 255, .2));
}

.footer-title {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.footer-title .ft-spark {
  font-size: 13px;
  color: #9aa7b9;
  animation: ft-twinkle 2.6s ease-in-out infinite;
}

.footer-title .ft-name {
  font-size: 16px;
  font-weight: 900;
  font-style: italic;
  letter-spacing: .6px;
  background: linear-gradient(100deg, #4b5563, #94a3b8);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.footer-title .ft-tag {
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 1px;
  padding-right: 1px;
  background: linear-gradient(100deg, #6b7280, #9aa7b9);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.footer-title .ft-tag::before {
  content: "·";
  margin-right: 4px;
  color: var(--line-strong);
}

@keyframes ft-twinkle {
  0%, 100% { opacity: .5; transform: scale(.82); }
  50% { opacity: 1; transform: scale(1.12); }
}

@media (prefers-reduced-motion: reduce) {
  .footer-title .ft-spark { animation: none; }
}

.footer-text {
  margin: 7px 0 0;
  font-size: 12.5px;
  line-height: 1.9;
  letter-spacing: .2px;
  color: var(--muted);
}

.brand-iwish {
  font-weight: 900;
  font-style: italic;
  letter-spacing: .6px;
  padding: 0 1px;
  background: linear-gradient(100deg, #0a72ff 0%, #005ee9 46%, #00b4ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-iwish .iwish-wish {
  border-bottom: 2px solid rgba(0, 180, 255, .55);
  padding-bottom: 1px;
}

.brand-block p,
.panel-head p,
.stage-head p,
.hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  margin-top: 4px;
}

.button {
  height: 38px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 15px;
  font-size: 13px;
  font-weight: 780;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: var(--shadow-tiny);
}

.button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.button.primary {
  background: linear-gradient(180deg, var(--blue), var(--blue-deep));
  color: #fff;
  border-color: rgba(0, 94, 233, .55);
}

.button.dark {
  background: var(--ink);
  color: #fff;
  border-color: rgba(15, 23, 42, .74);
}

.button.ghost {
  background: rgba(255, 255, 255, .86);
  color: var(--ink);
  border-color: var(--line-strong);
}

.badge {
  display: inline-flex;
  align-items: center;
  height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 11px;
  font-weight: 820;
  white-space: nowrap;
}

.badge.blue { background: var(--blue-soft); color: var(--blue-deep); }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.amber { background: var(--amber-soft); color: var(--amber); }

.layout {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(320px, 360px) minmax(420px, 1fr) minmax(300px, 340px);
  gap: 16px;
  padding: 16px;
  min-height: 0;
}

.panel {
  background: rgba(255, 255, 255, .86);
  border: 1px solid rgba(209, 218, 229, .8);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px) saturate(1.16);
}

.request-panel,
.side-rail {
  min-height: calc(100vh - 142px);
}

.request-panel {
  display: flex;
  flex-direction: column;
}

.side-rail {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 14px;
  min-width: 0;
}

.panel-head,
.stage-head {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(209, 218, 229, .72);
  background: rgba(255, 255, 255, .64);
}

.panel-head h2,
.stage-head h2 {
  font-size: 16px;
  color: var(--ink);
  font-weight: 820;
}

.compact-head {
  min-height: 48px;
}

.panel-scroll {
  padding: 16px;
  overflow: auto;
}

.section {
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid rgba(209, 218, 229, .55);
}

.section:last-child {
  border-bottom: 0;
  margin-bottom: 0;
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.section-title h3 {
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink);
  font-weight: 820;
}

.section-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.field {
  display: grid;
  gap: 7px;
  margin: 0 0 12px;
  color: #30394a;
  font-size: 12px;
  font-weight: 760;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(248, 251, 255, .92);
  color: var(--text);
  padding: 10px 11px;
  outline: none;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .9) inset;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(0, 103, 255, .66);
  box-shadow: 0 0 0 4px rgba(0, 103, 255, .10);
}

textarea {
  min-height: 82px;
  resize: vertical;
}

.image-type-groups {
  display: grid;
  gap: 14px;
}

.image-type-group {
  display: grid;
  gap: 7px;
}

.image-type-group-label {
  font-size: 11px;
  font-weight: 820;
  color: var(--muted);
  letter-spacing: .02em;
  text-transform: none;
  padding-left: 2px;
}

.seg-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.seg {
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .88);
  padding: 10px;
  text-align: left;
  cursor: pointer;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease, background .18s ease;
}

.seg:hover {
  border-color: rgba(0, 103, 255, .32);
  box-shadow: 0 10px 24px rgba(0, 103, 255, .08);
  transform: translateY(-1px);
}

.seg b {
  display: block;
  font-size: 13px;
  color: var(--ink);
  margin-bottom: 4px;
}

.seg span {
  display: block;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.35;
}

.seg.active {
  border-color: rgba(0, 103, 255, .72);
  background: linear-gradient(180deg, #ffffff, var(--blue-soft));
  box-shadow: inset 0 0 0 1px rgba(0, 103, 255, .38), 0 12px 26px rgba(0, 103, 255, .10);
}

.size-builder {
  display: grid;
  gap: 9px;
}

.size-add-row {
  display: grid;
  grid-template-columns: 1fr 62px;
  gap: 8px;
}

.add-size {
  height: 36px;
  border: 1px solid rgba(0, 94, 233, .55);
  border-radius: 8px;
  background: linear-gradient(180deg, var(--blue), var(--blue-deep));
  color: #fff;
  font-size: 12px;
  font-weight: 820;
  cursor: pointer;
}

.size-list {
  display: grid;
  gap: 7px;
}

.size-row {
  display: grid;
  grid-template-columns: 1fr 42px 30px;
  gap: 8px;
  align-items: center;
}

.size-pill {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 9px 10px;
}

.size-pill b {
  display: block;
  font-size: 12px;
  color: var(--ink);
}

.size-pill span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 2px;
}

.count-cell,
.remove-spec {
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 820;
}

.remove-spec {
  color: var(--muted);
  cursor: pointer;
}

.advanced-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  background: rgba(255, 255, 255, .8);
}

.advanced-box summary,
.inspect-panel summary {
  list-style: none;
  cursor: pointer;
  padding: 13px 14px;
  font-size: 13px;
  font-weight: 820;
  color: var(--ink);
}

.advanced-box summary::-webkit-details-marker,
.inspect-panel summary::-webkit-details-marker {
  display: none;
}

.advanced-box[open] {
  padding-bottom: 12px;
}

.advanced-box[open] summary {
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
}

.advanced-box .field {
  margin-left: 14px;
  margin-right: 14px;
}

.stage {
  min-height: calc(100vh - 142px);
  display: flex;
  flex-direction: column;
}

.result-grid {
  flex: 1;
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  grid-auto-flow: dense;
  align-content: start;
  gap: 16px;
  overflow: auto;
}

.empty-state {
  color: var(--muted);
}

.gallery-tile {
  min-height: 190px;
  border: 1px dashed rgba(184, 197, 214, .9);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.96), rgba(248,251,255,.88)),
    #fff;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 5px;
  padding: 14px;
}

.gallery-intro {
  grid-column: span 2;
  grid-row: span 2;
  min-height: 394px;
  background:
    radial-gradient(circle at 78% 18%, rgba(0, 103, 255, .16), transparent 34%),
    radial-gradient(circle at 18% 82%, rgba(16, 122, 87, .09), transparent 30%),
    linear-gradient(135deg, #ffffff, #f8fbff);
}

.gallery-tile b {
  font-size: 16px;
  color: var(--ink);
}

.gallery-tile span,
.gallery-tile em {
  font-size: 12px;
  color: var(--muted);
  font-style: normal;
}

.muted-tile {
  opacity: .58;
}

.loading-tile {
  border-style: solid;
  background: var(--amber-soft);
  border-color: #f3bf77;
}

.failure-tile {
  border-style: solid;
  background: var(--red-soft);
  border-color: #fda4af;
}

.system-panel {
  padding-bottom: 14px;
}

.steps {
  padding: 14px 14px 8px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.step {
  min-height: 56px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .82);
  padding: 9px;
}

.step b {
  display: block;
  font-size: 12px;
  margin-bottom: 4px;
  color: var(--ink);
}

.step span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

.step.done {
  background: var(--green-soft);
  border-color: rgba(16, 122, 87, .25);
}

.step.active,
.step.generating {
  background: var(--blue-soft);
  border-color: rgba(0, 103, 255, .32);
}

.step.failed {
  background: var(--red-soft);
  border-color: #fda4af;
}

.status-list {
  display: grid;
  gap: 7px;
  padding: 0 14px;
}

.status-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  border-bottom: 1px solid rgba(209, 218, 229, .55);
  padding: 8px 0;
  font-size: 12px;
}

.status-row b {
  color: #333c4d;
}

.status-row span {
  color: var(--muted);
  text-align: right;
}

.rail-actions {
  padding: 12px 14px 0;
}

.rail-actions .button {
  flex: 1;
}

.inspect-panel {
  min-height: 0;
  overflow: auto;
}

.inspect-panel[open] summary {
  border-bottom: 1px solid var(--line);
}

.tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.tab {
  height: 30px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .82);
  padding: 0 12px;
  font-size: 12px;
  font-weight: 820;
  color: #475569;
  cursor: pointer;
}

.tab.active {
  border-color: rgba(0, 94, 233, .55);
  background: linear-gradient(180deg, var(--blue), var(--blue-deep));
  color: #fff;
}

.action-tab {
  margin-left: auto;
}

.tab-panel {
  padding: 14px;
  overflow: auto;
  max-height: 260px;
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.info-card {
  border-left: 2px solid rgba(0, 103, 255, .28);
  padding: 3px 0 3px 10px;
}

.info-card label {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 4px;
}

.info-card b,
.info-card span {
  display: block;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text);
}

.decision-card {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, .34);
  border-radius: 8px;
  background: #f8fafc;
  display: grid;
  gap: 8px;
}

.decision-card.ready {
  border-color: rgba(16, 185, 129, .28);
  background: #ecfdf5;
}

.decision-card.warning {
  border-color: rgba(245, 158, 11, .32);
  background: #fffbeb;
}

.decision-card.blocked {
  border-color: rgba(244, 63, 94, .28);
  background: #fff1f2;
}

.decision-card.template {
  border-color: rgba(0, 103, 255, .25);
  background: #f6f9ff;
}

.decision-card label {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 3px;
}

.decision-card b {
  display: block;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.4;
}

.decision-card p,
.decision-card li {
  margin: 0;
  color: #475569;
  font-size: 11px;
  line-height: 1.45;
}

.decision-card ul,
.issue-actions {
  margin: 0;
  padding-left: 16px;
}

.template-score-list {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.template-score-list span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 7px;
  border: 1px solid rgba(0, 103, 255, .18);
  border-radius: 999px;
  background: #fff;
}

.template-score-list b,
.template-score-list em {
  font-size: 10px;
  font-style: normal;
}

.template-score-list em {
  color: var(--blue);
  font-weight: 800;
}

.json-box {
  margin: 0;
  padding: 14px;
  max-height: 300px;
  overflow: auto;
  background: #070614;
  color: #e5edf8;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.inspect-panel .meta-row {
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}

.progress-card {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
  padding: 18px;
  border: 1px dashed rgba(0, 103, 255, .35);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, var(--blue-soft));
  color: #334155;
  font-size: 13px;
  line-height: 1.5;
}

.progress-bar {
  height: 8px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--green));
  transition: width .25s ease;
}

.asset {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 12px 34px rgba(15, 23, 42, .08);
}

.asset:first-of-type {
  grid-column: span 2;
  grid-row: span 2;
}

.asset-preview {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--blue-soft);
}

.asset:first-of-type .asset-preview {
  aspect-ratio: 1;
}

.asset-info {
  padding: 11px;
}

.asset-info b {
  display: block;
  font-size: 13px;
  margin-bottom: 5px;
  color: var(--ink);
}

.asset-info span,
.asset-info code {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
  word-break: break-all;
}

.asset-info span:nth-of-type(n+2) {
  display: none;
}

.asset-info .quality-gate span,
.asset-info .quality-gate em,
.asset-info .quality-gate li {
  display: block;
}

.asset-actions {
  margin-top: 10px;
}

.quality-gate {
  display: grid;
  gap: 4px;
  margin-top: 8px;
  padding: 8px;
  border: 1px solid rgba(148, 163, 184, .38);
  border-radius: 8px;
  background: #f8fafc;
}

.quality-gate b {
  font-size: 11px;
  color: #334155;
}

.quality-gate span,
.quality-gate em {
  font-size: 10px;
  line-height: 1.35;
  color: #64748b;
  font-style: normal;
}

.issue-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.issue-breakdown span {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  padding: 3px 6px;
  background: #fff;
  border: 1px solid rgba(148, 163, 184, .32);
}

.issue-breakdown .high {
  color: #be123c;
  border-color: rgba(244, 63, 94, .28);
}

.issue-breakdown .medium {
  color: #b45309;
  border-color: rgba(245, 158, 11, .32);
}

.issue-actions li {
  font-size: 10px;
  line-height: 1.4;
  color: #475569;
}

.quality-gate.checking {
  border-color: rgba(37, 99, 235, .35);
  background: #eff6ff;
}

.quality-gate.checking b {
  color: #1d4ed8;
}

.quality-gate.retrying {
  border-color: rgba(217, 119, 6, .32);
  background: #fffbeb;
}

.quality-gate.retrying b {
  color: #b45309;
}

.quality-gate.passed {
  border-color: rgba(16, 185, 129, .32);
  background: #ecfdf5;
}

.quality-gate.passed b {
  color: #047857;
}

.quality-gate.failed,
.quality-gate.needs_review {
  border-color: rgba(244, 63, 94, .28);
  background: #fff1f2;
}

.quality-gate.failed b,
.quality-gate.needs_review b {
  color: #be123c;
}

.mini {
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 820;
  color: #334155;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.mini:disabled {
  opacity: .55;
  cursor: wait;
}

.regenerate-mini {
  color: var(--blue-deep);
  border-color: rgba(0, 94, 233, .45);
}

.regenerate-mini.active {
  color: #fff;
  background: var(--blue-deep);
}

.inline-regenerate {
  display: grid;
  gap: 10px;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.inline-regenerate-head {
  display: grid;
  gap: 2px;
}

.inline-regenerate-head b {
  font-size: 12px;
  color: var(--ink);
}

.inline-regenerate-head span {
  font-size: 11px;
  color: var(--muted);
}

.inline-regenerate textarea {
  min-height: 88px;
  resize: vertical;
  background: #fff;
  font-size: 12px;
  line-height: 1.45;
}

.inline-regenerate-actions {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 8px;
}

.inline-regenerate-actions .button {
  width: 100%;
  height: 32px;
  padding: 0 8px;
  font-size: 12px;
}

.history-panel {
  max-height: 220px;
}

.history-list {
  padding: 12px 14px 14px;
  overflow: auto;
  max-height: 170px;
}

.history-item {
  border-bottom: 1px solid rgba(209, 218, 229, .55);
  padding: 9px 0;
  cursor: pointer;
}

.history-item:last-child {
  border-bottom: 0;
}

.history-item b {
  display: block;
  font-size: 12px;
  color: var(--ink);
}

.history-item span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 3px;
}

/* 需求构建器 */
.req-list {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.req-row {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1.4fr) 58px 28px;
  gap: 6px;
  align-items: center;
}

.req-type,
.req-size {
  height: 38px;
  padding: 0 26px 0 10px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(248, 251, 255, .92);
  color: var(--text);
  cursor: pointer;
  width: 100%;
  /* 自定义箭头 + 右内边距:文字到箭头前就截断,不再出现原生箭头压字的「遮罩」 */
  appearance: none;
  -webkit-appearance: none;
  text-overflow: ellipsis;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%237c8aa0' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
}

.req-count {
  height: 38px;
  padding: 0 6px;
  font-size: 13px;
  font-weight: 820;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(248, 251, 255, .92);
  color: var(--text);
  width: 100%;
}

.req-remove {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.req-remove:hover:not(:disabled) {
  background: var(--red-soft);
  border-color: #fda4af;
  color: #be123c;
}

.req-remove:disabled {
  opacity: .35;
  cursor: not-allowed;
}

.add-req-btn {
  width: 100%;
  height: 36px;
  border: 1px dashed rgba(0, 94, 233, .48);
  border-radius: 8px;
  background: rgba(231, 246, 255, .55);
  color: var(--blue-deep);
  font-size: 12px;
  font-weight: 820;
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease;
}

.add-req-btn:hover {
  background: var(--blue-soft);
  border-color: rgba(0, 94, 233, .7);
}

@media (max-width: 1280px) {
  .layout {
    grid-template-columns: 330px minmax(440px, 1fr);
  }

  .side-rail {
    grid-column: 1 / -1;
    min-height: auto;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: auto;
  }
}

@media (max-width: 900px) {
  .topbar {
    height: auto;
    min-height: 64px;
    align-items: flex-start;
    padding: 12px;
    gap: 12px;
  }

  .brand-block p {
    display: none;
  }

  .top-actions {
    margin-left: auto;
  }

  .request-tabbar {
    top: 64px;
    padding: 0 10px;
  }

  .request-tab {
    min-width: 132px;
  }

  .layout {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .request-panel,
  .stage,
  .side-rail {
    min-height: auto;
  }

  .side-rail {
    grid-template-columns: 1fr;
  }

  .result-grid {
    min-height: 360px;
    grid-template-columns: 1fr;
  }

  .gallery-intro,
  .asset:first-of-type {
    grid-column: span 1;
    grid-row: span 1;
  }

  .gallery-intro {
    min-height: 220px;
  }
}

/* =========================================================================
   A · Refined Studio 视觉精修层（2026-06）
   仅提质感：圆角/阴影/聚焦/竖向步骤条/卡片化。品牌(IWISH 字标/Wishy 信鸟/footer)
   与 DOM 结构、所有 JS 绑定 ID 保持不变。后置覆盖，同特异性后者生效。
   ========================================================================= */
:root {
  --radius-panel: 18px;
  --radius-field: 11px;
  --radius-card: 14px;
  --shadow-soft: 0 18px 50px rgba(13, 27, 62, .10);
  --shadow-tiny: 0 2px 6px rgba(13, 27, 62, .06);
  --line: #e6ecf4;
  --line-strong: #d6deea;
}

.layout { gap: 18px; padding: 18px; }

.panel {
  border-radius: var(--radius-panel);
  border-color: var(--line);
  background: rgba(255, 255, 255, .93);
  box-shadow: var(--shadow-soft);
}

.panel-head,
.stage-head { background: transparent; border-bottom-color: var(--line); }

/* 按钮：更大圆角、对角渐变主按钮 + 柔光 */
.button { border-radius: var(--radius-field); height: 40px; padding: 0 17px; }
.button.primary {
  background: linear-gradient(135deg, #0067ff, #3b82f6);
  border-color: transparent;
  box-shadow: 0 10px 22px rgba(0, 103, 255, .30);
}
.button.primary:hover { box-shadow: 0 12px 28px rgba(0, 103, 255, .42); transform: translateY(-1px); }
.button.dark { border-color: transparent; }
.button { transition: box-shadow .15s, transform .12s; }

/* 输入：更大圆角 + 更明显的聚焦光晕 */
input, select, textarea { border-radius: var(--radius-field); background: #fbfcff; padding: 11px 12px; }
input:focus, select:focus, textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(0, 103, 255, .13);
}
/* 占位提示文字更淡灰，和已输入内容区分更明显 */
input::placeholder, textarea::placeholder { color: #b4bdcb; opacity: 1; font-weight: 600; }

.badge { height: 25px; padding: 0 11px; }
.add-req-btn { border-radius: 12px; }
.request-tab { border-radius: 11px 11px 0 0; }

/* 系统步骤：3列网格 → 竖向 stepper + 编号圆点（纯 CSS，HTML 不动） */
.steps {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 14px 12px;
  counter-reset: stp;
}
.step {
  min-height: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  border-radius: 11px;
  padding: 9px 11px;
}
.step::before {
  counter-increment: stp;
  content: counter(stp);
  flex: 0 0 auto;
  width: 23px;
  height: 23px;
  border-radius: 999px;
  border: 2px solid var(--line-strong);
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 900;
  color: var(--muted);
  background: #fff;
}
.step b { margin: 0; font-size: 13px; }
.step span { margin: 0 0 0 auto; font-size: 11px; text-align: right; }
.step.done { background: transparent; border-color: transparent; }
.step.done::before { content: "✓"; background: var(--green); border-color: var(--green); color: #fff; }
.step.active, .step.generating { background: var(--blue-soft); border-color: transparent; }
.step.active::before, .step.generating::before { background: var(--blue); border-color: var(--blue); color: #fff; }
.step.failed { background: var(--red-soft); border-color: transparent; }
.step.failed::before { content: "!"; background: #e23d52; border-color: #e23d52; color: #fff; }

/* 生成图卡片：圆角 + 柔影 + 质检状态左缘色条 */
.asset {
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  border: 1px solid var(--line);
  background: #fff;
}
.asset .asset-preview { border-radius: 0; }
.asset.passed { box-shadow: var(--shadow-soft), inset 4px 0 0 var(--green); }
.asset.review_pending, .asset.checking { box-shadow: var(--shadow-soft), inset 4px 0 0 var(--amber); }
.asset.failed { box-shadow: var(--shadow-soft), inset 4px 0 0 #e23d52; }

/* 空态/占位 tile 圆角与卡片一致 */
.gallery-tile { border-radius: var(--radius-card); }

/* 本地参考图上传：原生 file input 美化为虚线上传区 + 蓝色圆角按钮 */
#referenceFiles {
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius-field);
  background: #fbfcff;
  padding: 12px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
#referenceFiles:hover { border-color: var(--blue); background: var(--blue-soft); }
#referenceFiles::file-selector-button {
  margin-right: 12px;
  padding: 8px 14px;
  border-radius: 9px;
  border: 1px solid rgba(0, 103, 255, .28);
  background: #fff;
  color: var(--blue);
  font-size: 12px;
  font-weight: 760;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
#referenceFiles::file-selector-button:hover { background: var(--blue-soft); border-color: var(--blue); }

/* 尺寸单元格：比例缩略图标 + 尺寸下拉 */
.req-size-cell { display: flex; align-items: center; gap: 7px; min-width: 0; }
.req-size-cell .req-size { flex: 1; min-width: 0; }
.ratio-ic {
  flex: 0 0 auto;
  display: inline-block;
  border: 1.5px solid var(--blue);
  border-radius: 2px;
  background: rgba(0, 103, 255, .14);
}

/* 历史:管理员 个人/所有 切换 + 日期 */
.history-scope { display: flex; gap: 6px; margin-bottom: 10px; }
.history-scope .hs { flex: 1; border: 1px solid var(--line); background: #fff; color: var(--muted); border-radius: 9px; padding: 6px 8px; font-size: 12px; font-weight: 800; cursor: pointer; }
.history-scope .hs.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.history-item .hi-meta { display: flex; gap: 8px; align-items: center; margin-top: 4px; }
.history-item .hi-date { font-size: 11px; color: var(--muted); font-weight: 600; }
.history-item .hi-owner { font-size: 10px; color: var(--muted); font-family: ui-monospace, monospace; background: #eef2f8; border-radius: 5px; padding: 1px 6px; }

/* 生成配置(JSON/调试)面板:仅管理员可见 */
body:not(.is-admin) .inspect-panel { display: none; }

/* 信鸟仓入口:无白底、图标加大 */
/* V1 软胶囊:浅蓝胶囊 + 现有 Wishy 信鸟 mini 图标 + 实蓝文字 */
.nest-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--blue-soft);
  border: 1px solid rgba(0, 103, 255, .18);
  text-decoration: none;
  padding: 5px 12px 5px 9px;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
}
.nest-link:hover { background: #dbeeff; border-color: rgba(0, 103, 255, .36); }
.nest-link .nest-ic { display: block; flex: 0 0 auto; }
.nest-link span {
  font-size: 12.5px;
  font-weight: 850;
  letter-spacing: .5px;
  color: var(--blue);
}

/* 参考案例:信鸟仓收藏选择 */
#pickFavRefBtn { margin-top: 6px; }
.fav-ref-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.fav-ref-chip { display: inline-flex; align-items: center; gap: 5px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 3px 6px; font-size: 11px; font-weight: 700; }
.fav-ref-chip img { width: 24px; height: 24px; border-radius: 4px; object-fit: cover; }
.fav-ref-chip i { cursor: pointer; color: var(--muted); font-style: normal; padding: 0 2px; }
.fav-ref-chip i:hover { color: #be123c; }
.fav-picker { position: fixed; inset: 0; z-index: 60; background: rgba(11,18,32,.6); backdrop-filter: blur(3px); display: none; align-items: center; justify-content: center; padding: 28px; }
.fav-picker.open { display: flex; }
.fav-picker-card { background: #fff; border-radius: 16px; max-width: 900px; width: 100%; max-height: 86vh; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 30px 80px rgba(0,0,0,.4); }
.fav-picker-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.fav-picker-head b { font-size: 15px; color: var(--ink); }
.fav-picker-head span { color: var(--muted); font-size: 12px; flex: 1; }
.fav-picker-grid { padding: 16px; overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.fav-pick { position: relative; border: 2px solid transparent; border-radius: 10px; overflow: hidden; cursor: pointer; background: #f2f6fc; }
.fav-pick img { width: 100%; aspect-ratio: 1/1; object-fit: cover; display: block; }
.fav-pick.sel { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.fav-pick.sel::after { content: "✓"; position: absolute; right: 6px; top: 6px; width: 22px; height: 22px; border-radius: 999px; background: var(--blue); color: #fff; display: grid; place-items: center; font-weight: 900; font-size: 13px; }
.fav-pick-b { display: block; font-size: 11px; font-weight: 700; color: var(--ink); padding: 5px 7px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 需求 Tab 栏：对齐 A —— 圆角卡片 Tab、单行标题、选中白底上浮、＋新建内联 pill（置顶保留原行为） */
.request-tabbar { padding: 8px 18px 0; background: transparent; border-bottom: 1px solid var(--line); justify-content: flex-start; }
/* ＋新建 紧挨最后一个 Tab：标签容器只占内容宽、不再撑满把按钮顶到右边 */
.request-tabs { flex: 0 1 auto; }
.request-tab {
  height: auto;
  min-width: auto;
  max-width: 260px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  grid-template-columns: none;
  grid-template-rows: none;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-bottom-color: transparent;
  border-radius: 11px 11px 0 0;
  background: rgba(244, 248, 253, .85);
  color: var(--muted);
}
.request-tab span { font-size: 13px; font-weight: 740; color: inherit; }
.request-tab small { grid-column: auto; font-size: 11px; font-weight: 640; color: var(--muted); opacity: .85; }
.request-tab.active {
  height: auto;
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
  border-bottom-color: #fff;
  box-shadow: 0 -4px 14px rgba(13, 27, 62, .06);
}
.request-tab.active span { color: var(--ink); }
.request-tab i { grid-row: auto; grid-column: auto; width: 18px; height: 18px; font-size: 13px; opacity: .5; }
.request-tab i:hover { opacity: 1; background: #eef2f8; }
.new-request-tab {
  width: auto;
  height: auto;
  margin-bottom: 0;
  padding: 9px 14px;
  border-radius: 11px 11px 0 0;
  border: 1px solid var(--line);
  border-bottom-color: transparent;
  background: rgba(244, 248, 253, .85);
  color: var(--blue);
  font-size: 13px;
  font-weight: 740;
  line-height: 1;
}
.new-request-tab:hover { background: #fff; color: var(--blue); }
/* Tab 与 ＋新建 统一尺寸：同高、同内边距、内容垂直居中，避免大小不一 */
.request-tab,
.new-request-tab {
  height: 36px;
  padding: 0 14px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}
.request-tab.active { height: 36px; }

