/* 与 Figma Make 导出（Design Artistic H5 Page）对齐：微信壳、渐变主区、天际线、卡片与色板 */

:root {
  --wx-bg: #ffffff;
  --wx-footer: #f7f7f7;
  --figma-navy: #0d2f7a;
  --figma-sub: #4a5a72;
  --accent: #1a5fa8;
  --accent-hover: #154d8a;
  --accent-dashed: #4a9fd4;
  --accent-soft: #eff6ff;
  --blue-50: #eff6ff;
  --text: #111827;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --green-100: #dcfce7;
  --green-500: #22c55e;
  --green-600: #16a34a;
  --radius-xl: 1rem;
  --radius-2xl: 1rem;
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-btn: 0 10px 15px -3px rgba(26, 95, 168, 0.25);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body.figma-app {
  margin: 0;
  height: 100dvh;
  overflow: hidden;
  font-family: system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--text);
  line-height: 1.5;
  background: var(--wx-bg);
}

/* ── 根布局（等同 h-screen flex flex-col） ── */
.figma-root {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

/* ── 顶栏（功能 Tab） ── */
.wx-header {
  flex: none;
  background: var(--wx-bg);
  z-index: 50;
  border-bottom: 1px solid #f3f4f6;
}

/* Tab 栏 */
.wx-tab-bar {
  display: flex;
  background: var(--wx-bg);
}

.wx-tab {
  flex: 1;
  padding: 0.625rem 0.25rem;
  text-align: center;
  font-size: 15px;
  font-weight: 500;
  color: var(--gray-400);
  text-decoration: none;
  position: relative;
  transition: color 0.15s;
}

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

.wx-tab.is-active {
  color: var(--accent);
}

.wx-tab.is-active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 2rem;
  height: 2px;
  background: var(--accent);
  border-radius: 9999px;
}

/* ── 主内容区渐变 ── */
.wx-main {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  -webkit-overflow-scrolling: touch;
  background: linear-gradient(
    180deg,
    #ffffff 0%,
    #daeeff 15%,
    #7ec5f0 35%,
    #3a8fd1 55%,
    #1055a8 75%,
    #07307a 100%
  );
}

.wx-main-inner {
  padding: 0 0 calc(6.875rem + env(safe-area-inset-bottom, 0));
  max-width: 28rem;
  margin: 0 auto;
}

/* Logo 行 */
.figma-logo-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 1rem 1.5rem 0.75rem;
}

.figma-logo-img {
  height: 40px;
  width: auto;
  display: block;
}

/* 页内标题块 */
.wx-title-block {
  padding: 0 1.25rem 1.25rem;
}

.wx-page-title {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1.25;
  color: var(--figma-navy);
}

.wx-page-sub {
  margin: 0.375rem 0 0;
  font-size: 14px;
  color: var(--figma-sub);
  font-weight: 400;
}

/* 白卡片容器（rounded-2xl shadow-md） */
.figma-surface-card {
  background: #fff;
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  margin: 0 1rem 1rem;
}

.figma-surface-card--pad {
  padding: 1.25rem 1.25rem;
}

.figma-section-heading {
  margin: 0 0 1rem;
  font-size: 15px;
  font-weight: 500;
  color: var(--gray-600);
  text-align: center;
}

.figma-section-heading--left {
  text-align: left;
}

/* 肖像上传：内层虚线（Figma PortraitPage） */
.figma-surface-card .upload-card {
  margin: 1rem;
  border: 2px dashed var(--accent-dashed);
  border-radius: 0.75rem;
  padding: 2.25rem 1rem;
  background: transparent;
  box-shadow: none;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: background 0.15s;
}

.figma-surface-card .upload-card:hover,
.figma-surface-card .upload-card:focus-within {
  background: var(--blue-50);
  border-color: var(--accent-dashed);
}

.figma-surface-card .upload-card.has-file {
  border-style: solid;
  border-color: var(--gray-200);
  background: #fff;
  padding: 1rem;
}

.upload-card input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.upload-preview-wrap {
  display: none;
  margin-bottom: 0.75rem;
}

.upload-card.has-file .upload-preview-wrap {
  display: block;
}

