/* ========================================
   AI 提示词大全 — 前端样式
   深色主题 + 毛玻璃风格 + 现代动画
   ======================================== */

/* --- Google Fonts 导入 --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* --- CSS 变量 --- */
:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.08);
  --bg-glass: rgba(255, 255, 255, 0.06);
  --bg-glass-strong: rgba(255, 255, 255, 0.1);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.15);
  --text-primary: #f0f0f5;
  --text-secondary: rgba(255, 255, 255, 0.6);
  --text-tertiary: rgba(255, 255, 255, 0.4);
  --accent-blue: #6c8aff;
  --accent-purple: #a855f7;
  --accent-pink: #ec4899;
  --accent-green: #34d399;
  --accent-orange: #f59e0b;
  --gradient-primary: linear-gradient(135deg, #6c8aff, #a855f7);
  --gradient-warm: linear-gradient(135deg, #f59e0b, #ec4899);
  --gradient-cool: linear-gradient(135deg, #34d399, #6c8aff);
  --gradient-text-bg: linear-gradient(135deg, #667eea, #764ba2);
  --gradient-image-bg: linear-gradient(135deg, #f093fb, #f5576c);
  --gradient-video-bg: linear-gradient(135deg, #4facfe, #00f2fe);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
  --shadow-glow-blue: 0 0 30px rgba(108, 138, 255, 0.15);
  --shadow-glow-purple: 0 0 30px rgba(168, 85, 247, 0.15);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- 全局重置 --- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

#tishici-app-root,
#tishici-embed-root {
  position: relative;
  min-height: 100vh;
  background-color: var(--bg-primary);
}

/* --- 背景装饰（静态渐变，无动画） --- */
#tishici-app-root::before,
#tishici-embed-root::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at 20% 20%, rgba(108, 138, 255, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(168, 85, 247, 0.05) 0%, transparent 50%);
  z-index: -1;
  pointer-events: none;
}

/* ===== 页面头部 ===== */
.page-header {
  padding: 40px 20px 0;
  text-align: center;
  max-width: 920px;
  margin: 0 auto;
}

.page-title {
  font-size: 2.5rem;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.page-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  font-weight: 400;
  max-width: 720px;
  margin: 0 auto;
}

.page-subtitle strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* ===== Tab 导航 ===== */
.tab-nav {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 24px 20px 0;
  padding-bottom: 20px;
  max-width: 920px;
  margin: 0 auto;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border: 1px solid var(--border-subtle);
  border-radius: 50px;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
  font-family: inherit;
  appearance: none;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
}

.tab-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50px;
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.tab-btn[data-type="text"]::before {
  background: var(--gradient-text-bg);
}

.tab-btn[data-type="image"]::before {
  background: var(--gradient-image-bg);
}

.tab-btn[data-type="video"]::before {
  background: var(--gradient-video-bg);
}

.tab-btn:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.tab-btn.active {
  color: #fff;
  border-color: transparent;
  box-shadow: var(--shadow-lg);
}

.tab-btn.active::before {
  opacity: 1;
}

.tab-btn .tab-icon {
  font-size: 1.2rem;
  position: relative;
  z-index: 1;
}

.tab-btn .tab-label {
  position: relative;
  z-index: 1;
}

/* ===== 搜索栏 ===== */
.search-bar-wrap {
  display: flex;
  justify-content: center;
  padding: 0 20px 8px;
  max-width: 920px;
  margin: 0 auto;
}

.search-bar {
  position: relative;
  display: flex;
  align-items: center;
  width: min(100%, 720px);
  min-height: 58px;
  padding: 0 18px 0 50px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03)),
    rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}

.search-bar:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
}

.search-bar:focus-within {
  border-color: rgba(108, 138, 255, 0.5);
  box-shadow: 0 0 0 4px rgba(108, 138, 255, 0.12), var(--shadow-md);
}

.search-bar-icon {
  position: absolute;
  left: 18px;
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1;
  pointer-events: none;
}

.search-bar-input {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-size: 0.95rem;
  line-height: 1.5;
  outline: none;
  padding: 16px 0;
}

.search-bar-input::-webkit-search-cancel-button {
  display: none;
}

.search-bar-input::placeholder {
  color: var(--text-tertiary);
}

.search-bar-clear {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.9);
  transition: opacity var(--transition-fast), transform var(--transition-fast), background var(--transition-fast), color var(--transition-fast);
  flex-shrink: 0;
}

.search-bar.has-value .search-bar-clear {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.search-bar-clear:hover {
  background: rgba(255, 255, 255, 0.16);
  color: var(--text-primary);
}

/* ===== 排序/筛选栏 ===== */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 16px 20px;
  flex-wrap: wrap;
  max-width: 920px;
  margin: 0 auto;
}

