/**
 * 一键生成页面 — V21 原型 1:1 还原样式
 * 对照 frontend-v21-ui-prototype-final.html #view-generate
 */
@import "../../styles/global.css";

/* ============================================================
   页面容器
   ============================================================ */
.xx-generate-page {
  min-height: 100%;
  padding: var(--space-xl);
  max-width: 1400px;
  margin: 0 auto;
}

/* ============================================================
   页头
   ============================================================ */
.xx-generate-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-xl);
}

.xx-generate-head h2 {
  margin: 0 0 4px;
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
}

.xx-generate-head p {
  margin: 0;
  color: var(--text-secondary);
  font-size: var(--font-size-base);
}

/* ============================================================
   步骤条 steps-bar
   ============================================================ */
.xx-steps-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-bottom: 28px;
}

.xx-step-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-tertiary);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.xx-step-item:hover {
  background: var(--bg-secondary);
}

.xx-step-item.active {
  background: var(--primary-soft);
  color: var(--primary-color);
}

.xx-step-item.done {
  color: var(--secondary-color);
}

.xx-step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.xx-step-item.active .xx-step-num {
  background: var(--primary-color);
  color: var(--text-inverse);
}

.xx-step-item.done .xx-step-num {
  background: var(--secondary-color);
  color: var(--text-inverse);
}

.xx-step-arrow {
  color: var(--text-disabled);
  font-size: 14px;
  user-select: none;
}

/* ============================================================
   主布局 generate-layout
   ============================================================ */
.xx-generate-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  align-items: start;
}

/* ============================================================
   左侧表单区 generate-form
   ============================================================ */
.xx-generate-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── form-section 卡片 ── */
.xx-form-section {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
}

.xx-form-section h3 {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

/* ── form-field ── */
.xx-form-field {
  margin-bottom: 14px;
}

.xx-form-field:last-child {
  margin-bottom: 0;
}

.xx-form-field label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--text-primary);
}

.xx-form-field select,
.xx-form-field input {
  width: 100%;
  height: 44px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  padding: 0 14px;
  font-size: 14px;
  outline: 0;
  transition: 0.15s ease;
  color: var(--text-primary);
}

.xx-form-field select:focus,
.xx-form-field input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* ── form-row（双列） ── */
.xx-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* ============================================================
   choice-list 卡片式选择
   ============================================================ */
.xx-choice-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.xx-choice-item {
  position: relative;
  background: var(--bg-primary);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  cursor: pointer;
  transition: 0.18s ease;
  text-align: center;
}

.xx-choice-item:hover {
  border-color: var(--info-border);
}

.xx-choice-item.selected {
  border-color: var(--primary-color);
  background: var(--primary-soft);
}

.xx-choice-thumb {
  height: 60px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  color: var(--text-inverse);
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 10px;
}

.xx-choice-item h4 {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.xx-choice-item p {
  margin: 0;
  font-size: 11px;
  color: var(--text-tertiary);
}

.xx-choice-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary-color);
  color: var(--text-inverse);
  display: none;
  place-items: center;
  font-size: 12px;
  position: absolute;
  right: -6px;
  top: -6px;
}

.xx-choice-item.selected .xx-choice-check {
  display: grid;
}

/* ============================================================
   Pill 标签
   ============================================================ */
.xx-pill {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 999px;
  font-weight: 700;
  display: inline-block;
}

.xx-pill-ok {
  background: var(--success-soft);
  color: var(--secondary-dark);
}

.xx-pill-info {
  background: var(--info-soft);
  color: var(--info-color);
}

/* ============================================================
   配音卡片（步骤4 choice-list 变体）
   ============================================================ */
.xx-voice-choice-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.xx-voice-choice-item {
  position: relative;
  background: var(--bg-primary);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  cursor: pointer;
  transition: 0.18s ease;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 12px;
}

.xx-voice-choice-item:hover {
  border-color: var(--info-border);
}

.xx-voice-choice-item.selected {
  border-color: var(--primary-color);
  background: var(--primary-soft);
}

.xx-voice-choice-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gradient-primary);
  color: var(--text-inverse);
  display: grid;
  place-items: center;
  font-size: 18px;
  flex-shrink: 0;
}

