/* ========================================================================
   ai-drama.css —— AI 短剧页：ComfyUI 节点画布风格
   ======================================================================== */

.ad-page {
  position: relative;
  z-index: 1;
  padding-top: 76px;
  overflow: hidden;
}

/* ===== Banner ===== */
.ad-hero {
  position: relative;
  padding: 150px 48px 110px;
  text-align: center;
  overflow: hidden;
  background-size: cover;
  background-position: center 30%;
  background-repeat: no-repeat;
}
.ad-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(10, 14, 20, 0.82) 0%, rgba(10, 14, 20, 0.68) 45%, var(--bg-dark) 100%),
    radial-gradient(ellipse at 50% 40%, rgba(10, 14, 20, 0.2), rgba(10, 14, 20, 0.85));
}
.ad-hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  pointer-events: none;
  z-index: 1;
}
.ad-hero-orb-a {
  width: 380px;
  height: 380px;
  top: -120px;
  left: -80px;
  background: rgba(58, 123, 213, 0.28);
  animation: adFloat 13s ease-in-out infinite alternate;
}
.ad-hero-orb-b {
  width: 320px;
  height: 320px;
  right: -60px;
  bottom: -140px;
  background: rgba(201, 165, 76, 0.16);
  animation: adFloat 16s ease-in-out infinite alternate-reverse;
}
.ad-hero-inner {
  position: relative;
  z-index: 2;
  max-width: 940px;
  margin: 0 auto;
}
.ad-hero-label {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 5px;
  color: var(--gold);
  margin-bottom: 18px;
}
.ad-hero-title {
  font-size: clamp(34px, 6vw, 62px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: 4px;
  margin-bottom: 22px;
  background: linear-gradient(120deg, var(--text-primary) 10%, var(--accent-light) 55%, var(--gold-light) 95%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.ad-hero-desc {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.9;
}
.ad-hero-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 28px 0 34px;
}
.ad-hero-tags span {
  padding: 6px 16px;
  font-size: 13px;
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(10, 14, 20, 0.35);
}
.ad-hero-tags span:first-child {
  color: var(--gold-light);
  border-color: rgba(201, 165, 76, 0.45);
}
.ad-hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

/* ===== 区块通用 ===== */
.ad-section {
  max-width: 1240px;
  margin: 0 auto;
  padding: 60px 40px;
}
.ad-section-desc {
  max-width: 760px;
  margin: -28px auto 46px;
  text-align: center;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.9;
}

/* ========================================================================
   ComfyUI 画布
   ======================================================================== */
.ad-canvas {
  max-width: 1160px;
  margin: 0 auto;
  background: #1b1b1f;
  border: 1px solid #35353c;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
}
.ad-canvas-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 16px;
  background: #232327;
  border-bottom: 1px solid #33333a;
}
.ad-canvas-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.ad-canvas-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4f9cf9;
  box-shadow: 0 0 10px rgba(79, 156, 249, 0.8);
  flex: 0 0 auto;
}
.ad-canvas-file {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  color: #d4d4da;
  letter-spacing: 0.4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ad-canvas-badge {
  padding: 2px 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  letter-spacing: 1px;
  color: #8bc34a;
  border: 1px solid rgba(139, 195, 74, 0.45);
  border-radius: 3px;
  flex: 0 0 auto;
}
.ad-canvas-meta {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  color: #82828c;
  white-space: nowrap;
}
.ad-canvas-body {
  position: relative;
  padding: 48px 44px 56px;
  background-color: #1b1b1f;
  background-image:
    radial-gradient(circle, #2f2f36 1px, transparent 1px),
    radial-gradient(ellipse at 50% 0%, rgba(79, 156, 249, 0.06), transparent 60%);
  background-size: 22px 22px, 100% 100%;
}
.ad-chart {
  max-width: 100%;
  margin: 0 auto;
}

/* ===== 节点 ===== */
.ad-chart-node {
  position: relative;
  z-index: 1;
  background: #2a2a2e;
  border: 1px solid #3c3c44;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  transition: border-color 0.25s, box-shadow 0.25s;
}
.ad-chart-node:hover {
  border-color: rgba(79, 156, 249, 0.75);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(79, 156, 249, 0.2);
}
.ad-node-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: #35353b;
  border-bottom: 1px solid #414149;
  border-radius: 7px 7px 0 0;
}
.ad-node-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4f9cf9;
  flex: 0 0 auto;
}
.ad-node-dot.is-string { background: #8bc34a; }
.ad-node-dot.is-image { background: #4f9cf9; }
.ad-node-dot.is-prompt { background: #ffb74d; }
.ad-node-dot.is-shots { background: #ba68c8; }
.ad-node-dot.is-video { background: #f06292; }
.ad-node-type {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  color: #d2d2d8;
  letter-spacing: 0.3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ad-node-id {
  margin-left: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  color: #7c7c86;
  flex: 0 0 auto;
}
.ad-node-media {
  margin: 0;
  overflow: hidden;
  background: #121216;
  border-bottom: 1px solid #3a3a42;
}
.ad-node-media img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform 0.5s;
}
.ad-chart-node:hover .ad-node-media img {
  transform: scale(1.03);
}
.ad-node-io {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 10px;
  background: #26262a;
  border-bottom: 1px solid #34343b;
}
.ad-sock {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10.5px;
  color: #9a9aa4;
  white-space: nowrap;
}
.ad-sock::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4f9cf9;
  box-shadow: 0 0 0 2px rgba(79, 156, 249, 0.15);
  flex: 0 0 auto;
}
.ad-sock.is-out {
  flex-direction: row-reverse;
}
.ad-sock.is-string::before { background: #8bc34a; box-shadow: 0 0 0 2px rgba(139, 195, 74, 0.15); }
.ad-sock.is-image::before { background: #4f9cf9; box-shadow: 0 0 0 2px rgba(79, 156, 249, 0.15); }
.ad-sock.is-prompt::before { background: #ffb74d; box-shadow: 0 0 0 2px rgba(255, 183, 77, 0.15); }
.ad-sock.is-shots::before { background: #ba68c8; box-shadow: 0 0 0 2px rgba(186, 104, 200, 0.15); }
.ad-sock.is-video::before { background: #f06292; box-shadow: 0 0 0 2px rgba(240, 98, 146, 0.15); }
.ad-node-body {
  padding: 14px 14px 16px;
}
.ad-node-body h3 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  color: #ececf1;
}
.ad-node-body p {
  font-size: 12.5px;
  color: #a4a4ae;
  line-height: 1.75;
}

/* 根节点 */
.ad-chart-root {
  position: relative;
  display: flex;
  justify-content: center;
  padding-bottom: 40px;
}
.ad-chart-root .ad-chart-node::after {
  content: '';
  position: absolute;
  bottom: -40px;
  left: 50%;
  width: 1px;
  height: 40px;
  background: rgba(150, 158, 170, 0.45);
}
.is-root {
  width: 100%;
  max-width: 460px;
}
.is-root .ad-node-body h3 {
  font-size: 18px;
}

/* 四条支线 */
.ad-branch-list {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  list-style: none;
  margin: 0;
  padding: 40px 0 0;
}
.ad-branch-list::before {
  content: '';
  position: absolute;
  top: 0;
  left: 12.5%;
  right: 12.5%;
  height: 1px;
  background: rgba(150, 158, 170, 0.4);
}
.ad-branch-list > li::before {
  content: '';
  position: absolute;
  top: -40px;
  left: 50%;
  width: 1px;
  height: 40px;
  background: rgba(150, 158, 170, 0.4);
}
.ad-branch-list > li::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  width: 1px;
  height: 32px;
  background: rgba(150, 158, 170, 0.35);
}
.is-branch .ad-node-body {
  padding: 12px 12px 14px;
}
.is-branch .ad-node-body h3 {
  font-size: 15px;
}
.is-branch .ad-node-body p {
  font-size: 12px;
}

/* 汇聚节点 */
.ad-merge {
  position: relative;
  display: flex;
  justify-content: center;
  padding-top: 32px;
}
.ad-merge::before {
  content: '';
  position: absolute;
  top: 0;
  left: 12.5%;
  right: 12.5%;
  height: 1px;
  background: rgba(150, 158, 170, 0.4);
}
.ad-merge::after {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  width: 1px;
  height: 32px;
  background: rgba(150, 158, 170, 0.4);
}
.is-merge {
  width: 100%;
  max-width: 560px;
}

/* 后续链路 */
.ad-chain {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.is-chain {
  width: 100%;
  max-width: 560px;
  margin-top: 44px;
}
.is-chain::before {
  content: '';
  position: absolute;
  top: -44px;
  left: 50%;
  width: 1px;
  height: 44px;
  background: repeating-linear-gradient(180deg,
    rgba(150, 158, 170, 0.55) 0 5px,
    transparent 5px 10px);
}

/* ===== 视角分类（Preview 节点） ===== */
.ad-shots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.ad-shot {
  padding: 0 0 18px;
  background: #26262a;
  border: 1px solid #3a3a42;
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.ad-shot::before {
  content: 'Preview Image';
  display: block;
  margin-bottom: 14px;
  padding: 8px 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  color: #b8b8c0;
  letter-spacing: 0.4px;
  background: #35353b;
  border-bottom: 1px solid #414149;
}
.ad-shot:hover {
  border-color: rgba(79, 156, 249, 0.6);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4);
}
.ad-shot-visual {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  margin: 0 14px 14px;
  border: 1px solid #3c3c44;
  border-radius: 4px;
  background-color: #121216;
  background-image:
    linear-gradient(rgba(91, 156, 245, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(91, 156, 245, 0.08) 1px, transparent 1px),
    radial-gradient(ellipse at 50% 100%, rgba(58, 123, 213, 0.25), transparent 65%);
  background-size: 32px 32px, 32px 32px, 100% 100%;
}
.ad-figure {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 24px;
  height: 64px;
  border-radius: 12px 12px 0 0;
  background: linear-gradient(180deg, rgba(91, 156, 245, 0.95), rgba(58, 123, 213, 0.2));
  transform: translateX(-50%) scale(var(--s, 1));
  transform-origin: bottom center;
}
.ad-figure::before {
  content: '';
  position: absolute;
  top: -17px;
  left: 50%;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(232, 201, 106, 0.9);
  transform: translateX(-50%);
}
.is-wide .ad-figure { --s: 0.5; }
.is-full .ad-figure { --s: 0.7; }
.is-medium .ad-figure { --s: 0.95; }
.is-close .ad-figure { --s: 1.35; }
.is-tight .ad-figure { --s: 2.1; }
.is-macro .ad-figure { --s: 3.2; }
.ad-shot h3 {
  padding: 0 16px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  color: #ececf1;
}
.ad-shot p {
  padding: 0 16px;
  font-size: 12.5px;
  color: #a4a4ae;
  line-height: 1.75;
}

/* ===== 提示词模板（CLIP Text Encode 节点） ===== */
.ad-terminal {
  max-width: 920px;
  margin: 0 auto;
  background: #26262a;
  border: 1px solid #3c3c44;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}
.ad-terminal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  background: #35353b;
  border-bottom: 1px solid #414149;
}
.ad-terminal-title {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  letter-spacing: 0.3px;
  color: #d2d2d8;
}
.ad-terminal-badge {
  margin-left: auto;
  padding: 2px 7px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  letter-spacing: 0.5px;
  color: #ffb74d;
  border: 1px solid rgba(255, 183, 77, 0.45);
  border-radius: 3px;
}
.ad-terminal-body {
  padding: 20px 22px;
  overflow-x: auto;
  background: #1e1e22;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  line-height: 2;
  color: #c3d2e3;
  white-space: pre;
}
.ad-tools {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  max-width: 920px;
  margin: 26px auto 0;
}
.ad-tools span {
  padding: 5px 13px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px;
  color: #a4a4ae;
  border: 1px solid #3a3a42;
  border-radius: 4px;
  background: #26262a;
  transition: color 0.25s, border-color 0.25s;
}
.ad-tools span::before {
  content: '# ';
  color: #6e6e78;
}
.ad-tools span:hover {
  color: #d2d2d8;
  border-color: rgba(79, 156, 249, 0.55);
}

/* ===== 结尾 ===== */
.ad-outro {
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 48px 110px;
  text-align: center;
}
.ad-outro p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 2;
  margin-bottom: 14px;
}
.ad-outro a {
  font-size: 14px;
  color: var(--gold-light);
  text-decoration: none;
  border-bottom: 1px solid rgba(201, 165, 76, 0.35);
  padding-bottom: 2px;
  transition: color 0.3s, border-color 0.3s;
}
.ad-outro a:hover {
  color: var(--accent-light);
  border-color: var(--accent-light);
}

/* ===== 动画 ===== */
@keyframes adFloat {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(46px, 34px, 0) scale(1.12); }
}

/* ===== 响应式 ===== */
@media (max-width: 1024px) {
  .ad-hero {
    padding: 130px 32px 90px;
  }
  .ad-section {
    padding: 50px 28px;
  }
  .ad-branch-list {
    grid-template-columns: repeat(2, 1fr);
  }
  .ad-branch-list::before {
    left: 25%;
    right: 25%;
  }
  .ad-merge::before {
    left: 25%;
    right: 25%;
  }
  .ad-branch-list > li::after {
    display: none;
  }
  .ad-branch-list > li:nth-child(3)::after,
  .ad-branch-list > li:nth-child(4)::after {
    display: block;
  }
  .ad-shots {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 768px) {
  .ad-hero {
    padding: 120px 20px 70px;
    background-position: center top;
  }
  .ad-hero-actions {
    flex-direction: column;
  }
  .ad-hero-actions .btn-primary,
  .ad-hero-actions .btn-outline {
    width: 100%;
    justify-content: center;
  }
  .ad-section {
    padding: 44px 16px;
  }
  .ad-section-desc {
    margin-bottom: 30px;
  }
  .ad-canvas-bar {
    padding: 9px 12px;
  }
  .ad-canvas-meta {
    display: none;
  }
  .ad-canvas-body {
    padding: 26px 12px 32px;
    background-size: 18px 18px, 100% 100%;
  }
  .ad-chart-root {
    padding-bottom: 20px;
  }
  .ad-branch-list {
    grid-template-columns: 1fr;
    gap: 16px;
    padding-top: 0;
  }
  .ad-branch-list::before,
  .ad-branch-list > li::before,
  .ad-branch-list > li::after,
  .ad-merge::before,
  .ad-merge::after,
  .ad-chart-root .ad-chart-node::after {
    display: none;
  }
  .ad-merge {
    padding-top: 20px;
  }
  .is-chain {
    margin-top: 16px;
  }
  .is-chain::before {
    display: none;
  }
  .ad-shots {
    grid-template-columns: 1fr;
  }
  .ad-terminal-body {
    font-size: 11.5px;
    padding: 16px;
  }
  .ad-outro {
    padding: 20px 20px 80px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ad-hero-orb {
    animation: none;
  }
}