.favorites-entry {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 50px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-glass);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: inherit;
}

.favorites-entry:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

.favorites-entry.active {
  color: #fff;
  border-color: rgba(245, 158, 11, 0.4);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.18), rgba(236, 72, 153, 0.18));
  box-shadow: 0 0 24px rgba(245, 158, 11, 0.12);
}

.favorites-entry-icon {
  font-size: 1rem;
  line-height: 1;
}

.favorites-entry-count {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(245, 158, 11, 0.16);
  color: #ffd089;
  font-size: 0.72rem;
  font-weight: 700;
}

.sort-group {
  display: flex;
  gap: 4px;
  background: var(--bg-glass);
  border-radius: 50px;
  padding: 4px;
  border: 1px solid var(--border-subtle);
}

.sort-btn {
  padding: 8px 20px;
  border-radius: 50px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: inherit;
}

.sort-btn:hover {
  color: var(--text-primary);
}

.sort-btn.active {
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

/* --- 分类标签区 --- */
.category-tags {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px 16px;
  overflow: hidden;
  transition: max-height var(--transition-slow);
}

.category-tag {
  padding: 6px 16px;
  border-radius: 50px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-glass);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  font-family: inherit;
}

.category-tag:hover {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
  background: rgba(108, 138, 255, 0.1);
}

.category-tag.active {
  border-color: var(--accent-blue);
  background: rgba(108, 138, 255, 0.15);
  color: var(--accent-blue);
}

/* ===== 瀑布流容器 ===== */
.masonry-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 8px 20px 40px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.masonry-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

@media (max-width: 768px) {
  .masonry-container {
    padding: 8px 12px 40px;
  }
}

/* ===== 卡片样式 ===== */
.prompt-card {
  break-inside: avoid;
  margin-bottom: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition-normal);
  animation: cardFadeIn 0.5s ease backwards;
}

@keyframes cardFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.prompt-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* --- 卡片封面图 --- */
.card-cover {
  width: 100%;
  aspect-ratio: auto;
  overflow: hidden;
  position: relative;
}

.card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.prompt-card:hover .card-cover img {
  transform: scale(1.05);
}

/* 视频标识 */
.card-cover .video-badge {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  color: #fff;
  padding: 4px 10px;
  border-radius: 50px;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* --- 纯文字卡片的装饰背景 --- */
.card-text-decoration {
  padding: 24px;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.card-text-decoration::before {
  content: '✦';
  position: absolute;
  font-size: 4rem;
  opacity: 0.08;
  right: -10px;
  bottom: -15px;
}

.card-text-decoration.style-1 {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.15), rgba(118, 75, 162, 0.15));
}

.card-text-decoration.style-2 {
  background: linear-gradient(135deg, rgba(240, 147, 251, 0.15), rgba(245, 87, 108, 0.15));
}

.card-text-decoration.style-3 {
  background: linear-gradient(135deg, rgba(79, 172, 254, 0.15), rgba(0, 242, 254, 0.15));
}

.card-text-decoration.style-4 {
  background: linear-gradient(135deg, rgba(52, 211, 153, 0.15), rgba(108, 138, 255, 0.15));
}

.card-text-decoration.style-5 {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(236, 72, 153, 0.15));
}

.card-text-decoration .text-icon {
  font-size: 2.5rem;
}

.card-fallback-cover {
  min-height: 180px;
  flex-direction: column;
  gap: 10px;
}

