/* ============================================================
   最强AI生图系统 · 样式
   设计：暗色科技风 + 毛玻璃 + 极光背景
   响应式：PC 双栏 → 平板单栏 → 手机底部固定操作条
   ============================================================ */

:root {
  --bg: #0b0d12;
  --bg2: #11141c;
  --txt: #eef1f7;
  --txt2: #b6bdcc;
  --txt3: #767e92;
  --acc: #f7b955;
  --acc2: #ff8a3d;
  --acc3: #ff8f6b;
  --ok: #3ddc97;
  --err: #ff5f56;
  --warn: #ffb020;

  --glass: rgba(20, 23, 33, .62);
  --glass-2: rgba(28, 32, 45, .55);
  --glass-br: rgba(255, 255, 255, .1);
  --inp: rgba(10, 12, 18, .6);

  --r: 16px;
  --r-s: 11px;
  --r-xs: 8px;
  --ease: cubic-bezier(.22, .85, .3, 1);

  --top-h: 60px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--txt);
  font: 400 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
}

/* iOS 输入框字号 <16px 会触发自动放大 */
input, textarea, select, button { font-family: inherit; font-size: 16px; }
@media (min-width: 720px) {
  input, textarea, select, button { font-size: 13.5px; }
}

button { cursor: pointer; }

::selection { background: rgba(247, 185, 85, .28); }

/* 滚动条 */
* { scrollbar-width: thin; scrollbar-color: rgba(247,185,85,.35) transparent; }
*::-webkit-scrollbar { width: 7px; height: 7px; }
*::-webkit-scrollbar-thumb { background: rgba(247,185,85,.3); border-radius: 4px; }
*::-webkit-scrollbar-thumb:hover { background: rgba(247,185,85,.5); }
*::-webkit-scrollbar-track { background: transparent; }

/* ============================================================
   动态背景
   ============================================================ */
.bg {
  position: fixed; inset: -50px; z-index: -1; overflow: hidden; background: var(--bg);
}

.bg-img {
  position: absolute; inset: -14%;
  background: url('bg-nebula.webp') center/cover no-repeat;
  opacity: .85;
  filter: saturate(1.45) brightness(1.5) contrast(1.05);
  animation: bgDrift 28s ease-in-out infinite alternate;
}
@keyframes bgDrift {
  0%   { transform: scale(1.02) translate3d(-2.5%, -2%, 0); }
  100% { transform: scale(1.18) translate3d(2.5%, 2%, 0); }
}

.bg-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(247,185,85,.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(247,185,85,.07) 1px, transparent 1px);
  background-size: 58px 58px;
  mask-image: radial-gradient(ellipse 90% 65% at 50% 40%, #000 35%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 90% 65% at 50% 40%, #000 35%, transparent 100%);
  animation: gridMove 8s linear infinite;
}
@keyframes gridMove {
  from { background-position: 0 0, 0 0; }
  to   { background-position: 58px 58px, 58px 58px; }
}

.bg-glow { position: absolute; border-radius: 50%; filter: blur(100px); }
.g1 { width: 680px; height: 680px; top: -260px; left: -160px;
      background: radial-gradient(circle, rgba(247,185,85,.5), transparent 68%);
      animation: float1 11s ease-in-out infinite alternate; }
.g2 { width: 600px; height: 600px; bottom: -240px; right: -140px;
      background: radial-gradient(circle, rgba(255,138,61,.42), transparent 68%);
      animation: float2 15s ease-in-out infinite alternate; }
.g3 { width: 460px; height: 460px; top: 38%; left: 54%;
      background: radial-gradient(circle, rgba(255,143,107,.26), transparent 68%);
      animation: float3 19s ease-in-out infinite alternate; }
@keyframes float1 { from { transform: translate3d(0,0,0) scale(1); } to { transform: translate3d(190px,150px,0) scale(1.25); } }
@keyframes float2 { from { transform: translate3d(0,0,0) scale(1.15); } to { transform: translate3d(-170px,-130px,0) scale(1); } }
@keyframes float3 { from { transform: translate(-50%,-50%) scale(.85); opacity: .5; } to { transform: translate(-50%,-50%) scale(1.5); opacity: 1; } }