.xx-voice-choice-info h4 {
  margin: 0 0 2px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.xx-voice-choice-info p {
  margin: 0;
  font-size: 11px;
  color: var(--text-tertiary);
}

.xx-voice-choice-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary-color);
  color: var(--text-inverse);
  display: none;
  place-items: center;
  font-size: 12px;
  position: absolute;
  right: -6px;
  top: -6px;
}

.xx-voice-choice-item.selected .xx-voice-choice-check {
  display: grid;
}

/* ── 克隆声音区域 ── */
.xx-clone-section {
  margin-top: 16px;
  padding: 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.xx-clone-section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 8px;
}

.xx-clone-voices-list {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.xx-clone-voice-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: 0.15s ease;
}

.xx-clone-voice-row:hover {
  border-color: var(--primary-color);
}

.xx-clone-voice-row.selected {
  border-color: var(--primary-color);
  background: var(--primary-soft);
}

.xx-clone-voice-row.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.xx-clone-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 14px;
  flex-shrink: 0;
}

.xx-clone-avatar.ready {
  background: linear-gradient(
    135deg,
    var(--color-secondary-500),
    var(--color-secondary-600)
  );
  color: var(--text-inverse);
}

.xx-clone-avatar.processing {
  background: linear-gradient(
    135deg,
    var(--color-accent-500),
    var(--color-accent-600)
  );
  color: var(--text-inverse);
  animation: xx-clone-pulse 2s ease-in-out infinite;
}

.xx-clone-avatar.failed {
  background: linear-gradient(
    135deg,
    var(--color-gray-400),
    var(--color-gray-500)
  );
  color: var(--text-inverse);
}

@keyframes xx-clone-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

.xx-clone-info {
  flex: 1;
  min-width: 0;
}

.xx-clone-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.xx-clone-status {
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.xx-clone-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── 克隆进度条 ── */
.xx-clone-progress {
  position: relative;
  height: 4px;
  background: var(--bg-tertiary);
  border-radius: 3px;
  margin-top: 6px;
  overflow: hidden;
}

.xx-clone-progress-bar {
  height: 100%;
  background: linear-gradient(
    90deg,
    var(--warning-color),
    var(--success-color)
  );
  border-radius: 3px;
  transition: width 0.5s ease;
}

.xx-clone-progress--indeterminate .xx-clone-progress-bar {
  width: 100%;
  background: repeating-linear-gradient(
    90deg,
    var(--warning-color) 0%,
    var(--warning-color) 25%,
    var(--success-color) 25%,
    var(--success-color) 50%,
    var(--warning-color) 50%
  );
  background-size: 60px 100%;
  animation: xx-clone-progress-flow 1.2s linear infinite;
}

@keyframes xx-clone-progress-flow {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 60px 0;
  }
}

.xx-clone-progress-text {
  position: absolute;
  right: 0;
  top: -14px;
  font-size: 10px;
  color: var(--warning-color);
  font-weight: 600;
}

/* ── 轮询提示 ── */
.xx-clone-polling-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  font-size: 12px;
  color: var(--warning-color);
  background: rgba(245, 158, 11, 0.08);
  border-radius: var(--radius-sm);
  animation: xx-fade 2s ease-in-out infinite;
}

.xx-clone-polling-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--warning-color);
  animation: xx-blink 1.5s ease-in-out infinite;
}

@keyframes xx-fade {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

@keyframes xx-blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}

/* ============================================================
   确认生成（步骤5）摘要
   ============================================================ */
.xx-summary-card {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 16px;
}

.xx-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
}

.xx-summary-row + .xx-summary-row {
  border-top: 1px solid var(--border-color);
}

.xx-summary-label {
  color: var(--text-tertiary);
  font-size: 13px;
}

.xx-summary-value {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
}

/* ============================================================
   底部操作按钮
   ============================================================ */
.xx-step-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.xx-step-actions .xx-btn-ghost {
  flex: 0 0 auto;
}

.xx-step-actions .xx-btn-primary {
  flex: 1;
}

/* ============================================================
   按钮（匹配原型 .btn .ghost / .btn .primary）
   ============================================================ */
.xx-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 42px;
  padding: 0 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  border: none;
  outline: none;
  white-space: nowrap;
}

.xx-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.xx-btn-primary {
  background: var(--gradient-primary);
  color: var(--text-inverse);
  box-shadow: 0 14px 26px rgba(79, 70, 229, 0.22);
}

.xx-btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 18px 34px rgba(79, 70, 229, 0.28);
}