.upload-preview {
  width: 100%;
  max-height: 200px;
  object-fit: contain;
  border-radius: var(--radius-xl);
  background: #f9fafb;
}

.upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.upload-card.has-file .upload-placeholder {
  display: none;
}

.upload-icon {
  width: 60px;
  height: 60px;
  border-radius: 9999px;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
}

.upload-icon svg {
  width: 30px;
  height: 30px;
  stroke: currentColor;
  fill: none;
}

.upload-cta {
  font-size: 16px;
  font-weight: 500;
  color: var(--gray-700);
  margin-top: 0.25rem;
}

.upload-hint {
  font-size: 13px;
  color: var(--gray-400);
}

.upload-status {
  display: none;
  margin-top: 0.25rem;
  font-size: 15px;
  font-weight: 500;
  color: var(--accent);
}

.upload-card.has-file .upload-status {
  display: block;
}

.reupload-hint {
  display: none;
  margin-top: 0.25rem;
  font-size: 12px;
  color: var(--gray-400);
}

.upload-card.has-file .reupload-hint {
  display: block;
}

/* 风格四宫格 */
.style-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}

.style-chip {
  appearance: none;
  border: 1px solid var(--gray-200);
  background: #fff;
  border-radius: 0.5rem;
  padding: 0.625rem 0.25rem;
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-600);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s, box-shadow 0.2s;
  font-family: inherit;
}

.style-chip:hover {
  border-color: var(--accent-dashed);
}

.style-chip[aria-pressed="true"] {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* 主按钮 */
.figma-btn-primary {
  width: calc(100% - 2rem);
  margin: 0 1rem 1.5rem;
  border: none;
  border-radius: var(--radius-2xl);
  padding: 0.875rem 1.2rem;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.3s, transform 0.1s, box-shadow 0.3s;
  background: #e5e7eb;
  color: var(--gray-400);
}

.figma-btn-primary:enabled {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-btn);
}

.figma-btn-primary:enabled:hover {
  background: var(--accent-hover);
}

.figma-btn-primary:enabled:active {
  transform: scale(0.98);
}

.figma-btn-primary.is-loading:enabled {
  background: rgba(26, 95, 168, 0.85);
  cursor: wait;
}

/* 分镜页：已上传视频后主按钮加深（仅 #split-submit） */
#split-submit.figma-btn-primary:enabled {
  background: #0f3d73;
  box-shadow: 0 10px 15px -3px rgba(10, 45, 88, 0.42);
}

#split-submit.figma-btn-primary:enabled:hover {
  background: #0a305c;
}

.figma-config-hint {
  font-size: 11px;
  color: var(--gray-400);
  text-align: center;
  margin: -1rem 1rem 1rem;
  line-height: 1.4;
}

/* 视频页：稿件卡片顶栏 */
.review-card-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 1rem 0.25rem;
}

.review-card-head svg {
  flex-shrink: 0;
  color: var(--accent);
}

.review-card-head-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-700);
}

.review-char-count {
  margin-left: auto;
  font-size: 11px;
  color: var(--gray-400);
}

.review-textarea {
  width: 100%;
  min-height: 9rem;
  padding: 0.75rem 1rem;
  border: none;
  font-size: 14px;
  color: var(--gray-700);
  font-family: inherit;
  resize: none;
  outline: none;
  line-height: 1.625;
  background: transparent;
}

.review-textarea::placeholder {
  color: var(--gray-300);
}

.review-empty-tools {
  margin: 0 1rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--blue-50);
  border-radius: 0.75rem;
  padding: 0.625rem 0.75rem;
}

.review-empty-tools[hidden] {
  display: none !important;
}

.review-empty-tools svg {
  flex-shrink: 0;
  color: var(--accent-dashed);
}

.review-empty-tools span {
  font-size: 12px;
  color: var(--accent-dashed);
}

.review-file-btn {
  margin-left: auto;
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 0.5rem;
  padding: 0.125rem 0.625rem;
  background: #fff;
  cursor: pointer;
  font-family: inherit;
}

.review-file-btn:active {
  background: var(--blue-50);
}

.review-file-input-hidden {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

/* 评论风格 2×2 */
.review-style-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.review-style-btn {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  text-align: left;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid var(--gray-200);
  background: #fff;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  font-family: inherit;
}

.review-style-btn:hover {
  border-color: var(--accent-dashed);
}

.review-style-btn[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.review-style-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--blue-50);
}

.review-style-btn[aria-pressed="true"] .review-style-icon {
  background: rgba(255, 255, 255, 0.2);
}

.review-style-icon svg {
  width: 16px;
  height: 16px;
  stroke: var(--accent);
  fill: none;
}

.review-style-btn[aria-pressed="true"] .review-style-icon svg {
  stroke: #fff;
}

.review-style-text-main {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-700);
}

.review-style-btn[aria-pressed="true"] .review-style-text-main {
  color: #fff;
}

.review-style-text-sub {
  margin: 0;
  font-size: 11px;
  color: var(--gray-400);
}

.review-style-btn[aria-pressed="true"] .review-style-text-sub {
  color: rgba(255, 255, 255, 0.7);
}

/* 播报语气三按钮 */
.review-tone-row {
  display: flex;
  gap: 0.5rem;
}

.review-tone-btn {
  flex: 1;
  appearance: none;
  padding: 0.5rem 0.25rem;
  border-radius: 0.75rem;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--gray-200);
  background: #fff;
  color: var(--gray-600);
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.review-tone-btn:hover {
  border-color: var(--accent-dashed);
}

.review-tone-btn[aria-pressed="true"] {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* 视频页成功态 */
.review-result-card {
  background: #fff;
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-md);
  margin: 0 1rem 1.5rem;
  overflow: hidden;
}

.review-result-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem 0.75rem;
}

.review-result-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  background: var(--green-100);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.review-result-title {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  color: var(--gray-800);
}

.review-result-meta {
  margin: 0;
  font-size: 12px;
  color: var(--gray-400);
}

.review-result-video {
  width: calc(100% - 2.5rem);
  max-height: min(56vh, 520px);
  margin: 0 1.25rem 0.75rem;
  border-radius: 0.75rem;
  background: #000;
  display: block;
  object-fit: contain;
}

.review-fake-video {
  aspect-ratio: 16 / 9;
  margin: 0 1.25rem 0.75rem;
  border-radius: 0.75rem;
  background: linear-gradient(135deg, var(--accent) 0%, #07307a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.review-fake-play {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.review-fake-play::after {
  content: "";
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 10px 0 10px 18px;
  border-color: transparent transparent transparent #fff;
  margin-left: 4px;
}

.review-result-audio-wrap {
  padding: 0 1.25rem 0.75rem;
}

.review-result-audio-wrap .figma-audio {
  width: 100%;
  margin: 0;
}

.review-result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0 1.25rem 1.25rem;
}

.review-result-actions .figma-btn-secondary {
  flex: 1;
  margin: 0;
  padding: 0.625rem 0.5rem;
  border-radius: 0.75rem;
  font-size: 14px;
  font-weight: 500;
}

.figma-btn-secondary {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-xl);
  padding: 0.65rem 0.75rem;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s;
}

.figma-btn-secondary.is-outline {
  background: #fff;
  color: var(--gray-600);
}

.figma-btn-secondary.is-outline:hover {
  background: #f9fafb;
}

.figma-btn-secondary:not(.is-outline):hover {
  background: var(--accent-hover);
}

.review-regen-full {
  width: calc(100% - 2.5rem);
  margin: 0 1.25rem 1.25rem;
  padding: 0.625rem;
  border-radius: 0.75rem;
  border: 1px solid var(--gray-200);
  background: #fff;
  color: var(--gray-500);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}

.review-regen-full:hover {
  background: #f9fafb;
}

.review-legacy-out {
  padding: 0 1.25rem;
}

.review-legacy-out .figma-out {
  border: none;
  background: #f9fafb;
  min-height: 80px;
  font-size: 14px;
}

.review-legacy-status {
  padding: 0 1.25rem 0.5rem;
}

.review-legacy-status .figma-status {
  margin-top: 0;
}