.card-fallback-cover .fallback-label {
  font-size: 0.78rem;
  color: var(--text-secondary);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* --- 卡片内容区 --- */
.card-body {
  padding: 16px;
}

.card-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.4;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-prompt-preview {
  font-size: 0.825rem;
  color: var(--text-secondary);
  line-height: 1.6;
  height: 2.6rem;
  /* 基于 line-height 的两行固定高度 */
  display: -webkit-box;
  line-clamp: 2;
  /* 补足标准属性实现兼容性 */
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 12px;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

.card-meta-left,
.card-meta-right {
  display: flex;
  align-items: center;
  min-width: 0;
}

.card-meta-right {
  gap: 8px;
  flex-shrink: 0;
}

.card-author {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  max-width: 100%;
}

.card-author-text {
  display: inline-block;
  min-width: 0;
  max-width: 150px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-category {
  padding: 3px 8px;
  border-radius: 50px;
  background: var(--bg-glass-strong);
  font-size: 0.7rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.card-views {
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.card-favorite-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-tertiary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 1rem;
  line-height: 1;
}

.card-favorite-btn:hover {
  color: #ffd089;
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.18);
}

.card-favorite-btn.is-active {
  color: #ffd089;
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.2);
}

/* ===== 详情浮窗 Modal ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
  padding: 20px;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 720px;
  max-height: 85vh;
  overflow: visible;
  /* 改为可见，让按钮相对于它绝对定位时不被裁剪 */
  position: relative;
  transform: scale(0.9) translateY(20px);
  transition: transform var(--transition-normal);
  box-shadow: var(--shadow-lg);
}

.modal-overlay.active .modal-content {
  transform: scale(1) translateY(0);
}

/* --- Modal 内部滚动区 --- */
.modal-scroll-area {
  max-height: 85vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 20px;
  border-radius: inherit;
}

/* 自定义滚动条 (Modal 内部) */
.modal-scroll-area::-webkit-scrollbar {
  width: 6px;
}

.modal-scroll-area::-webkit-scrollbar-track {
  background: transparent;
}

.modal-scroll-area::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

/* --- Modal 关闭按钮 --- */
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  background: var(--bg-glass-strong);
  backdrop-filter: blur(10px);
  color: var(--text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  z-index: 100;
  /* 提升层级，确保在滚动内容之上 */
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
  color: var(--text-primary);
  transform: rotate(90deg);
}

/* --- Modal 媒体区域 --- */
.modal-media {
  width: 100%;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: #000;
}

.modal-media img,
.modal-media video {
  width: 100%;
  display: block;
  border-radius: inherit;
}

.modal-media .card-fallback-cover {
  min-height: 260px;
  border-radius: inherit;
}

/* --- Modal 内容区域 --- */
.modal-body {
  padding: 28px;
}

.modal-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 16px;
  line-height: 1.4;
}

.modal-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.modal-title-row .modal-title {
  margin-bottom: 0;
  flex: 1;
}

.modal-favorite-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-glass);
  color: var(--text-secondary);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: inherit;
  flex-shrink: 0;
}

.modal-favorite-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.modal-favorite-btn.is-active {
  color: #ffd089;
  border-color: rgba(245, 158, 11, 0.26);
  background: rgba(245, 158, 11, 0.12);
}

.modal-favorite-btn .favorite-icon {
  font-size: 1rem;
  line-height: 1;
}

.modal-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.modal-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.modal-meta-item .meta-icon {
  font-size: 1rem;
}

/* --- 提示词区域 --- */
.prompt-section {
  margin-top: 20px;
}

.prompt-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.prompt-section-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.copy-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 50px;
  border: 1px solid var(--accent-blue);
  background: rgba(108, 138, 255, 0.1);
  color: var(--accent-blue);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: inherit;
}

.copy-btn:hover {
  background: rgba(108, 138, 255, 0.2);
  box-shadow: var(--shadow-glow-blue);
}

.copy-btn.copied {
  border-color: var(--accent-green);
  color: var(--accent-green);
  background: rgba(52, 211, 153, 0.1);
}

/* --- 提示词文本容器（固定高度+内部滚动） --- */
.prompt-text-box {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  max-height: 400px;
  overflow-y: auto;
  font-size: 0.875rem;
  line-height: 1.8;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
}

.prompt-text-box::-webkit-scrollbar {
  width: 5px;
}

.prompt-text-box::-webkit-scrollbar-track {
  background: transparent;
}

.prompt-text-box::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
}

/* ===== 加载状态 ===== */
.loading-indicator {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-tertiary);
  font-size: 0.9rem;
}

.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border-subtle);
  border-top-color: var(--accent-blue);
  border-radius: 50%;
  margin: 0 auto 12px;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.no-more {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-tertiary);
  font-size: 0.85rem;
}

/* ===== 复制成功提示 ===== */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--accent-green);
  color: #000;
  padding: 12px 24px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  z-index: 2000;
  opacity: 0;
  transition: all var(--transition-normal);
  box-shadow: 0 4px 20px rgba(52, 211, 153, 0.3);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ===== 响应式适配 ===== */
