/* 欧泡5.5 AI PPT · 买家端样式（浅色卡片风） */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #fbfbfd; --card: #ffffff; --line: #e8e8ee;
  --text: #1f2329; --muted: #6b7280;
  --pri: #4f46e5; --pri-dark: #4338ca; --acc: #8b5cf6;
  --blue: #2563eb; --violet: #7c3aed; --indigo: #4f46e5;
  --danger: #dc2626; --ok: #059669;
  --radius: 14px;
}
body { font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg); color: var(--text); min-height: 100vh; }
button { font: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font: inherit; }

/* ── 品牌 ── */
.brand, .access-gate__brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, var(--pri), var(--acc));
  color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; font-size: 18px; }
.brand-tagline { color: var(--muted); font-size: 13px; margin-left: 2px; }

/* ── 授权门 ── */
.access-gate { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.access-gate__card { background: var(--card); border: 1px solid var(--line); border-radius: 20px;
  padding: 44px 40px; width: 100%; max-width: 420px; box-shadow: 0 12px 40px rgba(79,70,229,.08); }
.access-gate__card h1 { font-size: 20px; margin: 26px 0 6px; }
.gate-hint { color: var(--muted); font-size: 13px; margin-bottom: 18px; }
#gate-form { display: flex; flex-direction: column; gap: 12px; }
#gate-code { border: 1.5px solid var(--line); border-radius: 10px; padding: 12px 14px; font-size: 15px; }
#gate-code:focus { outline: none; border-color: var(--pri); }

/* ── 顶栏 ── */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 14px 28px;
  background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.topbar__actions { display: flex; align-items: center; gap: 10px; }
.entitlement-wallet { display: flex; gap: 8px; }
.entitlement-tier { background: #eef2ff; color: var(--pri-dark); border-radius: 999px;
  padding: 5px 12px; font-size: 13px; white-space: nowrap; }
.entitlement-tier strong { margin: 0 2px; }
.entitlement-tier em { font-style: normal; color: var(--danger); margin-left: 6px; font-size: 12px; }
.quota-button, .history-button { border: 1.5px solid var(--line); border-radius: 10px; padding: 8px 14px;
  font-size: 14px; background: var(--card); }
.quota-button { color: var(--pri); border-color: var(--pri); font-weight: 600; }
.quota-button:hover, .history-button:hover { background: #f5f5fa; }

/* ── 布局 ── */
.layout { display: grid; grid-template-columns: 1fr 320px; gap: 24px; max-width: 1180px;
  margin: 24px auto; padding: 0 20px; align-items: start; }
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; } }
.form-section { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; margin-bottom: 20px; }
.section-title { font-size: 17px; margin-bottom: 14px; }
.section-title small { color: var(--muted); font-weight: 400; font-size: 13px; margin-left: 8px; }

/* ── 格式卡片 ── */
.kind-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.kind-card { border: 1.5px solid var(--line); border-radius: 12px; padding: 16px 14px; text-align: left;
  display: flex; flex-direction: column; gap: 4px; background: var(--card); }
.kind-card__tag { display: inline-block; font-size: 12px; font-weight: 700; color: var(--pri);
  background: #eef2ff; border-radius: 6px; padding: 2px 8px; width: fit-content; }
.kind-card strong { font-size: 15px; }
.kind-card__meta { font-size: 12px; color: var(--muted); }
.kind-card.is-active { border-color: var(--pri); box-shadow: 0 0 0 3px rgba(79,70,229,.12); }

/* ── 主题表单 ── */
#topic { width: 100%; border: 1.5px solid var(--line); border-radius: 12px; padding: 14px;
  font-size: 14px; resize: vertical; min-height: 120px; }
