/* Ai快创Pro Go 复刻版 —— 设计系统与页面样式 */
:root {
  --font: "Inter", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  --bg: #ffffff;
  --bg-muted: #f8fafc;
  --bg-elevated: rgba(241, 245, 249, 0.6);
  --bg-elevated-solid: #f1f5f9;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #334155;
  --text-strong: #0f172a;
  --text-muted: #64748b;
  --text-dim: #94a3b8;
  --primary: #3b82f6;
  --primary-600: #2563eb;
  --primary-soft: rgba(59, 130, 246, 0.1);
  --primary-ring: rgba(59, 130, 246, 0.18);
  --brand: #f97316;
  --danger: #ef4444;
  --success: #10b981;
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-sm: 0 2px 8px -2px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 12px 28px -12px rgba(15, 23, 42, 0.18);
  --shadow-lg: 0 26px 60px -24px rgba(15, 23, 42, 0.28);
  --rail-w: 72px;
  --header-h: 64px;
  --container: 1304px;
  /* 主内容区左右内边距，宽度随断点变化：hero 光晕的溢出量以此为上界 */
  --page-pad: 32px;
}

[data-theme="dark"] {
  --bg: #0b1220;
  --bg-muted: #0f172a;
  --bg-elevated: rgba(30, 41, 59, 0.55);
  --bg-elevated-solid: #1e293b;
  --border: #1e293b;
  --border-strong: #334155;
  --text: #cbd5e1;
  --text-strong: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --primary-soft: rgba(59, 130, 246, 0.16);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
/* 兜底：任何残留的横向溢出都不应该变成可拖动的空白。
   clip 不产生滚动容器，sticky 顶栏与侧栏不受影响；不支持的浏览器退回 hidden。 */
html { overflow-x: hidden; }
html, body { overflow-x: clip; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.hidden { display: none !important; }
.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.icon.chev { width: 14px; height: 14px; opacity: .6; }

/* ---------- 布局骨架 ---------- */
.app { display: flex; min-height: 100vh; }
.rail {
  width: var(--rail-w); flex: 0 0 var(--rail-w);
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; align-items: center;
  border-right: 1px solid var(--border);
  background: var(--bg-elevated);
  backdrop-filter: blur(8px);
  z-index: 40;
}
.rail-logo { height: var(--header-h); display: flex; align-items: center; justify-content: center; width: 100%; }
.rail-logo img { width: 32px; height: 32px; border-radius: 9px; object-fit: cover; }
.rail-nav { display: flex; flex-direction: column; gap: 4px; width: 100%; align-items: center; padding-top: 8px; overflow-y: auto; scrollbar-width: none; }
.rail-nav::-webkit-scrollbar { display: none; }
.rail-item {
  position: relative; width: 40px; height: 40px; margin: 0 auto;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px; color: var(--text-muted);
  transition: background .18s, color .18s, transform .18s;
}
.rail-item:hover { background: var(--bg-elevated-solid); color: var(--text-strong); }
.rail-item.active { background: var(--primary-soft); color: var(--primary); }
.rail-item .icon { width: 21px; height: 21px; }
.rail-item::after {
  content: attr(data-tip); position: absolute; left: calc(100% + 10px); top: 50%;
  transform: translateY(-50%) scale(.96); transform-origin: left center;
  background: #0f172a; color: #fff; padding: 5px 9px; border-radius: 6px;
  font-size: 12px; white-space: nowrap; opacity: 0; pointer-events: none;
  transition: opacity .15s, transform .15s; z-index: 60;
}
.rail-item:hover::after { opacity: 1; transform: translateY(-50%) scale(1); }
.rail-bottom { margin-top: auto; padding-bottom: 16px; display: flex; flex-direction: column; gap: 4px; width: 100%; align-items: center; }
.rail-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--bg-elevated-solid); display: flex; align-items: center; justify-content: center; color: var(--text-muted); }

