/* ===== 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; }
  body.page-chat .chat-sidebar { display: none; }
  .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; }
}

/* 极小屏（≤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; }

/* ====== 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; }
.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; }
  .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); }
}
