/* ============================================================
   app.css - 前台 landing 与工作台专属样式
   （在 style.css 基础上叠加，复用其暗色主题变量）
   ============================================================ */

/* ---------- Landing 顶栏 ---------- */
.nav {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px 40px;
  background: rgba(246,246,243,.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.nav .logo { font-weight: 800; font-size: 18px; letter-spacing: .5px; }
.nav .links { display: flex; gap: 20px; font-size: 14px; color: var(--text-dim); }
.nav .links a { color: var(--text-dim); }
.nav .links a:hover { color: var(--text); }
.nav .spacer { flex: 1; }

/* ---------- Hero ---------- */
.hero {
  text-align: center;
  padding: 90px 20px 70px;
  max-width: 900px;
  margin: 0 auto;
}
.hero .tag {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-dim);
  font-size: 13px;
  margin-bottom: 24px;
}
.hero h1 {
  font-size: 46px;
  line-height: 1.2;
  font-weight: 800;
  margin-bottom: 20px;
  color: var(--text);
}
.hero p.sub { font-size: 17px; color: var(--text-dim); max-width: 640px; margin: 0 auto 32px; line-height: 1.7; }
.hero .cta-row { display: flex; gap: 12px; justify-content: center; }
.btn-lg { padding: 12px 28px; font-size: 15px; border-radius: 10px; }

/* ---------- 功能卡片 ---------- */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 24px;
}
.feature-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px;
  transition: border-color .2s, transform .2s;
}
.feature-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.feature-card .idx { font-size: 12px; color: var(--text-faint); margin-bottom: 10px; }
.feature-card h3 { font-size: 17px; margin-bottom: 8px; }
.feature-card p { font-size: 13px; color: var(--text-dim); line-height: 1.7; margin-bottom: 14px; }
.feature-card .meta { font-size: 12px; color: var(--text-faint); }

/* ---------- 步骤 ---------- */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-top: 24px; }
.step { background: var(--bg-panel); border: 1px solid var(--border); border-radius: 12px; padding: 22px; }
.step .no { font-size: 26px; font-weight: 800; color: var(--accent); margin-bottom: 10px; }
.step h4 { margin-bottom: 8px; }
.step p { font-size: 13px; color: var(--text-dim); }

/* ---------- 区块标题 ---------- */
.block { padding: 70px 40px; max-width: 1080px; margin: 0 auto; }
.block .block-title { text-align: center; font-size: 30px; font-weight: 800; margin-bottom: 8px; }
.block .block-sub { text-align: center; color: var(--text-dim); margin-bottom: 40px; }

/* ---------- 高亮网格 ---------- */
.highlights { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.highlight { background: var(--bg-panel); border: 1px solid var(--border); border-radius: 10px; padding: 18px; }
.highlight h4 { font-size: 14px; margin-bottom: 6px; }
.highlight p { font-size: 12px; color: var(--text-dim); }

/* ---------- FAQ ---------- */
.faq-item { background: var(--bg-panel); border: 1px solid var(--border); border-radius: 10px; padding: 18px 20px; margin-bottom: 10px; }
.faq-item .q { font-weight: 600; margin-bottom: 8px; }
.faq-item .a { font-size: 13px; color: var(--text-dim); line-height: 1.7; }

/* ---------- 工作台布局 ---------- */
.workspace { display: grid; grid-template-columns: 380px 1fr; gap: 16px; min-height: calc(100vh - 60px); padding: 16px; }
.panel-side { display: flex; flex-direction: column; gap: 14px; overflow-y: auto; }
.panel-main { display: flex; flex-direction: column; gap: 14px; }
/* 我的历史卡片默认展开：撑满右栏剩余空间，内容区可滚动 */
.panel-main .card:last-child { flex: 1; display: flex; flex-direction: column; min-height: 220px; }
.panel-main .card:last-child [id$="Area"] { flex: 1; overflow-y: auto; }

/* 上传区 */
.dropzone {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 26px;
  text-align: center;
  cursor: pointer;
  color: var(--text-dim);
  transition: border-color .2s, background .2s;
  font-size: 13px;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--accent); background: rgba(0,0,0,.04); }