/* 分镜：上传空态（flex 保证图标与文案相对虚线区水平居中） */
.split-state-empty {
  margin: 1rem;
  border: 2px dashed var(--accent-dashed);
  border-radius: 0.75rem;
  padding: 2.5rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  text-align: center;
  transition: background 0.15s;
}

.split-state-empty .upload-cta,
.split-state-empty .upload-hint {
  width: 100%;
  max-width: 100%;
}

.split-upload-card:hover .split-state-empty,
.split-upload-card:focus-within .split-state-empty {
  background: var(--blue-50);
}

.split-state-filled {
  display: none;
  margin: 1rem;
}

.split-upload-card.has-file .split-state-empty {
  display: none;
}

.split-upload-card.has-file .split-state-filled {
  display: block;
}

.split-video-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 0.75rem;
  overflow: hidden;
  background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.split-video-frame .split-video-bg-icon {
  position: absolute;
  color: rgba(255, 255, 255, 0.25);
}

.split-video-play {
  position: relative;
  z-index: 1;
  width: 3rem;
  height: 3rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.split-video-play svg {
  width: 20px;
  height: 20px;
  fill: #fff;
  margin-left: 2px;
}

.split-video-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.625rem 0.75rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.55), transparent);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.split-video-name {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.9);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 200px;
}

.split-video-replace {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
  flex-shrink: 0;
}

.split-upload-card {
  position: relative;
  cursor: pointer;
}

.split-upload-card .split-file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
  z-index: 4;
}

/* 分镜稿件类型 2×2（与 Video 评论风格一致） */
.split-type-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.split-type-btn {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  text-align: left;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid var(--gray-200);
  background: #fff;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.2s, background 0.2s;
}

.split-type-btn:hover {
  border-color: var(--accent-dashed);
}

.split-type-btn[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.split-type-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--blue-50);
}

.split-type-btn[aria-pressed="true"] .split-type-icon {
  background: rgba(255, 255, 255, 0.2);
}

.split-type-icon svg {
  width: 15px;
  height: 15px;
  stroke: var(--accent);
  fill: none;
}

.split-type-btn[aria-pressed="true"] .split-type-icon svg {
  stroke: #fff;
}

.split-type-main {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-700);
}

.split-type-btn[aria-pressed="true"] .split-type-main {
  color: #fff;
}

.split-type-sub {
  margin: 0;
  font-size: 11px;
  color: var(--gray-400);
}

.split-type-btn[aria-pressed="true"] .split-type-sub {
  color: rgba(255, 255, 255, 0.7);
}

/* 分镜成功卡片 */
.split-result-card {
  background: #fff;
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-md);
  margin: 0 1rem 1rem;
  overflow: hidden;
}

.split-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 1.25rem 1.25rem 0.75rem;
  border-bottom: 1px solid #f3f4f6;
}

.split-result-head-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.split-result-check {
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  background: var(--green-100);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--green-600);
}

.split-result-head-title {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-800);
}

.split-result-head-meta {
  margin: 0;
  font-size: 11px;
  color: var(--gray-400);
}

.split-result-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.split-copy-btn,
.split-export-btn {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.375rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  border: none;
}

.split-copy-btn {
  background: #f3f4f6;
  color: var(--gray-600);
}

.split-copy-btn.is-done {
  color: var(--green-500);
}

.split-export-btn {
  background: var(--accent);
  color: #fff;
}

.split-result-body {
  padding: 1rem 1.25rem;
  max-height: 50vh;
  overflow-y: auto;
}

.split-result-text {
  margin: 0;
  font-size: 14px;
  color: var(--gray-700);
  line-height: 1.625;
  white-space: pre-wrap;
  word-break: break-word;
}

.split-result-regen {
  width: calc(100% - 2.5rem);
  margin: 0 1.25rem 1.25rem;
  padding: 0.625rem;
  border-radius: 0.75rem;
  border: 1px solid var(--gray-200);
  background: #fff;
  color: var(--gray-500);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}

.split-legacy-card {
  margin: 0 1rem 1rem;
}

.split-legacy-card .figma-out {
  min-height: 100px;
  background: #f9fafb;
  border: 1px dashed var(--gray-300);
}