#topic:focus { outline: none; border-color: var(--pri); }
.form-row { margin-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.form-row label { font-size: 14px; font-weight: 600; }
.form-row select, .form-row input { border: 1.5px solid var(--line); border-radius: 10px;
  padding: 10px 12px; font-size: 14px; background: var(--card); }
.form-help { color: var(--muted); font-size: 12.5px; }

/* ── 风格四选一 ── */
.source-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.source-card { border: 1.5px solid var(--line); border-radius: 12px; padding: 16px;
  text-align: left; display: flex; flex-direction: column; gap: 6px; background: var(--card); }
.source-card strong { font-size: 15px; }
.source-card span { font-size: 13px; color: var(--muted); line-height: 1.5; }
.source-card__action { font-style: normal; font-size: 13px; font-weight: 600; margin-top: 4px; }
.source-card--blue .source-card__action { color: var(--blue); }
.source-card--violet .source-card__action { color: var(--violet); }
.source-card--indigo .source-card__action { color: var(--indigo); }
.source-card.is-active { border-color: var(--pri); box-shadow: 0 0 0 3px rgba(79,70,229,.12); }
.source-card.is-active .source-card__action::after { content: " ✓"; }

/* ── 上传 ── */
.upload-zone { border: 2px dashed var(--line); border-radius: 12px; padding: 26px; text-align: center;
  color: var(--muted); cursor: pointer; }
.upload-zone:hover { border-color: var(--pri); color: var(--pri); }
.upload-list { list-style: none; margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.upload-list li { display: flex; align-items: center; justify-content: space-between;
  background: #f7f7fb; border-radius: 10px; padding: 10px 14px; font-size: 13.5px; }
.upload-list .del { color: var(--danger); font-size: 13px; }

/* ── 概要侧栏 ── */
.summary { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; position: sticky; top: 84px; }
.summary h3 { font-size: 16px; margin-bottom: 14px; }
.summary-list { display: flex; flex-direction: column; }
.summary-row { display: flex; justify-content: space-between; padding: 10px 0;
  border-bottom: 1px dashed var(--line); font-size: 14px; }
.summary-row dt { color: var(--muted); }
.summary-row dd { font-weight: 600; text-align: right; max-width: 60%; }
.generate-button { width: 100%; margin-top: 18px; background: linear-gradient(135deg, var(--pri), var(--acc));
  color: #fff; border-radius: 12px; padding: 14px; transition: opacity .15s; }
.generate-button:disabled { opacity: .45; cursor: not-allowed; }
.generate-button__copy { display: flex; flex-direction: column; gap: 2px; }
.generate-button__copy strong { font-size: 16px; }
.generate-button__copy small { font-size: 12px; opacity: .85; }

/* ── 弹窗 ── */
.modal-backdrop { position: fixed; inset: 0; background: rgba(20,20,40,.45); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-backdrop[hidden] { display: none; }   /* hidden 属性必须生效，否则隐形遮罩会挡住点击 */
.compact-modal { background: var(--card); border-radius: 16px; padding: 26px; width: 100%;
  max-width: 460px; max-height: 86vh; overflow: auto; }
.compact-modal.wide { max-width: 860px; }
.compact-modal h2 { font-size: 18px; margin-bottom: 8px; }
.compact-modal .modal-sub { color: var(--muted); font-size: 13px; margin-bottom: 16px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
.primary-button { background: var(--pri); color: #fff; border-radius: 10px; padding: 11px 20px; font-weight: 600; }
.primary-button:hover { background: var(--pri-dark); }
.primary-button:disabled { opacity: .5; }
.ghost-button { border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 18px; }
.form-error { color: var(--danger); font-size: 13px; }
.form-input { width: 100%; border: 1.5px solid var(--line); border-radius: 10px; padding: 11px 13px; margin-top: 10px; }

/* ── 风格选择弹窗 ── */
.style-cats { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.style-cats button { border: 1.5px solid var(--line); border-radius: 999px; padding: 6px 14px; font-size: 13px; }
.style-cats button.is-active { background: var(--pri); color: #fff; border-color: var(--pri); }
.style-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 700px) { .style-grid { grid-template-columns: 1fr 1fr; } }
.style-card { border: 1.5px solid var(--line); border-radius: 12px; overflow: hidden; text-align: left; }
.style-card__preview { height: 90px; display: flex; align-items: flex-end; padding: 10px; }
.style-card__preview span { color: #fff; font-weight: 700; font-size: 15px; text-shadow: 0 1px 4px rgba(0,0,0,.3); }
.style-card__body { padding: 10px 12px; }
.style-card__body strong { font-size: 14px; display: block; }
.style-card__body span { font-size: 12px; color: var(--muted); }
.style-card.is-active { border-color: var(--pri); box-shadow: 0 0 0 3px rgba(79,70,229,.12); }

/* ── 任务历史 ── */
.history-list { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.history-row { border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.history-row__head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.history-row__title { font-size: 14px; font-weight: 600; flex: 1; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.state-chip { font-size: 12px; border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.state-chip--queued, .state-chip--running { background: #fff7ed; color: #c2410c; }
.state-chip--succeeded { background: #ecfdf5; color: var(--ok); }
.state-chip--failed, .state-chip--canceled { background: #fef2f2; color: var(--danger); }
.history-row__meta { font-size: 12px; color: var(--muted); margin-top: 6px; }
.history-row__prog { height: 6px; background: #f0f0f6; border-radius: 999px; margin-top: 10px; overflow: hidden; }
.history-row__prog-fill { height: 100%; background: linear-gradient(90deg, var(--pri), var(--acc)); border-radius: 999px; }
.history-row__actions { margin-top: 10px; display: flex; gap: 8px; }
.history-row__actions button, .history-row__actions a { font-size: 13px; color: var(--pri);
  border: 1px solid var(--pri); border-radius: 8px; padding: 5px 12px; text-decoration: none; }

/* ── 进度视图 ── */
.progress-view { text-align: center; padding: 30px 10px; }
.spinner { width: 42px; height: 42px; border: 4px solid #e8e8f5; border-top-color: var(--pri);
  border-radius: 50%; margin: 0 auto 18px; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.progress-bar { height: 10px; background: #f0f0f6; border-radius: 999px; overflow: hidden; margin: 18px 0 8px; }
.progress-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--pri), var(--acc));
  border-radius: 999px; transition: width .6s; }
.progress-status { color: var(--muted); font-size: 13.5px; }

.app-footer { display: flex; justify-content: space-between; align-items: center; max-width: 1180px;
  margin: 10px auto 30px; padding: 0 20px; color: var(--muted); font-size: 13px; }
.app-footer__logout { color: var(--muted); font-size: 13px; text-decoration: underline; }
