/* ============================================================
   青禾映画 · 设计系统
   美学方向：编辑式有机风（Editorial Organic）
   参考：thebcms.com 的模块化结构 + 农业温暖质感
   ============================================================ */

/* ---------- 设计令牌 ---------- */
:root {
  /* 色彩 */
  --color-bg: #f5f1e8;          /* 暖米纸色 */
  --color-bg-alt: #fbf8f1;       /* 卡片暖白 */
  --color-surface: #ffffff;      /* 纯白卡片 */
  --color-ink: #1f1f1f;          /* 炭黑主文字 */
  --color-ink-soft: #6b6357;     /* 暖灰次文字 */
  --color-ink-faint: #a39c8e;    /* 极淡灰 */
  --color-brand: #3d5a3d;        /* 深森林绿 */
  --color-brand-deep: #2d4a2b;   /* 更深绿 */
  --color-accent: #c9a961;       /* 麦穗金 */
  --color-accent-soft: #e8d9b0;  /* 淡金 */
  --color-warn: #b85c38;         /* 陶土橙 */
  --color-success: #7b9e5b;      /* 鼠尾草绿 */
  --color-border: #e8e2d5;       /* 边框暖灰 */
  --color-border-strong: #d4ccb8;

  /* 字体 */
  --font-display: "Fraunces", "Songti SC", "Noto Serif SC", Georgia, serif;
  --font-body: "DM Sans", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", Consolas, monospace;

  /* 尺寸 */
  --radius: 8px;
  --radius-sm: 4px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 3px rgba(31, 31, 31, 0.04);
  --shadow-md: 0 4px 16px rgba(31, 31, 31, 0.06);
  --shadow-lg: 0 12px 40px rgba(31, 31, 31, 0.08);

  /* 间距 */
  --space-max: 1200px;
  --space-gutter: 24px;
}

/* ---------- 重置 ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background-color: var(--color-bg);
  color: var(--color-ink);
  line-height: 1.6;
  font-size: 16px;
  min-height: 100vh;
  /* 纸张噪点纹理叠加 */
  background-image:
    url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  background-blend-mode: multiply;
}

/* 纹理层：极淡颗粒 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n2'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n2)'/%3E%3C/svg%3E");
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

/* ---------- 容器 ---------- */
.container {
  width: 100%;
  max-width: var(--space-max);
  margin: 0 auto;
  padding: 0 var(--space-gutter);
  position: relative;
  z-index: 2;
}

/* ---------- 路由页面区块 ---------- */
.page-section {
  display: none;
}

.page-section.is-active {
  display: block;
}

/* 开始创作页内部由多个 section 堆叠，激活时保持 block */
#createPage.is-active {
  display: block;
}

/* ---------- 排版 ---------- */
.display {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.eyebrow {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-brand);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.eyebrow .num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 1px solid var(--color-brand);
  border-radius: 50%;
  font-size: 0.65rem;
  color: var(--color-brand);
}

.section-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.5rem, 3vw, 2rem);
  letter-spacing: -0.015em;
  color: var(--color-ink);
  margin-top: 12px;
}

.section-desc {
  color: var(--color-ink-soft);
  font-size: 0.95rem;
  margin-top: 8px;
  max-width: 56ch;
}

/* ============================================================
   模块 1：顶部导航栏
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(245, 241, 232, 0.85);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--color-border);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand,
.brand-trigger {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
  color: var(--color-ink);
}

.brand-trigger {
  padding: 6px 10px;
  margin-left: -10px;
  border-radius: var(--radius);
  background: transparent;
  cursor: pointer;
  transition: background 0.2s ease;
}

.brand-trigger:hover {
  background: rgba(61, 90, 61, 0.06);
}

.brand__mark {
  width: 28px;
  height: 28px;
  color: var(--color-brand);
  flex-shrink: 0;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  min-width: 0;
}

.site-nav__link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-ink-soft);
  transition: color 0.2s ease;
  white-space: nowrap;
}

.site-nav__link:hover {
  color: var(--color-ink);
}

.site-nav__link.is-active {
  color: var(--color-brand);
  font-weight: 600;
  position: relative;
}

.site-nav__link.is-active::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--color-brand);
  border-radius: 2px;
}

.health-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--color-border-strong);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--color-ink-soft);
  background: var(--color-surface);
}

.health-pill__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-ink-faint);
  transition: background 0.3s ease;
}

.health-pill.is-ok .health-pill__dot {
  background: var(--color-success);
  box-shadow: 0 0 0 3px rgba(123, 158, 91, 0.18);
}

.health-pill.is-err .health-pill__dot {
  background: var(--color-warn);
}

/* ============================================================
   模块 2：Hero 区
   ============================================================ */