.thumb-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.thumb { position: relative; width: 64px; height: 64px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .remove {
  position: absolute; top: 2px; right: 2px;
  width: 18px; height: 18px; border-radius: 50%;
  background: rgba(0,0,0,.7); color: #fff; border: none;
  cursor: pointer; font-size: 11px; line-height: 18px; text-align: center;
}

/* 结果画廊 */
.result-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.result-item { position: relative; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); }
.result-item img { width: 100%; display: block; }
.result-item .actions {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 8px; background: linear-gradient(transparent, rgba(0,0,0,.8));
  display: flex; gap: 6px; opacity: 0; transition: opacity .2s;
}
.result-item:hover .actions { opacity: 1; }
.result-item .actions a { font-size: 12px; padding: 4px 10px; background: var(--accent); color: #fff; border-radius: 5px; }

/* 生成中遮罩 */
.generating { text-align: center; padding: 40px; color: var(--text-dim); }
.spinner {
  display: inline-block; width: 28px; height: 28px;
  border: 3px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 页面级标题区（工作台顶部大标题 + 副标题，靠左对齐） */
.page-head { padding: 36px 16px 0; }
.page-head h1 { font-size: 34px; font-weight: 800; letter-spacing: -1px; line-height: 1.2; }
.page-head p { font-size: 14px; color: var(--text-dim); margin-top: 8px; line-height: 1.6; }

/* 图片类型 tab（滑动指示条 + 平滑过渡，消除切换闪现） */
.type-tabs { position: relative; display: flex; gap: 6px; }
.type-tabs .tab-indicator {
  position: absolute; top: 0; bottom: 0; left: 0;
  background: var(--accent); border-radius: 10px;
  z-index: 0; pointer-events: none; opacity: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
  transition: transform .28s cubic-bezier(.4, 0, .2, 1), width .28s cubic-bezier(.4, 0, .2, 1), opacity .2s ease;
}
.type-tab {
  position: relative; z-index: 1;
  flex: 1;
  padding: 9px 12px;
  border: 1px solid var(--border);
  background: var(--bg-panel);
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  font-family: inherit;
  transition: color .25s ease, border-color .25s ease, background .25s ease, transform .12s ease;
}
.type-tab.active { background: transparent; color: #fff; border-color: transparent; }
.type-tab:active { transform: scale(.96); }

/* 专家模式开关 */
.expert-row { display: flex; align-items: center; gap: 10px; }
.switch { position: relative; display: inline-block; width: 40px; height: 22px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: .2s;
}
.switch-slider::before {
  content: ""; position: absolute; height: 16px; width: 16px;
  left: 2px; top: 2px; background: #fff;
  border-radius: 50%; transition: .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.switch input:checked + .switch-slider { background: var(--accent); }
.switch input:checked + .switch-slider::before { transform: translateX(18px); }

/* 工作台底部营销区 */
.marketing { padding: 60px 40px; border-top: 1px solid var(--border); background: var(--bg); }
.marketing h2 { font-size: 40px; font-weight: 800; letter-spacing: -1px; text-align: center; margin-bottom: 14px; }
.marketing .mk-sub { text-align: center; color: var(--text-dim); font-size: 14px; margin-bottom: 40px; }
.compare-wrap { overflow-x: auto; margin-bottom: 48px; }
.compare-table {
  width: 100%; border-collapse: collapse; background: #fff;
  border: 1px solid var(--border); border-radius: 16px; overflow: hidden;
}
.compare-table th, .compare-table td { padding: 14px 18px; border-bottom: 1px solid var(--border); text-align: left; font-size: 14px; }
.compare-table th { background: var(--bg-elevated); font-weight: 700; white-space: nowrap; }
.compare-table td.dim { color: var(--text-dim); }
.compare-table td.win { font-weight: 700; color: var(--accent); }
.compare-table tr:last-child td { border-bottom: none; }

/* 响应式 */
@media (max-width: 860px) {
  .workspace { grid-template-columns: 1fr; }
  .hero h1 { font-size: 32px; }
}
/* 窄屏：工作台顶栏隐藏次要元素，避免挤压 */
@media (max-width: 600px) {
  .topbar #pageTitle, .topbar #userName { display: none; }
  .topbar { gap: 8px; padding: 8px 12px; }
}

/* 提示词工具栏（保留复选框 / 草稿箱 / 清空） */
.prompt-toolbar { display: flex; align-items: center; gap: 8px; margin: 10px 0 12px; flex-wrap: wrap; }
.prompt-toolbar .keep-wrap { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text); cursor: pointer; user-select: none; }
.prompt-toolbar .keep-wrap input { accent-color: var(--accent); width: 15px; height: 15px; cursor: pointer; }
.prompt-toolbar .flex-spacer { flex: 1; }

/* 草稿箱弹窗内的列表 */
.draft-list { max-height: 340px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.draft-item { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: var(--bg); }
.draft-item .draft-text { font-size: 13px; color: var(--text); line-height: 1.6; word-break: break-all; }
.draft-item .draft-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 11px; color: var(--text-dim); }
.draft-item .draft-ops { display: flex; gap: 6px; }

/* 草稿箱弹窗：说明 / 搜索 / 空态 / 展开全文 */
.draft-note { font-size: 12px; color: var(--text-dim); line-height: 1.6; margin: 0 0 12px; }
.draft-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.draft-search {
  flex: 1; min-width: 0; padding: 7px 12px; font-size: 13px; font-family: inherit;
  color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
}
.draft-search:focus { outline: none; border-color: var(--accent); }
.draft-empty {
  padding: 26px 16px; text-align: center; font-size: 12.5px; color: var(--text-dim);
  line-height: 1.9; border: 1px dashed var(--border); border-radius: 10px;
}
.draft-item .draft-text.clamp {
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.draft-more {
  margin-top: 4px; padding: 0; border: none; background: none; cursor: pointer;
  color: var(--accent); font-size: 11.5px; font-family: inherit;
}
.draft-more:hover { text-decoration: underline; }

/* 分段按钮（智能/自定义模块、标准/快速速度，滑动指示条） */
.seg-buttons { position: relative; display: flex; gap: 8px; }
.seg-buttons .seg-indicator {
  position: absolute; top: 0; bottom: 0; left: 0;
  background: var(--accent); border-radius: 10px;
  z-index: 0; pointer-events: none; opacity: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
  transition: transform .28s cubic-bezier(.4, 0, .2, 1), width .28s cubic-bezier(.4, 0, .2, 1), opacity .2s ease;
}
.seg-btn {
  position: relative; z-index: 1;
  flex: 1; padding: 9px 12px; border: 1.5px solid var(--border);
  background: var(--bg-panel); border-radius: 10px; cursor: pointer;
  font-size: 13px; font-weight: 600; color: var(--text); font-family: inherit;
  display: flex; align-items: center; justify-content: center; gap: 4px;
  transition: color .25s ease, border-color .25s ease, background .25s ease, transform .12s ease;
}
.seg-btn.active { border-color: transparent; background: transparent; color: #fff; }
.seg-btn:active { transform: scale(.96); }
.seg-btn .seg-new { font-size: 10px; font-weight: 800; color: #fff; background: #ff4d4f; border-radius: 999px; padding: 1px 5px; position: relative; z-index: 2; }
.seg-btn.active .seg-new { background: #fff; color: #ff4d4f; }
label .seg-new { font-size: 10px; font-weight: 800; color: #fff; background: #ff4d4f; border-radius: 999px; padding: 1px 5px; }

/* 消耗积分提示 */
.cost-hint { font-size: 12px; color: var(--text-dim); }

/* 两阶段生成流程：5 步进度条 + 分析中 + 规划预览 */
.flow-steps { display: flex; align-items: center; gap: 6px; background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px; margin-bottom: 14px; flex-wrap: wrap; }
.flow-step { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-dim); white-space: nowrap; }
.flow-step .fs-dot { width: 22px; height: 22px; border-radius: 50%; background: var(--bg-elevated); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; }
.flow-step.active { color: var(--text); font-weight: 700; }
.flow-step.active .fs-dot { background: var(--accent); color: #fff; }
.flow-step.done { color: var(--text); }
.flow-step.done .fs-dot { background: var(--accent); color: #fff; }
.flow-line { width: 18px; height: 1.5px; background: var(--border); }
.plan-spec { background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; font-size: 13px; line-height: 1.8; white-space: pre-wrap; word-break: break-all; color: var(--text); }
.plan-item { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; margin-top: 10px; background: var(--bg-panel); }
.plan-item .pi-head { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--text); }
.plan-item .pi-idx { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 11px; flex-shrink: 0; }
.plan-item input { flex: 1; border: none; background: none; outline: none; font-size: 13px; font-weight: 700; color: var(--text); font-family: inherit; }
.plan-item textarea { width: 100%; margin-top: 8px; border: none; background: none; outline: none; font-size: 12.5px; line-height: 1.6; color: var(--text-dim); font-family: inherit; resize: vertical; }
.analyzing-box { text-align: center; padding: 30px 20px; }
.analyzing-box .spinner { width: 28px; height: 28px; }

/* 生成中阶段：头部/项目备注/总进度条/图片占位卡网格 */
.gen-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.gen-head-left { display: flex; flex-direction: column; }
.proj-note {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--border); border-radius: 999px; padding: 6px 12px;
  background: var(--bg-panel);
}
.proj-note .pn-label { font-size: 12px; color: var(--text-dim); white-space: nowrap; }
.proj-note input { border: none; background: none; outline: none; font-size: 12.5px; color: var(--text); width: 130px; font-family: inherit; }
.proj-note .pn-edit { font-size: 11px; color: var(--text-dim); }
.gen-progress { height: 5px; background: var(--bg-elevated); border-radius: 999px; overflow: hidden; }
.gen-progress-bar { height: 100%; background: var(--accent); border-radius: 999px; transition: width .4s ease; }
.gen-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-top: 12px; }
.gen-card {
  aspect-ratio: 3 / 4; border-radius: 14px; overflow: hidden;
  background: var(--bg); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; color: var(--text-dim); position: relative;
}
.gen-card img { width: 100%; height: 100%; object-fit: cover; }

/* 左栏配置卡撑满高度，与右侧底部对齐（消除左栏下方空白） */
.panel-side > .card:last-child { flex: 1; display: flex; flex-direction: column; }
.panel-side > .card:last-child > div:first-child { flex-shrink: 0; }

/* 整包绑定 chip（半绑定态：部分 skill 已绑定） */
.skill-chip.pkg-chip { border-style: dashed; }
.skill-chip.pkg-chip.half { border-color: #d97706; color: #d97706; background: #fffbeb; }

/* 单张重生成遮罩动画（2026-10-10，Uiverse.io by AbanoubMagdy1 四圆点 loader） */
.regen-overlay {
	position: absolute;
	inset: 0;
	z-index: 3;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 12px;
	background: rgba(255, 255, 255, 0.82);
	border-radius: inherit;
	backdrop-filter: blur(2px);
}
.regen-overlay .loader {
	--dim: 3rem;
	width: var(--dim);
	height: var(--dim);
	position: relative;
	animation: spin988 2s linear infinite;
}
.regen-overlay .loader .circle {
	--color: #333;
	--dim: 1.2rem;
	width: var(--dim);
	height: var(--dim);
	background-color: var(--color);
	border-radius: 50%;
}
/* 生成数量步进器（2026-10-10）：− 输入 ＋ */
/* 生成数量分段步进器（2026-10-12 视觉升级）：− | 数字 | ＋ 三段一体，与同排下拉框等高 */
.count-stepper {
  display: flex; align-items: stretch;
  border: 1px solid var(--border, #d9d6cd); border-radius: var(--radius-sm, 8px);
  overflow: hidden; background: var(--bg-panel, #fff);
  transition: border-color .15s, box-shadow .15s;
  height: 100%;
}
.count-stepper:hover { border-color: #b8b4a8; }
.count-stepper:focus-within { border-color: var(--accent, #1a1a1a); box-shadow: 0 0 0 2px rgba(26,26,26,.08); }
.count-stepper .cs-btn {
  width: 34px; border: none; background: transparent; flex-shrink: 0;
  font-size: 17px; font-weight: 600; line-height: 1; cursor: pointer;
  color: var(--text, #1a1a1a); display: flex; align-items: center; justify-content: center;
  transition: background .12s, color .12s; user-select: none; padding: 0;
}
.count-stepper .cs-btn:hover { background: rgba(0,0,0,.05); }
.count-stepper .cs-btn:active { background: rgba(0,0,0,.1); transform: scale(.92); }
.count-stepper .cs-btn:disabled { opacity: .3; cursor: default; }
.count-stepper .cs-btn:disabled:hover { background: transparent; }
.count-stepper .cs-btn[data-step="1"] { border-left: 1px solid var(--border, #d9d6cd); }
.count-stepper .cs-btn[data-step="-1"] { border-right: 1px solid var(--border, #d9d6cd); }
.count-stepper input {
  width: 100%; min-width: 48px; text-align: center; border: none;
  font-size: 14px; font-weight: 700; padding: 7px 4px; outline: none;
  background: transparent; color: var(--text, #1a1a1a);
}
.count-stepper input::-webkit-outer-spin-button, .count-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.count-stepper input[type=number] { -moz-appearance: textfield; appearance: textfield; }


/* 分类切换淡入（消除字段文案瞬时闪现） */
@keyframes formSwap { from { opacity: .25; transform: translateY(2px); } to { opacity: 1; transform: none; } }
.form-swap { animation: formSwap .22s ease; }
@keyframes panelFade { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.panel-fade { animation: panelFade .24s ease; }
