/* ===== Star AI - Design System ===== */
:root {
  --bg-0: #07060f;
  --bg-1: #0e0a1f;
  --bg-2: #15102b;
  --bg-3: #1c1638;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #ece9ff;
  --text-dim: #9892bd;
  --text-mute: #6a6489;
  --primary: #a855f7;
  --primary-2: #6366f1;
  --primary-3: #ec4899;
  --gradient: linear-gradient(135deg, #a855f7 0%, #6366f1 60%, #ec4899 100%);
  --gradient-hover: linear-gradient(135deg, #b969ff 0%, #7782ff 60%, #ff5dac 100%);
  --bubble-user: linear-gradient(135deg, #6366f1, #a855f7);
  --shadow-glow: 0 10px 40px -10px rgba(168, 85, 247, 0.55);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  font-family: "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont,
               "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(168, 85, 247, 0.18), transparent 60%),
    radial-gradient(900px 500px at -10% 30%, rgba(99, 102, 241, 0.18), transparent 60%),
    radial-gradient(900px 500px at 50% 110%, rgba(236, 72, 153, 0.12), transparent 60%),
    var(--bg-0);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
}
html { height: 100%; }
body { min-height: 100%; }

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select { font-family: inherit; color: inherit; outline: none; border: none; background: none; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* ====== Buttons ====== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.btn-primary {
  background: var(--gradient);
  color: #fff;
  box-shadow: var(--shadow-glow);
}
.btn-primary:hover { background: var(--gradient-hover); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-primary.big { padding: 14px 36px; font-size: 15px; }
.btn-ghost {
  padding: 8px 16px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 13px;
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.08); }

/* ====== Brand ====== */
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo {
  width: 32px; height: 32px; border-radius: 9px;
  background: var(--gradient);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  box-shadow: 0 4px 14px -4px rgba(168, 85, 247, 0.7);
}
.brand-logo.small { width: 24px; height: 24px; border-radius: 7px; }
.brand-name { font-weight: 700; font-size: 16px; letter-spacing: 0.3px; }

/* ====== HERO ====== */
.hero-section { padding: 60px 64px 40px; }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(360px, 0.85fr) 1.4fr;
  gap: 56px;
  align-items: stretch;
  max-width: 1480px;
  margin: 0 auto;
}

.hero-copy { padding: 24px 0; display: flex; flex-direction: column; gap: 28px; }
.hero-copy h1 {
  font-size: 60px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -1px;
}
.hero-copy h1 .accent {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-copy .lead {
  color: var(--text-dim);
  font-size: 16px;
  line-height: 1.7;
}
.hero-copy .btn-primary.big { align-self: flex-start; }

.social-proof {
  display: flex; align-items: center; gap: 12px;
  color: var(--text-mute); font-size: 13px;
}
.avatars { display: flex; }
.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid var(--bg-0);
  background: linear-gradient(135deg, #a855f7, #6366f1);
}
.avatar + .avatar { margin-left: -10px; }
.avatar.a1 { background: linear-gradient(135deg, #f472b6, #a855f7); }
.avatar.a2 { background: linear-gradient(135deg, #6366f1, #22d3ee); }
.avatar.a3 { background: linear-gradient(135deg, #fbbf24, #ef4444); }
.avatar.a-user {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, #f472b6, #a855f7);
}
.avatar.a-user.small { width: 32px; height: 32px; }

/* ====== CHAT PANEL ====== */
.chat-panel {
  display: grid;
  grid-template-columns: clamp(180px, 20vw, 240px) 1fr;
  background: rgba(20, 16, 41, 0.7);
  border: 1px solid var(--line);
  border-radius: 24px;
  overflow: hidden;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 24px 80px -20px rgba(0, 0, 0, 0.5);
  height: clamp(520px, 70vh, 720px);
  min-width: 0;
}

/* sidebar */
.chat-sidebar {
  background: rgba(10, 8, 24, 0.7);
  border-right: 1px solid var(--line);
  padding: 18px 14px;
  display: flex; flex-direction: column;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 14px;
  padding: 6px 4px 14px;
}
.new-chat {
  width: 100%;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 14px;
}
.new-chat .plus { font-size: 16px; line-height: 1; margin-right: 2px; }

.nav-list { display: flex; flex-direction: column; gap: 2px; }
.nav-list.bottom { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.nav-list li {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 13px;
  color: var(--text-dim);
  cursor: pointer;
  transition: background 0.15s;
}
.nav-list li:hover { background: rgba(255, 255, 255, 0.04); color: var(--text); }
.nav-list li.active {
  background: rgba(168, 85, 247, 0.12);
  color: #fff;
  font-weight: 500;
}

.user-card {
  margin-top: 14px;
  display: flex; align-items: center; gap: 10px;
  padding: 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
}
.user-card .meta { flex: 1; min-width: 0; }
.user-card .name { font-size: 13px; font-weight: 600; }
.user-card .badge {
  display: inline-block; margin-top: 2px;
  font-size: 10px; font-weight: 700;
  padding: 1px 6px; border-radius: 4px;
  background: var(--gradient); color: #fff;
}

/* chat main */
.chat-main { display: flex; flex-direction: column; min-width: 0; }
.chat-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
}
.chat-header .title { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.chat-header .actions { display: flex; gap: 6px; }
.icon-btn {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-dim);
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.06); color: var(--text); }

.chat-stream {
  flex: 1; overflow-y: auto;
  padding: 22px;
  display: flex; flex-direction: column; gap: 18px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.15) transparent;
}
.chat-stream::-webkit-scrollbar { width: 6px; }
.chat-stream::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 4px; }

.msg { display: flex; gap: 10px; align-items: flex-start; max-width: 90%; }
.msg-user { margin-left: auto; flex-direction: row-reverse; }
.msg .bubble {
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14px; line-height: 1.6;
  word-break: break-word;
}
.msg-user .bubble {
  background: var(--bubble-user);
  color: #fff;
  border-top-right-radius: 4px;
}
.msg-ai .bubble {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  border-top-left-radius: 4px;
}
.msg-ai.welcome .bubble { background: rgba(168, 85, 247, 0.08); }

.msg .avatar-tag {
  width: 32px; height: 32px; border-radius: 9px; flex-shrink: 0;
  background: var(--gradient);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
}
.msg-user .avatar-tag { background: linear-gradient(135deg, #f472b6, #a855f7); }

/* image grid in messages */
.gen-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.gen-grid img {
  width: 100%; aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 10px;
  cursor: zoom-in;
  background: rgba(255, 255, 255, 0.05);
  transition: transform 0.2s;
}
.gen-grid img:hover { transform: scale(1.02); }

/* skeleton placeholders while loading */
.gen-grid.loading img {
  background: linear-gradient(110deg, rgba(255,255,255,0.06) 30%, rgba(255,255,255,0.12) 50%, rgba(255,255,255,0.06) 70%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.chip-row {
  display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px;
}
.chip {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  color: var(--text-dim);
  cursor: pointer;
}
.chip:hover { background: rgba(168, 85, 247, 0.12); color: #fff; border-color: rgba(168, 85, 247, 0.4); }

.msg-meta {
  display: flex; align-items: center; gap: 10px; margin-top: 8px;
  color: var(--text-mute); font-size: 12px;
}

/* input bar */
.chat-input-bar { padding: 14px 22px 18px; border-top: 1px solid var(--line); }
.input-wrap {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 6px 6px 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  border-radius: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input-wrap:focus-within {
  border-color: rgba(168, 85, 247, 0.55);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.15);
}
#promptInput {
  flex: 1;
  font-size: 14px;
  padding: 10px 0;
  min-width: 0;
}
#promptInput::placeholder { color: var(--text-mute); }
.input-tools { display: flex; align-items: center; gap: 6px; }
.input-tools select {
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
  color: var(--text-dim);
}
.input-tools select option { background: var(--bg-2); color: var(--text); }
.send-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--gradient);
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff;
  box-shadow: 0 6px 18px -4px rgba(168, 85, 247, 0.6);
  transition: transform 0.15s, opacity 0.15s;
}
.send-btn:hover { transform: scale(1.06); }
.send-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ====== EXPLORE ====== */
.explore {
  margin: 32px 24px 64px;
  padding: 28px 36px 40px;
  background: rgba(20, 16, 41, 0.5);
  border: 1px solid var(--line);
  border-radius: 24px;
  backdrop-filter: blur(20px);
}
.explore-header {
  display: flex; align-items: center; gap: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.top-nav { display: flex; gap: 24px; flex: 1; justify-content: center; }
.top-nav a {
  font-size: 14px; color: var(--text-dim);
  padding: 6px 4px;
  position: relative;
}
.top-nav a:hover { color: var(--text); }
.top-nav a.active { color: var(--text); font-weight: 500; }
.top-nav a.active::after {
  content: ""; position: absolute;
  left: 0; right: 0; bottom: -8px;
  height: 2px; border-radius: 2px;
  background: var(--gradient);
}
.top-actions { display: flex; align-items: center; gap: 10px; }

.explore-title { text-align: center; margin: 32px 0 24px; }
.explore-title h2 { font-size: 30px; font-weight: 800; }
.explore-title p { margin-top: 8px; color: var(--text-dim); font-size: 14px; }

.cat-tabs {
  display: flex; justify-content: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 24px;
}
.cat-tabs button {
  padding: 7px 18px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--text-dim);
  border: 1px solid transparent;
  transition: all 0.15s;
}
.cat-tabs button:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.cat-tabs button.active {
  background: var(--gradient); color: #fff;
  box-shadow: 0 6px 18px -6px rgba(168, 85, 247, 0.6);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
}
.gallery .card {
  border-radius: 14px;
  overflow: hidden;
  background: var(--bg-2);
  aspect-ratio: 3 / 4;
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s;
}
.gallery .card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 36px -10px rgba(168, 85, 247, 0.4);
}
.gallery .card img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}

/* ====== Icon system (CSS-only) ====== */
[data-icon] {
  display: inline-block; width: 16px; height: 16px;
  background: currentColor;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: center; mask-position: center;
  -webkit-mask-size: contain; mask-size: contain;
  flex-shrink: 0;
}
[data-icon="chat"]    { --svg: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z'/></svg>"); -webkit-mask-image: var(--svg); mask-image: var(--svg); }
[data-icon="compass"] { --svg: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='10'/><polygon points='16.24 7.76 14.12 14.12 7.76 16.24 9.88 9.88 16.24 7.76'/></svg>"); -webkit-mask-image: var(--svg); mask-image: var(--svg); }
[data-icon="image"]   { --svg: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='3' width='18' height='18' rx='2'/><circle cx='8.5' cy='8.5' r='1.5'/><polyline points='21 15 16 10 5 21'/></svg>"); -webkit-mask-image: var(--svg); mask-image: var(--svg); }
[data-icon="star"]    { --svg: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polygon points='12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2'/></svg>"); -webkit-mask-image: var(--svg); mask-image: var(--svg); }
[data-icon="help"]    { --svg: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='10'/><path d='M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3'/><line x1='12' y1='17' x2='12.01' y2='17'/></svg>"); -webkit-mask-image: var(--svg); mask-image: var(--svg); }
[data-icon="settings"]{ --svg: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='3'/><path d='M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z'/></svg>"); -webkit-mask-image: var(--svg); mask-image: var(--svg); }
[data-icon="hash"]    { --svg: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><line x1='4' y1='9' x2='20' y2='9'/><line x1='4' y1='15' x2='20' y2='15'/><line x1='10' y1='3' x2='8' y2='21'/><line x1='16' y1='3' x2='14' y2='21'/></svg>"); -webkit-mask-image: var(--svg); mask-image: var(--svg); }
[data-icon="more"]    { --svg: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='1'/><circle cx='19' cy='12' r='1'/><circle cx='5' cy='12' r='1'/></svg>"); -webkit-mask-image: var(--svg); mask-image: var(--svg); }
[data-icon="chevron"] { --svg: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='9 18 15 12 9 6'/></svg>"); -webkit-mask-image: var(--svg); mask-image: var(--svg); width: 14px; height: 14px; color: var(--text-mute); }

/* ====== 返回按钮 ====== */
.back-btn {
  margin-right: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ====== 模型徽章 ====== */
.model-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: var(--gradient);
  color: #fff;
  letter-spacing: 0.3px;
  box-shadow: 0 4px 12px -4px rgba(168, 85, 247, 0.55);
}

/* ====== 独立对话页 (chat.html) ======
   策略：用 flex 取代 grid（更稳的高度填充）；
   100dvh 适配移动端浏览器地址栏；
   侧边栏宽度用 clamp 弹性缩放；
   不使用 position:fixed，避免移动端键盘弹起遮挡输入框。 */
html:has(body.page-chat) { height: 100%; overflow: hidden; }
body.page-chat {
  height: 100vh;       /* fallback */
  height: 100dvh;
  width: 100%;
  margin: 0;
  overflow: hidden;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(168, 85, 247, 0.18), transparent 60%),
    radial-gradient(900px 500px at -10% 30%, rgba(99, 102, 241, 0.18), transparent 60%),
    var(--bg-0);
}

/* 用 !important 防止 .chat-panel 的媒体查询规则覆盖 */
.chat-panel.chat-fullpage {
  position: relative;
  inset: auto;
  display: flex !important;       /* 覆盖 .chat-panel 的 grid */
  flex: 1 1 auto;
  flex-direction: row;
  width: 100%;
  height: 100% !important;
  min-height: 100%;
  border-radius: 0 !important;
  border: none !important;
  box-shadow: none !important;
  background: rgba(20, 16, 41, 0.85);
}
.chat-panel.chat-fullpage > .chat-sidebar {
  flex: 0 0 clamp(220px, 22vw, 280px);
  width: clamp(220px, 22vw, 280px);
  height: 100%;
}
.chat-panel.chat-fullpage > .chat-main {
  flex: 1 1 auto;
  height: 100%;
  min-width: 0;       /* 允许内部 flex 子项压缩 */
}

/* 平板：缩窄侧边栏 */
@media (max-width: 1024px) {
  .chat-panel.chat-fullpage > .chat-sidebar {
    flex-basis: clamp(180px, 24vw, 220px);
    width: clamp(180px, 24vw, 220px);
  }
}

/* 平板竖屏 / 小笔记本：进一步紧凑 */
@media (max-width: 900px) {
  .chat-panel.chat-fullpage > .chat-sidebar {
    flex-basis: 200px;
    width: 200px;
  }
}

/* 手机：侧边栏改为右侧滑出抽屉 */
@media (max-width: 720px) {
  .chat-panel.chat-fullpage { flex-direction: column; }

  /* 桌面专属元素隐藏，移动专属元素显示 */
  .desktop-only { display: none !important; }
  .mobile-only  { display: inline-flex !important; }

  body.page-chat .chat-sidebar {
    display: flex;
    position: fixed;
    top: 0; right: 0; left: auto;
    width: min(86vw, 320px);
    height: 100dvh;
    max-height: none;
    z-index: 1100;
    transform: translateX(100%);                  /* 右侧滑出 */
    transition: transform .28s cubic-bezier(.2,.8,.2,1);
    box-shadow: -8px 0 30px rgba(0,0,0,.5);       /* 阴影改到左边 */
    border-right: 0;
    border-left: 1px solid var(--line);
  }
  body.page-chat .chat-sidebar.is-open { transform: translateX(0); }

  body.page-chat .chat-sidebar .conv-list { max-height: none; flex: 1; overflow-y: auto; }

  .sidebar-backdrop {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 1099;
    animation: fadeIn .2s ease;
  }
  @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

  .chat-panel.chat-fullpage .chat-header  { padding: 12px 14px; }
  .chat-panel.chat-fullpage .chat-stream  { padding: 14px; }
  .chat-panel.chat-fullpage .chat-input-bar { padding: 10px 12px 14px; }
  .model-badge { display: none; }
  .chat-header .actions { gap: 2px; }
  .input-tools select { padding: 5px 8px; font-size: 11px; }
}

/* 桌面：隐藏移动专属按钮 + 遮罩 */
@media (min-width: 721px) {
  .mobile-only { display: none !important; }
  .sidebar-backdrop { display: none !important; }
}

/* 抽屉切换按钮：图标切换（更多 ⋯ ↔ 关闭 ×） */
.drawer-toggle .ico-close { display: none; }
.drawer-toggle.is-open .ico-more { display: none; }
.drawer-toggle.is-open .ico-close { display: inline-block; }
.drawer-toggle.is-open {
  background: rgba(168, 85, 247, 0.15);
  color: #d4b4ff;
}

/* ============================================================
   创作页 · 欢迎气泡 + 提示词 chips
   ============================================================ */
.welcome .bubble { line-height: 1.7; }
.prompt-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.prompt-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(168, 85, 247, 0.12);
  border: 1px solid rgba(168, 85, 247, 0.3);
  color: #d4b4ff;
  font-size: 13px;
  cursor: pointer;
  transition: all .15s;
  font-family: inherit;
}
.prompt-chip:hover {
  background: rgba(168, 85, 247, 0.25);
  border-color: rgba(168, 85, 247, 0.6);
  color: #fff;
  transform: translateY(-1px);
}
.welcome-tip {
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-mute, #a1a1aa);
  opacity: .8;
}

/* 极小屏（≤420）：简化输入工具 */
@media (max-width: 420px) {
  .input-tools select { display: none; }
  .input-wrap { padding: 4px 4px 4px 14px; }
  #promptInput { padding: 8px 0; font-size: 13px; }
}

/* 让对话主区在小屏上输入工具按需换行 */
.input-tools { flex-wrap: wrap; justify-content: flex-end; }

/* ============================================================
   AUTH 页（login.html / register.html）
   ============================================================ */
body.page-auth {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}
.auth-home {
  position: fixed; top: 20px; left: 24px;
  color: var(--text-mute);
  font-size: 14px;
  text-decoration: none;
  z-index: 5;
}
.auth-home:hover { color: #fff; }

.auth-card {
  width: 100%;
  max-width: 440px;
  background: rgba(20, 16, 41, 0.85);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 40px 36px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 24px 80px -20px rgba(0,0,0,.55);
}
.auth-brand { text-align: center; margin-bottom: 28px; }
.auth-brand .brand-logo {
  width: 56px; height: 56px;
  background: var(--gradient);
  border-radius: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff;
  margin-bottom: 14px;
}
.auth-brand h1 { font-size: 22px; margin: 0 0 4px; }
.auth-sub { color: var(--text-mute); font-size: 13px; margin: 0; }

.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-mute); }
.auth-form input {
  width: 100%;
  padding: 12px 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: #fff;
  font-size: 14px;
  transition: border-color .15s, background .15s;
}
.auth-form input:focus {
  border-color: rgba(168, 85, 247, 0.6);
  background: rgba(255,255,255,0.06);
}
.auth-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.auth-row input { flex: 1; }
.btn-code {
  flex: 0 0 120px;
  padding: 10px 14px;
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.4);
  border-radius: 10px;
  color: #d4b4ff;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}
.btn-code:hover:not(:disabled) { background: rgba(168, 85, 247, 0.25); }
.btn-code:disabled { opacity: .55; cursor: not-allowed; }

.auth-msg {
  font-size: 13px;
  min-height: 18px;
  padding: 8px 0;
  color: var(--text-mute);
}
.auth-msg.is-error   { color: #ef4444; }
.auth-msg.is-success { color: #10b981; }

.auth-submit { width: 100%; justify-content: center; }
.auth-submit:disabled { opacity: .65; cursor: not-allowed; }

.auth-foot {
  text-align: center;
  font-size: 13px;
  color: var(--text-mute);
  margin: 14px 0 0;
}
.auth-foot a { color: #c084fc; text-decoration: none; font-weight: 500; }
.auth-foot a:hover { color: #d4b4ff; }

@media (max-width: 480px) {
  .auth-card { padding: 28px 22px; }
  .auth-brand h1 { font-size: 19px; }
  .btn-code { flex-basis: 100px; font-size: 12px; }
}

/* ============================================================
   顶部 nav：用户徽章 / 额度徽章
   ============================================================ */
.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 4px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--line);
  border-radius: 999px;
  text-decoration: none;
  color: var(--text);
  font-size: 13px;
  transition: background .15s;
}
.user-pill:hover { background: rgba(255,255,255,0.08); }
.user-pill .u-name {
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-pill .u-credit {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: var(--gradient);
  color: #fff;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}
.user-pill .u-credit::before { content: '⚡'; font-size: 11px; }
.auth-slot { display: inline-flex; align-items: center; gap: 8px; }

.credit-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(34, 197, 94, 0.18);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.35);
}

/* ============================================================
   我的作品页（my-works.html）
   ============================================================ */
body.page-works {
  min-height: 100vh;
  min-height: 100dvh;
}
.works-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  background: rgba(20, 16, 41, 0.6);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand-link { text-decoration: none; color: inherit; display: inline-flex; align-items: center; gap: 8px; }
.works-nav { display: flex; align-items: center; gap: 14px; font-size: 14px; }
.works-nav a { color: var(--text-mute); text-decoration: none; }
.works-nav a:hover { color: #fff; }
.works-nav .user-info { color: #c084fc; font-weight: 500; }

.works-main { max-width: 1280px; margin: 0 auto; padding: 32px 24px 80px; }
.works-header { margin-bottom: 24px; }
.works-header h1 { font-size: 28px; margin: 0 0 6px; }
.works-stat { color: var(--text-mute); font-size: 14px; margin: 0; }

.works-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}
.works-card {
  background: rgba(20, 16, 41, 0.6);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  transition: transform .2s, border-color .2s;
}
.works-card:hover { transform: translateY(-2px); border-color: rgba(168, 85, 247, 0.4); }
.works-thumb { aspect-ratio: 1; background: #0a0818; overflow: hidden; }
.works-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  cursor: zoom-in;
  display: block;
}
.works-meta { padding: 12px 14px; }
.works-prompt {
  font-size: 13px;
  margin: 0 0 6px;
  color: #ddd;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.works-info {
  display: flex; justify-content: space-between;
  font-size: 11px; color: var(--text-mute);
}
.works-loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-mute);
}
.works-empty {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-mute);
}
.works-empty a { color: #c084fc; }
.works-pager { display: flex; gap: 6px; justify-content: center; margin-top: 32px; flex-wrap: wrap; }
.pager-btn {
  min-width: 36px; padding: 6px 12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}
.pager-btn:hover { background: rgba(255,255,255,0.1); }
.pager-btn.active { background: var(--gradient); border-color: transparent; color: #fff; }

@media (max-width: 720px) {
  .works-topbar { padding: 12px 16px; flex-wrap: wrap; gap: 12px; }
  .works-nav { font-size: 13px; gap: 10px; }
  .works-nav .user-info { display: none; }
  .works-main { padding: 20px 14px 60px; }
  .works-header h1 { font-size: 22px; }
  .works-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
}

/* ====== Lightbox ====== */
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0, 0, 0, 0.85);
  display: flex; align-items: center; justify-content: center;
  padding: 40px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
}
.lightbox.show { opacity: 1; pointer-events: auto; }

/* ============================================================
   定价页 pricing.html
   ============================================================ */
body.page-pricing { min-height: 100vh; min-height: 100dvh; }
.pricing-main { max-width: 1100px; margin: 0 auto; padding: 48px 24px 80px; }
.pricing-hero { text-align: center; margin-bottom: 40px; }
.pricing-hero h1 { font-size: 32px; margin: 0 0 10px; }
.pricing-rate { color: var(--text-mute); font-size: 15px; margin: 0; }
.pricing-rate b { color: #c084fc; }

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 48px;
}
.pricing-card {
  position: relative;
  background: rgba(20, 16, 41, 0.6);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px 22px 24px;
  text-align: center;
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
.pricing-card:hover {
  transform: translateY(-4px);
  border-color: rgba(168, 85, 247, 0.5);
  box-shadow: 0 12px 36px -12px rgba(168, 85, 247, 0.4);
}
.pricing-card.is-popular {
  border-color: rgba(168, 85, 247, 0.55);
  background: linear-gradient(180deg, rgba(168, 85, 247, 0.12), rgba(20, 16, 41, 0.7));
}
.pop-badge {
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  background: var(--gradient); color: #fff;
  padding: 3px 12px; border-radius: 999px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.5px;
}
.pkg-label { font-size: 14px; color: var(--text-mute); margin-bottom: 10px; }
.pkg-price { font-size: 38px; font-weight: 700; color: #fff; line-height: 1; margin-bottom: 6px; }
.pkg-price .cny { font-size: 18px; color: var(--text-mute); margin-right: 4px; }
.pkg-credits { font-size: 16px; color: #c084fc; font-weight: 500; margin-bottom: 8px; }
.pkg-tag {
  font-size: 12px; color: #4ade80;
  min-height: 18px; margin-bottom: 18px;
}
.pkg-buy { width: 100%; justify-content: center; }

.pricing-custom {
  background: rgba(20, 16, 41, 0.5);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px 28px;
}
.pricing-custom h3 { font-size: 18px; margin: 0 0 14px; }
.custom-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.custom-row input {
  flex: 1; min-width: 160px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: #fff;
  font-size: 15px;
}
.custom-eq { color: #c084fc; font-size: 14px; min-width: 80px; }

@media (max-width: 720px) {
  .pricing-main { padding: 28px 16px 60px; }
  .pricing-hero h1 { font-size: 24px; }
  .pricing-grid { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
  .pkg-price { font-size: 30px; }
  .pricing-custom { padding: 18px; }
  .custom-row { flex-direction: column; align-items: stretch; }
  .custom-row input { width: 100%; }
}

/* ============================================================
   订单创建弹窗
   ============================================================ */
.order-modal {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0, 0, 0, 0.7);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
}
.order-modal.show { opacity: 1; pointer-events: auto; }
.order-card {
  width: 100%; max-width: 460px;
  background: rgba(20, 16, 41, 0.96);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 32px 28px;
  backdrop-filter: blur(20px);
}
.order-card h2 { font-size: 22px; margin: 0 0 18px; text-align: center; }
.order-info {
  background: rgba(255,255,255,0.03);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 16px;
  font-size: 14px;
}
.order-info > div {
  display: flex; justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px dashed rgba(255,255,255,0.06);
}
.order-info > div:last-child { border-bottom: none; }
.order-info span { color: var(--text-mute); }
.order-info b { color: #fff; word-break: break-all; text-align: right; }
.status-pending { color: #fbbf24 !important; }

.order-pay {
  background: rgba(168, 85, 247, 0.08);
  border: 1px solid rgba(168, 85, 247, 0.25);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 18px;
  font-size: 13px;
  line-height: 1.7;
}
.order-pay p { margin: 0; }
.pay-remark { color: var(--text-mute); margin-top: 6px !important; font-size: 12px; }

.order-actions { display: flex; gap: 10px; justify-content: flex-end; }
.order-actions .btn-ghost,
.order-actions .btn-primary { padding: 8px 16px; font-size: 14px; }

/* ============================================================
   侧栏 · 历史对话列表
   ============================================================ */
.conv-section {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin-top: 8px;
  overflow: hidden;
}
.conv-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px 6px;
  font-size: 11px;
  color: var(--text-mute);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.conv-refresh {
  background: transparent;
  border: none;
  color: var(--text-mute);
  cursor: pointer;
  font-size: 14px;
  padding: 0 4px;
  line-height: 1;
  border-radius: 4px;
}
.conv-refresh:hover { color: #fff; background: rgba(255,255,255,0.06); }

.conv-list {
  list-style: none;
  margin: 0;
  padding: 0 6px;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
}
.conv-list::-webkit-scrollbar { width: 6px; }
.conv-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 3px; }

.conv-empty {
  padding: 14px 12px;
  font-size: 12px;
  color: var(--text-mute);
  text-align: center;
}
.conv-item {
  position: relative;
  padding: 8px 10px 8px 12px;
  margin-bottom: 2px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .12s;
}
.conv-item:hover { background: rgba(255,255,255,0.05); }
.conv-item.active {
  background: rgba(168, 85, 247, 0.18);
  border: 1px solid rgba(168, 85, 247, 0.35);
  padding: 7px 9px 7px 11px;
}
.conv-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.conv-title {
  flex: 1;
  font-size: 13px;
  color: #eee;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.conv-meta {
  font-size: 10px;
  color: var(--text-mute);
  margin-top: 2px;
}
.conv-del {
  flex: 0 0 auto;
  width: 20px; height: 20px;
  background: transparent;
  border: none;
  color: var(--text-mute);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  border-radius: 4px;
  opacity: 0;
  transition: opacity .15s, color .15s, background .15s;
}
.conv-item:hover .conv-del { opacity: 1; }
.conv-del:hover { color: #ef4444; background: rgba(239, 68, 68, 0.15); }

/* 让侧边栏在小屏上不会撑爆 */
@media (max-width: 720px) {
  .chat-sidebar { max-height: 40vh; }
  .conv-list { max-height: 25vh; }
}

/* ============================================================
   参考图上传区 + 工具按钮
   ============================================================ */
.ref-thumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: rgba(168, 85, 247, 0.06);
}
.ref-thumb {
  position: relative;
  width: 56px; height: 56px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.2);
  flex: 0 0 auto;
}
.ref-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.ref-rm {
  position: absolute;
  top: 2px; right: 2px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: rgba(0,0,0,0.7);
  color: #fff;
  border: none;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.ref-rm:hover { background: #ef4444; }

.ref-meta {
  font-size: 12px;
  color: #c084fc;
  font-weight: 500;
  margin-left: 4px;
}

/* 工具栏中的图标按钮（参考图上传等） */
.tool-btn {
  width: 36px; height: 36px;
  border: 1px solid rgba(255,255,255,0.1);
  background: transparent;
  color: var(--text-mute);
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
  flex: 0 0 auto;
}
.tool-btn:hover {
  color: #fff;
  border-color: rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.04);
}
.tool-btn.active {
  color: #fff;
  background: rgba(168, 85, 247, 0.25);
  border-color: rgba(168, 85, 247, 0.5);
}

/* 历史聊天里：用户消息中的参考图缩略 */
.user-refs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.user-refs img {
  width: 88px;
  height: 88px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.1);
  cursor: zoom-in;
  transition: transform .12s;
}
.user-refs img:hover { transform: scale(1.04); }

/* nav 列表内的 a 标签：保持与原 li 同样视觉 */
.nav-list .nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  color: inherit;
  text-decoration: none;
}

/* ============================================================
   Help Center
   ============================================================ */
.page-help { background: var(--bg, #0b0b15); color: var(--text, #fff); }

.help-main {
  max-width: 880px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

/* Hero */
.help-hero {
  text-align: center;
  margin-bottom: 36px;
}
.help-hero-icon {
  display: inline-flex;
  width: 72px; height: 72px;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(168,85,247,.25), rgba(99,102,241,.25));
  color: #c084fc;
  margin-bottom: 16px;
  border: 1px solid rgba(168,85,247,.35);
}
.help-hero h1 {
  font-size: 32px;
  margin: 0 0 8px;
  background: linear-gradient(135deg, #fff 0%, #c084fc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.help-hero-sub {
  font-size: 14px;
  color: var(--text-mute, #a1a1aa);
  margin: 0;
}

/* 联系卡片 */
.help-contact-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
  padding: 22px 24px;
  margin-bottom: 36px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(168,85,247,.12), rgba(99,102,241,.08));
  border: 1px solid rgba(168,85,247,.3);
}
.help-contact-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 6px;
}
.help-contact-desc {
  font-size: 13px;
  color: var(--text-mute, #a1a1aa);
}
.help-qq-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.help-qq-label {
  font-size: 12px;
  color: var(--text-mute, #a1a1aa);
}
.help-qq-num {
  font-family: 'JetBrains Mono', 'Cascadia Code', Consolas, monospace;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 1px;
}
.help-copy-btn {
  padding: 4px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.06);
  color: #fff;
  font-size: 12px;
  cursor: pointer;
  transition: all .15s;
}
.help-copy-btn:hover {
  background: rgba(168,85,247,.25);
  border-color: rgba(168,85,247,.5);
}
.help-copy-btn.done {
  background: rgba(34,197,94,.25);
  border-color: rgba(34,197,94,.5);
  color: #86efac;
}
.help-qq-jump {
  display: inline-block;
  font-size: 13px;
  color: #c084fc;
  text-decoration: none;
  border-bottom: 1px dashed rgba(192,132,252,.5);
  padding-bottom: 1px;
}
.help-qq-jump:hover { color: #e9d5ff; }

/* Section */
.help-section {
  margin-bottom: 40px;
}
.help-section h2 {
  font-size: 20px;
  margin: 0 0 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

/* Steps */
.help-steps {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.help-step {
  display: flex;
  gap: 16px;
  padding: 16px 18px;
  border-radius: 12px;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.06);
}
.help-step-num {
  flex: 0 0 auto;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #a855f7, #6366f1);
  color: #fff;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}
.help-step h3 {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 600;
}
.help-step p {
  margin: 0;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-mute, #a1a1aa);
}
.help-step a {
  color: #c084fc;
  text-decoration: none;
}
.help-step a:hover { color: #e9d5ff; }

/* FAQ */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.faq-item {
  padding: 14px 18px;
  border-radius: 10px;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.06);
  transition: all .15s;
}
.faq-item[open] {
  background: rgba(168,85,247,.08);
  border-color: rgba(168,85,247,.25);
}
.faq-item summary {
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
  position: relative;
  padding-right: 24px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  color: var(--text-mute, #a1a1aa);
  transition: transform .15s;
}
.faq-item[open] summary::after { content: '−'; color: #c084fc; }
.faq-item p {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-mute, #a1a1aa);
}

/* 守则 */
.help-rules {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.help-rules li {
  position: relative;
  padding: 10px 14px 10px 30px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-mute, #a1a1aa);
  background: rgba(255,255,255,.02);
  border-left: 2px solid rgba(168,85,247,.5);
  border-radius: 0 8px 8px 0;
}
.help-rules li::before {
  content: '⚠';
  position: absolute;
  left: 10px;
  top: 10px;
  color: #c084fc;
}

/* CTA */
.help-cta {
  text-align: center;
  padding: 32px 24px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(168,85,247,.1), rgba(99,102,241,.06));
  border: 1px solid rgba(255,255,255,.08);
}
.help-cta p {
  margin: 0 0 14px;
  color: var(--text-mute, #a1a1aa);
}

/* 用户协议折叠 */
.terms-fold {
  border-radius: 12px;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.08);
  overflow: hidden;
}
.terms-fold[open] { border-color: rgba(168,85,247,.3); }
.terms-fold > summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.terms-fold > summary::-webkit-details-marker { display: none; }
.terms-fold-title {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
}
.terms-fold-hint {
  font-size: 12px;
  color: var(--text-mute, #a1a1aa);
}
.terms-fold[open] .terms-fold-hint::after { content: ' ▲'; }
.terms-fold:not([open]) .terms-fold-hint::after { content: ' ▼'; }

.terms-doc {
  padding: 4px 24px 24px;
  border-top: 1px solid rgba(255,255,255,.06);
  font-size: 13.5px;
  line-height: 1.85;
  color: #d4d4d8;
  max-height: 520px;
  overflow-y: auto;
}
.terms-doc h3 {
  font-size: 14px;
  margin: 18px 0 8px;
  color: #fff;
}
.terms-doc p { margin: 8px 0; }
.terms-doc ul { padding-left: 20px; margin: 6px 0; }
.terms-doc ul li { margin: 4px 0; }
.terms-doc b { color: #fff; }
.terms-meta {
  font-size: 12px;
  color: var(--text-mute, #a1a1aa);
}
.terms-final {
  margin-top: 20px;
  padding: 12px 14px;
  border-radius: 8px;
  background: rgba(168,85,247,.1);
  border-left: 3px solid #c084fc;
}

/* 响应式 */
@media (max-width: 640px) {
  .help-contact-card { grid-template-columns: 1fr; }
  .help-qq-num { font-size: 18px; }
  .help-hero h1 { font-size: 26px; }
}

/* ============================================================
   全局：用户协议同意弹窗（chat 页生图前必须确认一次）
   ============================================================ */
.tos-modal-mask {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.tos-modal {
  width: 100%;
  max-width: 640px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  background: #14141f;
  border: 1px solid rgba(168,85,247,.3);
  box-shadow: 0 24px 60px rgba(0,0,0,.6);
  overflow: hidden;
  color: #e4e4e7;
}
.tos-modal-head {
  padding: 20px 24px 14px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.tos-modal-head h2 {
  margin: 0 0 6px;
  font-size: 18px;
  color: #fff;
}
.tos-modal-head p {
  margin: 0;
  font-size: 13px;
  color: #a1a1aa;
}
.tos-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 24px;
}
.tos-tabs {
  display: flex;
  gap: 4px;
  margin: 10px 0;
  background: rgba(255,255,255,.04);
  padding: 4px;
  border-radius: 10px;
}
.tos-tab {
  flex: 1;
  padding: 8px 12px;
  text-align: center;
  font-size: 13px;
  border-radius: 7px;
  cursor: pointer;
  color: #a1a1aa;
  transition: all .15s;
  border: none;
  background: transparent;
}
.tos-tab.active {
  background: linear-gradient(135deg, #a855f7, #6366f1);
  color: #fff;
  font-weight: 500;
}
.tos-pane {
  display: none;
  font-size: 13px;
  line-height: 1.8;
  padding: 8px 4px 16px;
}
.tos-pane.active { display: block; }
.tos-pane h3 {
  font-size: 13.5px;
  color: #fff;
  margin: 14px 0 6px;
}
.tos-pane ul { padding-left: 20px; margin: 6px 0; }
.tos-pane li { margin: 3px 0; color: #d4d4d8; }
.tos-pane b { color: #fff; }
.tos-pane a { color: #c084fc; }

.tos-modal-foot {
  padding: 14px 24px 20px;
  border-top: 1px solid rgba(255,255,255,.06);
  background: rgba(255,255,255,.02);
}
.tos-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: #d4d4d8;
  cursor: pointer;
  margin-bottom: 14px;
  user-select: none;
}
.tos-check input {
  margin-top: 3px;
  width: 16px; height: 16px;
  accent-color: #a855f7;
  cursor: pointer;
}
.tos-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.tos-btn {
  padding: 9px 18px;
  border-radius: 9px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.04);
  color: #d4d4d8;
  font-size: 13px;
  cursor: pointer;
  transition: all .15s;
}
.tos-btn:hover { background: rgba(255,255,255,.08); }
.tos-btn-primary {
  border-color: transparent;
  background: linear-gradient(135deg, #a855f7, #6366f1);
  color: #fff;
  font-weight: 500;
}
.tos-btn-primary:disabled {
  opacity: .45;
  cursor: not-allowed;
}
.tos-btn-primary:not(:disabled):hover {
  filter: brightness(1.1);
}
@media (max-width: 540px) {
  .tos-modal { max-height: 92vh; }
  .tos-modal-body { padding: 8px 16px; }
  .tos-modal-head, .tos-modal-foot { padding-left: 16px; padding-right: 16px; }
}

/* ============================================================
   定价页 · 支付方式选择 + 支付回执横幅
   ============================================================ */
.pay-method-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
}
.pay-method-label {
  font-size: 13px;
  color: var(--text-mute, #a1a1aa);
}
.pay-method-opt {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
}
.pay-method-opt input[type="radio"] {
  accent-color: #a855f7;
  cursor: pointer;
}
.pay-method-tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 500;
}
.pay-method-tag.pay-alipay {
  background: rgba(22,119,255,.18);
  color: #60a5fa;
  border: 1px solid rgba(22,119,255,.3);
}
.pay-method-tag.pay-wxpay {
  background: rgba(34,197,94,.18);
  color: #4ade80;
  border: 1px solid rgba(34,197,94,.3);
}
.pay-method-opt input[type="radio"]:checked + .pay-method-tag.pay-alipay {
  background: rgba(22,119,255,.35);
  color: #fff;
}
.pay-method-opt input[type="radio"]:checked + .pay-method-tag.pay-wxpay {
  background: rgba(34,197,94,.35);
  color: #fff;
}

.pay-result {
  margin: 0 auto 24px;
  max-width: 720px;
  padding: 14px 20px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.6;
}
.pay-result a {
  margin-left: 10px;
  color: inherit;
  text-decoration: underline;
}
.pay-result-ok {
  background: rgba(34,197,94,.12);
  border: 1px solid rgba(34,197,94,.4);
  color: #86efac;
}
.pay-result-fail {
  background: rgba(239,68,68,.12);
  border: 1px solid rgba(239,68,68,.4);
  color: #fca5a5;
}

.lightbox img { max-width: 100%; max-height: 100%; border-radius: 12px; }

/* ====== Responsive ====== */
@media (max-width: 1180px) {
  .hero-grid { grid-template-columns: 1fr; }
  .chat-panel { height: 600px; }
  .gallery { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
  .hero-section { padding: 24px; }
  .hero-copy h1 { font-size: 40px; }
  .chat-panel { grid-template-columns: 1fr; height: 80vh; }
  /* 仅首页内嵌的预览面板隐藏侧边栏；创作页（page-chat）走抽屉规则 */
  body:not(.page-chat) .chat-sidebar { display: none; }
  .explore { margin: 16px; padding: 20px; }
  .explore-header { flex-wrap: wrap; gap: 12px; }
  .top-nav { order: 3; width: 100%; justify-content: flex-start; overflow-x: auto; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   视频生成页（video.html）专属样式
   ============================================================ */
.vid-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 10px;
}
.vid-item {
  position: relative;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.vid-item video {
  width: 100%;
  display: block;
  aspect-ratio: 16/9;
  background: #000;
  object-fit: contain;
}
.vid-actions {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 10px; font-size: 12px; color: #c4b5fd;
}
.vid-actions .vid-dl {
  color: #c084fc; text-decoration: none;
}
.vid-actions .vid-dl:hover { text-decoration: underline; }
.vid-actions .vid-tag { color: #94a3b8; }

.vid-grid.loading .vid-item {
  aspect-ratio: 16/9;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 8px;
  background: linear-gradient(110deg, rgba(255,255,255,0.04) 30%, rgba(255,255,255,0.10) 50%, rgba(255,255,255,0.04) 70%);
  background-size: 200% 100%;
  animation: shimmer 1.6s linear infinite;
}
.vid-spinner {
  width: 32px; height: 32px;
  border: 3px solid rgba(168, 85, 247, 0.25);
  border-top-color: #a855f7;
  border-radius: 50%;
  animation: vid-spin 0.9s linear infinite;
}
.vid-progress { color: #c4b5fd; font-size: 12px; }
.vid-tip { display: block; margin-top: 4px; font-size: 11px; color: #94a3b8; opacity: 0.85; }
@keyframes vid-spin { to { transform: rotate(360deg); } }

/* 醒目的"切换功能"chip（前往视频 / 前往生图） */
.prompt-chip.prompt-chip-alt {
  background: linear-gradient(135deg, rgba(168,85,247,0.20), rgba(244,114,182,0.18));
  border-color: rgba(168,85,247,0.45);
  color: #f5d0fe;
  font-weight: 600;
}
.prompt-chip.prompt-chip-alt:hover {
  background: linear-gradient(135deg, rgba(168,85,247,0.35), rgba(244,114,182,0.30));
  transform: translateY(-1px);
}

/* 视频 i2v 单图缩略 */
body.page-video .ref-thumb img { aspect-ratio: 16/9; }