.hero {
  padding: 72px 0 56px;
  position: relative;
  overflow: hidden;
}

.hero__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 48px;
  align-items: center;
}

.hero__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
  color: var(--color-ink);
}

.hero__title em {
  font-style: italic;
  font-weight: 500;
  color: var(--color-brand);
}

.hero__sub {
  margin-top: 20px;
  font-size: 1.05rem;
  color: var(--color-ink-soft);
  max-width: 48ch;
  line-height: 1.65;
}

.hero__meta {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--color-border-strong);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--color-ink-soft);
  background: var(--color-bg-alt);
}

.tag__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-accent);
}

/* Hero 装饰：麦穗线条插画 */
.hero__art {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 280px;
}

.hero__art svg {
  width: 100%;
  max-width: 360px;
  height: auto;
  color: var(--color-brand);
  opacity: 0.9;
}

.hero__art::after {
  content: "";
  position: absolute;
  inset: -20px;
  background: radial-gradient(
    circle at 50% 50%,
    rgba(201, 169, 97, 0.12),
    transparent 70%
  );
  z-index: -1;
}

/* ============================================================
   通用：模块区块
   ============================================================ */
.module {
  padding: 56px 0;
  position: relative;
}

.module__head {
  margin-bottom: 32px;
}

/* 卡片基础 */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

/* ============================================================
   模块 3：输入表单
   ============================================================ */
.form-card {
  padding: 32px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px 32px;
  margin-top: 24px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field--full {
  grid-column: 1 / -1;
}

.field__label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-ink);
  display: flex;
  align-items: center;
  gap: 6px;
}

.field__label .req {
  color: var(--color-warn);
  font-weight: 700;
}

.field__hint {
  font-size: 0.78rem;
  color: var(--color-ink-faint);
}

.input,
.textarea,
.select {
  width: 100%;
  padding: 11px 14px;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  color: var(--color-ink);
  font-size: 0.95rem;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.textarea {
  resize: vertical;
  min-height: 88px;
  line-height: 1.5;
}

.input::placeholder,
.textarea::placeholder {
  color: var(--color-ink-faint);
}

.input:focus,
.textarea:focus,
.select:focus {
  outline: none;
  border-color: var(--color-brand);
  background: var(--color-surface);
  box-shadow: 0 0 0 3px rgba(61, 90, 61, 0.1);
}

.select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%236b6357' stroke-width='1.5' d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.btn--primary {
  background: var(--color-brand);
  color: #fff;
  border-color: var(--color-brand);
}

.btn--primary:hover {
  background: var(--color-brand-deep);
  border-color: var(--color-brand-deep);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(61, 90, 61, 0.22);
}

.btn--primary:active {
  transform: translateY(0);
}

.btn--primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn--ghost {
  background: transparent;
  color: var(--color-ink);
  border-color: var(--color-border-strong);
}

.btn--ghost:hover {
  border-color: var(--color-brand);
  color: var(--color-brand);
}

.form-actions {
  margin-top: 28px;
  display: flex;
  gap: 12px;
}

.form-actions .btn {
  flex: 1;
}

/* ============================================================
   模块 4：分步 Agent 工坊
   步骤卡片 / 输出区样式已迁移至 workshop.css
   此处保留媒体工坊（素材生成区）样式
   ============================================================ */

.media-lab {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 22px;
  margin-top: 20px;
  background:
    linear-gradient(135deg, rgba(201, 169, 97, 0.12), transparent 42%),
    var(--color-surface);
}