.xx-btn-ghost {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.xx-btn-ghost:hover:not(:disabled) {
  border-color: var(--info-border);
  color: var(--primary-dark);
  background: var(--primary-soft);
}

/* ============================================================
   右侧预览区 generate-preview
   ============================================================ */
.xx-generate-preview {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  position: sticky;
  top: 92px;
}

/* ── 视频预览 ── */
.xx-preview-video {
  aspect-ratio: 9 / 16;
  max-height: 400px;
  border-radius: var(--radius-md);
  background: linear-gradient(
    135deg,
    var(--color-gray-900),
    var(--color-primary-900)
  );
  display: grid;
  place-items: center;
  color: var(--text-inverse);
  font-size: 36px;
  position: relative;
  overflow: hidden;
  margin-bottom: 16px;
}

.xx-preview-video::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at 72% 28%,
    rgba(255, 255, 255, 0.2),
    transparent 40%
  );
  pointer-events: none;
}

.xx-preview-video video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-md);
  position: relative;
  z-index: 1;
}

.xx-play-btn {
  position: relative;
  z-index: 1;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: grid;
  place-items: center;
  backdrop-filter: blur(8px);
  border: none;
  color: var(--text-inverse);
  font-size: 24px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.xx-play-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
}

/* ── 字幕预览 ── */
.xx-preview-caption {
  background: rgba(255, 255, 255, 0.95);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  padding: 10px;
  text-align: center;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 14px;
}

/* ── 时间线标题 ── */
.xx-preview-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 10px;
}

/* ── 时间线列表 ── */
.xx-preview-timeline {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.xx-timeline-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.xx-timeline-item .num {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-xs);
  background: var(--primary-soft);
  color: var(--primary-color);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 11px;
  flex-shrink: 0;
}

.xx-timeline-item span {
  color: var(--text-tertiary);
  margin-left: auto;
  font-size: 12px;
}

.xx-timeline-item .scene-name {
  color: var(--text-primary);
  margin-left: 0;
  flex: 1;
  font-size: 13px;
}

/* ── 生成操作按钮 ── */
.xx-generate-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.xx-generate-actions .xx-btn {
  flex: 1;
}

/* ============================================================
   生成进度
   ============================================================ */
.xx-progress-bar {
  width: 100%;
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}

.xx-progress-bar-fill {
  height: 100%;
  background: linear-gradient(
    90deg,
    var(--color-primary-500),
    var(--color-primary-600)
  );
  border-radius: 3px;
  transition: width 0.3s ease;
}

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 1200px) {
  .xx-generate-layout {
    grid-template-columns: 1fr;
  }

  .xx-generate-preview {
    position: static;
  }
}

@media (max-width: 768px) {
  .xx-generate-page {
    padding: var(--space-md);
  }

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

  .xx-voice-choice-list {
    grid-template-columns: 1fr;
  }

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

  .xx-step-label {
    display: none;
  }
}

@media (max-width: 480px) {
  .xx-generate-page {
    padding: var(--space-sm);
  }

  .xx-choice-list {
    grid-template-columns: 1fr;
  }

  .xx-step-actions {
    flex-direction: column;
  }

  .xx-generate-actions {
    flex-direction: column;
  }
}

/* ── 存为素材弹窗 ── */
.xx-save-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: xxFadeIn 0.15s ease;
}

.xx-save-modal {
  background: var(--bg-card, #fff);
  border-radius: var(--radius-lg, 16px);
  width: 420px;
  max-width: 90vw;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  animation: xxSlideUp 0.2s ease;
}

.xx-save-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light, #f1f5f9);
  font-weight: 600;
  font-size: 15px;
  color: var(--text-primary, #0f172a);
}

.xx-save-modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-tertiary, #94a3b8);
  font-size: 14px;
  padding: 4px;
  border-radius: var(--radius-sm, 6px);
  transition: all 0.15s;
}

