/* ============ 用户端样式 —— 白风 ============ */
:root {
  --primary: #1664ff;         /* 品牌蓝 */
  --primary-hover: #0e4ee0;
  --primary-soft: #e8f0ff;
  --bg: #f7f8fa;
  --card: #ffffff;
  --text: #1d2129;
  --text-2: #4e5969;
  --text-3: #86909c;
  --line: #e5e6eb;
  --green: #00b42a;
  --orange: #ff7d00;
  --red: #f53f3f;
  --gold: #f7ba1e;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 14px rgba(0,0,0,.05);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding-bottom: calc(64px + env(safe-area-inset-bottom));
  font-size: 14px;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; font-size: 14px; color: inherit; }
input, textarea, select { font-family: inherit; font-size: 14px; }
img { max-width: 100%; display: block; }
.hidden { display: none !important; }

/* ---------- 顶部导航 ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: #fff; border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
}
.nav-inner { max-width: 1080px; margin: 0 auto; display: flex; align-items: center; gap: 24px; height: 56px; padding: 0 16px; }
.brand { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 600; color: var(--text); }
.brand .logo-mark {
  width: 26px; height: 26px; border-radius: 6px; background: var(--primary);
  display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 14px; font-weight: 700;
}
.nav-links { display: flex; gap: 4px; margin-left: 8px; }
.nav-links a {
  padding: 7px 14px; border-radius: 8px; color: var(--text-2); font-size: 14px; transition: all .15s;
}
.nav-links a:hover { background: var(--primary-soft); color: var(--primary); }
.nav-links a.active { color: var(--primary); font-weight: 600; background: var(--primary-soft); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.pill {
  font-size: 12px; padding: 4px 12px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-weight: 500;
}
.pill.gold { background: #fff7e0; color: #b87400; font-weight: 600; }
.avatar-btn { display: flex; border-radius: 50%; overflow: hidden; }
.announcement {
  max-width: 1080px; margin: 0 auto; padding: 6px 16px 0;
  font-size: 12.5px; color: var(--text-3);
}

/* ---------- 主容器 ---------- */
.container { max-width: 1080px; margin: 0 auto; padding: 20px 16px; }
.page { animation: fadeIn .2s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- 卡片 ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 16px; display: flex; align-items: center; justify-content: space-between; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px; border-radius: 8px; font-size: 14px; font-weight: 500; transition: all .15s; user-select: none;
}
.btn:active { opacity: .85; }
.btn-primary { background: var(--primary); color: #fff; width: 100%; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:disabled { background: #a8c5ff; cursor: not-allowed; }
.btn-outline { border: 1px solid var(--line); color: var(--text-2); background: #fff; }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger { background: #fff1f0; color: var(--red); }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 7px; }
.btn-block { width: 100%; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.input, .textarea, .select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 8px; background: #fff; outline: none; transition: border .15s; color: var(--text);
}
.input:focus, .textarea:focus, .select:focus { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.textarea { resize: vertical; min-height: 100px; line-height: 1.6; }

/* ---------- 生成器 ---------- */
.gen-layout { display: grid; grid-template-columns: 380px 1fr; gap: 16px; align-items: stretch; }
.gen-toolbar { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.preset-chip {
  font-size: 13px; padding: 6px 13px; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; color: var(--text-2); transition: all .15s;
}
.preset-chip:hover { border-color: var(--primary); color: var(--primary); }
.preset-chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.size-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.size-btn {
  padding: 9px; border-radius: 8px; border: 1px solid var(--line); background: #fff;
  font-size: 13px; color: var(--text-2); text-align: center; transition: all .15s; line-height: 1.5;
}
.size-btn small { color: var(--text-3); font-size: 11px; }
.size-btn.active { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); font-weight: 500; }
.ref-upload { position: relative; }
.ref-drop {
  border: 1.5px dashed var(--line); border-radius: 10px;
  padding: 24px 16px; display: flex; flex-direction: column; align-items: center; gap: 6px;
  color: var(--text-2); font-size: 13px; cursor: pointer; transition: all .15s; text-align: center;
}
.ref-drop:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.ref-plus {
  width: 36px; height: 36px; border-radius: 50%; background: var(--primary-soft); color: var(--primary);
  display: flex; align-items: center; justify-content: center; font-size: 20px;
}
.ref-preview { position: relative; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #f2f3f5; }
.ref-preview img { width: 100%; max-height: 260px; object-fit: contain; display: block; }
.ref-remove {
  position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border-radius: 50%;
  background: rgba(0,0,0,.55); color: #fff; font-size: 16px; line-height: 1;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.ref-remove:hover { background: var(--red); }
.gen-cost {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--primary-soft); border-radius: 8px; padding: 10px 14px; margin: 14px 0; font-size: 13px; color: var(--text-2);
}
.gen-cost b { color: var(--primary); font-size: 15px; }
.result-box { margin-top: 16px; }
.result-panel { min-height: 460px; display: flex; flex-direction: column; }
.result-panel .result-box { flex: 1; display: flex; flex-direction: column; margin-top: 0; }

/* 多任务列表（玻璃卡片，倒序排列，每个任务一个框） */
.task-card {
  background: rgba(255,255,255,.55);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 12px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.task-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.task-no { font-weight: 700; color: var(--primary); font-size: 14px; }
.task-status { font-size: 12px; color: var(--text-2); }
.task-status.done { color: var(--green); }
.task-body { display: flex; align-items: center; gap: 12px; }
.task-prompt { font-size: 12px; color: var(--text-3); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 10px; }
.task-img img { width: 100%; border-radius: 10px; display: block; }
.task-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* 生成中的卡片：紧凑小长条（矮一半） */
.task-generating { padding: 10px 14px; }
.task-generating .task-body { display: flex; align-items: center; gap: 10px; }
.task-generating .spinner { width: 16px; height: 16px; border-width: 2px; margin: 0; }
.task-generating .task-no { font-size: 13px; }
.task-generating .task-status { white-space: nowrap; }
.task-generating .task-prompt { font-size: 12px; flex: 1; }
.result-empty {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--text-3); gap: 12px; min-height: 320px; text-align: center;
}
.result-empty .re-icon {
  width: 60px; height: 60px; border-radius: 14px; background: var(--primary-soft);
  display: flex; align-items: center; justify-content: center; font-size: 26px; color: var(--primary);
}
.result-img {
  width: 100%; border-radius: var(--radius); overflow: hidden; background: #f2f3f5;
  display: flex; align-items: center; justify-content: center; min-height: 200px; border: 1px solid var(--line);
}
.result-img img { width: 100%; height: auto; }
.result-actions { display: flex; gap: 10px; margin-top: 12px; }
.spinner {
  width: 40px; height: 40px; border-radius: 50%;
  border: 3px solid var(--primary-soft); border-top-color: var(--primary);
  animation: spin .8s linear infinite; margin: 26px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 侧栏信息卡 */
.side-card { padding: 16px; }
.side-card .label { font-size: 12.5px; color: var(--text-3); }
.side-card .value { font-size: 22px; font-weight: 600; margin: 4px 0 10px; }
.side-card .value small { font-size: 12px; font-weight: 400; color: var(--text-3); }

/* ---------- 历史列表 ---------- */
.his-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.his-item:last-child { border-bottom: none; }
.his-thumb {
  width: 80px; height: 80px; border-radius: 8px; overflow: hidden; flex-shrink: 0;
  background: #f2f3f5; display: flex; align-items: center; justify-content: center; border: 1px solid var(--line);
}
.his-thumb img { width: 100%; height: 100%; object-fit: cover; }
.his-info { flex: 1; min-width: 0; }
.his-prompt { font-size: 14px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.his-meta { font-size: 12px; color: var(--text-3); margin-top: 6px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.tag { font-size: 11.5px; padding: 2px 8px; border-radius: 4px; }
.tag-ok { background: #e8ffea; color: var(--green); }
.tag-fail { background: #fff1f0; color: var(--red); }
.empty { text-align: center; color: var(--text-3); padding: 44px 0; font-size: 13.5px; }

/* ---------- 套餐卡 ---------- */
.plans-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.plan-card {
  position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 16px; text-align: center; transition: all .15s;
}
.plan-card:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.plan-card.hot { border-color: var(--primary); }
.plan-points small.svip-text { color: #e8a33d; font-weight: 700; }
.plan-badge {
  position: absolute; top: -9px; left: 50%; transform: translateX(-50%);
  background: var(--primary); color: #fff; font-size: 11px; font-weight: 500; padding: 2px 10px; border-radius: 999px; white-space: nowrap;
}
.plan-points { font-size: 22px; font-weight: 700; color: var(--primary); }
.plan-points small { font-size: 12px; font-weight: 400; color: var(--text-3); }
.plan-name { font-size: 13px; color: var(--text-2); margin-top: 4px; }
.plan-price { font-size: 15px; font-weight: 600; margin-top: 10px; }
.plan-price small { font-weight: 400; color: var(--text-3); font-size: 12px; }

/* ---------- 会员 ---------- */
.member-banner {
  background: linear-gradient(120deg, #1664ff, #3c7bff);
  color: #fff; border-radius: var(--radius); padding: 22px 20px; margin-bottom: 16px;
}
.member-banner .mb-title { font-size: 18px; font-weight: 600; }
.member-banner .mb-sub { font-size: 13px; opacity: .9; margin-top: 8px; line-height: 1.6; }
.benefit-list { list-style: none; }
.benefit-list li { display: flex; gap: 10px; align-items: center; padding: 9px 0; font-size: 14px; border-bottom: 1px dashed var(--line); color: var(--text-2); }
.benefit-list li:last-child { border-bottom: none; }
.benefit-list li::before { content: '✓'; color: var(--primary); font-weight: 700; }

/* ---------- 个人中心 ---------- */
.me-head { display: flex; align-items: center; gap: 14px; }
.me-head .me-name { font-size: 17px; font-weight: 600; }
.me-head .me-sub { font-size: 12.5px; color: var(--text-3); margin-top: 3px; }
.avatar { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; color: #fff; font-weight: 600; flex-shrink: 0; }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 16px 0 6px; }
.stat-box { background: var(--bg); border-radius: 8px; padding: 14px 8px; text-align: center; }
.stat-box b { display: block; font-size: 20px; color: var(--text); font-weight: 600; }
.stat-box span { font-size: 12px; color: var(--text-3); }
.menu-list { border-radius: var(--radius); background: #fff; border: 1px solid var(--line); overflow: hidden; }
.menu-item { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.menu-item:last-child { border-bottom: none; }
.menu-item .arrow { color: #c9cdd4; }
.log-item { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.log-item:last-child { border-bottom: none; }
.log-item .plus { color: var(--green); font-weight: 600; }
.log-item .minus { color: var(--red); font-weight: 600; }
.log-item .lg-remark { color: var(--text-3); font-size: 12px; margin-top: 3px; }

/* ---------- 登录 / 注册 ---------- */
.auth-wrap { max-width: 380px; margin: 60px auto; text-align: center; }
.auth-logo { width: 48px; height: 48px; border-radius: 12px; background: var(--primary); color: #fff; font-size: 22px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.auth-title { font-size: 22px; font-weight: 600; }
.auth-sub { font-size: 13px; color: var(--text-3); margin: 8px 0 24px; }
.auth-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 20px; box-shadow: var(--shadow); text-align: left; }
.auth-switch { text-align: center; font-size: 13.5px; color: var(--text-3); margin-top: 14px; }
.auth-switch a { color: var(--primary); font-weight: 500; }

/* ---------- 底部导航（移动端） ---------- */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 60;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: #fff; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 0 6px; color: var(--text-3); font-size: 11px; }
.bottom-nav a.active { color: var(--primary); font-weight: 600; }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.45);
  display: flex; align-items: flex-end; justify-content: center;
}
.modal {
  background: #fff; width: 100%; max-width: 460px;
  border-radius: 12px 12px 0 0; padding: 22px 18px calc(22px + env(safe-area-inset-bottom));
  animation: slideUp .22s ease;
}
@keyframes slideUp { from { transform: translateY(30px); opacity: .5; } to { transform: none; opacity: 1; } }
.modal-title { font-size: 16px; font-weight: 600; text-align: center; margin-bottom: 16px; }
.modal-body { font-size: 14px; line-height: 1.7; }
.modal-actions { display: flex; gap: 10px; margin-top: 18px; }

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; top: 16px; left: 0; right: 0; z-index: 200; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast {
  max-width: 86%; background: rgba(29,33,41,.92); color: #fff;
  font-size: 13px; padding: 9px 18px; border-radius: 999px;
  opacity: 0; transform: translateY(-10px); transition: all .25s;
}
.toast.show { opacity: 1; transform: none; }
.toast-success { background: rgba(0,180,42,.95); }
.toast-error { background: rgba(245,63,63,.95); }

/* ---------- 分页 ---------- */
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 14px 0; font-size: 13px; color: var(--text-3); }
.pager button { padding: 6px 14px; border-radius: 7px; border: 1px solid var(--line); background: #fff; font-size: 13px; color: var(--text-2); }
.pager button:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.pager button:disabled { opacity: .4; }

/* ---------- 响应式 ---------- */
@media (max-width: 760px) {
  .nav-links { display: none; }            /* 手机端顶部链接隐藏，用底部导航 */
  .nav-inner { gap: 10px; height: 52px; padding: 0 12px; }
  .brand { font-size: 15px; }
  .brand .logo-mark { width: 22px; height: 22px; font-size: 12px; }
  .pill { font-size: 11px; padding: 3px 9px; }
  .container { padding: 12px; }
  .card { padding: 16px; }
  .gen-layout { grid-template-columns: 1fr; }
  .result-panel { min-height: auto; }
  .result-empty { min-height: 200px; }
  .result-img { min-height: 120px; }
  .plans-grid { grid-template-columns: repeat(2, 1fr); }
  .member-banner { padding: 18px 16px; }
  .auth-wrap { margin: 28px auto; }
  .modal-mask { align-items: flex-end; }
}
@media (min-width: 761px) {
  body { padding-bottom: 24px; }
  .bottom-nav { display: none; }           /* 桌面端隐藏底部导航 */
  .plans-grid { grid-template-columns: repeat(4, 1fr); }
  .modal { border-radius: 12px; margin: 6vh 0; }
  .modal-mask { align-items: center; }
}

/* ===== 生成页（ 体验风格，居中大输入卡片）===== */
.hero { text-align: center; }
.hero-title {
  font-size: clamp(1.7rem, 3.2vw, 2.6rem); font-weight: 400;
  margin: 4px 0 26px; color: var(--text); letter-spacing: .5px;
}
.gen-main {
  max-width: 920px; margin: 0 auto; background: #fff;
  border: 1px solid #dcd6ee; border-radius: 20px; padding: 18px;
  box-shadow: 0 6px 30px rgba(93, 33, 182, .06);
}
.gen-top { display: flex; flex-direction: column; gap: 12px; }
.gen-upload {
  width: 64px; height: 64px; border: 1.5px dashed #c9c2e8; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  color: #9ca3af; cursor: pointer; flex-shrink: 0; transition: all .15s;
}
.gen-upload:hover { border-color: #7c3aed; color: #7c3aed; background: #faf8ff; }
.gen-upload .up-ico { font-size: 26px; line-height: 1; font-weight: 300; }
.gen-input {
  width: 100%; min-height: 96px; border: none; outline: none; resize: none;
  font-size: 16px; color: var(--text); line-height: 1.6; padding: 12px 14px;
  background: #f7f6fb; border-radius: 14px; font-family: inherit;
}
.gen-input::placeholder { color: #b3b8c2; }
.gen-ref-preview {
  position: relative; width: 96px; height: 96px; border-radius: 12px; overflow: hidden;
  border: 1px solid #dcd6ee; flex-shrink: 0; background: #f2f0fa;
}
.gen-ref-preview img { width: 100%; height: 100%; object-fit: cover; }
.gen-ref-remove {
  position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; border-radius: 50%;
  background: rgba(0,0,0,.55); color: #fff; font-size: 13px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.gen-ref-remove:hover { background: #e11d48; }
.ref-boxes { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; flex-shrink: 0; }
.ref-thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-thumb {
  position: relative; width: 64px; height: 64px; border-radius: 10px; overflow: hidden;
  border: 1px solid #dcd6ee; background: #f2f0fa; flex-shrink: 0;
}
.ref-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ref-thumb .gen-ref-remove { top: 3px; right: 3px; width: 18px; height: 18px; font-size: 12px; }
.gen-toolbar {
  margin-top: 14px; padding-top: 14px; border-top: 1px solid #f0edf8;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px;
}
.gen-toolbar-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.gen-model {
  display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); cursor: pointer;
  font-size: 14px; padding: 6px 12px; border-radius: 12px; background: rgba(255,255,255,.55);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: all .15s; border: 1px solid transparent;
}
.gen-model:hover { color: #6d28d9; }
.gen-model.mode-active, .param-btn.mode-active {
  background: var(--primary-soft) !important;
  color: var(--primary) !important;
  border-color: var(--primary) !important;
  font-weight: 600;
}
.gen-model.mode-active:hover, .param-btn.mode-active:hover { color: var(--primary) !important; }
.gen-params {
  display: flex; align-items: center; gap: 4px; background: #f7f6fb;
  padding: 5px 12px; border-radius: 10px; font-size: 13px; color: var(--text-2);
}
.gen-params button { color: var(--text-2); font-size: 13px; padding: 2px 5px; border-radius: 6px; transition: color .15s; }
.gen-params button:hover { color: #6d28d9; }
.gen-params button.active { color: #6d28d9; font-weight: 600; }
.gen-params .sep { color: #d6d9e0; }
.gen-toolbar-right { display: flex; align-items: center; gap: 12px; }
.gen-price { color: #9ca3af; font-size: 13px; white-space: nowrap; }
.gen-send {
  width: 44px; height: 44px; border-radius: 50%; background: #d8d2f7; color: #5b21b6;
  display: flex; align-items: center; justify-content: center; font-size: 18px; transition: all .15s;
}
.gen-send:hover { background: #c9c0f2; transform: translateY(-1px); }
.gen-send:disabled { opacity: .55; cursor: not-allowed; }
.gen-result { max-width: 920px; margin: 20px auto 0; text-align: left; }

@media (max-width: 760px) {
  .hero-title { margin-bottom: 20px; }
  .gen-main { border-radius: 16px; padding: 14px; }
  .gen-upload { width: 78px; height: 78px; border-radius: 10px; }
  .gen-ref-preview { width: 78px; height: 78px; }
  .gen-input { font-size: 16px; min-height: 78px; }
  .gen-model { font-size: 13px; }
  .gen-params { padding: 5px 10px; font-size: 12px; }
  .gen-price { font-size: 12px; }
  .gen-send { width: 42px; height: 42px; }
}

/* ===== 参数触发器 + Popover（交互，向下展开，卡片式） ===== */
.gen-main { position: relative; z-index: 70; }
.param-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.55); padding: 6px 14px; border-radius: 12px; font-size: 13px; color: var(--text-2);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  cursor: pointer; user-select: none; transition: background .15s; border: 1px solid transparent;
  white-space: nowrap; flex-shrink: 0;
}
.param-btn:hover { background: #efedfb; }
.param-btn .pico { color: var(--text-3); font-size: 13px; }
.param-btn .sep { color: #d6d9e0; }
.gen-popover {
  position: absolute; top: calc(100% + 12px); left: 0; right: 0; z-index: 120;
  background: #fff; border: 1px solid #dcd6ee; border-radius: 16px;
  max-height: 62vh; overflow-y: auto;
  box-shadow: 0 8px 30px rgba(0,0,0,.08); padding: 20px; text-align: left;
}
.pop-section { margin-bottom: 20px; }
.pop-section:last-child { margin-bottom: 0; }
.pop-label { font-size: 13px; color: var(--text-2); margin-bottom: 10px; font-weight: 500; }
.pop-ratios { display: grid; grid-template-columns: repeat(9, 1fr); gap: 8px; }
.ratio-card {
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 2px;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  font-size: 12px; color: var(--text-2); cursor: pointer; transition: all .12s; text-align: center;
}
.ratio-card:hover { background: #f7f6fc; }
.ratio-card .rc-ico { font-size: 14px; color: var(--text-3); line-height: 1; }
.ratio-card.active { border: 2px solid #d8d2f7; background: #f7f6fc; color: var(--text); font-weight: 500; padding: 9px 1px; }
.ratio-card.active .rc-ico { color: #6d28d9; }
.pop-size { display: flex; align-items: center; gap: 12px; }
.pop-size input {
  flex: 1; min-width: 0; padding: 12px 16px; border: 1px solid #e8e6f2; border-radius: 12px;
  background: #f7f6fc; text-align: center; outline: none; font-size: 14px;
}
.pop-size input:focus { border-color: #7c3aed; background: #fff; }
.pop-size .swap-btn { color: var(--text-3); font-size: 16px; cursor: pointer; padding: 4px; }
.pop-size .swap-btn:hover { color: #6d28d9; }
.pop-res { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.res-card {
  border: 1px solid var(--line); border-radius: 12px; padding: 12px; text-align: center;
  font-size: 14px; color: var(--text-2); cursor: pointer; transition: all .12s;
}
.res-card:hover { background: #f7f6fc; }
.res-card.active { border: 2px solid #d8d2f7; background: #f7f6fc; font-weight: 500; color: var(--text); }
.pop-count { display: grid; grid-template-columns: repeat(9, 1fr); gap: 8px; }
.count-card {
  border: 1px solid var(--line); border-radius: 12px; padding: 10px; text-align: center;
  font-size: 14px; color: var(--text-2); cursor: pointer; transition: all .12s;
}
.count-card:hover { background: #f7f6fc; }
.count-card.active { border: 2px solid #d8d2f7; background: #f7f6fc; font-weight: 600; color: var(--text); }
.gen-result-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.gen-result-grid .result-img { min-height: 0; }
@media (max-width: 760px) {
  .pop-ratios { grid-template-columns: repeat(5, 1fr); }
  .pop-count { grid-template-columns: repeat(5, 1fr); }
  .gen-result-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ===== 图片放大查看（lightbox） ===== */
.lightbox-mask {
  position: fixed; inset: 0; z-index: 999; background: rgba(0, 0, 0, .85);
  display: flex; align-items: center; justify-content: center; padding: 24px; cursor: zoom-out;
}
.lightbox-img { max-width: 100%; max-height: 100%; border-radius: 6px; box-shadow: 0 8px 40px rgba(0, 0, 0, .4); }
.lightbox-close {
  position: absolute; top: 16px; right: 16px; width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255, 255, 255, .15); color: #fff; font-size: 24px; line-height: 1;
  display: flex; align-items: center; justify-content: center; cursor: pointer; border: none;
}
.lightbox-close:hover { background: rgba(255, 255, 255, .3); }
.result-img img, .his-thumb img { cursor: zoom-in; }

/* 模板选择 */
.tpl-item {
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px;
  margin-bottom: 8px; cursor: pointer; transition: all .12s;
}
.tpl-item:hover { border-color: var(--primary); background: var(--primary-soft); }
.tpl-name { font-size: 14px; font-weight: 600; color: var(--text); }
.tpl-prompt {
  font-size: 12.5px; color: var(--text-3); margin-top: 4px; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.tpl-ref {
  font-size: 12px; color: #16a34a; margin-top: 6px; line-height: 1.5;
  background: #f0fdf4; border-radius: 6px; padding: 4px 8px;
}

/* 全局生成状态提示（切换页面不消失） */
.gen-status {
  position: fixed; bottom: calc(76px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%);
  z-index: 150; display: flex; align-items: center; gap: 9px;
  background: rgba(29, 33, 41, .93); color: #fff; padding: 10px 18px;
  border-radius: 999px; font-size: 13px; box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
  white-space: nowrap; max-width: 90vw;
}
.gen-status-spin {
  width: 16px; height: 16px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, .3); border-top-color: #fff;
  animation: spin .8s linear infinite;
}
@media (min-width: 761px) {
  .gen-status { bottom: 30px; }
}

/* 登录页自定义文字窗口 */
.login-text {
  max-width: 380px; margin: 12px auto 18px; padding: 12px 16px;
  background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 10px;
  font-size: 14px; font-weight: 600; color: #16a34a; line-height: 1.8; text-align: left;
  white-space: pre-wrap;
}

/* ============================================================
   手机端 · 苹果玻璃拟态（深色高级风）—— 仅手机生效
   ============================================================ */
@media (max-width: 760px) {
  :root {
    --primary: #5b8cff;
    --primary-2: #a855f7;
    --primary-soft: rgba(91, 140, 255, .22);
    --bg: #0a0a12;
    --text: #ffffff;
    --text-2: rgba(255, 255, 255, .68);
    --text-3: rgba(255, 255, 255, .45);
    --line: rgba(255, 255, 255, .12);
  }

  body {
    background:
      radial-gradient(circle at 85% -8%, rgba(59, 91, 255, .55), transparent 42%),
      radial-gradient(circle at -8% 42%, rgba(168, 85, 247, .4), transparent 42%),
      radial-gradient(circle at 92% 96%, rgba(244, 114, 182, .28), transparent 42%),
      #0a0a12;
    color: #fff;
  }

  /* 玻璃通用 */
  .card,
  .gen-main,
  .menu-list,
  .auth-card {
    background: rgba(255, 255, 255, .06);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, .12);
    box-shadow: 0 20px 50px rgba(0, 0, 0, .35);
  }
  .card-title { color: #fff; }

  /* 顶部导航 */
  .nav {
    background: rgba(10, 10, 18, .6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, .08);
  }
  .brand { color: #fff; }
  .brand .logo-mark {
    background: linear-gradient(135deg, #5b8cff, #a855f7);
    box-shadow: 0 4px 14px rgba(91, 140, 255, .5);
  }
  .pill {
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .12);
    color: #fff;
  }
  .pill.gold {
    background: rgba(247, 186, 30, .15);
    border: 1px solid rgba(247, 186, 30, .3);
    color: #ffd66b;
  }
  .announcement { color: rgba(255, 255, 255, .5); }

  /* 主按钮 */
  .btn-primary {
    background: linear-gradient(135deg, #5b8cff, #a855f7);
    box-shadow: 0 8px 22px rgba(91, 140, 255, .4);
  }
  .btn-outline {
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .15);
    color: rgba(255, 255, 255, .7);
  }
  .btn-outline:hover { color: #fff; border-color: rgba(255,255,255,.3); }

  /* 输入框 */
  .input, .textarea, .select {
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .12);
    color: #fff;
  }
  .input:focus, .textarea:focus, .select:focus {
    border-color: #5b8cff;
    box-shadow: 0 0 0 3px rgba(91, 140, 255, .2);
    background: rgba(255, 255, 255, .08);
  }
  .field label { color: rgba(255, 255, 255, .6); }

  /* 生成器 */
  .hero-title span,
  .hero-title {
    color: #fff;
  }
  .gen-main { border-radius: 24px; }
  .gen-input {
    color: #fff;
    background: rgba(255, 255, 255, .05);
    border-radius: 15px;
    padding: 12px 14px;
    caret-color: #8ab4ff;
  }
  .gen-input::placeholder { color: rgba(255, 255, 255, .35); }
  .gen-upload {
    border-color: rgba(255, 255, 255, .22);
    background: rgba(255, 255, 255, .04);
    color: rgba(255, 255, 255, .65);
  }
  .gen-upload .up-ico { color: #8ab4ff; }
  .gen-toolbar { border-top-color: rgba(255, 255, 255, .08); }
  .gen-model {
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .1);
    color: rgba(255, 255, 255, .68);
  }
  .param-btn {
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .1);
    color: rgba(255, 255, 255, .68);
  }
  .param-btn .pico { color: rgba(255, 255, 255, .5); }
  .gen-price { color: rgba(255, 255, 255, .5); }
  .gen-send {
    background: linear-gradient(135deg, #5b8cff, #a855f7);
    color: #fff;
    box-shadow: 0 6px 18px rgba(91, 140, 255, .45);
  }
  .gen-cost {
    background: rgba(91, 140, 255, .15);
    color: rgba(255, 255, 255, .75);
  }
  .gen-cost b { color: #8ab4ff; }

  /* 参数弹窗 */
  .gen-popover {
    background: rgba(20, 20, 30, .92);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, .12);
  }
  .pop-label { color: rgba(255, 255, 255, .6); }
  .ratio-card, .res-card, .count-card {
    background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(255, 255, 255, .1);
    color: rgba(255, 255, 255, .68);
  }
  .ratio-card .rc-ico { color: rgba(255,255,255,.45); }
  .ratio-card.active, .res-card.active, .count-card.active {
    background: linear-gradient(135deg, #5b8cff, #a855f7);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 14px rgba(91,140,255,.4);
  }
  .ratio-card.active .rc-ico { color: #fff; }
  .pop-size input {
    background: rgba(255, 255, 255, .06);
    border-color: rgba(255, 255, 255, .12);
    color: #fff;
  }
  .pop-size .swap-btn, .pop-count button { color: rgba(255,255,255,.6); border-color: rgba(255,255,255,.12); }

  /* 结果区 */
  .result-img { background: rgba(255, 255, 255, .05); border-color: rgba(255, 255, 255, .12); }
  .result-empty { color: rgba(255, 255, 255, .45); }
  .result-empty .re-icon { background: rgba(91,140,255,.2); color: #8ab4ff; }

  /* 历史 */
  .his-thumb { background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.12); }
  .his-prompt { color: #fff; }
  .his-meta { color: rgba(255, 255, 255, .5); }

  /* 套餐卡 */
  .plan-card {
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .12);
  }
  .plan-card.hot { border-color: rgba(91,140,255,.5); }
  .plan-points { color: #8ab4ff; }
  .plan-name { color: rgba(255,255,255,.68); }
  .plan-price { color: #fff; }
  .plan-badge { background: linear-gradient(135deg,#5b8cff,#a855f7); }

  /* 多任务玻璃卡片（深色） */
  .task-card {
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .14);
  }
  .task-no { color: #8ab4ff; }
  .task-status { color: rgba(255,255,255,.68); }
  .task-status.done { color: #34d399; }
  .task-prompt { color: rgba(255,255,255,.5); }

  /* 会员 */
  .member-banner { background: linear-gradient(120deg, #5b8cff, #a855f7, #f472b6); }
  .benefit-list li { color: rgba(255, 255, 255, .78); border-bottom-color: rgba(255,255,255,.1); }
  .benefit-list li::before { color: #8ab4ff; }

  /* 个人中心 */
  .me-name { color: #fff; }
  .me-sub { color: rgba(255,255,255,.5); }
  .stat-box { background: rgba(255,255,255,.06); }
  .stat-box b { color: #fff; }
  .stat-box span { color: rgba(255,255,255,.5); }
  .menu-item { color: rgba(255,255,255,.85); border-bottom-color: rgba(255,255,255,.08); }
  .log-item { border-bottom-color: rgba(255,255,255,.08); color: rgba(255,255,255,.8); }
  .log-item .lg-remark { color: rgba(255,255,255,.45); }

  /* 登录 */
  .auth-title { color: #fff; }
  .auth-sub { color: rgba(255,255,255,.5); }
  .auth-logo { background: linear-gradient(135deg,#5b8cff,#a855f7); box-shadow: 0 8px 22px rgba(91,140,255,.5); }
  .auth-switch { color: rgba(255,255,255,.5); }
  .auth-switch a { color: #8ab4ff; }

  /* 分页 */
  .pager { color: rgba(255,255,255,.5); }
  .pager button { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.12); color: rgba(255,255,255,.7); }

  /* 空状态 / tag */
  .empty { color: rgba(255, 255, 255, .45); }
  .tag-ok { background: rgba(0,180,42,.18); color: #5ce08a; }
  .tag-fail { background: rgba(245,63,63,.18); color: #ff7d7d; }

  /* 模板选择 */
  .tpl-item { background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1); }
  .tpl-item:hover { background: rgba(255,255,255,.08); }
  .tpl-name { color: #fff; }
  .tpl-prompt { color: rgba(255,255,255,.5); }
  .tpl-ref { background: rgba(0,180,42,.12); color: #5ce08a; }

  /* 底部导航 → 毛玻璃悬浮 Dock */
  .bottom-nav {
    position: fixed; left: 14px; right: 14px; bottom: 14px; z-index: 60;
    display: grid; grid-template-columns: repeat(5, 1fr);
    background: rgba(255, 255, 255, .08);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 26px;
    padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
  }
  .bottom-nav a { color: rgba(255, 255, 255, .5); font-size: 11px; }
  .bottom-nav a span { display: flex; align-items: center; justify-content: center; font-size: 19px; }
  .bottom-nav a span svg { width: 20px; height: 20px; }
  .bottom-nav a.active { color: #fff; font-weight: 600; }
  .bottom-nav a.active span {
    background: linear-gradient(135deg, #5b8cff, #a855f7);
    border-radius: 12px; padding: 5px 11px;
    box-shadow: 0 4px 12px rgba(91, 140, 255, .45);
  }
  body { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
}