/* 天际线 */
.figma-skyline {
  position: fixed;
  bottom: 62px;
  left: 0;
  width: 100%;
  height: 110px;
  pointer-events: none;
  z-index: 40;
}

/* 微信底栏 */
.wx-footer {
  flex: none;
  background: var(--wx-footer);
  border-top: 1px solid var(--gray-200);
  z-index: 50;
}

.wx-footer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.625rem 1.5rem;
  max-width: 32rem;
  margin: 0 auto;
}

.wx-footer-group {
  display: flex;
  align-items: center;
  gap: 2.5rem;
}

.wx-footer-group--right {
  gap: 2rem;
}

.wx-footer-btn {
  appearance: none;
  border: none;
  background: transparent;
  padding: 0.25rem;
  color: var(--gray-700);
  cursor: pointer;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wx-footer-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}

.wx-footer-btn:disabled,
.wx-footer-btn.is-disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.wx-footer-divider {
  border-left: 1px solid var(--gray-300);
  padding-left: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
}

.wx-footer-safe {
  height: 1rem;
  background: var(--wx-footer);
}

/* 生成结果区（肖像） */
.result-block {
  margin: 0 1rem 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.35);
}

.result-status {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 0.75rem;
  min-height: 1.25rem;
}

.result-grid {
  display: grid;
  gap: 0.75rem;
}

.result-grid a {
  display: block;
  border-radius: var(--radius-2xl);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: var(--shadow-md);
}

.result-grid img {
  width: 100%;
  height: auto;
  display: block;
  vertical-align: middle;
}

/* 肖像生成中：页面居中 loading */
.photo-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 180;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  padding-bottom: max(1rem, env(safe-area-inset-bottom));
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
}

.photo-loading-overlay[hidden] {
  display: none !important;
}

.photo-loading-overlay__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 1.75rem 2rem;
  background: var(--wx-bg);
  border-radius: var(--radius-2xl);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.2);
  max-width: min(100%, 17rem);
}

.photo-loading-overlay__spinner {
  width: 2.5rem;
  height: 2.5rem;
  border: 3px solid var(--gray-200);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: photo-loading-spin 0.75s linear infinite;
}

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

.photo-loading-overlay__text {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  color: var(--gray-700);
  text-align: center;
}

/* 肖像生成结果弹窗 */
.photo-result-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  padding-bottom: max(1rem, env(safe-area-inset-bottom));
}

.photo-result-modal.is-open {
  display: flex;
}

.photo-result-modal[hidden] {
  display: none !important;
}

.photo-result-modal__backdrop {
  position: absolute;
  inset: 0;
  border: none;
  padding: 0;
  margin: 0;
  background: rgba(15, 23, 42, 0.55);
  cursor: pointer;
}

.photo-result-modal__panel {
  position: relative;
  z-index: 1;
  width: min(100%, 22rem);
  max-height: min(90dvh, 36rem);
  display: flex;
  flex-direction: column;
  background: var(--wx-bg);
  border-radius: var(--radius-2xl);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.photo-result-modal__header {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--gray-200);
}

.photo-result-modal__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-900);
}

.photo-result-modal__close {
  appearance: none;
  border: none;
  background: transparent;
  padding: 0.35rem;
  border-radius: 9999px;
  cursor: pointer;
  color: var(--gray-600);
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-result-modal__close:hover {
  background: var(--gray-200);
  color: var(--gray-800);
}

.photo-result-modal__body {
  flex: 1;
  min-height: 0;
  padding: 0.75rem 1rem;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--blue-50);
}

.photo-result-modal__img {
  max-width: 100%;
  max-height: min(55dvh, 20rem);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
}

.photo-result-modal__footer {
  flex: none;
  padding: 0.75rem 1rem 1rem;
  border-top: 1px solid var(--gray-200);
}

.photo-result-modal__link {
  display: block;
  width: 100%;
  text-align: center;
  text-decoration: none;
  box-sizing: border-box;
}

/* 分镜稿件结果弹窗（与肖像弹窗同层级与交互） */
.split-result-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  padding-bottom: max(1rem, env(safe-area-inset-bottom));
}

.split-result-modal.is-open {
  display: flex;
}

.split-result-modal[hidden] {
  display: none !important;
}

