/* AI 工作室页 — 与旧版卡片堆叠完全不同的左右工作台 */
.page-ai {
  background: #f3f4f6;
}

.page-ai .page-main {
  padding-bottom: 64px;
}

.ai-intro {
  padding: 48px 0 28px;
}

.ai-intro-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
  gap: 36px;
  align-items: end;
}

.ai-kicker {
  margin: 0 0 10px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand);
}

.ai-intro h1 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.ai-lead {
  margin: 0 0 20px;
  max-width: 36em;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

.ai-intro-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ai-intro-pills span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 0.82rem;
  font-weight: 500;
}

.ai-intro-pills i {
  color: var(--brand);
  font-size: 0.95rem;
}

.ai-intro-aside {
  background: #fff;
  border: 1px solid rgba(17, 17, 17, 0.06);
  border-radius: 10px;
  padding: 22px 22px 18px;
  box-shadow: 0 1px 2px rgba(17, 17, 17, 0.04);
}

.ai-intro-aside h2 {
  margin: 0 0 16px;
  font-size: 0.92rem;
  font-weight: 700;
}

.ai-flow {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.ai-flow-step {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.ai-flow-step + .ai-flow-step {
  margin-top: 4px;
}

.ai-flow-index {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.ai-flow-step strong {
  display: block;
  font-size: 0.92rem;
  line-height: 1.4;
}

.ai-flow-step span {
  display: block;
  margin-top: 2px;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.5;
}

.ai-flow-line {
  width: 1px;
  height: 14px;
  margin: 2px 0 2px 13px;
  background: var(--line);
}

.ai-studio {
  padding: 0 0 8px;
}

.ai-studio-frame {
  display: grid;
  grid-template-columns: 228px minmax(0, 1fr);
  min-height: 640px;
  background: #fff;
  border: 1px solid rgba(17, 17, 17, 0.06);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(17, 17, 17, 0.04);
}

.ai-rail {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 12px;
  background: #fafafa;
  border-right: 1px solid var(--line);
}

.ai-rail-label {
  margin: 10px 10px 6px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.ai-rail-label:first-child {
  margin-top: 2px;
}

.ai-rail-btn,
.ai-rail-link {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  padding: 10px 10px;
  border-radius: 8px;
  text-align: left;
  color: var(--ink-2);
  background: transparent;
  border: 0;
}

.ai-rail-btn i,
.ai-rail-link i {
  margin-top: 2px;
  font-size: 1.15rem;
  color: var(--muted);
}

.ai-rail-btn strong,
.ai-rail-link strong {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.3;
}

.ai-rail-btn small,
.ai-rail-link small {
  display: block;
  margin-top: 2px;
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.4;
}

.ai-rail-btn:hover,
.ai-rail-link:hover {
  background: #fff;
  color: var(--ink);
}

.ai-rail-btn.is-active {
  background: #fff;
  box-shadow: 0 0 0 1px rgba(67, 20, 182, 0.16);
}

.ai-rail-btn.is-active i {
  color: var(--brand);
}

.ai-rail-btn.is-active strong {
  color: var(--brand);
}

.ai-stage {
  min-width: 0;
  background: #fff;
}

.ai-pane {
  display: none;
  padding: 28px 28px 32px;
}

.ai-pane.is-active {
  display: block;
}

.ai-pane-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.ai-pane-head h2 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.ai-pane-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

.ai-pane-tag {
  flex-shrink: 0;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-size: 0.72rem;
  font-weight: 700;
}

.ai-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 28px;
  align-items: stretch;
}

.page-ai .ai-form label {
  display: block;
  margin: 0 0 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-2);
}

.page-ai .ai-form input,
.page-ai .ai-form textarea,
.page-ai .ai-form select {
  width: 100%;
  margin-bottom: 14px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font-size: 0.95rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.page-ai .ai-form textarea {
  min-height: 140px;
  resize: vertical;
}

.page-ai .ai-form input:focus,
.page-ai .ai-form textarea:focus,
.page-ai .ai-form select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(67, 20, 182, 0.12);
  background: #fff;
}

.page-ai .ai-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.page-ai .ai-result-wrap {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fafafa;
}

.page-ai .ai-result-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.page-ai .ai-result-bar .ai-result-label {
  margin-right: auto;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.page-ai .ai-result {
  flex: 1;
  min-height: 320px;
  padding: 18px 16px 22px;
  background: transparent;
  border: 0;
  border-radius: 0;
  white-space: pre-wrap;
  font-size: 0.95rem;
  color: var(--ink-2);
  line-height: 1.75;
}

.page-ai .ai-result.is-streaming {
  border: 0;
  box-shadow: inset 3px 0 0 var(--brand);
}

.page-ai .ai-result.is-error {
  background: #fef2f2;
  color: #991b1b;
}

.page-ai .ai-action:disabled,
.page-ai #btn-to-editor.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

@media (max-width: 980px) {
  .ai-intro-inner {
    grid-template-columns: 1fr;
    gap: 20px;
    align-items: stretch;
  }

  .ai-studio-frame {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .ai-rail {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 12px;
    gap: 6px;
  }

  .ai-rail-label {
    display: none;
  }

  .ai-rail-btn,
  .ai-rail-link {
    flex: 0 0 auto;
    width: auto;
    min-width: 148px;
  }

  .ai-rail-btn small,
  .ai-rail-link small {
    display: none;
  }

  .ai-panel {
    grid-template-columns: 1fr;
  }

  .ai-pane {
    padding: 20px 16px 24px;
  }

  .page-ai .ai-result {
    min-height: 220px;
  }
}

@media (max-width: 560px) {
  .ai-intro {
    padding: 32px 0 20px;
  }

  .ai-pane-head {
    flex-direction: column;
  }
}