.bg-aurora {
  position: absolute; left: -14%; right: -14%; top: 2%; height: 46vh; min-height: 280px;
  background: url('hero-aurora.webp') center/cover no-repeat;
  mix-blend-mode: screen;
  mask-image: linear-gradient(180deg, transparent, #000 26%, #000 62%, transparent);
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 26%, #000 62%, transparent);
  animation: aurora 13s ease-in-out infinite alternate;
}
@keyframes aurora {
  0%   { transform: translate3d(-7%,0,0) scaleX(.98); opacity: .38; }
  100% { transform: translate3d(7%,-2.5%,0) scaleX(1.14); opacity: .8; }
}

.bg-particles { position: absolute; inset: 0; overflow: hidden; }
.bg-particles i {
  position: absolute; bottom: -14px; display: block;
  width: 3px; height: 3px; border-radius: 50%;
  background: rgba(247,185,85,.85);
  box-shadow: 0 0 8px 2px rgba(247,185,85,.45);
  animation: riseUp linear infinite;
}
@keyframes riseUp {
  0%   { transform: translateY(0) scale(.6); opacity: 0; }
  12%  { opacity: .9; }
  80%  { opacity: .55; }
  100% { transform: translateY(-102vh) scale(1.1); opacity: 0; }
}

.bg-sweep {
  position: absolute; top: 0; bottom: 0; width: 46%;
  background: linear-gradient(100deg, transparent, rgba(247,185,85,.07) 45%,
              rgba(255,193,120,.12) 50%, rgba(247,185,85,.07) 55%, transparent);
  transform: skewX(-14deg);
  animation: sweepAcross 9s ease-in-out infinite;
  mix-blend-mode: screen;
}
@keyframes sweepAcross {
  0% { left: -50%; opacity: 0; }
  15% { opacity: 1; }
  85% { opacity: 1; }
  100% { left: 115%; opacity: 0; }
}

.bg-noise {
  position: absolute; inset: 0; opacity: .16; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
}

/* ============================================================
   毛玻璃基类
   ============================================================ */
.glass {
  position: relative;
  background: var(--glass);
  -webkit-backdrop-filter: blur(26px) saturate(165%);
  backdrop-filter: blur(26px) saturate(165%);
  border: 1px solid var(--glass-br);
  border-radius: var(--r);
  box-shadow: 0 24px 60px -30px rgba(0,0,0,.9), inset 0 1px 0 rgba(255,255,255,.06);
}
.glass::before {
  content: ""; position: absolute; top: 0; left: 14%; right: 14%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(247,185,85,.55), transparent);
}
.glass > * { position: relative; z-index: 1; }

/* ============================================================
   门禁页
   ============================================================ */
.gate {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 24px 18px calc(24px + var(--safe-b));
  background: #06070a;
  overflow-y: auto;
}
.gate-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(247,185,85,.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(247,185,85,.07) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, #000 20%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, #000 20%, transparent 100%);
  animation: gridMove 9s linear infinite;
}
.gate-glow {
  position: absolute; top: 50%; left: 50%; width: 760px; height: 760px;
  transform: translate(-50%, -50%); border-radius: 50%;
  background: radial-gradient(circle, rgba(247,185,85,.2), rgba(255,138,61,.09) 42%, transparent 68%);
  filter: blur(70px);
  animation: gatePulse 8s ease-in-out infinite alternate;
}
@keyframes gatePulse {
  from { opacity: .55; transform: translate(-50%,-50%) scale(.9); }
  to   { opacity: 1; transform: translate(-50%,-50%) scale(1.15); }
}

.gate-card {
  position: relative; z-index: 1;
  width: 100%; max-width: 372px;
  padding: 36px 28px 26px; text-align: center;
  background: rgba(17, 19, 28, .66);
  -webkit-backdrop-filter: blur(30px) saturate(170%);
  backdrop-filter: blur(30px) saturate(170%);
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 20px;
  box-shadow: 0 34px 80px -24px rgba(0,0,0,.92), inset 0 1px 0 rgba(255,255,255,.08);
  animation: gateIn .45s var(--ease) both;
}
@keyframes gateIn { from { opacity: 0; transform: translateY(22px) scale(.97); } }
.gate-card::before {
  content: ""; position: absolute; top: 0; left: 22%; right: 22%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(247,185,85,.7), transparent);
}
.gate-card.shake { animation: shakeIt .4s var(--ease); }
@keyframes shakeIt {
  10%, 90% { transform: translateX(-2px); }
  30%, 70% { transform: translateX(5px); }
  50% { transform: translateX(-5px); }
}

.gate-logo {
  width: 72px; height: 72px; border-radius: 50%; object-fit: cover;
  filter: drop-shadow(0 0 22px rgba(247,185,85,.6));
  animation: floaty 5.5s ease-in-out infinite;
}
@keyframes floaty { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-12px) } }

