/* ============================================================
   案例库 · 任务展示页样式（独立主题：深色画廊风）
   用于 demo/case.html —— 每个 AI 任务一个页面，全素材可视化
   ============================================================ */

:root {
  --bg0: #0f1020;
  --bg1: #171936;
  --card: rgba(255, 255, 255, 0.045);
  --card-line: rgba(255, 255, 255, 0.09);
  --gold: #f4c542;
  --gold-2: #e8a23d;
  --text: #f2f3fa;
  --text-sub: #9aa0c0;
  --accent: #7c8cff;
  --success: #4ade80;
  --radius: 16px;
}

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

html, body {
  background: radial-gradient(1200px 600px at 20% -10%, #232652 0%, var(--bg0) 55%) fixed, var(--bg0);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 12px 22px;
  background: rgba(15, 16, 32, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--card-line);
}
.topbar .back {
  color: var(--text-sub);
  text-decoration: none;
  font-size: 13px;
  padding: 6px 12px;
  border: 1px solid var(--card-line);
  border-radius: 999px;
  transition: all 0.15s;
  white-space: nowrap;
}
.topbar .back:hover { color: var(--text); border-color: var(--gold); }
.topbar .brand { font-weight: 800; letter-spacing: 1px; font-size: 15px; }
.topbar .brand em { color: var(--gold); font-style: normal; }

.tabs { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.tab {
  border: 1px solid var(--card-line);
  background: transparent;
  color: var(--text-sub);
  font-family: inherit;
  font-size: 13px;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.tab:hover { color: var(--text); border-color: var(--gold); }
.tab.active {
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  color: #231a00;
  font-weight: 700;
  border-color: transparent;
}

/* ---------- 主容器 ---------- */
.case {
  max-width: 1060px;
  margin: 0 auto;
  padding: 26px 20px 80px;
}

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
  background: var(--card);
  border: 1px solid var(--card-line);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 26px;
}
.hero-cover {
  width: 100%;
  border-radius: 12px;
  object-fit: cover;
  aspect-ratio: 3 / 4;
  border: 1px solid var(--card-line);
  cursor: zoom-in;
}
.hero-info h1 { font-size: 28px; letter-spacing: 1px; }
.hero-info h1 .emoji { margin-right: 6px; }
.hero-status {
  display: inline-block;
  margin: 8px 0;
  font-size: 12px;
  color: var(--success);
  border: 1px solid rgba(74, 222, 128, 0.35);
  padding: 3px 10px;
  border-radius: 999px;
}
.hero-desc { color: var(--text-sub); font-size: 14px; line-height: 1.8; margin: 8px 0 14px; }
.spec-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.spec {
  font-size: 12px;
  background: rgba(124, 140, 255, 0.12);
  border: 1px solid rgba(124, 140, 255, 0.25);
  color: #c7ceff;
  padding: 5px 11px;
  border-radius: 8px;
}

/* ---------- 区块 ---------- */
.section {
  background: var(--card);
  border: 1px solid var(--card-line);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 26px;
}
.section h2 {
  font-size: 18px;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section .sub { color: var(--text-sub); font-size: 13px; margin-bottom: 16px; }
.section h2 .bar {
  width: 4px; height: 18px;
  background: linear-gradient(var(--gold), var(--gold-2));
  border-radius: 2px;
}

/* ---------- 成片播放器 ---------- */
.video-shell {
  display: flex;
  justify-content: center;
  background: #0a0b16;
  border-radius: 12px;
  padding: 14px;
  border: 1px solid var(--card-line);
}
.video-shell video {
  max-height: 560px;
  max-width: 100%;
  border-radius: 10px;
  background: #000;
}
.dl-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.dl-link {
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
  border: 1px solid rgba(124, 140, 255, 0.3);
  padding: 6px 12px;
  border-radius: 999px;
  transition: all 0.15s;
}
.dl-link:hover { background: rgba(124, 140, 255, 0.12); }

/* ---------- 音乐区 ---------- */
.music-grid { display: grid; grid-template-columns: 240px 1fr; gap: 20px; }
.music-cover { width: 100%; border-radius: 12px; border: 1px solid var(--card-line); cursor: zoom-in; }
.music-info audio { width: 100%; margin: 10px 0; }
.music-title { font-weight: 700; font-size: 16px; }
.music-meta { color: var(--text-sub); font-size: 12px; margin-bottom: 8px; }
details.lyrics {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-line);
  border-radius: 10px;
  padding: 10px 14px;
  margin-top: 10px;
}
details.lyrics summary { cursor: pointer; font-size: 13px; color: var(--text-sub); }
details.lyrics pre {
  white-space: pre-wrap;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.9;
  color: var(--text);
  margin-top: 10px;
  max-height: 260px;
  overflow: auto;
}

/* ---------- 角色图鉴（原图 vs 3D） ---------- */
.char-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; }
.char-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-line);
  border-radius: 12px;
  padding: 8px;
}
.char-card .pair { display: flex; gap: 6px; }
.char-card .pair img {
  width: 50%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--card-line);
  cursor: zoom-in;
}
.char-card .name {
  font-size: 11px;
  color: var(--text-sub);
  text-align: center;
  margin-top: 7px;
  line-height: 1.5;
}
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--text-sub); margin-bottom: 12px; }
.legend span b { color: var(--text); }