.media-lab__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 18px;
}

.media-lab__head h3 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  margin-top: 8px;
}

.media-lab__head p {
  color: var(--color-ink-soft);
  margin-top: 6px;
  max-width: 58ch;
}

.media-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.video-preview {
  margin-top: 24px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  background: #172016;
  color: #f5f1e8;
}

.video-preview.is-hidden {
  display: none;
}

.video-preview__frame {
  min-height: 260px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 30% 20%, rgba(201, 169, 97, 0.28), transparent 28%),
    linear-gradient(135deg, #20331f, #11180f);
  position: relative;
  overflow: hidden;
}

.video-preview__play {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: rgba(245, 241, 232, 0.9);
  color: var(--color-brand-deep);
  display: grid;
  place-items: center;
  font-size: 1.8rem;
  box-shadow: 0 18px 60px rgba(0,0,0,0.25);
}

.video-preview__body {
  padding: 18px 20px;
}

.video-preview__body h4 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin-bottom: 8px;
}

.video-preview__body p {
  color: rgba(245, 241, 232, 0.78);
  font-size: 0.9rem;
}

.video-preview__meta {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.video-preview__meta span {
  border: 1px solid rgba(245, 241, 232, 0.18);
  border-radius: 999px;
  padding: 5px 10px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
}

/* ============================================================
   模块 5：流水线进度
   ============================================================ */
.pipeline-card {
  padding: 32px;
}

.pipeline-flow {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin: 24px 0 28px;
  position: relative;
}

.node {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  position: relative;
  z-index: 2;
}

.node__icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg-alt);
  border: 1.5px solid var(--color-border-strong);
  color: var(--color-ink-faint);
  transition: all 0.4s ease;
}

.node__icon svg {
  width: 22px;
  height: 22px;
}

.node__label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-ink-faint);
  transition: color 0.4s ease;
  line-height: 1.3;
}

.node__step {
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--color-ink-faint);
  font-family: var(--font-mono);
}

/* 节点连线 */
.node::after {
  content: "";
  position: absolute;
  top: 26px;
  left: 50%;
  width: 100%;
  height: 1.5px;
  background: var(--color-border-strong);
  z-index: -1;
}

.node:last-child::after {
  display: none;
}

/* 状态：进行中 */
.node.is-active .node__icon {
  border-color: var(--color-accent);
  color: var(--color-accent);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(201, 169, 97, 0.15);
  animation: pulse 1.8s ease-in-out infinite;
}

.node.is-active .node__label {
  color: var(--color-ink);
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(201, 169, 97, 0.15); }
  50% { box-shadow: 0 0 0 8px rgba(201, 169, 97, 0.08); }
}

/* 状态：完成 */
.node.is-done .node__icon {
  border-color: var(--color-success);
  background: var(--color-success);
  color: #fff;
}

.node.is-done .node__label {
  color: var(--color-ink);
}

.node.is-done::after {
  background: var(--color-success);
}

/* 状态：错误 */
.node.is-error .node__icon {
  border-color: var(--color-warn);
  background: var(--color-warn);
  color: #fff;
}

.node.is-error .node__label {
  color: var(--color-warn);
}

/* 进度条 */
.progress-track {
  height: 4px;
  background: var(--color-border);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 16px;
}

.progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--color-accent), var(--color-brand));
  border-radius: 999px;
  transition: width 0.5s ease;
}

.status-line {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--color-ink-soft);
  padding: 12px 16px;
  background: var(--color-bg-alt);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--color-accent);
}

.status-line strong {
  color: var(--color-ink);
  font-weight: 600;
}

.status-line.is-success {
  border-left-color: var(--color-success);
  color: var(--color-brand-deep);
}

.status-line.is-error {
  border-left-color: var(--color-warn);
  color: var(--color-warn);
}

.task-id {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--color-ink-soft);
  background: var(--color-bg);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}

/* 空状态 */
.empty-hint {
  text-align: center;
  padding: 40px 24px;
  color: var(--color-ink-soft);
  font-size: 0.95rem;
}