@media (max-width: 768px) {
  .page-header {
    padding: 28px 16px 0;
    text-align: center;
  }

  .page-title {
    font-size: clamp(1.9rem, 7vw, 2.4rem);
    line-height: 1.1;
  }

  .page-subtitle {
    max-width: none;
    margin: 0 auto;
    font-size: 0.92rem;
    line-height: 1.7;
  }

  .tab-nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    padding: 16px 16px 12px;
    justify-content: center;
    align-items: stretch;
  }

  .tab-btn {
    width: 100%;
    padding: 12px 10px;
    font-size: 0.82rem;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    border-radius: 50px;
    gap: 6px;
    box-shadow: none;
  }

  .tab-btn::before {
    display: none;
  }

  .tab-btn[data-type="text"].active {
    background: var(--gradient-text-bg);
  }

  .tab-btn[data-type="image"].active {
    background: var(--gradient-image-bg);
  }

  .tab-btn[data-type="video"].active {
    background: var(--gradient-video-bg);
  }

  .tab-btn .tab-icon {
    font-size: 1.15rem;
  }

  .tab-btn .tab-label {
    display: block;
    font-size: 0.72rem;
    line-height: 1.25;
    white-space: normal;
  }

  .filter-bar {
    padding: 10px 16px 0;
    gap: 12px;
    justify-content: center;
  }

  .search-bar-wrap {
    padding: 0 16px 8px;
  }

  .search-bar {
    width: 100%;
    min-height: 54px;
    padding-left: 46px;
    padding-right: 14px;
  }

  .search-bar-icon {
    left: 16px;
  }

  .search-bar-input {
    font-size: 0.9rem;
    padding: 14px 0;
  }

  .favorites-entry {
    padding: 8px 14px;
    font-size: 0.8rem;
  }

  .category-tags {
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    padding: 8px 16px 12px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    /* Firefox */
  }

  .category-tags::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari/Edge */
  }

  .category-tag {
    flex-shrink: 0;
  }

  .sort-btn {
    flex: 1 1 0;
    min-width: 0;
    padding: 10px 6px;
    font-size: 0.8rem;
    text-align: center;
  }

  .sort-group {
    width: 100%;
    border-radius: 50px;
  }

  .modal-body {
    padding: 18px 16px 20px;
  }

  .modal-title {
    font-size: 1.18rem;
    padding-right: 44px;
  }

  .modal-title-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .modal-favorite-btn {
    padding: 7px 12px;
    font-size: 0.8rem;
  }

  .masonry-container {
    padding: 12px 16px 32px;
    gap: 10px;
  }

  .masonry-column {
    gap: 12px;
  }

  .prompt-card {
    border-radius: 18px;
  }

  .card-body {
    padding: 14px;
  }

  .card-title {
    font-size: 0.98rem;
  }

  .card-prompt-preview {
    display: none;
  }

  .card-footer {
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: nowrap;
    white-space: nowrap;
  }

  .card-meta-left {
    flex: 1 1 auto;
    min-width: 0;
  }

  .card-meta-right {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    width: auto;
    justify-content: flex-end;
    margin-left: 10px;
  }

  .card-favorite-btn {
    width: 26px;
    height: 26px;
    font-size: 0.95rem;
  }

  .card-author {
    min-width: 0;
  }

  .card-author-text {
    max-width: 88px;
  }

  .card-views {
    display: none !important;
  }

  .card-category {
    max-width: 96px;
    margin-left: 8px;
    flex-shrink: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .modal-overlay {
    align-items: center;
    justify-content: center;
    padding: 12px;
  }

  .modal-content {
    width: min(84vw, 380px);
    max-width: 380px;
    max-height: 88vh;
    border-radius: 22px;
    margin: auto;
  }

  .modal-scroll-area {
    max-height: 88vh;
    padding-bottom: 16px;
  }

  .modal-close {
    top: 12px;
    right: 12px;
    background: rgba(10, 12, 18, 0.52);
    border-color: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.92);
  }

  .modal-meta {
    gap: 10px;
  }

  .modal-meta-item {
    font-size: 0.8rem;
  }

  .prompt-section-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .copy-btn {
    width: 100%;
    justify-content: center;
  }

  .prompt-text-box {
    max-height: 45vh;
    padding: 14px;
    font-size: 0.84rem;
  }
}

@media (max-width: 480px) {
  .page-header {
    padding: 20px 14px 0;
    text-align: center;
  }

  .page-title {
    font-size: 1.65rem;
  }

  .tab-nav {
    padding: 14px 14px 10px;
    gap: 8px;
  }

  .tab-btn {
    padding: 10px 8px;
    border-radius: 50px;
  }

  .tab-btn .tab-label {
    font-size: 0.68rem;
  }

  .filter-bar {
    padding: 10px 14px 0;
    justify-content: center;
  }

  .search-bar-wrap {
    padding: 0 14px 8px;
  }

  .search-bar {
    min-height: 50px;
    padding-left: 44px;
    padding-right: 12px;
  }

  .search-bar-icon {
    left: 15px;
    font-size: 0.95rem;
  }

  .search-bar-input {
    font-size: 0.86rem;
  }

  .search-bar-clear {
    width: 30px;
    height: 30px;
    font-size: 0.92rem;
  }

  .category-tags {
    padding: 8px 14px 10px;
  }

  .masonry-container {
    padding: 10px 14px 28px;
    gap: 8px;
  }

  .modal-content {
    width: min(88vw, 350px);
    max-width: 350px;
    max-height: 88vh;
    border-radius: var(--radius-lg);
  }

  .modal-overlay {
    padding: 8px;
  }

  .modal-body {
    padding: 16px 14px 18px;
  }

  .card-author-text {
    max-width: 76px;
  }

  .card-category {
    max-width: 84px;
  }
}
