/* ========================================
   AI天地 v3 - 宇宙画廊升级 CSS
   ======================================== */

/* === 基础页面 === */
.ai-page {
  min-height: 100vh;
  padding-bottom: 100px;
  background: linear-gradient(180deg, #0a0e1a 0%, #0d1321 40%, #111827 100%);
}

/* === 顶部区域 === */
.ai-header {
  text-align: center;
  padding: 48px 20px 36px;
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #0f172a 100%);
  position: relative;
  overflow: hidden;
}
.ai-header::before {
  content: '';
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(circle at 30% 40%, rgba(99,102,241,0.08) 0%, transparent 50%),
              radial-gradient(circle at 70% 60%, rgba(168,85,247,0.06) 0%, transparent 50%);
  animation: aiHeaderGlow 8s ease-in-out infinite alternate;
}
@keyframes aiHeaderGlow {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-2%, -1%) scale(1.05); }
}
.ai-header > * { position: relative; z-index: 1; }

.ai-title {
  font-size: 28px; font-weight: 700; color: #fff;
  margin: 0 0 8px; letter-spacing: 2px;
  background: linear-gradient(135deg, #c084fc, #818cf8, #67e8f9);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.ai-subtitle {
  color: rgba(255,255,255,0.5); font-size: 13px;
  margin: 0; letter-spacing: 3px;
}

/* === 每日AI画 === */
.ai-daily-featured {
  margin: 16px 15px 0;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(129,140,248,0.15);
  box-shadow: 0 4px 24px rgba(129,140,248,0.08);
}
.ai-daily-label {
  position: absolute; top: 12px; left: 14px; z-index: 2;
  padding: 4px 12px;
  background: rgba(0,0,0,0.5); backdrop-filter: blur(10px);
  border-radius: 20px; font-size: 11px;
  color: #a5b4fc; letter-spacing: 1px;
  border: 1px solid rgba(129,140,248,0.2);
}
.ai-daily-card {
  position: relative; cursor: pointer;
  transition: transform 0.3s;
}
.ai-daily-card:hover { transform: scale(1.01); }
.ai-daily-img {
  width: 100%; height: 200px; object-fit: cover;
  display: block;
}
.ai-daily-overlay {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 30px 16px 14px;
  background: linear-gradient(transparent, rgba(0,0,0,0.75));
}
.ai-daily-title {
  color: #fff; font-size: 16px; font-weight: 600;
  margin-bottom: 4px;
}
.ai-daily-author {
  color: rgba(255,255,255,0.5); font-size: 12px;
}

/* === 收益概览条 === */
.ai-earning-bar {
  display: flex; align-items: center; justify-content: center;
  gap: 24px; padding: 14px 20px;
  margin: 16px 15px 0;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px; backdrop-filter: blur(10px);
}
.ai-earning-item {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.ai-earning-label {
  font-size: 11px; color: rgba(255,255,255,0.4); letter-spacing: 1px;
}
.ai-earning-value {
  font-size: 16px; font-weight: 600; color: #f0b429;
  font-variant-numeric: tabular-nums;
}
.ai-earning-divider {
  width: 1px; height: 28px; background: rgba(255,255,255,0.08);
}

/* === 介绍卡片 === */
.ai-intro-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(168,85,247,0.15);
  border-radius: 14px; padding: 20px;
  margin: 16px 15px; color: #e2e8f0;
  position: relative; backdrop-filter: blur(10px);
  animation: aiFadeIn 0.4s ease;
}
.ai-intro-card.u-hidden { display: none; }
.ai-intro-header {
  display: flex; align-items: center; gap: 10px; margin-bottom: 14px;
}
.ai-intro-icon { font-size: 22px; }
.ai-intro-header h3 { margin: 0; font-size: 16px; font-weight: 600; color: #c4b5fd; }
.ai-intro-content p { margin: 0 0 10px; font-size: 13px; line-height: 1.7; color: rgba(255,255,255,0.65); }
.ai-intro-list { margin: 8px 0; padding-left: 18px; }
.ai-intro-list li { margin: 6px 0; font-size: 13px; color: rgba(255,255,255,0.6); }
.ai-intro-earn {
  background: rgba(240,180,41,0.08); border: 1px solid rgba(240,180,41,0.15);
  padding: 10px 14px; border-radius: 10px;
  margin: 12px 0 !important; color: #f0b429; font-size: 13px;
}
.ai-intro-note { font-size: 11px; opacity: 0.5; }
.ai-intro-close {
  position: absolute; top: 14px; right: 14px;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.5); padding: 5px 12px; border-radius: 6px;
  cursor: pointer; font-size: 11px; transition: all 0.2s;
}
.ai-intro-close:hover { background: rgba(255,255,255,0.1); color: #fff; }

/* === 分类栏 === */
.ai-category-bar {
  display: flex; gap: 8px; padding: 4px 15px 16px;
  overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.ai-category-bar::-webkit-scrollbar { display: none; }
.ai-cat-btn {
  flex-shrink: 0; padding: 8px 18px; background: transparent;
  border: 1px solid rgba(255,255,255,0.08); border-radius: 20px;
  color: rgba(255,255,255,0.45); font-size: 13px; cursor: pointer;
  transition: all 0.25s; white-space: nowrap;
}
.ai-cat-btn.active {
  background: rgba(129,140,248,0.12); border-color: rgba(129,140,248,0.3);
  color: #a5b4fc; box-shadow: 0 0 16px rgba(129,140,248,0.1);
}
.ai-cat-btn:hover:not(.active) {
  background: rgba(255,255,255,0.04); color: rgba(255,255,255,0.6);
}

/* === 作品列表 === */
.ai-works-container { padding: 0 15px; min-height: 300px; }
.ai-works-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px;
}
.ai-work-card {
  background: rgba(255,255,255,0.02); border-radius: 12px;
  overflow: hidden; cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
  border: 1px solid rgba(255,255,255,0.04);
}
.ai-work-card:hover {
  transform: translateY(-3px); border-color: rgba(129,140,248,0.2);
  box-shadow: 0 8px 24px rgba(129,140,248,0.08);
}
.ai-work-cover {
  width: 100%; height: 110px; object-fit: cover; position: relative;
  background: linear-gradient(135deg, #1e1b4b 0%, #0f172a 100%);
}
.ai-work-type-badge {
  position: absolute; top: 8px; left: 8px;
  padding: 2px 8px; border-radius: 4px;
  font-size: 10px; font-weight: 600; letter-spacing: 0.5px;
  backdrop-filter: blur(8px);
}
.ai-work-type-badge.cinema { background: rgba(239,68,68,0.2); color: #fca5a5; border: 1px solid rgba(239,68,68,0.3); }
.ai-work-type-badge.novel { background: rgba(34,197,94,0.2); color: #86efac; border: 1px solid rgba(34,197,94,0.3); }
.ai-work-type-badge.image { background: rgba(168,85,247,0.2); color: #d8b4fe; border: 1px solid rgba(168,85,247,0.3); }
.ai-work-type-badge.video { background: rgba(59,130,246,0.2); color: #93c5fd; border: 1px solid rgba(59,130,246,0.3); }
.ai-work-earn-badge {
  position: absolute; bottom: 8px; right: 8px;
  padding: 2px 6px; border-radius: 4px;
  font-size: 9px; font-weight: 600;
  background: rgba(240,180,41,0.15); color: #fbbf24;
  border: 1px solid rgba(240,180,41,0.25);
  backdrop-filter: blur(8px);
}
.ai-work-info { padding: 10px 12px; }
.ai-work-title {
  font-size: 13px; color: #e2e8f0; margin: 0 0 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500;
}
.ai-work-meta {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11px; color: rgba(255,255,255,0.35);
}
.ai-work-author { display: flex; align-items: center; gap: 4px; }
.ai-work-stats { display: flex; gap: 8px; }
.ai-work-earn-line {
  margin-top: 6px; padding-top: 6px;
  border-top: 1px solid rgba(255,255,255,0.04);
  font-size: 11px; color: #f0b429;
  display: flex; align-items: center; gap: 4px;
}
.ai-empty {
  text-align: center; padding: 60px 20px;
  color: rgba(255,255,255,0.25); grid-column: 1 / -1;
}
.ai-empty-icon { font-size: 48px; margin-bottom: 12px; }

/* === 上传按钮 === */
.ai-upload-btn {
  position: fixed; bottom: 100px; right: 20px;
  width: 52px; height: 52px; border-radius: 14px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border: none; color: #fff; font-size: 22px; cursor: pointer;
  box-shadow: 0 4px 20px rgba(99,102,241,0.3);
  z-index: 100; transition: all 0.3s;
}
.ai-upload-btn:hover { transform: scale(1.05); box-shadow: 0 6px 28px rgba(99,102,241,0.4); }

/* === 弹窗通用 === */
.ai-modal {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.8); backdrop-filter: blur(8px);
  z-index: 1000; display: flex;
  align-items: center; justify-content: center; padding: 20px;
}
.ai-modal-content {
  background: #111827; border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px; max-width: 500px; width: 100%;
  max-height: 80vh; overflow-y: auto; position: relative;
}
.ai-modal-close {
  position: absolute; top: 14px; right: 14px;
  width: 36px; height: 36px; min-width: 36px; min-height: 36px;
  border-radius: 8px; background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.5); font-size: 16px; cursor: pointer;
  transition: all 0.2s; display: flex; align-items: center;
  justify-content: center; padding: 4px 8px;
}
.ai-modal-close:hover { background: rgba(255,255,255,0.1); color: #fff; }
.ai-modal-close:active { background: rgba(255,255,255,0.15); transform: scale(0.92); }

/* === 详情弹窗 === */
.ai-detail-header { padding: 20px 20px 10px; }
.ai-detail-header h3 { margin: 0 0 5px; color: #e2e8f0; font-size: 17px; font-weight: 600; }
.ai-detail-author { color: rgba(255,255,255,0.4); font-size: 12px; }
.ai-detail-media { width: 100%; min-height: 200px; background: #000; }
.ai-detail-media iframe { width: 100%; height: 280px; border: none; }
.ai-detail-media img { width: 100%; max-height: 320px; object-fit: contain; }
.ai-detail-info { padding: 14px 20px; }
.ai-detail-info p { color: rgba(255,255,255,0.6); font-size: 13px; line-height: 1.7; margin: 0 0 14px; }
.ai-detail-stats {
  display: flex; gap: 16px; padding: 12px 0;
  border-top: 1px solid rgba(255,255,255,0.04);
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.4); font-size: 12px;
}
.ai-detail-earn {
  margin-top: 10px; padding: 10px 12px;
  background: rgba(240,180,41,0.06); border: 1px solid rgba(240,180,41,0.12);
  border-radius: 8px; font-size: 12px; color: #f0b429;
  display: flex; align-items: center; gap: 6px;
  flex-direction: column; align-items: flex-start;
}
.ai-detail-actions { padding: 14px 20px 20px; }
.ai-like-btn {
  width: 100%; padding: 11px;
  background: rgba(129,140,248,0.1); border: 1px solid rgba(129,140,248,0.2);
  border-radius: 10px; color: #a5b4fc; font-size: 13px;
  cursor: pointer; transition: all 0.2s;
}
.ai-like-btn:hover {
  background: rgba(129,140,248,0.18); border-color: rgba(129,140,248,0.35);
}
.ai-like-btn:active { transform: scale(0.97); }

/* === 上传表单 === */
.ai-upload-content h3 { color: #e2e8f0; text-align: center; margin: 0; padding: 20px; font-weight: 600; }
.ai-upload-form { padding: 0 20px 20px; }
.ai-upload-form .form-group { margin-bottom: 14px; }
.ai-upload-form label { display: block; color: rgba(255,255,255,0.45); font-size: 12px; margin-bottom: 6px; }
.ai-upload-form input,
.ai-upload-form select,
.ai-upload-form textarea {
  width: 100%; padding: 10px 12px;
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px; color: #e2e8f0; font-size: 13px;
  transition: border-color 0.2s;
}
.ai-upload-form input:focus,
.ai-upload-form select:focus,
.ai-upload-form textarea:focus { outline: none; border-color: rgba(129,140,248,0.3); }
.ai-upload-form input::placeholder,
.ai-upload-form textarea::placeholder { color: rgba(255,255,255,0.2); }
.ai-upload-note {
  background: rgba(240,180,41,0.06); border: 1px solid rgba(240,180,41,0.12);
  border-radius: 8px; padding: 10px; color: #f0b429; font-size: 11px;
  margin-bottom: 14px;
}
.ai-submit-btn {
  width: 100%; padding: 12px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border: none; border-radius: 10px; color: #fff;
  font-size: 14px; font-weight: 500; cursor: pointer; transition: all 0.2s;
}
.ai-submit-btn:hover { opacity: 0.9; }

/* === 动画 === */
@keyframes aiFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.ai-work-card { animation: aiFadeIn 0.35s ease both; }

/* === 响应式 === */
@media (min-width: 768px) {
  .ai-works-grid { grid-template-columns: repeat(3, 1fr); }
  .ai-title { font-size: 32px; }
  .ai-work-cover { height: 130px; }
  .ai-daily-img { height: 260px; }
}
@media (min-width: 1024px) {
  .ai-works-grid { grid-template-columns: repeat(4, 1fr); }
  .ai-work-cover { height: 140px; }
  .ai-daily-img { height: 300px; }
}