.empty-hint svg {
  width: 40px;
  height: 40px;
  margin: 0 auto 12px;
  color: var(--color-ink-faint);
  opacity: 0.6;
}

/* ============================================================
   模块 5：结果展示
   ============================================================ */
.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}

.result-head__left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.result-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
}

/* Tab 切换 */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 24px;
  overflow-x: auto;
}

.tab {
  padding: 12px 18px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-ink-soft);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.tab:hover {
  color: var(--color-ink);
}

.tab.is-active {
  color: var(--color-brand);
  border-bottom-color: var(--color-brand);
  font-weight: 600;
}

.tab-panels {
  min-height: 200px;
}

.tab-panel {
  display: none;
  animation: fadeIn 0.3s ease;
}

.tab-panel.is-active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Markdown 报告区 */
.report {
  padding: 28px 32px;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  line-height: 1.75;
  color: var(--color-ink);
  font-size: 0.95rem;
}

.report h1,
.report h2,
.report h3 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--color-ink);
  margin: 24px 0 12px;
  line-height: 1.3;
}

.report h1 { font-size: 1.6rem; }
.report h2 { font-size: 1.3rem; }
.report h3 { font-size: 1.1rem; }

.report h1:first-child,
.report h2:first-child,
.report h3:first-child {
  margin-top: 0;
}

.report p {
  margin: 12px 0;
}

.report ul,
.report ol {
  margin: 12px 0;
  padding-left: 22px;
}

.report li {
  margin: 6px 0;
}

.report strong {
  color: var(--color-brand-deep);
  font-weight: 600;
}

.report blockquote {
  margin: 16px 0;
  padding: 12px 18px;
  border-left: 3px solid var(--color-accent);
  background: var(--color-surface);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--color-ink-soft);
}

.report code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--color-surface);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  color: var(--color-warn);
}

.report hr {
  border: none;
  border-top: 1px dashed var(--color-border-strong);
  margin: 24px 0;
}

/* JSON 展示 */
.json-view {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.6;
  padding: 24px 28px;
  background: #1f1f1f;
  color: #e8e2d5;
  border-radius: var(--radius);
  overflow-x: auto;
  white-space: pre;
}

.json-view .k { color: #c9a961; }
.json-view .s { color: #a3c98a; }
.json-view .n { color: #e0a96d; }
.json-view .b { color: #8fb3d1; }

/* 子 Tab 网格 */
.subtabs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}

.subtab {
  padding: 10px 8px;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--color-ink-soft);
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.subtab:hover {
  border-color: var(--color-border-strong);
  color: var(--color-ink);
}

.subtab.is-active {
  background: var(--color-brand);
  color: #fff;
  border-color: var(--color-brand);
}

/* 下载区 */
.download-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 28px;
  padding-top: 28px;
  border-top: 1px dashed var(--color-border-strong);
}

.image-gallery {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.image-gallery.is-hidden {
  display: none;
}

.image-card {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.image-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: var(--color-border);
}

.image-card__body {
  padding: 12px 14px;
}

.image-card__title {
  font-weight: 700;
  color: var(--color-brand-deep);
  margin-bottom: 6px;
}

.image-card__prompt {
  font-size: 0.82rem;
  color: var(--color-ink-soft);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.image-card__link {
  display: inline-block;
  margin-top: 10px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--color-brand);
}

/* ============================================================
   模块 6：页脚
   ============================================================ */
.site-footer {
  margin-top: 64px;
  padding: 48px 0 40px;
  border-top: 1px solid var(--color-border);
  background: var(--color-bg-alt);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 40px;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-brand p {
  font-size: 0.88rem;
  color: var(--color-ink-soft);
  max-width: 38ch;
  line-height: 1.65;
}

.footer-col h4 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--color-ink);
  margin-bottom: 14px;
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-col a {
  font-size: 0.85rem;
  color: var(--color-ink-soft);
  transition: color 0.2s ease;
}

.footer-col a:hover {
  color: var(--color-brand);
}

.footer-bottom {
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--color-ink-faint);
}

/* ============================================================
   入场动画
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.is-in {
  opacity: 1;
  transform: translateY(0);
}

/* 加载骨架 */
.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--color-accent-soft);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 900px) {
  .hero__grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .hero__art {
    min-height: 200px;
    order: -1;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .site-nav {
    gap: 18px;
  }

  .pipeline-flow {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 16px;
  }

  .node {
    flex: 0 0 calc(33.333% - 12px);
  }

  .node::after {
    display: none;
  }

  .subtabs {
    grid-template-columns: repeat(3, 1fr);
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
}

@media (max-width: 768px) {
  .site-header__inner {
    gap: 12px;
  }

  .site-nav {
    gap: 14px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .site-nav::-webkit-scrollbar {
    display: none;
  }

  .site-nav__link {
    font-size: 0.82rem;
  }

  .site-nav__link.is-active::after {
    bottom: -4px;
  }
}

@media (max-width: 600px) {
  .form-card,
  .pipeline-card {
    padding: 22px;
  }

  .download-row {
    grid-template-columns: 1fr;
  }

  .image-gallery {
    grid-template-columns: 1fr;
  }

  .node {
    flex: 0 0 calc(50% - 8px);
  }

  .subtabs {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ============================================================
   布局：左侧边栏 + 主内容区
   边栏默认折叠，承担方案历史与生成进度职责
   ============================================================ */

/* 布局变量 */
:root {
  --sidebar-collapsed: 64px;
  --sidebar-expanded: 260px;
  --sidebar-bg: var(--color-bg-alt);
  --sidebar-border: var(--color-border);
}

.site-wrapper {
  display: flex;
  width: 100%;
  min-height: 100vh;
  overflow: hidden;
}

.site-sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-expanded);
  height: 100vh;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  transform: translateX(-100%);
  transition: transform 0.25s ease;
  overflow: hidden;
  flex-shrink: 0;
}

.site-sidebar.is-expanded {
  transform: translateX(0);
  box-shadow: 8px 0 30px rgba(31, 31, 31, 0.12);
}

.site-sidebar.is-collapsed {
  transform: translateX(-100%);
}

.site-body {
  flex: 1;
  min-width: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  margin-left: 0;
}

/* 边栏展开时遮罩主内容 */
.site-sidebar.is-expanded + .site-body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(31, 31, 31, 0.18);
  z-index: 190;
  pointer-events: auto;
}

/* 边栏头部：切换按钮 */
.sidebar__header {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 64px;
  border-bottom: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}

.sidebar__toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  color: var(--color-ink-soft);
  background: transparent;
  transition: all 0.2s ease;
}

.sidebar__toggle:hover {
  background: var(--color-bg);
  color: var(--color-brand);
}

.sidebar__toggle svg {
  width: 20px;
  height: 20px;
}

.site-sidebar.is-expanded .sidebar__toggle {
  color: var(--color-brand);
}

/* 新建方案 */
.sidebar__new {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}

.sidebar__fab {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-brand);
  color: #fff;
  flex-shrink: 0;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(61, 90, 61, 0.18);
}

.sidebar__fab:hover {
  background: var(--color-brand-deep);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(61, 90, 61, 0.25);
}

.sidebar__fab svg {
  width: 16px;
  height: 16px;
}

.sidebar__label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-ink);
  white-space: nowrap;
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.site-sidebar.is-expanded .sidebar__label {
  opacity: 1;
  transform: translateX(0);
}

/* 进度区 */
.sidebar__progress {
  padding: 16px;
  border-bottom: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}

.sidebar__progress[hidden] {
  display: none;
}

/* 边栏内流水线节点：紧凑垂直布局 */
.sidebar__progress .pipeline-flow {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px 6px;
  margin-bottom: 14px;
}

.sidebar__progress .node {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
}

.sidebar__progress .node::after {
  display: none;
}

.sidebar__progress .node__icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-bg);
  border: 1.5px solid var(--color-border-strong);
  color: var(--color-ink-faint);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.sidebar__progress .node__icon svg {
  width: 16px;
  height: 16px;
}

.sidebar__progress .node__label {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--color-ink-faint);
  line-height: 1.2;
}

.sidebar__progress .node__step {
  display: none;
}

.sidebar__progress .node.is-active .node__icon {
  border-color: var(--color-accent);
  color: var(--color-accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(201, 169, 97, 0.15);
  animation: pulse 1.8s ease-in-out infinite;
}

.sidebar__progress .node.is-done .node__icon {
  border-color: var(--color-success);
  background: var(--color-success);
  color: #fff;
}

.sidebar__progress .node.is-done .node__label {
  color: var(--color-ink);
}

.sidebar__progress .node.is-error .node__icon {
  border-color: var(--color-warn);
  background: var(--color-warn);
  color: #fff;
}

.sidebar__progress .node.is-error .node__label {
  color: var(--color-warn);
}

.sidebar__progress .progress-track {
  margin-bottom: 10px;
}

.sidebar__progress .status-line {
  font-size: 0.78rem;
  padding: 8px 10px;
}

/* 方案列表 */
.sidebar__plans {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 16px 0;
}

.sidebar__section-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-ink-faint);
  padding: 0 16px 10px;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.site-sidebar.is-expanded .sidebar__section-title {
  opacity: 1;
  transform: translateX(0);
}

.sidebar__list {
  flex: 1;
  overflow-y: auto;
  padding: 0 10px;
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.site-sidebar.is-expanded .sidebar__list {
  opacity: 1;
  transform: translateX(0);
}

.sidebar__plan-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: var(--color-ink-soft);
  font-size: 0.85rem;
  text-align: left;
  transition: all 0.18s ease;
  white-space: nowrap;
  overflow: hidden;
}

.sidebar__plan-item:hover {
  background: var(--color-bg);
  color: var(--color-ink);
}

.sidebar__plan-item.is-active {
  background: rgba(61, 90, 61, 0.08);
  color: var(--color-brand);
  font-weight: 600;
}

.sidebar__plan-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--color-bg);
  color: var(--color-ink-faint);
  flex-shrink: 0;
  font-size: 0.75rem;
}

.sidebar__plan-item.is-active .sidebar__plan-icon {
  background: var(--color-brand);
  color: #fff;
}

.sidebar__plan-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar__empty {
  padding: 12px 16px;
  font-size: 0.8rem;
  color: var(--color-ink-faint);
  white-space: nowrap;
}

.sidebar__all {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-brand);
  white-space: nowrap;
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.site-sidebar.is-expanded .sidebar__all {
  opacity: 1;
  transform: translateX(0);
}

.sidebar__all:hover {
  color: var(--color-brand-deep);
}

/* 收起状态下隐藏需要文字的区域 */
.site-sidebar.is-collapsed .sidebar__plans {
  align-items: center;
}

.site-sidebar.is-collapsed .sidebar__list {
  padding: 0 10px;
}

.site-sidebar.is-collapsed .sidebar__plan-item {
  justify-content: center;
  padding: 10px;
}

.site-sidebar.is-collapsed .sidebar__plan-title,
.site-sidebar.is-collapsed .sidebar__empty,
.site-sidebar.is-collapsed .sidebar__all {
  display: none;
}

/* 隐藏工具 */
.is-hidden {
  display: none !important;
}

/* ============================================================
   Task 5 · 图片生成骨架屏 / 视频成片（媒体工坊相关样式）
   Agent 卡片 / 输出区样式已迁移至 workshop.css
   ============================================================ */

/* ---------- 图片生成：画廊提示行 ---------- */
.image-gallery__hint {
  grid-column: 1 / -1;
  margin: 0 0 16px 0;
  padding: 10px 14px;
  font-size: 0.85rem;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}

/* ---------- 图片卡片：骨架屏 / 重生 / 重试 ---------- */
.image-card {
  position: relative;
}

.image-card--loading {
  border-color: var(--color-border-strong);
}

.image-card__skeleton {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: linear-gradient(
    100deg,
    var(--color-border) 30%,
    rgba(255, 255, 255, 0.55) 50%,
    var(--color-border) 70%
  );
  background-size: 200% 100%;
  animation: image-skeleton-pulse 1.4s ease-in-out infinite;
}

@keyframes image-skeleton-pulse {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.image-card__placeholder {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-ink-faint);
  font-size: 0.82rem;
  background: var(--color-border);
}

.image-card--error {
  border-color: rgba(184, 92, 56, 0.45);
  background: rgba(184, 92, 56, 0.05);
}

.image-card__error {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px;
  text-align: center;
  background: rgba(184, 92, 56, 0.08);
}

.image-card__error-title {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--color-warn);
  text-transform: uppercase;
}

.image-card__errmsg {
  font-size: 0.74rem;
  color: var(--color-ink-soft);
  max-width: 90%;
  word-break: break-word;
  line-height: 1.45;
}

.image-card__regen,
.image-card__retry {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  padding: 3px 10px;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  border-radius: 999px;
  border: 1px solid var(--color-border-strong);
  background: rgba(255, 255, 255, 0.92);
  color: var(--color-brand-deep);
  backdrop-filter: blur(2px);
  transition: all 0.18s ease;
}

.image-card__regen:hover {
  background: var(--color-accent);
  color: var(--color-bg-alt);
  border-color: var(--color-accent);
}

.image-card__retry {
  position: static;
  background: var(--color-warn);
  color: var(--color-bg-alt);
  border-color: var(--color-warn);
}

.image-card__retry:hover {
  background: var(--color-brand-deep);
  border-color: var(--color-brand-deep);
}

/* ============================================================
   视频成片播放区（一键成片结果）
   美学延续：编辑式有机风 —— 圆角 8px、暖灰边框、深森林绿下载按钮、
   麦穗金进度文字。原生 <video>，不引入外部播放器。
   ============================================================ */
.video-result {
  margin-top: 24px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

.video-result.is-hidden {
  display: none;
}

.video-result__inner {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* 9:16 竖屏居中播放器 */
.video-result__player {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 18px;
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 30% 20%, rgba(201, 169, 97, 0.18), transparent 45%),
    linear-gradient(135deg, #20331f, #11180f);
}

.video-result__player video {
  max-width: 100%;
  max-height: 70vh;
  aspect-ratio: 9 / 16;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--color-border-strong);
  background: #000;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

/* 元信息：图片数 / 预计时长 / 任务号 */
.video-result__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  padding: 12px 14px;
  font-size: 0.88rem;
  color: var(--color-ink-soft);
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}

.video-result__meta strong {
  color: var(--color-brand-deep);
  font-weight: 700;
}

.video-result__meta code {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--color-ink-soft);
  background: var(--color-bg);
  padding: 2px 6px;
  border-radius: 4px;
}

/* 下载按钮区：主按钮深森林绿实心（沿用 .btn--primary） */
.video-result__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

/* 进度提示：麦穗金文字 + 旋转脉冲点 */
.video-result__progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 30px 20px;
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--color-accent);
  background:
    radial-gradient(circle at 30% 20%, rgba(201, 169, 97, 0.10), transparent 45%),
    var(--color-surface);
}

.video-result__progress--error {
  flex-direction: column;
  gap: 6px;
  text-align: center;
  color: var(--color-warn);
  background:
    radial-gradient(circle at 30% 20%, rgba(184, 92, 56, 0.08), transparent 45%),
    var(--color-surface);
}

.video-result__progress--error span:first-child {
  font-weight: 700;
}

.video-result__spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(201, 169, 97, 0.35);
  border-top-color: var(--color-accent);
  animation: qinghe-spin 0.9s linear infinite;
}

@keyframes qinghe-spin {
  to { transform: rotate(360deg); }
}

/* 移动端收紧 */
@media (max-width: 640px) {
  .video-result__inner {
    padding: 14px;
    gap: 12px;
  }
  .video-result__player {
    padding: 10px;
  }
  .video-result__actions .btn {
    flex: 1 1 100%;
  }
}

/* ============================================================
   左侧边栏移动端适配
   ============================================================ */
@media (max-width: 768px) {
  .site-sidebar {
    width: min(var(--sidebar-expanded), 85vw);
  }

  .site-sidebar.is-collapsed::after {
    display: none;
  }
}