.split-result-modal__backdrop {
  position: absolute;
  inset: 0;
  border: none;
  padding: 0;
  margin: 0;
  background: rgba(15, 23, 42, 0.55);
  cursor: pointer;
}

.split-result-modal__panel {
  position: relative;
  z-index: 1;
  width: min(100%, 26rem);
  max-height: min(90dvh, 42rem);
  display: flex;
  flex-direction: column;
  background: var(--wx-bg);
  border-radius: var(--radius-2xl);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.split-result-modal__header {
  flex: none;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--gray-200);
}

.split-result-modal__head-text {
  min-width: 0;
  flex: 1;
}

.split-result-modal__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-900);
}

.split-result-modal__meta {
  margin: 0.25rem 0 0;
  font-size: 12px;
  color: var(--gray-500);
}

.split-result-modal__close {
  appearance: none;
  border: none;
  background: transparent;
  padding: 0.35rem;
  border-radius: 9999px;
  cursor: pointer;
  color: var(--gray-600);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.split-result-modal__close:hover {
  background: var(--gray-200);
  color: var(--gray-800);
}

.split-result-modal__body {
  flex: 1;
  min-height: 0;
  padding: 0.75rem 1rem;
  overflow: auto;
  background: var(--blue-50);
}

.split-result-modal__text {
  margin: 0;
  font-size: 14px;
  line-height: 1.625;
  color: var(--gray-800);
  white-space: pre-wrap;
  word-break: break-word;
}

.split-result-modal__footer {
  flex: none;
  padding: 0.75rem 1rem 1rem;
  border-top: 1px solid var(--gray-200);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.split-result-modal__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.split-result-modal__regen {
  width: 100%;
  margin: 0;
  box-sizing: border-box;
}

.figma-out {
  min-height: 120px;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 15px;
  line-height: 1.55;
  padding: 0.85rem;
  border-radius: var(--radius-xl);
  border: 1px dashed var(--gray-300);
  background: #fafafa;
  color: var(--text);
}

.figma-status {
  margin-top: 0.5rem;
  font-size: 13px;
  color: var(--gray-600);
  min-height: 1.2em;
}

.figma-audio {
  width: 100%;
  margin-top: 0.75rem;
}

/* 折叠：专业参数 */
.figma-advanced {
  margin: 0 1rem 1.5rem;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.2);
  overflow: hidden;
  backdrop-filter: blur(8px);
}

.figma-advanced summary {
  cursor: pointer;
  padding: 0.85rem 1rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: #fff;
  list-style: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.figma-advanced summary::-webkit-details-marker {
  display: none;
}

.figma-advanced .advanced-body {
  padding: 0 1rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  background: #0f1419;
  color: #e8eaef;
}

.figma-advanced .advanced-body .muted,
.figma-advanced .advanced-body .hint {
  color: #9ca3af;
}

.figma-advanced .advanced-body label {
  color: #cbd5e1;
}

.figma-advanced .advanced-body input,
.figma-advanced .advanced-body select,
.figma-advanced .advanced-body textarea {
  background: #1a1f2e;
  border-color: #2d3748;
  color: #e8eaef;
}

.figma-advanced .advanced-body button.primary {
  background: #2563eb;
  color: #fff;
}

.figma-advanced .advanced-body .split-output {
  min-height: 120px;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.9rem;
  line-height: 1.55;
  padding: 0.75rem;
  border-radius: var(--radius-xl);
  border: 1px dashed #2d3748;
  background: #1a1f2e;
  color: #e8eaef;
}

.figma-advanced .advanced-body .split-audio {
  width: 100%;
  margin-top: 0.75rem;
}

.split-grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 720px) {
  .split-grid.two {
    grid-template-columns: 1fr 1fr;
  }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.split-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.75rem;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.photo-grid a {
  display: block;
}

.photo-grid img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid #2d3748;
}

.photo-meta {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: #9ca3af;
  word-break: break-all;
}

.split-status {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: #9ca3af;
}

/* 隐藏（成功态切换） */
.is-hidden {
  display: none !important;
}

#review-success {
  display: none;
}

#review-success.is-visible {
  display: block;
}