.gate-card h1 {
  margin: 16px 0 6px; font-size: 22px; font-weight: 750; letter-spacing: -.3px;
  background: linear-gradient(100deg, #fff 12%, var(--acc) 52%, var(--acc2) 88%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: var(--acc);
}
.gate-sub { margin: 0 0 22px; font-size: 12.5px; color: var(--txt3); }

.gate-field {
  position: relative; display: block; margin-bottom: 12px;
}
/* 门禁卡里的输入框要压过通用 input 规则 */
.gate-card .gate-field input {
  width: 100%; padding: 14px 14px 14px 60px;
  background: rgba(8, 9, 14, .78);
  border: 1px solid rgba(255,255,255,.1); border-radius: var(--r-s);
  color: var(--txt); font-size: 16px; letter-spacing: 2px;
  transition: border-color .2s, box-shadow .2s;
}
.gate-field input:focus {
  outline: none; border-color: rgba(247,185,85,.7);
  box-shadow: 0 0 0 3px rgba(247,185,85,.14);
}
.gate-prefix {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  font: 600 13px ui-monospace, Menlo, monospace; color: var(--acc);
  padding-right: 11px; border-right: 1px solid rgba(255,255,255,.12);
  pointer-events: none;
}
.gate-msg { min-height: 18px; margin: 12px 0 0; font-size: 12.5px; color: var(--err); }
.gate-msg.ok { color: var(--ok); }
.gate-foot { margin: 14px 0 0; font-size: 11px; color: var(--txt3); }

/* ============================================================
   通用按钮
   ============================================================ */
.btn-primary {
  position: relative; width: 100%; border: 0; border-radius: var(--r-s);
  padding: 13px; overflow: hidden; font-weight: 700; color: #1b1406;
  background: linear-gradient(120deg,
    #f7b955 0%, #ff8a3d 16.67%, #ffc178 33.33%,
    #f7b955 50%, #ff8a3d 66.67%, #ffc178 83.33%, #f7b955 100%);
  background-size: 200% 100%;
  box-shadow: 0 14px 38px -14px rgba(247,185,85,.8);
  transition: transform .18s var(--ease), box-shadow .2s, opacity .2s;
  animation: hue 9s linear infinite;
}
@keyframes hue { from { background-position: 0% 50%; } to { background-position: 100% 50%; } }
.btn-primary:hover:not(:disabled) { transform: translateY(-2px); }
.btn-primary:active:not(:disabled) { transform: translateY(0) scale(.99); }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; animation: none; }

.mini {
  padding: 6px 11px; border-radius: var(--r-xs); font-size: 12px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1);
  color: var(--txt2); transition: .15s;
  min-height: 32px;
}
.mini:hover { border-color: rgba(247,185,85,.5); color: var(--acc); }
.mini:active { transform: scale(.96); }

/* ============================================================
   主布局
   ============================================================ */
.app {
  max-width: 1500px; margin: 0 auto;
  padding: 0 16px calc(24px + var(--safe-b));
  display: flex; flex-direction: column; gap: 14px;
  min-height: 100vh; min-height: 100dvh;
}

/* 顶栏 */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 4px;
  margin: 0 -16px; padding-left: 16px; padding-right: 16px;
  background: rgba(11,13,18,.72);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.logo {
  width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex: 0 0 auto;
  filter: drop-shadow(0 0 14px rgba(247,185,85,.5));
}
.brand-txt { min-width: 0; }
.brand-txt h1 {
  margin: 0; font-size: 15px; font-weight: 750; letter-spacing: -.2px;
  background: linear-gradient(100deg, #fff 20%, var(--acc) 70%, var(--acc2));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: var(--acc);
  white-space: nowrap;
}
.brand-txt p {
  margin: 1px 0 0; font-size: 10.5px; color: var(--txt3);
  display: flex; align-items: center; gap: 5px;
}
.live {
  width: 5px; height: 5px; border-radius: 50%; background: var(--ok);
  box-shadow: 0 0 6px rgba(61,220,151,.8);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .35 } }

.topright { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }

.pill {
  display: flex; align-items: center; gap: 7px;
  padding: 6px 12px; border-radius: 999px;
  background: var(--glass-2); border: 1px solid var(--glass-br);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}
.quota b {
  font: 700 15px ui-monospace, Menlo, monospace; color: var(--ok);
  text-shadow: 0 0 12px rgba(61,220,151,.5);
}
.quota span { font-size: 10.5px; color: var(--txt3); }
.quota.low b { color: var(--acc2); text-shadow: 0 0 12px rgba(255,138,61,.5); }
.quota.empty b { color: var(--err); text-shadow: 0 0 12px rgba(255,95,86,.5); }

.user { gap: 8px; }
.avatar {
  width: 24px; height: 24px; border-radius: 50%; flex: 0 0 auto;
  display: grid; place-items: center;
  font: 700 10px ui-monospace, Menlo, monospace; color: #1b1406;
  background: linear-gradient(135deg, var(--acc), var(--acc2));
}
.uphone {
  font: 600 11.5px ui-monospace, Menlo, monospace; color: var(--txt2);
  letter-spacing: .3px;
}

/* 主体两栏 */
.main {
  display: grid; gap: 14px;
  grid-template-columns: 1fr;
  align-items: start;
}

@media (min-width: 1120px) {
  .main { grid-template-columns: 400px minmax(0, 1fr); gap: 18px; }
  .panel { position: sticky; top: calc(var(--top-h) + 14px); }
  .panel .panel-body {
    max-height: calc(100dvh - var(--top-h) - 120px);
    overflow-y: auto; padding-right: 4px;
  }
}

/* ============================================================
   控制台面板
   ============================================================ */
.panel { padding: 0; overflow: hidden; }