.shell { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.header {
  height: var(--header-h); position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 10px;
  padding: 0 24px;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-spacer { flex: 1; }
.nav-toggle { display: inline-flex; color: var(--primary); }
.nav-toggle:hover { background: var(--primary-soft); color: var(--primary-600); }
.icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: block; }
body.rail-collapsed .rail { width: 0; flex-basis: 0; border-right: 0; overflow: hidden; }
body.rail-collapsed .rail > * { visibility: hidden; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-muted); transition: background .16s, color .16s;
  position: relative;
}
.icon-btn:hover { background: var(--bg-elevated-solid); color: var(--text-strong); }
.icon-btn .icon { width: 19px; height: 19px; }
.badge-btn .dot-badge {
  position: absolute; top: 1px; right: 1px; background: var(--danger); color: #fff;
  font-size: 10px; line-height: 1; min-width: 15px; height: 15px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center; padding: 0 3px; border: 2px solid var(--bg);
}
.credits-pill {
  display: inline-flex; align-items: center; gap: 5px; height: 36px; padding: 0 13px;
  border-radius: 999px; background: var(--primary-soft); color: var(--primary-600);
  font-size: 13px; font-weight: 500; transition: background .16s;
}
.credits-pill:hover { background: color-mix(in srgb, var(--primary) 16%, transparent); }
.credits-pill .icon { width: 16px; height: 16px; }
.credits-pill b { font-weight: 700; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 14px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500; white-space: nowrap;
  border: 1px solid transparent; transition: all .16s;
}
.btn .icon { width: 15px; height: 15px; }
.btn-outline { border-color: var(--border-strong); color: var(--text); background: var(--bg); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-primary-outline { border-color: color-mix(in srgb, var(--primary) 55%, white); color: var(--primary-600); background: var(--bg); }
.btn-primary-outline:hover { background: var(--primary-soft); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-600); }
.btn-light { background: #fff; color: #0f172a; }
.btn-light:hover { background: #eef2ff; }
.btn-ghost { color: var(--text-muted); }
.btn-ghost:hover { background: var(--bg-elevated-solid); color: var(--text-strong); }
.btn-block { width: 100%; height: 42px; }
.btn[disabled] { opacity: .55; pointer-events: none; }

.account { position: relative; }
.account-btn { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 8px; border-radius: 999px; border: 1px solid var(--border); }
.account-btn:hover { border-color: var(--primary); }
.avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.avatar .icon { width: 15px; height: 15px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.account-name { font-size: 13px; max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-pop {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 170px;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-md); padding: 6px; display: none; z-index: 50;
}
.account-pop.open { display: block; }
.account-pop a, .account-pop button {
  display: flex; align-items: center; gap: 9px; width: 100%; padding: 9px 10px;
  border-radius: 8px; font-size: 13px; color: var(--text); text-align: left;
}
.account-pop a:hover, .account-pop button:hover { background: var(--bg-elevated-solid); }
.account-pop .icon { width: 16px; height: 16px; color: var(--text-muted); }

.main { flex: 1; padding: 0 var(--page-pad); }
.container { max-width: var(--container); margin: 0 auto; }

/* ---------- Hero ---------- */
.hero {
  position: relative; max-width: var(--container); margin: 0 auto;
  padding: 32px 0 12px; display: flex; flex-direction: column; align-items: center; gap: 16px;
  text-align: center;
}
.hero::before {
  /* 横向溢出量不能超过主内容区的左右内边距，否则页面会出现横向滚动与右侧空白 */
  content: ""; position: absolute; inset: -64px max(-12vw, calc(-1 * var(--page-pad))) 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(52% 60% at 50% 34%, rgba(255, 214, 189, 0.55), transparent 72%),
    radial-gradient(38% 46% at 24% 18%, rgba(255, 236, 210, 0.65), transparent 72%),
    radial-gradient(40% 48% at 78% 12%, rgba(218, 232, 255, 0.6), transparent 72%),
    radial-gradient(30% 40% at 62% 46%, rgba(255, 228, 236, 0.5), transparent 75%),
    linear-gradient(180deg, #fffdf8 0%, rgba(255, 255, 255, 0) 78%);
}
[data-theme="dark"] .hero::before {
  background:
    radial-gradient(52% 60% at 50% 34%, rgba(37, 99, 235, 0.22), transparent 72%),
    radial-gradient(40% 48% at 78% 12%, rgba(14, 116, 144, 0.18), transparent 72%),
    linear-gradient(180deg, rgba(15, 23, 42, .7) 0%, transparent 78%);
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 14px;
  border-radius: 999px; background: rgba(255, 255, 255, 0.72);
  border: 1px solid color-mix(in srgb, var(--primary) 22%, white);
  color: var(--primary-600); font-size: 12.5px; font-weight: 500;
  box-shadow: 0 6px 16px -10px rgba(37, 99, 235, .45);
  backdrop-filter: blur(6px);
}
.hero-badge:hover { background: #fff; }
.hero-badge .icon { width: 15px; height: 15px; }
.hero-badge .ext { width: 12px; height: 12px; opacity: .6; }
.hero-title {
  margin: 2px 0 0; font-size: 40px; line-height: 1.16; letter-spacing: -0.5px;
  font-weight: 750; color: #0f172a; letter-spacing: .5px;
}
[data-theme="dark"] .hero-title { color: #f8fafc; }
.hero-sub { margin: 0; font-size: 15px; color: var(--text-muted); }
.hero-composer { position: relative; z-index: 25; width: 100%; display: flex; justify-content: center; margin-top: 8px; }

/* ---------- 创作输入面板 ---------- */
.composer {
  width: 848px; max-width: 100%;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #e9edf4;
  border-radius: var(--radius-xl);
  box-shadow: 0 26px 60px -34px rgba(15, 23, 42, 0.35), 0 2px 8px -4px rgba(15, 23, 42, .08);
  padding: 18px 20px 16px;
  text-align: left;
  transition: box-shadow .2s, border-color .2s;
  backdrop-filter: blur(10px);
}
[data-theme="dark"] .composer { background: rgba(15, 23, 42, .88); border-color: #1e293b; }
.composer:focus-within { border-color: color-mix(in srgb, var(--primary) 35%, var(--border)); box-shadow: 0 30px 70px -34px rgba(37, 99, 235, .38), 0 2px 8px -4px rgba(15, 23, 42, .08); }
.composer-tabs {
  display: inline-flex; gap: 2px; padding: 4px; border-radius: 12px;
  background: rgba(241, 245, 249, 0.7); border: 1px solid var(--border);
}
[data-theme="dark"] .composer-tabs { background: rgba(30, 41, 59, .7); }
.seg {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 13px;
  border-radius: 8px; font-size: 12.5px; font-weight: 500; color: var(--text-muted);
  transition: all .18s; white-space: nowrap; flex-shrink: 0;
}
.seg .icon { width: 15px; height: 15px; }
.seg.active { background: var(--primary); color: #fff; box-shadow: 0 6px 14px -8px rgba(37, 99, 235, .8); }
.composer-body { position: relative; }
.composer textarea {
  width: 100%; min-height: 92px; max-height: 240px; resize: none;
  background: transparent; border: 0; outline: none;
  padding: 14px 4px 8px; font-size: 14px; line-height: 1.6; color: var(--text-strong);
}
.composer textarea::placeholder { color: #9aa7ba; }
.composer-ref { display: flex; align-items: center; gap: 8px; padding: 0 4px 6px; }
.composer-ref img { width: 54px; height: 54px; border-radius: 8px; object-fit: cover; border: 1px solid var(--border); }
.ref-remove { width: 22px; height: 22px; border-radius: 50%; background: var(--bg-elevated-solid); display: flex; align-items: center; justify-content: center; }
.ref-remove .icon { width: 12px; height: 12px; }
.composer-toolbar { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; }
.toolbar-left { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.toolbar-right { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.tool-btn {
  width: 28px; height: 28px; border-radius: var(--radius-xs); display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); transition: all .16s;
}
.tool-btn:hover { background: var(--bg-elevated-solid); color: var(--text-strong); }
.tool-btn .icon { width: 17px; height: 17px; }
.pill-btn {
  display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px;
  border-radius: var(--radius-xs); background: var(--primary-soft); color: var(--primary-600);
  font-size: 12px; font-weight: 500; transition: background .16s; white-space: nowrap; flex-shrink: 0;
}
.pill-btn:hover { background: color-mix(in srgb, var(--primary) 18%, transparent); }
.pill-btn .icon { width: 14px; height: 14px; }
.select { position: relative; flex-shrink: 0; max-width: 100%; }
.select-btn {
  display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 9px;
  border-radius: var(--radius-xs); font-size: 12px; color: var(--text-muted);
  border: 1px solid transparent; transition: all .16s; max-width: 320px;
}
.select-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.select-btn:hover { background: var(--bg-elevated-solid); border-color: var(--border); color: var(--text-strong); }
.select-btn .icon:first-child { width: 14px; height: 14px; }
.select-pop {
  position: absolute; bottom: calc(100% + 8px); left: 0; min-width: 170px; max-height: 320px; overflow-y: auto;
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-md);
  padding: 5px; display: none; z-index: 300;
}
.select-pop.wide { min-width: 280px; }
.select-pop.open { display: block; }
.select-pop button { display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 7px; font-size: 12.5px; color: var(--text); white-space: nowrap; }
.select-pop button:hover { background: var(--bg-elevated-solid); }
.select-pop button.active { color: var(--primary); background: var(--primary-soft); }
.select-pop.format-pop {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%);
  right: auto; bottom: auto;
  width: min(420px, calc(100vw - 24px));
  max-height: min(80dvh, 640px); overflow-y: auto; padding: 16px;
  z-index: 500; box-shadow: var(--shadow-lg);
}
.format-pop fieldset { min-width: 0; margin: 0 0 14px; padding: 0; border: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.format-pop fieldset:last-child { margin-bottom: 0; }
.format-pop fieldset[hidden], .format-pop [hidden] { display: none; }
.format-pop legend { padding: 0; margin-bottom: 8px; color: var(--text-muted); }
.format-pop button { display: grid; justify-items: center; align-content: center; gap: 3px; min-height: 40px; padding: 6px 2px; text-align: center; border: 1px solid var(--border); }
.format-pop button.active { border-color: var(--primary); }
.format-pop .format-ratios button { min-height: 84px; }
.format-ratios i { height: 28px; max-width: 48px; border: 2px solid currentColor; border-radius: 4px; opacity: .75; }
.format-ratios small { color: var(--text-muted); }
.format-pop .format-count { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 768px) {
  .select[data-select="format"] { position: static; }
  .select-pop.format-pop {
    width: calc(100vw - 24px); max-height: 78dvh;
    z-index: 500;
  }
}
.counter { font-size: 11px; color: var(--text-dim); white-space: nowrap; }
.cost-hint { font-size: 12px; font-weight: 500; color: var(--primary-600); white-space: nowrap; }
.cost-hint { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; line-height: 1.3; white-space: nowrap; }
.cost-main { display: inline-flex; align-items: baseline; gap: 3px; }
.cost-hint b { font-weight: 700; font-size: 14px; }
.cost-hint [data-cost-detail] { color: var(--text-dim); font-weight: 400; font-size: 11px; }
.cost-sub { position: absolute; right: 19px; bottom: 1px; font-size: 10px; color: var(--text-dim); pointer-events: none; }
.composer { position: relative; z-index: 26; }
.send-btn {
  width: 32px; height: 32px; border-radius: 8px; background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  transition: background .16s, transform .16s; box-shadow: 0 8px 18px -10px rgba(37, 99, 235, .9);
}
.send-btn:hover { background: var(--primary-600); transform: translateY(-1px); }
.send-btn .icon { width: 17px; height: 17px; }
.send-btn.loading { animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .6; } }

.agent-chips { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 4px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 15px;
  border-radius: 999px; background: color-mix(in srgb, var(--bg) 82%, transparent);
  border: 1px solid var(--border);
  font-size: 13px; color: var(--text); backdrop-filter: blur(6px);
  box-shadow: 0 4px 14px -10px rgba(15, 23, 42, .3);
  transition: all .16s;
}
[data-theme="dark"] .chip { color: var(--text-strong); border-color: var(--border-strong); }
.chip:hover { border-color: color-mix(in srgb, var(--primary) 40%, var(--border)); color: var(--primary-600); transform: translateY(-1px); }
.chip .icon { width: 15px; height: 15px; color: var(--primary); }

/* ---------- 分类卡 ---------- */
.category-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 26px; }
.category-card {
  position: relative; height: 128px; border-radius: var(--radius-lg); overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 18px 20px; color: #fff; background: #0f172a; isolation: isolate;
}
.category-cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .5s; z-index: -2; }
.category-card:hover .category-cover { transform: scale(1.04); }
.category-shade { position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(8, 15, 30, .18) 0%, rgba(8, 15, 30, .62) 100%); }
.category-body { display: flex; flex-direction: column; justify-content: space-between; height: 100%; }
.category-body h3 { margin: 0; font-size: 17px; font-weight: 650; letter-spacing: .3px; text-shadow: 0 1px 8px rgba(0, 0, 0, .25); }
.category-body p { margin: 4px 0 0; font-size: 11.5px; opacity: .82; }
.category-enter { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; opacity: .85; }
.category-enter .icon { width: 12px; height: 12px; }

/* ---------- AI Agent + 工具 ---------- */
.split-section { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 22px; }
.agent-promo {
  position: relative; border-radius: var(--radius-lg); overflow: hidden;
  background:
    radial-gradient(70% 90% at 82% 12%, rgba(56, 132, 255, .55), transparent 62%),
    radial-gradient(60% 70% at 12% 90%, rgba(37, 99, 235, .35), transparent 60%),
    linear-gradient(135deg, #071127 0%, #0d1f46 55%, #122a5c 100%);
  color: #fff; padding: 26px 28px; min-height: 230px;
  display: flex; align-items: center;
  box-shadow: 0 22px 48px -26px rgba(8, 20, 52, .65);
}
.agent-promo::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, .09) 1px, transparent 1px);
  background-size: 22px 22px; opacity: .5;
}
.agent-promo-text { position: relative; z-index: 3; max-width: 62%; }
.tag-pill { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 6px; background: rgba(255, 255, 255, .14); font-size: 11px; letter-spacing: .5px; }
.agent-promo h2 { margin: 12px 0 10px; font-size: 22px; line-height: 1.32; font-weight: 700; }
.agent-promo p { margin: 0 0 16px; font-size: 12.5px; line-height: 1.7; color: rgba(226, 236, 255, .78); max-width: 300px; }
.agent-promo .btn { height: 34px; padding: 0 13px; font-size: 12.5px; border-radius: 8px; }
.agent-sub { display: inline-flex; align-items: center; gap: 5px; margin-left: 10px; font-size: 11.5px; color: rgba(200, 220, 255, .72); }
.agent-sub .icon { width: 13px; height: 13px; }
.agent-mascot { position: absolute; right: 16px; bottom: 0; height: 214px; z-index: 2; filter: drop-shadow(0 22px 28px rgba(8, 20, 52, .36)); }
.float-chip {
  position: absolute; z-index: 4; display: inline-flex; align-items: center; gap: 5px;
  height: 26px; padding: 0 10px; border-radius: 999px; font-size: 11px;
  background: rgba(255, 255, 255, .92); color: #0f172a; box-shadow: 0 10px 22px -12px rgba(0, 0, 0, .6);
  animation: floaty 5s ease-in-out infinite;
}
.float-chip .icon { width: 13px; height: 13px; color: var(--primary); }
.float-a { top: 20px; right: 27%; }
.float-b { bottom: 26px; right: 9%; animation-delay: 2.2s; }
@keyframes floaty { 50% { transform: translateY(-6px); } }

.tools-panel { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px 22px; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-head h2 { margin: 0; font-size: 16px; font-weight: 650; color: var(--text-strong); }
.panel-head p { margin: 3px 0 0; font-size: 12px; color: var(--text-muted); }
.link-arrow { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--primary-600); white-space: nowrap; }
.link-arrow .icon { width: 13px; height: 13px; }
.tool-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tool-card {
  display: flex; align-items: center; gap: 10px; padding: 12px 10px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg);
  transition: all .18s; min-width: 0;
}
.tool-card:hover { border-color: color-mix(in srgb, var(--primary) 35%, var(--border)); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.tool-icon { width: 36px; height: 36px; border-radius: 9px; object-fit: cover; flex-shrink: 0; }
.tool-text { min-width: 0; display: flex; flex-direction: column; }
.tool-text b { font-size: 12.5px; font-weight: 600; color: var(--text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tool-text span { font-size: 10.5px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 灵感广场 ---------- */
.gallery-section { margin-top: 34px; padding-bottom: 8px; }
.gallery-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.gallery-head h2 { margin: 0; font-size: 20px; font-weight: 700; color: var(--text-strong); }
.gallery-head p { margin: 4px 0 0; font-size: 12.5px; color: var(--text-muted); }
.gallery-tools { display: flex; align-items: center; gap: 10px; }
.search-box {
  display: flex; align-items: center; gap: 7px; height: 36px; width: 290px; max-width: 100%;
  padding: 0 12px; border-radius: var(--radius-sm); background: var(--bg-muted); border: 1px solid transparent;
  transition: all .16s;
}
.search-box:focus-within { background: var(--bg); border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
.search-box .icon { width: 16px; height: 16px; color: var(--text-dim); }
.search-box input { border: 0; outline: none; background: transparent; width: 100%; font-size: 13px; }
.gallery-filters { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 14px 0 16px; flex-wrap: wrap; }
.gallery-filters .select-btn { height: 32px; padding: 0 11px; border: 1px solid var(--border); background: var(--bg); border-radius: var(--radius-sm); color: var(--text); }
.gallery-filters .select-btn:hover { border-color: var(--primary); color: var(--primary); }
.gallery-tools .search-box { height: 34px; }
.filter-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-chips .seg { height: 30px; padding: 0 13px; border: 1px solid var(--border); background: var(--bg); }
.filter-chips .seg:hover { border-color: var(--primary); color: var(--primary); }
.filter-chips .seg.active { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: none; }
.filter-chips .seg.active:hover { color: #fff; }
.masonry { column-count: 6; column-gap: 16px; }
.masonry-item { break-inside: avoid; margin-bottom: 18px; cursor: pointer; }
.masonry-thumb { position: relative; border-radius: 10px; overflow: hidden; background: var(--bg-elevated-solid); border: 1px solid rgba(226, 232, 240, .5); }
.masonry-thumb img { width: 100%; display: block; transition: transform .35s; }
.masonry-item:hover .masonry-thumb img { transform: scale(1.03); }
.masonry-badge {
  position: absolute; top: 8px; left: 8px; max-width: 70%;
  background: rgba(15, 23, 42, .68); color: #fff; font-size: 10.5px; padding: 3px 8px;
  border-radius: 5px; backdrop-filter: blur(4px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.masonry-video {
  position: absolute; top: 8px; right: 8px; display: inline-flex; align-items: center; gap: 3px;
  background: rgba(59, 130, 246, .92); color: #fff; font-size: 10px; padding: 3px 7px; border-radius: 5px;
}
.masonry-video .icon { width: 10px; height: 10px; }
.masonry-actions { position: absolute; right: 8px; bottom: 8px; opacity: 0; transition: opacity .2s; display: flex; gap: 6px; }
.masonry-item:hover .masonry-actions { opacity: 1; }
.masonry-action {
  width: 28px; height: 28px; border-radius: 7px; background: rgba(15, 23, 42, .6); color: #fff;
  display: flex; align-items: center; justify-content: center; backdrop-filter: blur(4px);
}
.masonry-action .icon { width: 14px; height: 14px; }
.masonry-action.active { background: var(--primary); }
.masonry-title { margin: 8px 2px 2px; font-size: 13px; line-height: 1.45; color: var(--text-strong); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.masonry-meta { display: flex; align-items: center; gap: 4px; margin: 0 2px; font-size: 11px; color: var(--text-dim); white-space: nowrap; overflow: hidden; }
.masonry-meta > span, .masonry-meta > b { overflow: hidden; text-overflow: ellipsis; }
.masonry-meta > b { flex-shrink: 0; }
.masonry-meta b { color: var(--text-muted); font-weight: 500; }
.masonry-meta .icon { width: 12px; height: 12px; margin-left: auto; opacity: .55; }
.load-more-wrap { display: flex; justify-content: center; padding: 10px 0 26px; }
.loading-skeleton, .masonry .skeleton {
  height: 240px; border-radius: 10px; background: linear-gradient(100deg, var(--bg-muted) 30%, var(--bg-elevated-solid) 50%, var(--bg-muted) 70%);
  background-size: 300% 100%; animation: shimmer 1.4s infinite; break-inside: avoid;
}
@keyframes shimmer { 0% { background-position: 150% 0; } 100% { background-position: -150% 0; } }

/* ---------- 页脚 ---------- */
.footer { text-align: center; padding: 34px 0 30px; color: var(--text-dim); font-size: 11.5px; }
.footer p { margin: 3px 0; }
.footer-icp { opacity: .8; }

/* ---------- 弹窗 / 登录 ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center;
  background: rgba(15, 23, 42, .45); backdrop-filter: blur(6px); padding: 20px;
  animation: fadeIn .2s ease-out;
}
.modal-backdrop.hidden { display: none; }
@keyframes fadeIn { from { opacity: 0; } }
.auth-card {
  width: 400px; max-width: 100%; background: var(--bg); border-radius: 18px; padding: 26px 28px 22px;
  box-shadow: var(--shadow-lg); position: relative; animation: popIn .22s cubic-bezier(.22, 1, .36, 1);
}
@keyframes popIn { from { transform: translateY(10px) scale(.97); opacity: 0; } }
.modal-close { position: absolute; top: 14px; right: 14px; width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: var(--text-dim); }
.modal-close:hover { background: var(--bg-elevated-solid); color: var(--text-strong); }
.auth-head { text-align: center; }
.auth-logo img { width: 44px; height: 44px; border-radius: 12px; margin: 4px auto 10px; }
.auth-head h2 { margin: 0; font-size: 19px; font-weight: 700; color: var(--text-strong); }
.auth-head p { margin: 5px 0 0; font-size: 12px; color: var(--text-muted); }
.auth-tabs { display: flex; gap: 4px; padding: 4px; background: var(--bg-elevated-solid); border-radius: 10px; margin: 16px 0 14px; }
.auth-tabs .seg { flex: 1; justify-content: center; background: transparent; color: var(--text-muted); }
.auth-tabs .seg.active { background: var(--bg); color: var(--text-strong); box-shadow: var(--shadow-xs); }
.auth-form label { display: block; margin-bottom: 11px; font-size: 12px; color: var(--text-muted); }
.auth-form input {
  display: block; width: 100%; height: 40px; margin-top: 5px; padding: 0 12px;
  border-radius: 9px; border: 1px solid var(--border-strong); background: var(--bg); font-size: 13px; outline: none;
  transition: border-color .16s, box-shadow .16s;
}
.auth-form input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
.form-error { min-height: 16px; margin: 2px 0 8px; font-size: 12px; color: var(--danger); }
.auth-legal { margin: 12px 0 0; text-align: center; font-size: 11px; color: var(--text-dim); }

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  background: #0f172a; color: #fff; padding: 9px 16px; border-radius: 10px; font-size: 12.5px;
  box-shadow: var(--shadow-md); animation: toastIn .24s ease-out; max-width: 76vw;
}
.toast.err { background: #b91c1c; }
.toast.ok { background: #047857; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }

/* ---------- 生成结果 ---------- */
.result-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.result-card { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); background: var(--bg); }
.result-card img { width: 100%; display: block; }
.result-actions { display: flex; gap: 6px; padding: 8px; }
.task-line { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 10px; }
.task-line .bar { flex: 1; height: 6px; border-radius: 999px; background: var(--bg-elevated-solid); overflow: hidden; }
.task-line .bar i { display: block; height: 100%; background: var(--primary); border-radius: 999px; transition: width .4s; }

/* ---------- 页面通用 ---------- */
.page-head { max-width: var(--container); margin: 0 auto; padding: 30px 0 18px; }
.page-head h1 { margin: 0; font-size: 26px; font-weight: 750; color: var(--text-strong); letter-spacing: .3px; }
.page-head p { margin: 6px 0 0; color: var(--text-muted); font-size: 13px; }
.panel { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 26px 0 12px; }
.section-title h2 { margin: 0; font-size: 17px; font-weight: 650; color: var(--text-strong); }

/* ---------- 响应式 ---------- */
@media (max-width: 1280px) {
  .masonry { column-count: 5; }
}
@media (max-width: 1100px) {
  .masonry { column-count: 4; }
  .category-grid { grid-template-columns: repeat(2, 1fr); }
  .split-section { grid-template-columns: 1fr; }
  .hero-title { font-size: 34px; }
  .agent-mascot { height: 190px; }
}
@media (max-width: 1024px) {
  :root { --rail-w: 0px; --page-pad: 20px; }
  .rail {
    position: fixed; left: 0; top: 0; bottom: 0; width: 72px; flex-basis: 72px;
    transform: translateX(-100%); transition: transform .3s cubic-bezier(.22, 1, .36, 1);
    background: var(--bg); box-shadow: var(--shadow-lg);
  }
  .rail.open { transform: translateX(0); }
  .nav-toggle { display: inline-flex; }
  .main { padding: 0 var(--page-pad); }
  .hero { padding-top: 22px; }
  .hero-title { font-size: 30px; }
  .masonry { column-count: 4; }
  .tool-grid { grid-template-columns: repeat(2, 1fr); }
  .agent-promo-text { max-width: 66%; }
}
@media (max-width: 768px) {
  :root { --page-pad: 14px; }
  .header { padding: 0 14px; gap: 6px; }
  .header .btn-outline#loginBtn { height: 34px; padding: 0 10px; }
  .credits-pill { height: 34px; padding: 0 11px; }
  .btn-primary-outline { display: none; }
  .main { padding: 0 var(--page-pad); }
  .hero-title { font-size: 25px; letter-spacing: 0; }
  .hero-sub { font-size: 13px; padding: 0 8px; }
  .composer { padding: 14px 14px 12px; border-radius: 18px; }
  .composer textarea { min-height: 74px; font-size: 13.5px; }
  .toolbar-right { width: 100%; justify-content: flex-end; }
  .toolbar-left { width: 100%; flex-wrap: wrap; overflow: visible; gap: 4px; }
  .toolbar-left .select-btn span { max-width: 108px; }
  .toolbar-right { width: 100%; justify-content: flex-end; flex-wrap: wrap; }
  .toolbar-right .select-btn span { max-width: 210px; }
  .cost-sub { display: none; }
  .category-grid { gap: 10px; margin-top: 18px; }
  .category-card { height: 108px; padding: 13px 14px; }
  .category-body h3 { font-size: 15px; }
  .masonry { column-count: 2; column-gap: 10px; }
  .masonry-item { margin-bottom: 12px; }
  .search-box { width: 100%; }
  .gallery-tools { width: 100%; }
  .gallery-tools .btn { display: none; }
  .tool-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .tool-card { flex-direction: column; text-align: center; gap: 6px; padding: 10px 6px; }
  .tool-text span { display: none; }
  .tool-text b { font-size: 11.5px; white-space: normal; }
  .agent-promo { padding: 20px; min-height: 210px; }
  .agent-promo h2 { font-size: 19px; }
  .agent-mascot { height: 160px; right: 4px; opacity: .95; }
  .agent-promo-text { max-width: 72%; }
  .float-chip { display: none; }
  .footer { padding: 24px 0; }
  .auth-card { padding: 22px 20px 18px; }
}
@media (max-width: 480px) {
  .hero-title { font-size: 22px; }
  .agent-chips { gap: 6px; }
  .chip { height: 30px; padding: 0 11px; font-size: 12px; }
  .masonry { column-count: 2; }
  .masonry-title { font-size: 12px; }
  .masonry-meta { font-size: 10px; }
  .counter { display: none; }
  .toolbar-right { justify-content: flex-end; gap: 10px; }
  .cost-hint { margin-left: auto; }
  .cost-hint [data-cost-detail] { display: none; }
}
/* 极窄屏（≤380px）收紧顶栏，避免一行放不下而被横向裁切 */
@media (max-width: 380px) {
  .header { gap: 4px; padding: 0 10px; }
  .credits-pill { padding: 0 9px; }
  .credits-pill span { display: none; }
  .header #loginBtn { padding: 0 8px; }
}

/* 生成框右侧在中等宽度下只保留总额 */
@media (max-width: 1100px) {
  .composer .cost-hint [data-cost-detail] { display: none; }
  .composer .counter { display: none; }
}

/* ---------- 空状态 ---------- */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 44px 24px; text-align: center; }
.empty-icon { width: 56px; height: 56px; border-radius: 18px; display: flex; align-items: center; justify-content: center; background: var(--primary-soft); color: var(--primary); }
.empty-icon .icon { width: 26px; height: 26px; }
.empty-state h3 { margin: 2px 0 0; font-size: 15px; font-weight: 650; color: var(--text-strong); }
.empty-state p { margin: 0; font-size: 12.5px; color: var(--text-muted); max-width: 360px; line-height: 1.6; }
.empty-state .btn { margin-top: 6px; }

/* ---------- 骨架屏 ---------- */
.skeleton-block { border-radius: var(--radius-sm); background: linear-gradient(100deg, var(--bg-muted) 30%, var(--bg-elevated-solid) 50%, var(--bg-muted) 70%); background-size: 300% 100%; animation: shimmer 1.4s infinite; }
.skeleton-card { break-inside: avoid; margin-bottom: 18px; }
.skeleton-thumb { width: 100%; border-radius: 10px; }
.skeleton-line { height: 12px; margin-top: 8px; border-radius: 6px; }
.skeleton-line.short { width: 55%; }

/* ---------- 按钮加载态 ---------- */
.btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-loading::after {
  content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff;
  animation: btn-spin .7s linear infinite;
}
.btn-outline.is-loading::after { border-color: var(--border-strong); border-top-color: var(--primary); }
@keyframes btn-spin { to { transform: rotate(360deg); } }

/* ---------- 弹窗打开时锁定背景滚动 ---------- */
body.modal-open { overflow: hidden; }

/* 表单错误提示 */
.form-error { display: flex; align-items: center; gap: 6px; }
.form-error:not(:empty)::before { content: "!"; flex: 0 0 16px; width: 16px; height: 16px; border-radius: 50%; background: var(--danger); color: #fff; font-size: 11px; display: inline-flex; align-items: center; justify-content: center; }
.shake { animation: shake .32s ease-in-out; }
@keyframes shake { 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }
