/* 创作台 · WaveSpeed 生成页同款布局：左侧图标竖栏 → 中间参数列（模型下拉 / 提示词 / 参考素材 / 设置 / 生成）→ 右侧结果。
   配色沿用 base.css 的明亮变量；本文件只管布局与这套控件的外观，加载在其它 studio-*.css 之后覆盖旧卡片样式。 */

/* ---------- 左侧图标竖栏 ---------- */
/* main.studio / section.workbench 多带一级标签选择器：responsive.css 在后面加载、里面还有旧侧栏的宽度断点，要压过它 */
main.studio {
  grid-template-columns: 78px minmax(0, 1fr);
}

.studio-side {
  align-items: stretch;
  gap: 4px;
  padding: 12px 8px 10px;
}

.rail-link,
.side-nav button {
  display: flex;
  width: 100%;
  min-height: 60px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 4px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--muted-strong);
  background: none;
  text-align: center;
  text-decoration: none;
  transition: background 0.12s, color 0.12s;
}

.rail-link svg {
  width: 22px;
  height: 22px;
}

.rail-link span,
.side-nav .side-nav-text strong {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0;
  line-height: 1.2;
}

.rail-link:hover,
.side-nav button:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.side-nav {
  gap: 4px;
}

/* 模式按钮：图标在上、名称在下；模型数小字与选中态左蓝条不再需要 */
.side-nav button svg {
  width: 36px;
  height: 36px;
  padding: 8px;
  border-radius: 10px;
}

.side-nav .side-nav-text {
  gap: 0;
  text-align: center;
}

.side-nav .side-nav-text small {
  display: none;
}

.side-nav button[aria-selected="true"] {
  border-color: transparent;
  color: var(--accent-text);
  background: var(--accent-soft);
  box-shadow: none;
}

.side-nav button[aria-selected="true"]::before {
  display: none;
}

.side-nav button em {
  top: 4px;
  right: 4px;
}

.side-foot {
  gap: 4px;
  padding-top: 8px;
}

.side-foot output {
  padding: 0 4px;
  font-size: 10px;
}

/* ---------- 中间参数列 ---------- */
section.workbench {
  grid-template-columns: 448px minmax(0, 1fr);
}

@media (max-width: 1180px) {
  section.workbench {
    grid-template-columns: 400px minmax(0, 1fr);
  }
}

.compose {
  gap: 22px;
  padding: 18px 22px 0 24px;
}

.compose-head h1 {
  font-size: 19px;
}

.compose-section {
  display: grid;
  gap: 8px;
}

.section-head {
  display: flex;
  min-height: 18px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted-strong);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.section-eyebrow em {
  color: var(--danger);
  font-style: normal;
}

.section-eyebrow em[data-optional] {
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0;
}

.section-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 11.5px;
}

.section-tools a,
.section-tools button {
  padding: 0;
  border: 0;
  color: var(--accent-text);
  background: none;
  font-size: 11.5px;
  font-weight: 600;
}

.section-tools a:hover,
.section-tools button:hover {
  text-decoration: underline;
}

.section-note {
  color: var(--muted);
  font-weight: 500;
}

.section-tools[hidden] {
  display: none;
}

/* ---------- 设置：两列下拉 ---------- */
.settings-grid {
  display: grid;
  gap: 12px 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.settings-grid > [data-field="ratio"],
.settings-grid > .option-grid,
.settings-grid > [data-field="duration"] {
  grid-column: 1 / -1;
}

.settings-grid > .option-grid[hidden],
.settings-grid > [data-field="duration"][hidden],
.settings-grid > [data-field="ratio"][hidden] {
  display: none;
}

.settings-grid .field {
  gap: 6px;
}

.settings-grid .field-head {
  color: var(--muted-strong);
  font-size: 12.5px;
  font-weight: 650;
}

.settings-grid .field-head .field-readout {
  margin-left: 6px;
  font-size: 11px;
  font-weight: 500;
}

.compose .settings-grid select {
  min-height: 40px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
}

.compose .stepper {
  min-height: 40px;
}

/* ---------- 底部：整宽生成按钮，价格写在按钮里 ---------- */
.compose-footer {
  display: grid;
  gap: 8px;
  padding-bottom: 18px;
  grid-template-columns: minmax(0, 1fr);
}

.compose-footer > * {
  grid-column: 1 / -1;
}

.compose-footer .cost-note {
  color: var(--muted);
  font-size: 11.5px;
  text-align: center;
}

.compose-footer .generate {
  display: flex;
  width: 100%;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 16px;
  border: 0;
  border-radius: 12px;
  color: white;
  background: var(--accent);
  font-size: 15px;
  font-weight: 750;
  box-shadow: 0 8px 20px -10px rgba(31, 58, 138, 0.6);
}

.compose-footer .generate:hover:not(:disabled) {
  background: var(--accent-hover, var(--accent));
}

.compose-footer .generate:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  box-shadow: none;
}

.compose-footer .generate svg {
  width: 18px;
  height: 18px;
}

.generate-cost {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  margin-left: 4px;
  padding-left: 12px;
  border-left: 1px solid rgba(255, 255, 255, 0.35);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.generate-cost strong {
  font-size: 15px;
}

.generate-cost small {
  color: rgba(255, 255, 255, 0.8);
  font-size: 11.5px;
  font-weight: 500;
}

.compose-footer .generate kbd {
  margin-left: auto;
  padding: 2px 7px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.12);
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 600;
}

.compose-footer .compliance-strip {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

/* 参考素材：模型没有素材输入槽（纯文生图 / 文生视频）时整段不显示，不留空标题 */
.compose-section[data-card="assets"]:has(.input-slots[hidden]) {
  display: none;
}

/* 手机 / 窄屏：图标栏横排，参数列单栏 */
@media (max-width: 900px) {
  main.studio {
    grid-template-columns: minmax(0, 1fr);
  }

  .studio-side {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 2px;
    padding: 6px 8px;
    overflow-x: auto;
  }

  .rail-link {
    width: auto;
    flex: none;
  }

  .rail-link,
  .side-nav button {
    min-width: 64px;
    min-height: 52px;
    padding: 4px;
  }

  .side-nav {
    display: flex;
    gap: 2px;
  }

  .side-foot {
    display: flex;
    margin-top: 0;
    margin-left: auto;
    padding-top: 0;
    border-top: 0;
  }

  section.workbench {
    grid-template-columns: minmax(0, 1fr);
  }
}