.panel-hd {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px 12px; border-bottom: 1px solid rgba(255,255,255,.06);
}
.ph-line {
  width: 3px; height: 15px; border-radius: 2px;
  background: linear-gradient(180deg, var(--acc), var(--acc2));
  box-shadow: 0 0 10px rgba(247,185,85,.6);
}
.panel-hd h2 { margin: 0; font-size: 13.5px; font-weight: 650; letter-spacing: .2px; }
.collapse-btn {
  margin-left: auto; display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: var(--r-xs);
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08);
  color: var(--txt2); transition: .2s;
}
.collapse-btn svg { transition: transform .25s var(--ease); }
.panel.collapsed .collapse-btn svg { transform: rotate(180deg); }
.panel.collapsed .panel-body { display: none; }

.panel-body { padding: 16px; display: flex; flex-direction: column; gap: 15px; }

/* 字段 */
.field { display: flex; flex-direction: column; gap: 7px; }
.flabel {
  font-size: 11.5px; font-weight: 600; color: var(--txt3);
  letter-spacing: .3px; display: flex; align-items: center; gap: 6px;
}
.req { color: var(--acc2); }
.optional { font-weight: 400; color: var(--txt3); opacity: .7; font-size: 10.5px; }

.ta-wrap { position: relative; }
/* 列举类型而不是用 :not() 链——:not 会累加特异性（6 个就是 0,6,1），
   会把门禁卡里 .gate-field input 的 padding 覆盖掉，导致 +86 和占位文字重叠。 */
