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

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display",
    "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: #0a0a0f;
  color: #eaeaf2;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============ 顶栏 ============ */
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 40px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  position: sticky; top: 0;
  background: rgba(10,10,15,0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 100;
}
.logo {
  font-size: 17px; font-weight: 600; letter-spacing: -0.01em;
  background: linear-gradient(90deg, #ffffff, #a78bfa);
  -webkit-background-clip: text; color: transparent;
}
.topbar nav { display: flex; gap: 28px; }
.topbar nav a {
  color: rgba(255,255,255,0.55); text-decoration: none;
  font-size: 14px; font-weight: 500;
  transition: color 0.2s;
}
.topbar nav a:hover, .topbar nav a.active { color: #fff; }
.user-info { font-size: 13px; color: rgba(255,255,255,0.45); }

/* ============ Hero ============ */
.hero {
  text-align: center; padding: 120px 20px 80px;
  position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; top: -50%; left: 50%;
  transform: translateX(-50%);
  width: 800px; height: 800px;
  background: radial-gradient(circle, rgba(139,92,246,0.15), transparent 60%);
  pointer-events: none;
}
.hero h1 {
  font-size: 72px; font-weight: 800;
  letter-spacing: -0.04em; line-height: 1.05;
  margin-bottom: 24px;
  background: linear-gradient(135deg, #fff 0%, #c4b5fd 50%, #f0abfc 100%);
  -webkit-background-clip: text; color: transparent;
  background-size: 200%;
  animation: heroShine 8s ease-in-out infinite;
  position: relative;
}
@keyframes heroShine {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
.hero p {
  font-size: 19px; font-weight: 400;
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.01em; margin-bottom: 48px;
  position: relative;
}
.cta-btn {
  display: inline-block; padding: 16px 44px;
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
  color: #fff; text-decoration: none;
  font-weight: 600; font-size: 15px;
  letter-spacing: 0.02em;
  border-radius: 999px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 8px 32px rgba(139,92,246,0.35);
  position: relative;
}
.cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 44px rgba(139,92,246,0.55);
}

/* ============ 区块 ============ */
.section { max-width: 1280px; margin: 0 auto 80px; padding: 0 40px; }
.section h2 {
  font-size: 26px; font-weight: 700;
  letter-spacing: -0.02em; margin-bottom: 28px;
  color: #fff;
}

/* ============ AI 应用展示卡片 ============ */
.app-showcase {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}
@media (max-width: 768px) {
  .app-showcase { grid-template-columns: 1fr; }
}
.showcase-card {
  position: relative; display: block;
  aspect-ratio: 16 / 10;
  border-radius: 20px; overflow: hidden;
  cursor: pointer; text-decoration: none; color: #fff;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.4s;
  isolation: isolate;
  background: #15151f;
}
.showcase-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 24px 60px rgba(0,0,0,0.7),
              0 0 0 1px color-mix(in srgb, var(--accent) 60%, transparent);
}
.showcase-video {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
  z-index: 0;
  transition: transform 0.6s ease;
}
.showcase-card:hover .showcase-video { transform: scale(1.06); }
.showcase-overlay {
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(
    to top,
    rgba(0,0,0,0.85) 0%,
    rgba(0,0,0,0.35) 45%,
    rgba(0,0,0,0.1) 100%
  );
  transition: background 0.3s;
}
.showcase-content {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 26px 24px; z-index: 2;
}
.showcase-title {
  font-size: 22px; font-weight: 700;
  letter-spacing: -0.02em; margin-bottom: 8px;
  text-shadow: 0 2px 12px rgba(0,0,0,0.5);
}
.showcase-desc {
  font-size: 13px; font-weight: 400;
  color: rgba(255,255,255,0.72);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.showcase-arrow {
  position: absolute; top: 20px; right: 20px;
  z-index: 2; width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 600;
  opacity: 0; transform: translateX(-8px);
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.showcase-card:hover .showcase-arrow {
  opacity: 1; transform: translateX(0);
}

/* ============ 瀑布流 ============ */
.masonry { column-count: 4; column-gap: 18px; }
@media (max-width: 1200px) { .masonry { column-count: 3; } }
@media (max-width: 768px)  { .masonry { column-count: 2; } }
@media (max-width: 480px)  { .masonry { column-count: 1; } }

.masonry-item {
  break-inside: avoid; margin-bottom: 18px;
  border-radius: 14px; overflow: hidden;
  position: relative; cursor: pointer;
  background: #15151f;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.masonry-item:hover { transform: translateY(-4px); }
.masonry-item img {
  width: 100%; display: block;
  transition: transform 0.5s ease;
}
.masonry-item:hover img { transform: scale(1.04); }
.masonry-item .tag {
  position: absolute; top: 10px; left: 10px;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #fff; font-size: 11px; font-weight: 600;
  letter-spacing: 0.02em;
  padding: 3px 10px; border-radius: 999px;
  z-index: 2;
  border: 1px solid rgba(255,255,255,0.15);
}
.masonry-item .dur {
  position: absolute; bottom: 10px; right: 10px;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 3px 8px; border-radius: 4px;
  font-size: 11px; font-weight: 500;
  color: #fff; z-index: 2;
  font-variant-numeric: tabular-nums;
}
.masonry-item .meta {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 40px 14px 14px;
  font-size: 14px; font-weight: 500;
  letter-spacing: -0.01em;
  background: linear-gradient(transparent, rgba(0,0,0,0.85));
  color: #fff;
  z-index: 1;
}

.load-more {
  text-align: center; padding: 48px;
  color: rgba(255,255,255,0.35);
  cursor: pointer; font-size: 14px;
  font-weight: 500; letter-spacing: 0.01em;
  transition: color 0.25s;
}
.load-more:hover { color: #a78bfa; }

/* ============ 创作台 ============ */
.create-layout {
  display: grid; grid-template-columns: 400px 1fr; gap: 28px;
  padding: 40px; max-width: 1440px; margin: 0 auto;
}
@media (max-width: 900px) { .create-layout { grid-template-columns: 1fr; } }

.panel {
  background: #12121a;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 20px; padding: 28px;
  height: fit-content; position: sticky; top: 100px;
}
.panel h3 {
  font-size: 17px; font-weight: 600;
  letter-spacing: -0.01em; margin-bottom: 22px;
}
.panel label {
  display: block; margin: 18px 0 8px;
  font-size: 13px; font-weight: 500;
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.01em;
}
.panel textarea, .panel select, .panel input[type="text"] {
  width: 100%; background: #0a0a0f;
  border: 1px solid rgba(255,255,255,0.08);
  color: #fff; border-radius: 10px;
  padding: 12px 14px; font-size: 14px;
  outline: none; font-family: inherit;
  resize: vertical;
  transition: border-color 0.2s;
}
.panel textarea:focus, .panel select:focus, .panel input:focus {
  border-color: #8b5cf6;
}
.panel button {
  width: 100%; margin-top: 24px; padding: 14px;
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
  border: none; border-radius: 10px; color: #fff;
  font-weight: 600; font-size: 15px;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s;
}
.panel button:hover:not(:disabled) {
  opacity: 0.92; transform: translateY(-1px);
}
.panel button:disabled { opacity: 0.4; cursor: not-allowed; }
.status {
  margin-top: 14px; font-size: 13px;
  color: #a78bfa; letter-spacing: 0.01em;
}

/* 创作模式卡片 */
.mode-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px; margin-bottom: 22px;
}
.mode-card {
  padding: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px; cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  background: #0a0a0f;
}
.mode-card:hover {
  border-color: rgba(139,92,246,0.5);
  transform: translateY(-1px);
}
.mode-card.active {
  border-color: #8b5cf6;
  background: rgba(139,92,246,0.08);
  box-shadow: 0 0 0 1px #8b5cf6 inset;
}
.mode-title {
  font-size: 13px; font-weight: 600;
  color: #fff; margin-bottom: 5px;
  letter-spacing: -0.01em;
}
.mode-desc {
  font-size: 11px;
  color: rgba(255,255,255,0.45);
  line-height: 1.45;
}

/* ============ 结果区 ============ */
.preview { min-height: 500px; }
.result-box {
  background: #12121a;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 20px; padding: 32px;
  min-height: 500px;
  font-size: 15px; line-height: 1.8;
  letter-spacing: 0.005em;
  white-space: pre-wrap; word-break: break-word;
}
.result-box .empty {
  color: rgba(255,255,255,0.25);
  text-align: center; padding: 100px 20px;
  font-size: 14px; letter-spacing: 0.01em;
}
.result-box .cursor {
  display: inline-block; width: 7px; height: 17px;
  background: #8b5cf6; margin-left: 3px;
  border-radius: 2px;
  animation: blink 1.1s ease-in-out infinite;
  vertical-align: middle;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.15; }
}

/* 图片上传 */
.upload-area {
  margin-top: 14px; padding: 20px;
  border: 1px dashed rgba(255,255,255,0.1);
  border-radius: 10px; text-align: center;
  cursor: pointer;
  transition: all 0.25s;
  font-size: 13px;
  color: rgba(255,255,255,0.45);
}
.upload-area:hover {
  border-color: #8b5cf6;
  color: #a78bfa;
  background: rgba(139,92,246,0.03);
}
.upload-area img {
  max-width: 100%; max-height: 120px;
  border-radius: 8px; margin-top: 10px;
}

/* ============ 视频卡片：统一 16:9，裁剪适配 ============ */
.masonry-video video {
  width: 100% !important;
  aspect-ratio: 16 / 9 !important;
  object-fit: cover !important;
  display: block !important;
  border-radius: 14px;
  background: #f5f3ee;
}

/* ============ 视频弹层（必须有，否则视频会堆在页面底部） ============ */
.video-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: vModalIn 0.25s ease;
}
@keyframes vModalIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.video-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  cursor: pointer;
}
.video-modal-content {
  position: relative;
  z-index: 1;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.video-modal-content video {
  max-width: 100%;
  max-height: 75vh;
  border-radius: 16px;
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.6);
  background: #000;
}
.video-modal-info {
  color: #fff;
  text-align: center;
}
.video-modal-info h3 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}
.video-modal-info p {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
}
.video-modal-close {
  position: absolute;
  top: -48px;
  right: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.video-modal-close:hover {
  background: rgba(255, 255, 255, 0.25);
}
body.modal-open {
  overflow: hidden;
}

/* ============ 禁用图片/视频拖拽和右键 ============ */
.masonry-item img,
.masonry-item video,
.showcase-video {
  -webkit-user-drag: none;
  user-select: none;
  -webkit-touch-callout: none;
}