/* ---------- 镜头链路 ---------- */
.shot-list { display: flex; flex-direction: column; gap: 14px; }
.shot {
  display: grid;
  grid-template-columns: 150px 120px 1fr;
  gap: 14px;
  align-items: start;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-line);
  border-radius: 12px;
  padding: 12px;
}
.shot .cell { display: flex; flex-direction: column; gap: 6px; }
.shot .cell .tag { font-size: 11px; color: var(--text-sub); }
.shot .cell img {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--card-line);
  cursor: zoom-in;
  aspect-ratio: 1;
  object-fit: cover;
}
.shot video { width: 100%; max-height: 240px; border-radius: 8px; background: #000; }
.shot .title { font-weight: 700; font-size: 14px; margin-bottom: 4px; }
.shot .script-note { font-size: 12px; color: var(--text-sub); line-height: 1.7; }

/* ---------- 大图（海报/对比墙） ---------- */
.big-img { width: 100%; border-radius: 12px; border: 1px solid var(--card-line); cursor: zoom-in; }

/* ---------- 封面/配音网格 ---------- */
.small-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.small-card { background: rgba(255,255,255,0.03); border: 1px solid var(--card-line); border-radius: 12px; padding: 8px; }
.small-card img { width: 100%; border-radius: 8px; cursor: zoom-in; aspect-ratio: 1; object-fit: cover; }
.small-card .name { font-size: 11px; color: var(--text-sub); text-align: center; margin-top: 6px; }
.small-card audio { width: 100%; margin-top: 6px; }

/* ---------- 文档 ---------- */
.doc-list { display: flex; gap: 10px; flex-wrap: wrap; }
.doc-link {
  font-size: 13px;
  color: var(--text);
  text-decoration: none;
  background: rgba(244, 197, 66, 0.1);
  border: 1px solid rgba(244, 197, 66, 0.35);
  padding: 8px 14px;
  border-radius: 10px;
  transition: all 0.15s;
}
.doc-link:hover { background: rgba(244, 197, 66, 0.2); }

/* ---------- 角色利用率提示条 ---------- */
.util-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  background: rgba(74, 222, 128, 0.08);
  border: 1px solid rgba(74, 222, 128, 0.25);
  color: #b9f6cd;
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: 16px;
}

/* ---------- Lightbox ---------- */
/* 注意：display 会覆盖 hidden 属性，必须先声明 hidden 隐藏，否则全屏遮罩常驻 */
.lightbox[hidden] { display: none; }
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(5, 5, 12, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  cursor: zoom-out;
  padding: 30px;
}
.lightbox img { max-width: 92vw; max-height: 88vh; border-radius: 10px; }

/* ---------- 响应式 ---------- */
@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; }
  .hero-cover { max-width: 300px; }
  .music-grid { grid-template-columns: 1fr; }
  .shot { grid-template-columns: 1fr; }
  .shot .cell { flex-direction: row; align-items: center; }
  .shot .cell img { width: 90px; }
  .tabs { margin-left: 0; width: 100%; }
}