.xx-save-modal-close:hover {
  background: var(--bg-hover, #f8fafc);
  color: var(--text-primary, #0f172a);
}

.xx-save-modal-body {
  padding: 20px;
}

.xx-save-modal-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary, #475569);
  margin-bottom: 6px;
  margin-top: 14px;
}

.xx-save-modal-label:first-child {
  margin-top: 0;
}

.xx-save-modal-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: var(--radius-sm, 10px);
  font-size: 14px;
  outline: none;
  background: var(--bg-surface, #fff);
  color: var(--text-primary, #0f172a);
  transition: border-color 0.15s;
}

.xx-save-modal-input:focus {
  border-color: var(--primary-500, #6366f1);
  box-shadow: 0 0 0 2px var(--primary-100, #e0e7ff);
}

.xx-save-modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: var(--radius-sm, 10px);
  min-height: 40px;
  align-items: center;
  cursor: text;
  transition: border-color 0.15s;
}

.xx-save-modal-tags:focus-within {
  border-color: var(--primary-500, #6366f1);
  box-shadow: 0 0 0 2px var(--primary-100, #e0e7ff);
}

.xx-save-modal-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  font-size: 12px;
  border-radius: 12px;
  background: var(--primary-50, #eef2ff);
  color: var(--primary-600, #4f46e5);
  border: 1px solid var(--primary-200, #c7d2fe);
}

.xx-save-modal-tag-remove {
  font-size: 10px;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.15s;
}

.xx-save-modal-tag-remove:hover {
  opacity: 1;
}

.xx-save-modal-tag-input {
  border: none;
  outline: none;
  flex: 1;
  min-width: 100px;
  font-size: 13px;
  background: transparent;
  color: var(--text-primary, #0f172a);
}

.xx-save-modal-tag-input::placeholder {
  color: var(--text-tertiary, #94a3b8);
}

.xx-save-modal-tag-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-light, #f1f5f9);
}

.xx-save-modal-tag-preset {
  padding: 3px 10px;
  font-size: 12px;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 12px;
  background: var(--bg-surface, #fff);
  color: var(--text-secondary, #475569);
  cursor: pointer;
  transition: all 0.15s;
}

.xx-save-modal-tag-preset:hover {
  border-color: var(--primary-300, #a5b4fc);
  color: var(--primary-600, #4f46e5);
  background: var(--primary-50, #eef2ff);
}

.xx-save-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--border-light, #f1f5f9);
}

@keyframes xxFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

/* ── 生成数量步进器 ── */
.xx-count-stepper {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.xx-count-stepper-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--border-primary, #e2e8f0);
  border-radius: 8px;
  background: var(--bg-surface, #fff);
  color: var(--text-secondary, #64748b);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}

.xx-count-stepper-btn:hover:not(:disabled) {
  border-color: var(--primary-400, #818cf8);
  color: var(--primary-600, #4f46e5);
  background: var(--primary-50, #eef2ff);
}

.xx-count-stepper-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.xx-count-stepper-value {
  min-width: 24px;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary, #1e293b);
}

.xx-count-stepper-hint {
  font-size: 12px;
  color: var(--text-tertiary, #94a3b8);
  margin-left: 2px;
}

/* ── 素材选择模式切换 Tab ── */
.xx-material-mode-tabs {
  display: flex;
  gap: 0;
  border: 1px solid var(--border-primary, #e2e8f0);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 4px;
}

.xx-material-mode-tab {
  flex: 1;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  border: none;
  background: var(--bg-surface, #fff);
  color: var(--text-secondary, #64748b);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.xx-material-mode-tab:first-child {
  border-right: 1px solid var(--border-primary, #e2e8f0);
}

.xx-material-mode-tab:hover {
  background: var(--primary-50, #eef2ff);
  color: var(--primary-600, #4f46e5);
}

.xx-material-mode-tab.active {
  background: var(--primary-500, #6366f1);
  color: #fff;
  font-weight: 600;
}

/* ── 自动匹配卡片 ── */
.xx-auto-match-card {
  margin-top: 14px;
  padding: 20px;
  background: linear-gradient(135deg, #f0f4ff 0%, #faf5ff 100%);
  border: 1px solid var(--border-primary, #e2e8f0);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.xx-auto-match-icon {
  font-size: 36px;
  margin-bottom: 10px;
}

.xx-auto-match-body {
  width: 100%;
}

.xx-auto-match-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary, #1e293b);
  margin: 0 0 8px;
}

.xx-auto-match-desc {
  font-size: 13px;
  color: var(--text-secondary, #64748b);
  line-height: 1.6;
  margin: 0 0 14px;
}

.xx-auto-match-features {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.xx-auto-match-feature {
  display: inline-block;
  padding: 4px 12px;
  font-size: 12px;
  color: var(--primary-600, #4f46e5);
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--border-light, #f1f5f9);
  border-radius: 20px;
}
