* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, "Microsoft YaHei", "PingFang SC", sans-serif;
  background: #f4f6fb;
  color: #1f2937;
  line-height: 1.6;
}

header {
  background: linear-gradient(135deg, #1a5276, #6c3483);
  color: #fff;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.logo { font-size: 18px; font-weight: 700; }
nav { display: flex; gap: 6px; flex: 1; }
nav button {
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  padding: 7px 14px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 14px;
  transition: 0.2s;
}
nav button.active { background: #fff; color: #1a5276; font-weight: 700; }
.usage { font-size: 13px; background: rgba(255,255,255,0.2); padding: 4px 10px; border-radius: 12px; }

main { max-width: 720px; margin: 24px auto; padding: 0 16px; }
.tab { display: none; }
.tab.active { display: block; }
h1 { font-size: 22px; margin-bottom: 4px; }
.sub { color: #6b7280; margin-bottom: 20px; font-size: 14px; }

label { display: block; margin: 16px 0 6px; font-weight: 600; font-size: 14px; }
textarea, input, select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  background: #fff;
}
textarea { min-height: 84px; resize: vertical; }

.row { display: flex; gap: 14px; }
.row .col { flex: 1; }

button.primary {
  margin-top: 22px;
  width: 100%;
  background: linear-gradient(135deg, #2e86c1, #a569bd);
  color: #fff;
  border: none;
  padding: 14px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}
button.primary:hover { opacity: 0.92; }
button.primary.disabled {
  background: #cbd5e1;
  cursor: not-allowed;
}

.status { margin-top: 14px; font-size: 14px; color: #2563eb; min-height: 20px; }
.status.warn { color: #dc2626; font-weight: 600; }

.output {
  display: none;
  margin-top: 18px;
  background: #fff;
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}
.output h3 { margin: 16px 0 8px; font-size: 16px; color: #1a5276; }
.output ul { padding-left: 20px; }
.output .body p { margin: 10px 0; }
.output .tags span {
  display: inline-block;
  background: #eef2ff;
  color: #4338ca;
  padding: 4px 10px;
  border-radius: 12px;
  margin: 4px 4px 0 0;
  font-size: 13px;
}

.vip-card {
  background: #fff;
  border-radius: 16px;
  padding: 26px;
  text-align: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}
.price { font-size: 38px; font-weight: 800; color: #1a5276; }
.price span { font-size: 15px; color: #6b7280; font-weight: 400; }
.vip-card ul { text-align: left; max-width: 280px; margin: 18px auto; list-style: none; }
.vip-card li { margin: 8px 0; font-size: 15px; }
.pay-note { color: #6b7280; font-size: 13px; margin-top: 14px; }
.contact-note {
  color: #475569;
  font-size: 13px;
  margin: -8px 0 18px;
}
.qr-placeholder {
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  padding: 30px 10px;
  color: #94a3b8;
  margin: 10px 0 18px;
}
.qr-img {
  display: block;
  max-width: 260px;
  width: 100%;
  margin: 10px auto 18px;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

footer { text-align: center; color: #9ca3af; font-size: 12px; padding: 30px 0 40px; }

.account-area { margin-left: auto; }
.link-btn { background: rgba(255,255,255,0.2); border: none; color: #fff; padding: 7px 14px; border-radius: 20px; cursor: pointer; font-size: 14px; }
.link-btn:hover { background: rgba(255,255,255,0.32); }
.acc-name { font-weight: 700; }

.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 16px; }
.modal-box { background: #fff; border-radius: 16px; padding: 24px; width: 100%; max-width: 380px; position: relative; }
.modal-close { position: absolute; top: 12px; right: 14px; background: none; border: none; font-size: 24px; color: #9ca3af; cursor: pointer; line-height: 1; }
.tabs2 { display: flex; gap: 8px; margin-bottom: 16px; }
.tabs2 button { flex: 1; padding: 10px; border: 1px solid #e5e7eb; background: #f9fafb; border-radius: 10px; cursor: pointer; font-size: 15px; font-weight: 600; color: #6b7280; }
.tabs2 button.active { background: #1a5276; color: #fff; border-color: #1a5276; }
.vip-field { margin: 14px 0; }
.vip-field label { margin-top: 0; }
.vip-field input { width: 100%; padding: 10px 12px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 15px; }

/* 短剧剧本输出 */
.script-out h4 { margin: 14px 0 6px; color: #6c3483; font-size: 15px; }
.script-out .logline { color: #475569; font-style: italic; margin-bottom: 14px; }
.script-out .outline li { margin: 6px 0; font-size: 14px; }
.script-out .ep { border-top: 1px dashed #e2e8f0; padding-top: 6px; }
.script-out .scene { background: #f1f5f9; border-radius: 8px; padding: 8px 12px; font-size: 13px; color: #475569; margin: 8px 0 4px; }
.script-out .lines p { margin: 4px 0; font-size: 14px; }

/* 会员状态（等待后台核实 / 已开通） */
.status.waiting { color: #b45309; font-weight: 600; }
.status.ok { color: #16a34a; font-weight: 700; }
.status .uid { display:inline-block; margin-top:8px; background:#f1f5f9; padding:4px 10px; border-radius:6px; font-size:13px; word-break:break-all; }
.status .hint { display:block; margin-top:8px; font-size:12px; color:#94a3b8; font-weight:400; }

/* 剧本：复制按钮 + 即梦视频提示词 + 主线脉络 */
.copy-bar { display:flex; gap:10px; margin-bottom:6px; flex-wrap:wrap; }
.copy-btn {
  margin-top:0; width:auto;
  background:#eef2ff; color:#4338ca; border:1px solid #c7d2fe;
  padding:8px 14px; border-radius:10px; font-size:13px; font-weight:600; cursor:pointer;
}
.copy-btn:hover { background:#e0e7ff; }
.script-out .throughline { background:#faf5ff; border-left:3px solid #a569bd; padding:8px 12px; border-radius:0 8px 8px 0; font-size:14px; color:#6b21a8; margin-bottom:14px; }
.video-prompts { display:flex; flex-direction:column; gap:8px; }
.vp { display:flex; gap:10px; background:#f0fdf4; border:1px solid #bbf7d0; border-radius:10px; padding:10px 12px; font-size:14px; color:#166534; line-height:1.5; }
.vp-no { flex:0 0 22px; height:22px; background:#16a34a; color:#fff; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:12px; font-weight:700; }

/* 通用 */
.hide { display: none !important; }
label .tip { font-weight: 400; color: #6b7280; font-size: 12px; margin-left: 6px; }

/* PPT 图片预览 */
.image-preview { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.image-preview img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; border: 1px solid #e2e8f0; }

/* PPT 编辑区 */
.ppt-editor {
  margin-top: 22px;
  background: #fff;
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}
.ppt-editor h3 { font-size: 16px; margin-bottom: 4px; color: #1a5276; }
.ppt-editor > .tip { font-size: 13px; color: #6b7280; margin-bottom: 14px; }
.edit-row { margin-bottom: 12px; }
.edit-row label { margin: 0 0 4px; font-size: 13px; color: #475569; }
.edit-slide {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 12px;
  background: #fafbfc;
}
.slide-no { font-size: 12px; color: #6b7280; margin-bottom: 6px; font-weight: 600; background: #eef2f7; display: inline-block; padding: 2px 8px; border-radius: 10px; }
.slide-preview {
  font-size: 13px; color: #475569; background: #fff; border: 1px dashed #cbd5e1;
  border-radius: 8px; padding: 8px 10px; white-space: pre-wrap; line-height: 1.6; max-height: 120px; overflow: auto;
}
.slide-title-input {
  font-weight: 700;
  margin-bottom: 8px;
  border-color: #cbd5e1;
}
.slide-content-input {
  min-height: 80px;
  font-size: 14px;
  line-height: 1.6;
}
#ppt-download { margin-top: 10px; }

/* 剧本：人物小传卡片 / 关系网 / 动作行 / 分镜 / 钩子 */
.script-out .chars { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .script-out .chars { grid-template-columns: 1fr; } }
.script-out .char {
  background: #faf5ff; border: 1px solid #eadbf7; border-radius: 10px; padding: 10px 12px; font-size: 13px;
}
.script-out .char strong { color: #6b21a8; font-size: 14px; }
.script-out .char-role { color: #9333ea; font-size: 12px; margin-left: 6px; }
.script-out .char-f { color: #475569; margin-top: 3px; line-height: 1.5; }
.script-out .relations { background: #fef9c3; border-left: 3px solid #ca8a04; padding: 8px 12px; border-radius: 0 8px 8px 0; font-size: 14px; color: #854d0e; margin: 4px 0 14px; }
.script-out .hook { color: #dc2626; font-size: 12px; background: #fee2e2; padding: 1px 6px; border-radius: 8px; margin-left: 4px; }
.script-out .action { color: #64748b; font-size: 13px; font-style: italic; margin: 4px 0; }
.script-out .who { font-weight: 700; color: #1a5276; }
.script-out .shot { color: #0e7490; font-size: 12px; margin: 4px 0 8px; background: #ecfeff; border-radius: 6px; padding: 5px 8px; }

/* 通用次要按钮（如：模板画廊链接、应用修改） */
.ghost-btn {
  display: inline-block;
  background: #eef2ff; color: #4338ca; border: 1px solid #c7d2fe;
  padding: 9px 16px; border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer;
  text-decoration: none;
}
.ghost-btn:hover { background: #e0e7ff; }

/* PPT 对话式修改面板 */
.ai-edit {
  margin-top: 18px;
  border: 1px dashed #c7d2fe;
  border-radius: 12px;
  padding: 14px;
  background: #fafaff;
}
.ai-edit h4 { font-size: 15px; color: #4338ca; margin-bottom: 4px; }
.ai-edit .ai-edit-row { display: flex; gap: 10px; margin-top: 8px; }
.ai-edit .ai-edit-row input { flex: 1; }
.ai-edit #ppt-ai-apply { width: auto; margin-top: 0; white-space: nowrap; }

/* 剧本：SVG 人物关系图 */
.rel-graph { margin: 6px 0 14px; display: flex; justify-content: center; }
.rel-graph svg { background: #f8fafc; border-radius: 12px; border: 1px solid #eef2f7; }

/* 剧本：完整故事长文 */
.script-out .story-text { font-size: 15px; color: #1f2937; line-height: 1.9; }
.script-out .story-text .chapter { color: #6b21a8; margin: 18px 0 6px; font-size: 16px; }