textarea, select,
input[type="text"], input[type="search"], input[type="tel"],
input[type="url"], input[type="email"], input[type="password"],
input[type="number"], input[type="date"], input[type="datetime-local"],
input[type="time"], input[type="month"], input[type="week"] {
  width: 100%; padding: 11px 12px;
  background: var(--inp);
  border: 1px solid rgba(255,255,255,.09);
  border-radius: var(--r-s); color: var(--txt);
  transition: border-color .2s, box-shadow .2s, background .2s;
  resize: vertical;
}
textarea { min-height: 88px; line-height: 1.6; }
textarea:focus, select:focus, input:focus {
  outline: none; border-color: rgba(247,185,85,.65);
  box-shadow: 0 0 0 3px rgba(247,185,85,.12);
  background: rgba(12,14,21,.8);
}
textarea::placeholder, input::placeholder { color: #5a6274; }

.pcount {
  position: absolute; right: 9px; bottom: 7px;
  font: 500 10px ui-monospace, Menlo, monospace; color: var(--txt3);
  background: rgba(10,12,18,.82); padding: 1px 6px; border-radius: 4px;
  pointer-events: none;
}
.pcount b { color: var(--acc); font-weight: 600; }

/* @ 引用菜单 */
.ref-menu {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 40;
  display: flex; flex-direction: column; gap: 3px;
  padding: 6px; max-height: 224px; overflow-y: auto;
  background: rgba(20, 23, 33, .97);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  border: 1px solid rgba(247,185,85,.32);
  border-radius: var(--r-s);
  box-shadow: 0 20px 44px -16px rgba(0,0,0,.92);
  animation: menuIn .16s var(--ease);
}
@keyframes menuIn { from { opacity: 0; transform: translateY(-5px); } }
.ref-item {
  display: flex; align-items: center; gap: 9px;
  padding: 6px 8px; border-radius: 7px; width: 100%;
  background: transparent; border: 0; text-align: left;
  color: var(--txt2); font-size: 12.5px;
  transition: background .12s, color .12s;
}
.ref-item:hover, .ref-item.active {
  background: rgba(247,185,85,.14); color: var(--acc);
}
.ref-item img {
  width: 32px; height: 32px; border-radius: 5px; object-fit: cover;
  border: 1px solid rgba(255,255,255,.12); flex: 0 0 auto;
}

/* 指代提示 */
.ref-hint {
  font-size: 10.5px; color: var(--txt3); line-height: 1.7; margin-top: 1px;
}
.ref-hint code {
  background: rgba(247,185,85,.13); color: var(--acc);
  padding: 1px 5px; border-radius: 4px;
  font-family: ui-monospace, Menlo, monospace; font-size: 10px;
  white-space: nowrap;
}

select {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%23767e92' stroke-width='1.8'%3E%3Cpath d='M1 1l5 5 5-5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  padding-right: 32px;
}

.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* 模型选择 */
.models { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.model {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 11px; border-radius: var(--r-s);
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.08);
  color: var(--txt2); text-align: left;
  transition: .2s var(--ease);
  min-height: 46px;
}
.model:hover { border-color: rgba(247,185,85,.35); background: rgba(247,185,85,.05); }
.model.active {
  border-color: rgba(247,185,85,.65);
  background: linear-gradient(100deg, rgba(247,185,85,.16), rgba(255,138,61,.07));
  box-shadow: 0 0 0 1px rgba(247,185,85,.2), 0 6px 20px -12px rgba(247,185,85,.8);
  color: var(--txt);
}
.morb {
  width: 13px; height: 13px; border-radius: 50%; flex: 0 0 auto;
  box-shadow: inset -2px -2px 4px rgba(0,0,0,.45);
}
.morb.sun { background: radial-gradient(circle at 33% 30%, #ffe0a8, var(--acc) 48%, #c07820 88%); box-shadow: 0 0 10px rgba(247,185,85,.6), inset -2px -2px 4px rgba(0,0,0,.4); }
.morb.fla { background: radial-gradient(circle at 33% 30%, #ffd0a8, var(--acc2) 48%, var(--acc3) 88%); box-shadow: 0 0 10px rgba(255,138,61,.6), inset -2px -2px 4px rgba(0,0,0,.4); }
.model b { font: 640 12px ui-monospace, Menlo, monospace; white-space: nowrap; }
.msuf {
  font-style: normal; font-size: 10px; font-weight: 600;
  padding: 2px 5px; border-radius: 4px; margin-left: auto;
  background: rgba(255,255,255,.07); color: var(--txt3);
  border: 1px solid rgba(255,255,255,.08);
  transition: .2s; white-space: nowrap;
}
.model.active .msuf {
  background: rgba(247,185,85,.2); color: var(--acc);
  border-color: rgba(247,185,85,.38);
}

/* 档位 + 比例 */
.tiers { display: flex; gap: 6px; }
.tier {
  flex: 1; padding: 7px 4px; border-radius: var(--r-xs);
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  color: var(--txt3); font-size: 11.5px; font-weight: 600;
  transition: .18s; min-height: 34px;
}
.tier:hover { color: var(--txt2); border-color: rgba(255,255,255,.16); }
.tier.active {
  background: rgba(247,185,85,.16); border-color: rgba(247,185,85,.55);
  color: var(--acc);
}

.ratios {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px;
  margin-top: 2px;
}
.ratio {
  padding: 7px 2px; border-radius: var(--r-xs);
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.07);
  color: var(--txt3); font: 600 10.5px/1.2 ui-monospace, Menlo, monospace;
  transition: .16s; min-height: 32px;
}
.ratio:hover { color: var(--txt2); border-color: rgba(255,255,255,.15); }
.ratio.active {
  background: rgba(247,185,85,.18); border-color: rgba(247,185,85,.6);
  color: var(--acc); box-shadow: 0 0 12px -4px rgba(247,185,85,.8);
}

.hint-line {
  font-size: 10.5px; color: var(--txt3);
  display: flex; align-items: center; gap: 5px; margin-top: 1px;
}
.hint-line b { color: var(--acc); font-family: ui-monospace, Menlo, monospace; font-weight: 600; }

/* 参考图 */
.drop {
  display: flex; align-items: center; gap: 10px;
  padding: 12px; border-radius: var(--r-s);
  border: 1px dashed rgba(255,255,255,.16);
  background: rgba(255,255,255,.02);
  color: var(--txt3); transition: .2s; min-height: 60px;
}
.drop:hover, .drop.hot {
  border-color: rgba(247,185,85,.6);
  background: rgba(247,185,85,.06);
  color: var(--acc);
}
.drop-ico { flex: 0 0 auto; display: grid; place-items: center; }
.drop-txt { display: flex; flex-direction: column; gap: 1px; font-size: 11px; }
.drop-txt b { color: var(--txt2); font-weight: 600; font-size: 12px; }

.thumbs { display: flex; flex-wrap: wrap; gap: 6px; }
.thumbs:empty { display: none; }
.thumb-item {
  position: relative; width: 52px; height: 52px; cursor: pointer; border-radius: var(--r-xs);
  overflow: hidden; border: 1px solid rgba(255,255,255,.12);
  animation: popIn .25s var(--ease) both;
}
@keyframes popIn { from { opacity: 0; transform: scale(.8); } }
.thumb-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-item:hover { border-color: rgba(247,185,85,.6); }
.thumb-item .idx {
  position: absolute; left: 2px; top: 2px;
  font: 700 8.5px/1 ui-monospace, Menlo, monospace;
  background: rgba(0,0,0,.7); color: var(--acc);
  padding: 2px 4px; border-radius: 3px;
}
.thumb-item .rm {
  position: absolute; right: 0; top: 0; width: 17px; height: 17px;
  display: grid; place-items: center; border: 0;
  background: rgba(0,0,0,.72); color: #fff; font-size: 10px;
  border-bottom-left-radius: 6px;
}

/* 开关 */
.switch-row { display: flex; align-items: center; gap: 9px; }
.sw { position: relative; display: inline-flex; cursor: pointer; }
.sw input { position: absolute; opacity: 0; width: 0; height: 0; }
.track {
  width: 38px; height: 21px; border-radius: 999px;
  background: rgba(255,255,255,.12); transition: .22s var(--ease);
  position: relative; display: block;
}
.track i {
  position: absolute; top: 2.5px; left: 2.5px;
  width: 16px; height: 16px; border-radius: 50%;
  background: #8b93a6; transition: .22s var(--ease);
}
.sw input:checked + .track { background: rgba(247,185,85,.85); }
.sw input:checked + .track i { transform: translateX(17px); background: #1b1406; }
.sw-txt { font-size: 12px; color: var(--txt2); }

/* 生成按钮 */
.btn-gen { margin-top: 3px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.btn-gen .gl { font-size: 15px; font-weight: 750; letter-spacing: .2px; }
.btn-gen .gs {
  font: 500 10px/1.3 ui-monospace, Menlo, monospace;
  opacity: .62; letter-spacing: .2px;
}
.gsheen {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 38%, rgba(255,255,255,.42) 50%, transparent 62%);
  transform: translateX(-120%);
  animation: sheen 4.5s var(--ease) infinite;
}
@keyframes sheen {
  0%, 55% { transform: translateX(-120%); }
  85%, 100% { transform: translateX(120%); }
}

/* ============================================================
   结果区
   ============================================================ */
.out { padding: 0; overflow: hidden; display: flex; flex-direction: column; }

.out-hd {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 13px 16px; border-bottom: 1px solid rgba(255,255,255,.06);
  flex-wrap: wrap;
}
.oh-l h2 { margin: 0; font-size: 13.5px; font-weight: 650; }
.oh-l .meta {
  margin-top: 3px; font: 500 10.5px/1.3 ui-monospace, Menlo, monospace;
  color: var(--txt3); word-break: break-all;
}
.oh-r { display: flex; align-items: center; gap: 8px; }
.counter {
  font-size: 11px; color: var(--txt3);
  padding: 5px 10px; border-radius: 999px;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08);
}
.counter b {
  font: 700 12.5px ui-monospace, Menlo, monospace; color: var(--acc);
  display: inline-block;
}
.counter b.bump { animation: countBump .45s var(--ease); }
@keyframes countBump {
  0% { transform: scale(1); }
  38% { transform: scale(1.35); text-shadow: 0 0 20px rgba(247,185,85,.9); }
  100% { transform: scale(1); }
}

.queue { display: flex; flex-direction: column; gap: 8px; padding: 12px 16px; }
.queue:empty { display: none; }

.results {
  display: grid; gap: 12px; padding: 14px 16px 18px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  min-height: 260px;
}

/* 空状态 */
.empty {
  grid-column: 1 / -1; text-align: center; padding: 56px 16px;
  color: var(--txt3);
}
.orb-wrap { position: relative; width: 132px; height: 132px; margin: 0 auto; }
.orb {
  position: relative; z-index: 2; width: 100%; height: 100%; object-fit: contain;
  mix-blend-mode: screen;
  filter: drop-shadow(0 0 30px rgba(247,185,85,.5));
  animation: floaty 6s ease-in-out infinite;
}
.orb-halo {
  position: absolute; inset: -26px; border-radius: 50%; z-index: 1;
  background: radial-gradient(circle, rgba(247,185,85,.34), transparent 66%);
  filter: blur(26px);
  animation: floaty 6s ease-in-out infinite reverse;
}
.orb-ring {
  position: absolute; inset: 5px; border-radius: 50%; z-index: 3;
  border: 1px solid rgba(247,185,85,.22);
  border-top-color: rgba(247,185,85,.85);
  border-right-color: rgba(247,185,85,.45);
  animation: orbSpin 8s linear infinite;
  pointer-events: none;
}
@keyframes orbSpin { to { transform: rotate(360deg); } }
.empty p { margin: 18px 0 4px; font-size: 13.5px; color: var(--txt2); letter-spacing: .4px; }
.empty small { font-size: 11px; line-height: 1.6; display: block; max-width: 300px; margin: 0 auto; }

/* 任务卡 */
.task {
  position: relative; overflow: hidden;
  padding: 11px 13px; border-radius: var(--r);
  background: linear-gradient(100deg, rgba(247,185,85,.09), rgba(30,33,46,.42));
  border: 1px solid rgba(247,185,85,.3);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  animation: rise .3s var(--ease) both;
}
.task.done {
  border-color: rgba(61,220,151,.4);
  background: linear-gradient(100deg, rgba(61,220,151,.09), rgba(30,33,46,.42));
}
.task.failed {
  border-color: rgba(255,95,86,.45);
  background: linear-gradient(100deg, rgba(255,95,86,.09), rgba(30,33,46,.42));
}
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.98); } }

.task-top { display: flex; align-items: center; gap: 9px; margin-bottom: 7px; }
.spinner {
  width: 13px; height: 13px; border-radius: 50%; flex: 0 0 auto;
  border: 2px solid rgba(247,185,85,.26);
  border-top-color: var(--acc);
  animation: spin .75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.task.done .spinner { border-color: rgba(61,220,151,.3); border-top-color: var(--ok); animation: none; }
.task.failed .spinner { border-color: rgba(255,95,86,.3); border-top-color: var(--err); animation: none; }
.task-title { font-size: 12.5px; font-weight: 600; }
.task-elapsed {
  margin-left: auto; font: 600 11px ui-monospace, Menlo, monospace;
  color: var(--acc); letter-spacing: .3px;
}

.pbar { height: 5px; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; margin-bottom: 7px; }
.pfill {
  height: 100%; width: 0; border-radius: 999px;
  background: linear-gradient(90deg, var(--acc), var(--acc2));
  transition: width .9s linear;
  position: relative; overflow: hidden;
}
.pfill::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.5), transparent);
  animation: flow 1.4s linear infinite;
}
@keyframes flow { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.task.done .pfill { background: linear-gradient(90deg, var(--ok), #6ee7b7); }
.task.done .pfill::after { display: none; }
.task.failed .pfill { background: linear-gradient(90deg, var(--err), #ff8a8a); }
.task.failed .pfill::after { display: none; }

.task-meta {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font: 500 10.5px ui-monospace, Menlo, monospace; color: var(--txt3);
}
.tag {
  padding: 2px 7px; border-radius: 5px; font-size: 10px; font-weight: 600;
  background: rgba(247,185,85,.14); color: var(--acc);
  border: 1px solid rgba(247,185,85,.28); white-space: nowrap;
}
.tag.flare {
  background: rgba(255,138,61,.14); color: var(--acc2);
  border-color: rgba(255,138,61,.28);
}
.task-hint { margin-top: 5px; font-size: 10.5px; color: var(--txt3); }

/* 结果卡片 */
.card {
  position: relative; overflow: hidden; border-radius: var(--r);
  background: var(--glass-2);
  border: 1px solid var(--glass-br);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  animation: cardIn .42s var(--ease) both;
  transition: transform .26s var(--ease), box-shadow .26s, border-color .26s;
  display: flex; flex-direction: column;
}
@keyframes cardIn { from { opacity: 0; transform: translateY(16px) scale(.97); } }
@media (hover: hover) {
  .card:hover {
    transform: translateY(-5px) perspective(760px)
      rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
    border-color: rgba(247,185,85,.4);
    box-shadow: 0 24px 52px -18px rgba(0,0,0,.92),
                0 0 0 1px rgba(247,185,85,.18),
                0 0 40px -14px rgba(247,185,85,.35);
  }
  .card::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(115deg, transparent 38%, rgba(255,255,255,.09) 50%, transparent 62%);
    transform: translateX(-120%); transition: transform .62s var(--ease);
  }
  .card:hover::after { transform: translateX(120%); }
}

.thumb {
  width: 100%; aspect-ratio: 1/1; object-fit: cover; display: block;
  background: rgba(0,0,0,.3); cursor: zoom-in;
  transition: filter .2s;
}
.thumb.r-169 { aspect-ratio: 16/9; }
.thumb.r-916 { aspect-ratio: 9/16; }
.thumb.r-43  { aspect-ratio: 4/3; }
.thumb.r-34  { aspect-ratio: 3/4; }
.thumb.r-32  { aspect-ratio: 3/2; }
.thumb.r-23  { aspect-ratio: 2/3; }

.card .bar {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 10px; border-top: 1px solid rgba(255,255,255,.06);
  flex-wrap: wrap;
}
.card .info {
  font: 500 10px ui-monospace, Menlo, monospace; color: var(--txt3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1;
  min-width: 0;
}
.card .mini.dl { flex: 0 0 auto; }
.card .rev {
  padding: 0 10px 8px; font-size: 10px; color: var(--txt3);
  line-height: 1.5; opacity: .8;
}

/* 报错框 */
.errbox {
  grid-column: 1 / -1; padding: 14px 16px; border-radius: var(--r);
  background: rgba(255,95,86,.09);
  border: 1px solid rgba(255,95,86,.34);
  animation: rise .3s var(--ease) both;
}
.errbox h4 { margin: 0 0 5px; font-size: 12.5px; color: var(--err); }
.errbox p { margin: 0; font-size: 11.5px; color: var(--txt2); line-height: 1.55; }

/* 页脚 */
.foot {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 14px 0 4px; font-size: 10.5px; color: var(--txt3);
  letter-spacing: .4px;
}
.foot b { color: var(--txt2); font-weight: 600; }
.foot a { color: var(--txt3); text-decoration: none; transition: color .15s; white-space: nowrap; }
.foot a:hover { color: var(--acc); }
.foot i { width: 1px; height: 10px; background: rgba(255,255,255,.12); }

/* ============================================================
   移动端底部操作条
   ============================================================ */
.mbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  display: none; gap: 10px; align-items: center;
  padding: 10px 14px calc(10px + var(--safe-b));
  background: rgba(11,13,18,.9);
  -webkit-backdrop-filter: blur(20px) saturate(170%);
  backdrop-filter: blur(20px) saturate(170%);
  border-top: 1px solid rgba(255,255,255,.09);
  box-shadow: 0 -12px 30px -14px rgba(0,0,0,.9);
}
.mbar-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 0 14px; height: 46px; border-radius: var(--r-s);
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1);
  color: var(--txt2); font-size: 13px; font-weight: 600; flex: 0 0 auto;
}
.mbar-btn:active { transform: scale(.97); }
.mbar-go {
  flex: 1; height: 46px; border: 0; border-radius: var(--r-s);
  font-size: 15px; font-weight: 750; color: #1b1406;
  background: linear-gradient(120deg, #f7b955, #ff8a3d 45%, #ffc178);
  box-shadow: 0 10px 26px -10px rgba(247,185,85,.9);
  transition: transform .15s;
}
.mbar-go:active { transform: scale(.98); }
.mbar-go:disabled { opacity: .55; }

/* ============================================================
   大图 / 提示
   ============================================================ */
.lightbox {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center;
  padding: 56px 16px calc(56px + var(--safe-b));
  background: rgba(4, 5, 8, .93);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  animation: fade .2s;
}
@keyframes fade { from { opacity: 0; } }
.lightbox img {
  max-width: 100%; max-height: 100%; object-fit: contain;
  border-radius: 10px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.95);
}
.lb-close {
  position: absolute; top: calc(14px + env(safe-area-inset-top, 0px)); right: 14px;
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.16);
  color: #fff; font-size: 16px;
}
.lb-dl {
  position: absolute; bottom: calc(16px + var(--safe-b)); left: 50%;
  transform: translateX(-50%);
  padding: 10px 22px; border-radius: 999px;
  background: linear-gradient(120deg, var(--acc), var(--acc2));
  color: #1b1406; font-size: 13px; font-weight: 700; text-decoration: none;
  box-shadow: 0 12px 30px -10px rgba(247,185,85,.8);
}

.toast {
  position: fixed; left: 50%; bottom: calc(80px + var(--safe-b));
  transform: translateX(-50%) translateY(10px);
  z-index: 400; max-width: min(90vw, 420px);
  padding: 11px 18px; border-radius: 999px;
  background: rgba(24, 27, 38, .95);
  border: 1px solid rgba(255,255,255,.14);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  color: var(--txt); font-size: 12.5px; text-align: center;
  box-shadow: 0 18px 44px -16px rgba(0,0,0,.9);
  animation: toastIn .28s var(--ease) both;
}
@keyframes toastIn { to { opacity: 1; transform: translateX(-50%) translateY(0); } }
.toast.ok { border-color: rgba(61,220,151,.45); color: #b8f5da; }
.toast.err { border-color: rgba(255,95,86,.45); color: #ffc9c6; }

/* ============================================================
   响应式：平板 / 手机
   ============================================================ */
@media (max-width: 1119px) {
  .panel .panel-body { max-height: none; }
}

@media (max-width: 719px) {
  .app { padding: 0 12px calc(78px + var(--safe-b)); gap: 12px; }
  .topbar { margin: 0 -12px; padding-left: 12px; padding-right: 12px; }
  .brand-txt h1 { font-size: 14px; }
  .brand-txt p { display: none; }
  .logo { width: 32px; height: 32px; }
  .uphone { display: none; }
  .pill { padding: 5px 10px; }
  .quota b { font-size: 14px; }

  /* 手机端隐藏底部按钮，改用固定操作条 */
  .btn-gen { display: none; }
  .mbar { display: flex; }

  .panel-hd { padding: 12px 14px; }
  .panel-body { padding: 14px; gap: 14px; }
  .panel.collapsed .panel-body { display: none; }

  .ratios { grid-template-columns: repeat(3, 1fr); }
  .results { grid-template-columns: repeat(2, 1fr); gap: 9px; padding: 12px 14px 16px; }
  .out-hd { padding: 11px 14px; }
  .queue { padding: 10px 14px; }
  .card .bar { padding: 6px 8px; }
  .card .info { font-size: 9.5px; }
  .card .mini.dl { padding: 5px 8px; min-height: 28px; font-size: 11px; }
  .foot {
    flex-wrap: wrap; gap: 4px 10px; padding: 12px 0 4px;
    font-size: 10px; letter-spacing: 0;
  }
  .foot i { display: none; }

  .empty { padding: 40px 12px; }
  .orb-wrap { width: 108px; height: 108px; }
  .toast { bottom: calc(76px + var(--safe-b)); font-size: 12px; }
  .lightbox { padding: 52px 10px calc(64px + var(--safe-b)); }
}

@media (max-width: 380px) {
  .models { grid-template-columns: 1fr; }
  .msuf { margin-left: auto; }
  .results { grid-template-columns: 1fr; }
}

/* 横屏手机 */
@media (max-height: 500px) and (orientation: landscape) {
  .gate-card { padding: 20px 24px; }
  .gate-logo { width: 48px; height: 48px; }
  .gate-card h1 { font-size: 18px; margin-top: 10px; }
  .gate-sub { margin-bottom: 14px; }
}

/* 减弱动效 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .bg-sweep, .bg-particles { display: none; }
}

[hidden] { display: none !important; }
