/* ===== gpt-image2-v1.7 样式表 ===== */
/* 从 index.html 分离，防止升级时乱动核心样式 */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  width: 100%;
  min-height: 100%;
  overflow-x: hidden;
  background: #0f0f12;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #0f0f12; color: #e8e8f0;
  min-height: 100vh;
  padding: 20px 16px;
  overflow-x: hidden;
  overscroll-behavior-x: none;
}
html.ios-wechat body {
  width: 100%;
  height: var(--app-height, 100dvh);
  min-height: var(--app-height, 100dvh);
  overflow: hidden;
  position: fixed;
  inset: 0;
  padding: 0;
  overscroll-behavior: none;
}

/* 登录遮罩 */
.login-overlay {
  position: fixed; inset: 0;
  background: rgba(15,15,18,0.97);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
}
.login-box {
  background: #1a1a24; border: 1px solid #2a2a3a;
  border-radius: 16px; padding: 40px 36px;
  display: flex; flex-direction: column; align-items: center; gap: 18px;
  min-width: 320px;
}
.login-box h2 {
  font-size: 22px;
  background: linear-gradient(135deg, #a78bfa, #38bdf8);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.login-box p { color: #7c7c9a; font-size: 14px; margin-bottom: 4px; }
.login-tabs { display: flex; gap: 0; margin: 14px 0 16px; border: 1px solid #2e2e44; border-radius: 8px; overflow: hidden; }
.login-tab { flex: 1; padding: 8px; text-align: center; font-size: 13px; color: #5a5a7a; cursor: pointer; transition: all 0.15s; }
.login-tab.active { background: linear-gradient(135deg, #7c3aed, #2563eb); color: #fff; }
.login-tab:not(.active):hover { background: #1a1a28; }
.login-input {
  width: 100%; padding: 10px 14px;
  background: #12121a; border: 1px solid #2e2e44; border-radius: 10px;
  color: #e8e8f0; font-size: 14px; outline: none; text-align: center;
  letter-spacing: 0.05em;
}
.login-input:focus { border-color: #a78bfa; }
.login-btn {
  width: 100%; padding: 11px;
  background: linear-gradient(135deg, #7c3aed, #2563eb);
  color: #fff; font-size: 15px; font-weight: 700;
  border: none; border-radius: 10px; cursor: pointer;
  transition: opacity 0.2s;
}
.login-btn:hover { opacity: 0.92; }
.login-error { color: #f87171; font-size: 13px; min-height: 18px; }
.sms-send-btn {
  padding: 8px 14px; white-space: nowrap;
  border: 0.5px solid #534AB7; border-radius: 8px;
  background: transparent; color: #534AB7;
  font-size: 12px; cursor: pointer; transition: opacity 0.2s;
}
.sms-send-btn:disabled { opacity: 0.5; cursor: default; }
.sms-send-btn:hover:not(:disabled) { background: #EEEDFE; }

/* ── 新手机号登录页（暗色主题）── */
.login-card {
  background: #12121a; border-radius: 16px; padding: 44px 28px;
  max-width: 400px; width: 100%; box-sizing: border-box;
  margin: 0 16px;
}
.login-switch-link {
  display: flex; justify-content: flex-end; margin-bottom: 20px;
}
.login-switch-link span {
  font-size: 13px; color: #a78bfa; cursor: pointer;
}
.login-hero {
  margin-bottom: 42px;
}
.login-hero div {
  font-size: 28px; font-weight: 500; color: #e8e8f0; line-height: 1.3;
}
.login-tabs2 {
  display: flex; gap: 24px; margin-bottom: 32px;
}
.login-tab2 {
  font-size: 16px; color: #5a5a7a; cursor: pointer; padding-bottom: 4px;
}
.login-tab2.active {
  color: #e8e8f0; font-weight: 500; border-bottom: 2px solid #7c3aed;
}
.input-wrap {
  position: relative; margin-bottom: 20px;
}
input.login-input2 {
  width: 100%; height: 52px; padding: 0 16px;
  border: 1px solid #2e2e44; border-radius: 8px;
  font-size: 15px; color: #e8e8f0 !important; background: #1a1a28 !important;
  box-sizing: border-box; outline: none;
}
input.login-input2:-webkit-autofill,
input.login-input2:-webkit-autofill:hover,
input.login-input2:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 50px #1a1a28 inset !important;
  -webkit-text-fill-color: #e8e8f0 !important;
}
input.login-input2:focus { border-color: #7c3aed; }
.login-input2.sms-input { padding-right: 100px; }
.sms-btn-inline {
  position: absolute; right: 4px; top: 4px;
  height: 44px; padding: 0 14px; border: 0; background: transparent;
  color: #a78bfa; font-size: 13px; cursor: pointer; white-space: nowrap;
  border-radius: 6px;
}
.sms-btn-inline:disabled { color: #5a5a7a; cursor: default; }
.agree-row {
  display: flex; align-items: center; gap: 8px;
  margin: 24px 0 32px; font-size: 12px; color: #5a5a7a;
}
.agree-circle {
  width: 18px; height: 18px; border: 1px solid #5a5a7a; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
}
.agree-circle.checked {
  background: #7c3aed; border-color: #7c3aed;
}
.agree-circle.checked::after {
  content: '✓'; color: #fff; font-size: 12px;
}
.agree-link { color: #a78bfa; cursor: pointer; }
.login-btn2 {
  width: 100%; height: 50px; border: 0; border-radius: 25px;
  background: linear-gradient(135deg, #7c3aed, #2563eb);
  color: #fff; font-size: 16px;
  cursor: pointer; font-weight: 600; opacity: 1;
}
.login-btn2:disabled { opacity: 0.4; cursor: default; }
.forgot-link {
  text-align: center; margin-top: 24px;
  font-size: 13px; color: #5a5a7a; cursor: pointer;
}
.pwd-eye {
  position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
  font-size: 12px; color: #5a5a7a; cursor: pointer;
}

/* 主容器：默认继承 body 滚动，iPhone 微信下切换为固定视口 */
#app-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  margin: 0 auto;
}
html.ios-wechat #app-container {
  height: var(--app-height, 100dvh);
  padding: calc(16px + env(safe-area-inset-top)) 16px 0;
  overflow: hidden;
  align-items: stretch;
  justify-content: flex-start;
}

/* 用户栏 */
.user-bar {
  width: 100%; max-width: 680px;
  display: flex; justify-content: space-between; align-items: center;
  margin: 0 auto 12px; padding: 0 16px;
  font-size: 13px; color: #7c7c9a;
  box-sizing: border-box;
  flex-shrink: 0;
}
.user-bar .username { color: #a78bfa; font-weight: 600; }
.logout-btn {
  padding: 5px 14px; background: transparent;
  border: 1px solid #2e2e44; border-radius: 8px;
  color: #7c7c9a; font-size: 12px; cursor: pointer; transition: all 0.2s;
}
.logout-btn:hover { border-color: #f87171; color: #f87171; }

/* 管理员面板 */
.admin-panel {
  width: 100%; max-width: 680px;
  margin-top: 16px; padding: 18px 20px;
  background: #1a1a24; border: 1px solid #2a2a3a; border-radius: 16px;
  display: flex; flex-direction: column; gap: 14px;
}
/* 统计卡片 */
.admin-stats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.admin-stat-card {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 12px 8px; background: #12121a; border-radius: 10px;
}
.admin-stat-num { font-size: 20px; font-weight: 700; color: #a78bfa; }
.admin-stat-label { font-size: 11px; color: #5a5a7a; }

/* 用户搜索 */
.admin-user-search {
  width: 100%; padding: 10px 14px;
  background: #12121a; border: 1px solid #2e2e44; border-radius: 10px;
  color: #e8e8f0; font-size: 13px; outline: none; transition: border-color 0.2s;
  box-sizing: border-box;
}
.admin-user-search:focus { border-color: #a78bfa; }
.admin-user-search::placeholder { color: #4a4a6a; }

/* 用户列表 */
.admin-user-list { display: flex; flex-direction: column; gap: 8px; }

/* 用户卡片 */
.admin-user-card {
  background: #12121a; border: 1px solid #2e2e44; border-radius: 12px;
}
.admin-user-header {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; cursor: pointer; transition: background 0.15s;
}
.admin-user-header:hover { background: #1a1a28; }
.admin-user-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, #7c3aed, #2563eb);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.admin-user-info { flex: 1; min-width: 0; }
.admin-user-name { font-size: 13px; font-weight: 600; color: #e8e8f0; }
.admin-user-meta { font-size: 11px; color: #5a5a7a; margin-top: 1px; }
.admin-user-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.admin-user-actions {
  display: flex; gap: 6px; padding: 4px 12px 8px 56px; flex-wrap: wrap;
}
.admin-user-count { font-size: 11px; color: #7c7c9a; }
.admin-user-arrow { font-size: 10px; color: #5a5a7a; }

/* 用户作品列表 */
.admin-user-works { border-top: 1px solid #2e2e44; }
.admin-work-row {
  display: flex; gap: 10px; padding: 10px 12px;
  border-bottom: 1px solid #1a1a24; cursor: pointer;
  transition: background 0.1s;
}
.admin-work-row:hover { background: #1a1a28; }
.admin-work-thumb {
  width: 48px; height: 48px; border-radius: 8px; overflow: hidden;
  background: #0f0f12; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}
.admin-work-thumb img { width: 100%; height: 100%; object-fit: cover; }
.admin-work-info { flex: 1; min-width: 0; }
.admin-work-prompt {
  font-size: 12px; color: #c0c0d0; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; max-width: 300px;
}
.admin-work-meta {
  display: flex; gap: 8px; margin-top: 3px; font-size: 11px; color: #5a5a7a;
  flex-wrap: wrap;
}
.admin-work-sub { font-size: 10px; color: #4a4a6a; margin-top: 2px; }
.admin-work-more {
  padding: 8px 12px; text-align: center; font-size: 11px;
  color: #a78bfa; cursor: pointer;
}
.admin-work-more:hover { background: #1a1a28; }

.admin-section { display: flex; gap: 10px; margin-bottom: 8px; }
.admin-input {
  flex: 1; padding: 9px 12px;
  background: #12121a; border: 1px solid #2e2e44; border-radius: 10px;
  color: #e8e8f0; font-size: 13px; outline: none;
}
.admin-input:focus { border-color: #a78bfa; }
.admin-btn {
  padding: 9px 18px;
  background: linear-gradient(135deg, #7c3aed, #2563eb);
  color: #fff; font-size: 13px; font-weight: 600;
  border: none; border-radius: 10px; cursor: pointer; transition: opacity 0.2s;
}
.admin-btn:hover { opacity: 0.92; }
.admin-toggle-btn {
  padding: 3px 10px; background: transparent;
  border: 1px solid #a78bfa; border-radius: 6px;
  color: #a78bfa; font-size: 10px; cursor: pointer; transition: all 0.2s;
  white-space: nowrap;
}
.admin-toggle-btn:hover { background: rgba(167,139,250,0.1); }
.accounts-list { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.account-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 12px; background: #0f0f12; border-radius: 8px;
  font-size: 12px; color: #e8e8f0;
}
.del-account {
  padding: 3px 10px; background: transparent;
  border: 1px solid #f87171; border-radius: 6px;
  color: #f87171; font-size: 10px; cursor: pointer; transition: all 0.2s;
}
.del-account:hover { background: rgba(248,113,113,0.1); }

/* 头部 */
.header { text-align: center; margin-bottom: 32px; }
.header h1 { font-size: 28px; font-weight: 700; background: linear-gradient(135deg, #a78bfa, #38bdf8); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.header p { margin-top: 8px; color: #7c7c9a; font-size: 14px; }

/* 公告系统 */
.ann-banner {
  display: flex; align-items: center; gap: 10px;
  width: 100%; max-width: 680px; margin: 0 auto 12px;
  padding: 10px 14px; background: #1a1a28; border-radius: 8px;
  box-sizing: border-box;
}
.ann-banner .ann-icon { font-size: 14px; flex-shrink: 0; }
.ann-banner .ann-text {
  flex: 1; font-size: 12.5px; color: #e8e8f0;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.ann-banner .ann-actions {
  display: flex; align-items: center; gap: 10px; flex-shrink: 0;
}
.ann-banner .ann-link {
  font-size: 11px; color: #a78bfa; cursor: pointer;
  white-space: nowrap;
}
.ann-banner .ann-close {
  cursor: pointer; font-size: 13px; color: #5a5a7a; line-height: 1;
}
.ann-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  z-index: 5000; display: flex; align-items: center; justify-content: center;
}
.ann-more-card {
  background: #12121a; border-radius: 12px; padding: 20px;
  max-width: 480px; width: calc(100% - 32px); max-height: 60vh;
  overflow-y: auto; overflow-x: hidden; border: 0.5px solid #2e2e44; word-break: break-word;
}
.ann-more-head {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 15px; font-weight: 500; color: #e8e8f0; margin-bottom: 14px;
}
.ann-more-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0; border-bottom: 0.5px solid #1e1e2e;
  font-size: 13px; color: #7c7c9a; cursor: pointer;
}
.ann-more-item:hover { color: #e8e8f0; }
.ann-more-tag {
  font-size: 10px; background: rgba(124,58,237,0.15); color: #a78bfa;
  padding: 2px 6px; border-radius: 4px; white-space: nowrap;
}
.ann-more-item .ann-more-title {
  flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.ann-more-item .ann-more-date {
  margin-left: auto; font-size: 11px; flex-shrink: 0;
}
.ann-important-card {
  background: #12121a; border-radius: 12px; padding: 24px;
  max-width: 460px; width: calc(100% - 32px); border: 1.5px solid #7c3aed;
  overflow-y: auto; overflow-x: hidden; word-break: break-word;
  max-height: 70vh;
}
.ann-btn-gotit {
  display: inline-block; background: #7c3aed; color: #fff;
  border: 0; padding: 8px 24px; border-radius: 6px;
  font-size: 13px; cursor: pointer;
}
.ann-detail-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.75);
  z-index: 6000; display: flex; align-items: center; justify-content: center;
}
.ann-detail-card {
  background: #12121a; border-radius: 12px; padding: 24px;
  max-width: 500px; width: calc(100% - 32px); max-height: 70vh;
  overflow-y: auto; overflow-x: hidden;
  border: 0.5px solid #2e2e44; word-break: break-word;
}

/* 主卡片 */
.card { background: #1a1a24; border: 1px solid #2a2a3a; border-radius: 16px; padding: 28px; width: 100%; max-width: 680px; }

/* 标签 */
label { display: block; font-size: 12px; font-weight: 600; color: #a0a0c0; margin-bottom: 8px; letter-spacing: 0.05em; text-transform: uppercase; }

/* 文本域 */
textarea { width: 100%; height: 90px; background: #12121a; border: 1px solid #2e2e44; border-radius: 10px; color: #e8e8f0; font-size: 14px; padding: 12px 14px; resize: vertical; outline: none; transition: border-color 0.2s; font-family: inherit; }
textarea:focus { border-color: #a78bfa; }

/* 模式切换 */
.mode-tabs { display: flex; gap: 4px; background: #12121a; border-radius: 10px; padding: 4px; margin-bottom: 22px; }
.mode-tab { flex: 1; padding: 9px 12px; border: none; border-radius: 7px; font-size: 13px; font-weight: 600; cursor: pointer; background: transparent; color: #7c7c9a; transition: all 0.2s; }
.mode-tab.active { background: #7c3aed; color: #fff; }
.mode-tab:hover:not(.active) { background: #1e1e2e; color: #c0c0e0; }

/* API Key 行 */
.api-key-row { margin-top: 20px; }
input[type="text"], input[type="password"] { width: 100%; background: #12121a; border: 1px solid #2e2e44; border-radius: 10px; color: #e8e8f0; font-size: 14px; padding: 10px 14px; outline: none; transition: border-color 0.2s; }
input:focus { border-color: #a78bfa; }

/* 顶部工具栏 */
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.check-btn { padding: 8px 14px; background: #12121a; border: 1px solid #2e2e44; border-radius: 8px; color: #a0a0c0; font-size: 12px; cursor: pointer; white-space: nowrap; transition: all 0.2s; }
.check-btn:hover { border-color: #a78bfa; color: #a78bfa; }
#check-result { font-size: 12px; color: #7c7c9a; }
#check-result.ok { color: #4ade80; }
#check-result.fail { color: #f87171; }

/* 参数区 */
.params-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; margin-top: 18px; }
select { width: 100%; background: #12121a; border: 1px solid #2e2e44; border-radius: 10px; color: #e8e8f0; font-size: 14px; padding: 10px 14px; outline: none; cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237c7c9a' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; transition: border-color 0.2s; }
select:focus { border-color: #a78bfa; }

/* 参考图上传区 */
#ref-section { display: none; margin-top: 18px; }
#ref-section.visible { display: block; }
.upload-zone { border: 2px dashed #3a3a5a; border-radius: 12px; padding: 24px; text-align: center; cursor: pointer; transition: all 0.2s; min-height: 100px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; }
.upload-zone:hover, .upload-zone.dragover { border-color: #a78bfa; background: rgba(167,139,250,0.06); }
.upload-zone p { font-size: 13px; color: #7c7c9a; }
.upload-zone small { font-size: 11px; color: #4a4a6a; }
#file-input { display: none; }
#thumb-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.thumb { position: relative; width: 70px; height: 70px; border-radius: 8px; overflow: hidden; border: 2px solid #2e2e44; flex-shrink: 0; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .del { position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; background: rgba(239,68,68,0.85); border: none; border-radius: 50%; color: #fff; font-size: 11px; line-height: 18px; text-align: center; cursor: pointer; opacity: 0; transition: opacity 0.2s; }
.thumb:hover .del { opacity: 1; }
.thumb-num { position: absolute; bottom: 2px; left: 4px; background: rgba(0,0,0,0.6); color: #fff; font-size: 9px; padding: 1px 4px; border-radius: 3px; }

/* mask 上传 */
.mask-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.mask-label { font-size: 11px; color: #7c7c9a; }

/* 生成按钮 */
.generate-btn { margin-top: 22px; width: 100%; padding: 14px; background: linear-gradient(135deg, #7c3aed, #2563eb); color: #fff; font-size: 15px; font-weight: 700; border: none; border-radius: 12px; cursor: pointer; transition: opacity 0.2s, transform 0.1s; letter-spacing: 0.03em; }
.generate-btn:hover { opacity: 0.92; }
.generate-btn:active { transform: scale(0.98); }
.generate-btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

/* 状态栏 */
.status-bar { margin-top: 14px; min-height: 28px; display: flex; align-items: center; gap: 10px; font-size: 13px; }
.spinner { width: 16px; height: 16px; border: 2px solid #7c7c9a; border-top-color: #a78bfa; border-radius: 50%; animation: spin 0.7s linear infinite; display: none; flex-shrink: 0; }
@keyframes spin { to { transform: rotate(360deg); } }
#timer { margin-left: auto; color: #a78bfa; font-size: 12px; display: none; }

/* 错误框 */
.error-box { border-radius: 10px; padding: 13px 15px; display: none; margin-top: 12px; word-break: break-word; line-height: 1.5; }

/* 上传超限提示 */
.upload-over-size {
  margin-top: 8px; padding: 10px 14px;
  background: rgba(226,75,74,0.06);
  border-left: 3px solid #e24b4a;
  border-radius: 6px;
  font-size: 12px; color: #f87171;
  line-height: 1.7;
}
.upload-over-size .uos-close {
  float: right; cursor: pointer; font-size: 14px;
  color: #5a5a7a; margin-left: 8px;
}
.upload-over-size .uos-close:hover { color: #f87171; }
.upload-zone-error {
  border-color: #e24b4a !important;
  border-style: solid !important;
}
.upload-hint-error { color: #f87171 !important; }

/* 结果区 */
.result-section { margin-top: 24px; width: 100%; max-width: 680px; }
.result-title { font-size: 12px; font-weight: 600; color: #a0a0c0; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 12px; }
#image-container { background: #1a1a24; border: 1px solid #2a2a3a; border-radius: 16px; min-height: 200px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.placeholder { color: #4a4a6a; font-size: 14px; padding: 40px; text-align: center; }
#generated-image { width: 100%; display: none; border-radius: 15px; }
.meta-bar { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.meta-chip { background: #12121a; border: 1px solid #2e2e44; border-radius: 6px; padding: 4px 10px; font-size: 12px; color: #7c7c9a; display: none; }
.download-btn { margin-top: 10px; padding: 9px 18px; background: transparent; border: 1px solid #38bdf8; color: #38bdf8; border-radius: 8px; font-size: 13px; cursor: pointer; display: none; transition: background 0.2s; }
.download-btn:hover { background: rgba(56,189,248,0.1); }

/* 历史记录 */
.history-section { margin-top: 22px; width: 100%; max-width: 680px; display: none; }
.history-title { font-size: 12px; font-weight: 600; color: #a0a0c0; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 12px; }
.history-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.history-thumb { border-radius: 8px; overflow: hidden; cursor: pointer; border: 2px solid transparent; transition: border-color 0.2s; }
.history-thumb:hover { border-color: #a78bfa; }
.history-thumb img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }

/* 参数区整体 */
.params-section { margin-top: 18px; display: flex; flex-direction: column; gap: 22px; }
.param-group label { margin-bottom: 10px; }

/* 比例网格 */
.ratio-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.ratio-card { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 10px 4px 8px; border: 1px solid #2e2e44; border-radius: 10px; cursor: pointer; transition: all 0.2s; }
.ratio-card:hover { border-color: #7c7c9a; }
.ratio-card.selected { border-color: #a78bfa; background: rgba(167,139,250,0.08); }
.ratio-icon { width: 80%; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; }
.ratio-rect { background: #2e2e44; border-radius: 3px; }
.ratio-card.selected .ratio-rect { background: #a78bfa; }
.ratio-card span { font-size: 11px; color: #7c7c9a; }
.ratio-card.selected span { color: #a78bfa; }

/* 质量选择行 */
.quality-row { display: flex; gap: 8px; }
.quality-card { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 10px; border: 1px solid #2e2e44; border-radius: 10px; cursor: pointer; font-size: 12px; color: #7c7c9a; transition: all 0.2s; }
.quality-card:hover { border-color: #7c7c9a; }
.quality-card.selected { border-color: #a78bfa; color: #a78bfa; background: rgba(167,139,250,0.08); }
.quality-dot { width: 8px; height: 8px; border-radius: 50%; }
.quality-dot.low { background: #22c55e; }
.quality-dot.medium { background: #facc15; }
.quality-dot.high { background: #ef4444; }

/* 格式选择行 */
.format-row { display: flex; gap: 8px; }
.format-chip { flex: 1; text-align: center; padding: 8px 10px; border: 1px solid #2e2e44; border-radius: 10px; cursor: pointer; font-size: 12px; color: #7c7c9a; transition: all 0.2s; }
.format-chip:hover { border-color: #7c7c9a; }
.format-chip.selected { border-color: #38bdf8; color: #38bdf8; background: rgba(56,189,248,0.08); }

/* 生成数量选择 */
.n-selector { display: flex; gap: 8px; }
.n-chip { flex: 1; text-align: center; padding: 8px 10px; border: 1px solid #2e2e44; border-radius: 10px; cursor: pointer; font-size: 13px; color: #7c7c9a; transition: all 0.2s; font-weight: 500; }
.n-chip:hover { border-color: #7c7c9a; }
.n-chip.selected { border-color: #a78bfa; color: #a78bfa; background: rgba(167,139,250,0.08); }

/* 自定义尺寸开关 */
.custom-toggle { display: flex; align-items: center; gap: 8px; cursor: pointer; flex-shrink: 0; }
.custom-toggle span { font-size: 12px; color: #7c7c9a; transition: color 0.2s; }
.custom-toggle.active span { color: #a78bfa; }
.toggle-switch { width: 44px; height: 24px; background: #2e2e44; border-radius: 12px; position: relative; transition: background 0.2s; flex-shrink: 0; }
.toggle-switch.active { background: #7c3aed; }
.toggle-knob { width: 20px; height: 20px; background: #e8e8f0; border-radius: 50%; position: absolute; top: 2px; left: 2px; transition: transform 0.2s; }
.toggle-switch.active .toggle-knob { transform: translateX(20px); }

/* 自定义尺寸输入区 */
.custom-size-panel { display: none; margin-top: 12px; }
.custom-size-panel.visible { display: block; }
.size-input-row { display: flex; align-items: flex-end; gap: 12px; }
.size-input-group { flex: 1; }
.size-input-group label { font-size: 11px; color: #7c7c9a; margin-bottom: 6px; display: block; }
.size-control { display: flex; align-items: center; background: #12121a; border: 1px solid #2e2e44; border-radius: 10px; overflow: hidden; }
.size-control button { width: 36px; height: 38px; background: #2a2a3a; border: none; color: #e8e8f0; font-size: 18px; cursor: pointer; transition: background 0.2s; display: flex; align-items: center; justify-content: center; }
.size-control button:hover { background: #3a3a5a; }
.size-control input { flex: 1; height: 38px; background: transparent; border: none; color: #e8e8f0; font-size: 15px; text-align: center; -moz-appearance: textfield; outline: none; }
.size-control input::-webkit-outer-spin-button,
.size-control input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.size-x { font-size: 18px; color: #5a5a7a; padding-bottom: 8px; }
.size-hint { margin-top: 8px; font-size: 11px; color: #5a5a7a; line-height: 1.6; }
.size-hint.error { color: #f87171; }

/* ===== V1.8 生成成功提示 ===== */
.generate-success {
  display: flex; flex-direction: column; align-items: center;
  padding: 40px 20px; text-align: center; gap: 10px;
}
.gs-icon { font-size: 48px; line-height: 1; }
.gs-title { font-size: 18px; font-weight: 700; color: #e8e8f0; }
.gs-desc { font-size: 13px; color: #a0a0c0; }
.gs-meta { font-size: 11px; color: #5a5a7a; }
.gs-btn {
  margin-top: 8px; padding: 10px 24px;
  background: linear-gradient(135deg, #7c3aed, #2563eb);
  color: #fff; font-size: 13px; font-weight: 600;
  border: none; border-radius: 10px; cursor: pointer;
  transition: opacity 0.2s;
}
.gs-btn:hover { opacity: 0.92; }

/* ===== V1.8 页面切换 ===== */
.page {
  display: none;
  width: 100%; max-width: 680px; margin: 0 auto;
  padding-bottom: 60px;
}
html.ios-wechat .page {
  flex: 1 1 auto; min-height: 0;
  max-width: 680px;
  align-self: center;
  overflow-x: hidden; overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  padding-bottom: calc(88px + env(safe-area-inset-bottom));
}
.page.active { display: block; }

/* ===== V1.8 底部导航栏 ===== */
.tab-bar {
  position: fixed; bottom: 0; left: 0; right: 0;
  display: none; justify-content: space-around; align-items: center;
  background: #1a1a24; border-top: 1px solid #2a2a3a;
  padding: 8px 0; z-index: 1000;
}
html.ios-wechat .tab-bar {
  position: static;
  flex-shrink: 0;
  width: calc(100% + 32px);
  margin: 0 -16px;
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
  transform: translateZ(0); -webkit-transform: translateZ(0);
  touch-action: manipulation;
}
.tab {
  flex: 1; text-align: center; padding: 8px 4px;
  font-size: 11px; font-weight: 600; color: #5a5a7a;
  cursor: pointer; transition: all 0.2s;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
}
.tab .tab-icon { font-size: 20px; line-height: 1; }
.tab.active { color: #a78bfa; }
.tab:hover:not(.active) { color: #7c7c9a; }
/* 底部留白避免被导航栏遮挡，实际留白在 .page 中按安全区计算 */

/* ===== V1.8 作品列表头部 ===== */
.works-header {
  display: flex; flex-direction: column; gap: 12px;
  margin-bottom: 16px;
}
.works-header h2 { font-size: 16px; font-weight: 700; color: #e8e8f0; }

/* 搜索框 */
.works-search {
  width: 100%; padding: 10px 14px;
  background: #12121a; border: 1px solid #2e2e44; border-radius: 10px;
  color: #e8e8f0; font-size: 13px; outline: none; transition: border-color 0.2s;
}
.works-search:focus { border-color: #a78bfa; }
.works-search::placeholder { color: #4a4a6a; }

/* 日历按钮 */
.cal-btn {
  padding: 8px 14px; background: #12121a; border: 1px solid #2e2e44; border-radius: 10px;
  color: #7c7c9a; font-size: 12px; cursor: pointer; white-space: nowrap; transition: border-color 0.2s;
}
.cal-btn:hover { border-color: #a78bfa; color: #e8e8f0; }
.cal-btn.active { border-color: #a78bfa; color: #a78bfa; }

/* 日历弹窗 */
.cal-popup {
  background: #12121a; border: 1px solid #2e2e44; border-radius: 10px;
  padding: 12px 14px; display: flex; flex-direction: column; gap: 8px;
}
.cal-nav { display: flex; align-items: center; justify-content: space-between; }
.cal-nav span { font-size: 13px; color: #e8e8f0; font-weight: 500; }
.cal-nav-btn { border: 0; background: none; color: #666; font-size: 16px; cursor: pointer; padding: 2px 8px; }
.cal-nav-btn:hover { color: #a78bfa; }
.cal-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-size: 10px; color: #4a4a6a; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; text-align: center; }
.cal-cell { font-size: 12px; padding: 6px 0; color: #888; }
.cal-cell.has-work { color: #a78bfa; cursor: pointer; border-radius: 50%; width: 30px; height: 30px; line-height: 30px; margin: 0 auto; }
.cal-cell.has-work:hover { background: rgba(167,139,250,0.12); }
.cal-cell.has-many { background: #7F77DD; color: #fff; cursor: pointer; border-radius: 50%; width: 30px; height: 30px; line-height: 30px; margin: 0 auto; font-weight: 500; }
.cal-cell.today { border: 1.5px solid #a78bfa; border-radius: 50%; }
.cal-cell.empty { color: #333; }


/* 筛选芯片 */
.works-chips {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.works-chip {
  padding: 5px 14px; border: 1px solid #2e2e44; border-radius: 20px;
  font-size: 12px; color: #7c7c9a; cursor: pointer;
  transition: all 0.2s; background: transparent;
}
.works-chip:hover { border-color: #7c7c9a; }
.works-chip.active { border-color: #a78bfa; color: #a78bfa; background: rgba(167,139,250,0.08); }
.works-clean-btn {
  padding: 5px 14px; border: 1px solid #7f1d1d; border-radius: 20px;
  font-size: 12px; color: #fc8181; cursor: pointer;
  transition: all 0.2s; background: transparent; margin-left: auto; flex-shrink: 0;
}
.works-clean-btn:hover { background: rgba(248,113,113,0.1); border-color: #fc8181; }

/* ===== V1.8 瀑布流 ===== */
.works-masonry {
  column-count: 2; column-gap: 12px;
  width: 100%;
}
@media(min-width: 600px) {
  .works-masonry { column-count: 3; }
}
@media(min-width: 900px) {
  .works-masonry { column-count: 4; }
}

/* ===== V1.8 作品卡片 ===== */
.work-card {
  break-inside: avoid; margin-bottom: 12px;
  background: #1a1a24; border: 1px solid #2a2a3a;
  border-radius: 12px; overflow: hidden;
  cursor: pointer; transition: border-color 0.2s;
}
.work-card:hover { border-color: #a78bfa; }
.wc-img { width: 100%; min-height: 120px; display: block; }
.wc-body { padding: 10px 12px 12px; }
.wc-prompt {
  font-size: 12px; color: #c0c0d0; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; word-break: break-all;
}
.wc-meta {
  display: flex; align-items: center; gap: 8px;
  margin-top: 8px; font-size: 11px; color: #5a5a7a;
}
.wc-badge {
  padding: 2px 8px; border-radius: 4px;
  font-size: 10px; font-weight: 600;
  background: rgba(167,139,250,0.12); color: #a78bfa;
}
.wc-badge.jpeg, .wc-badge.jpg { background: rgba(56,189,248,0.12); color: #38bdf8; }
.wc-badge.webp { background: rgba(34,197,94,0.12); color: #22c55e; }
.wc-time { margin-left: auto; }
.wc-elapsed { color: #38bdf8; font-size: 11px; }

/* ===== V1.8 生成中占位 ===== */
.wc-img-placeholder {
  width: 100%; min-height: 160px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 30px 20px;
}
.wc-img-placeholder.loading { background: #12121a; }
.wc-img-placeholder.failed { background: rgba(248,113,113,0.06); }
.wc-img-placeholder.failed.blocked { background: rgba(163,45,45,0.04); opacity: 0.65; }
.wc-img-placeholder.failed.blocked .wc-loading-text { color: #a32d2d; }
.wc-loading-spinner {
  width: 28px; height: 28px;
  border: 3px solid #2e2e44; border-top-color: #a78bfa;
  border-radius: 50%; animation: wc-spin 0.8s linear infinite;
}
@keyframes wc-spin { to { transform: rotate(360deg); } }
.wc-loading-text { font-size: 12px; color: #7c7c9a; }
.wc-img-placeholder.failed .wc-loading-text { color: #f87171; }

/* ===== V1.8 空状态 ===== */
.works-empty {
  display: flex; flex-direction: column; align-items: center;
  padding: 60px 20px; text-align: center; gap: 8px;
}
.works-empty .we-icon { font-size: 40px; }
.works-empty .we-title { font-size: 15px; color: #7c7c9a; }
.works-empty .we-desc { font-size: 12px; color: #4a4a6a; }

/* ===== V1.8 加载更多 ===== */
.load-more {
  width: 100%; padding: 12px; margin-top: 8px; margin-bottom: 16px;
  background: transparent; border: 1px solid #2e2e44; border-radius: 10px;
  color: #7c7c9a; font-size: 13px; cursor: pointer;
  transition: all 0.2s; text-align: center;
}
.load-more:hover { border-color: #a78bfa; color: #a78bfa; }
.load-more:disabled { opacity: 0.4; cursor: not-allowed; }

/* ===== V1.8 详情弹窗 ===== */
.detail-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.85);
  display: none; flex-direction: column; align-items: center;
  z-index: 2000; padding: 20px;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
}
html.ios-wechat .detail-overlay {
  height: var(--app-height, 100dvh);
  overscroll-behavior: contain;
}
.detail-overlay.active { display: flex; }
.detail-close {
  position: absolute; top: 16px; right: 16px;
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid #3a3a5a; background: #1a1a24;
  color: #e8e8f0; font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.detail-close:hover { background: #2a2a3a; }
.detail-img {
  max-width: 90vw; max-height: 65vh; border-radius: 12px;
  object-fit: contain; margin-bottom: 16px; flex-shrink: 0;
}
.detail-longpress-tip {
  width: 100%; max-width: 500px;
  margin: -4px 0 14px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(250, 204, 21, 0.12);
  border: 1px solid rgba(250, 204, 21, 0.35);
  color: #facc15;
  font-size: 13px; font-weight: 600;
  text-align: center;
  flex-shrink: 0;
}

/* 多图画廊 */
.detail-gallery {
  display: none; width: 100%; max-width: 600px;
  margin-bottom: 16px;
}
.dg-item {
  background: #1a1a24; border: 1px solid #2a2a3a;
  border-radius: 12px; overflow: hidden; margin-bottom: 10px;
}
.dg-img-wrap {
  display: flex; align-items: center; justify-content: center;
  background: #12121a; padding: 10px;
}
.dg-img-wrap img {
  max-width: 100%; max-height: 55vh; border-radius: 6px;
  object-fit: contain;
}
.dg-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; border-top: 1px solid #2a2a3a;
}
.dg-idx { font-size: 11px; color: #5a5a7a; }
.dg-dl { padding: 4px 12px; font-size: 11px; }
/* ×N 角标 */
.wc-n-badge {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  background: rgba(124,58,237,0.92); color: #fff;
  font-size: 11px; font-weight: 600; padding: 2px 8px;
  border-radius: 6px; line-height: 1.4;
}
/* 参考图角标 */
.wc-ref-badge {
  position: absolute; top: 8px; left: 8px; z-index: 2;
  background: rgba(93,202,165,0.18); color: #5DCAA5;
  font-size: 10px; padding: 2px 6px;
  border-radius: 4px; border: 0.5px solid rgba(93,202,165,0.35);
  line-height: 1.3;
}
.detail-info {
  background: #1a1a24; border: 1px solid #2a2a3a;
  border-radius: 14px; padding: 18px 20px;
  width: 100%; max-width: 500px;
}
.di-prompt-wrap {
  position: relative;
  margin-bottom: 14px;
  padding-bottom: 26px;
}
.detail-info .di-prompt {
  font-size: 13px; color: #c0c0d0; line-height: 1.6;
  margin-bottom: 0; word-break: break-word;
}
.di-prompt-copy {
  position: absolute; right: 0; bottom: 0;
  border: 0.5px solid rgba(124, 58, 237, 0.38);
  background: rgba(124, 58, 237, 0.12);
  color: #a78bfa;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px; font-weight: 600;
  cursor: pointer;
  line-height: 1.3;
}
.di-prompt-copy:hover { background: rgba(124, 58, 237, 0.2); color: #c4b5fd; }
.di-prompt-copy.copied {
  border-color: rgba(93, 202, 165, 0.4);
  background: rgba(93, 202, 165, 0.12);
  color: #5DCAA5;
}
.di-prompt-collapsed {
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden; word-break: break-word;
}
.di-prompt-toggle {
  font-size: 11px; color: #7c3aed; cursor: pointer; margin-top: 4px;
  display: inline-block;
}
.di-prompt-toggle:hover { color: #a78bfa; }
.di-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.di-param {
  display: flex; flex-direction: column; gap: 3px;
  padding: 8px 10px; background: #12121a; border-radius: 8px;
}
.di-param .di-label { font-size: 10px; color: #5a5a7a; text-transform: uppercase; letter-spacing: 0.05em; }
.di-param .di-value { font-size: 12px; color: #e8e8f0; }
.di-ref-section {
  margin-top: 14px; padding: 12px;
  background: #14141e; border: 0.5px solid #2a2a3a; border-radius: 10px;
}
.di-ref-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px; font-size: 12px; color: #a0a0c0; font-weight: 500;
}
.di-ref-header span:last-child { font-size: 11px; color: #5a5a7a; font-weight: 400; }
.di-ref-imgs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.di-ref-imgs img {
  width: 80px; height: 80px; border-radius: 8px;
  object-fit: cover; cursor: pointer; flex-shrink: 0;
  border: 0.5px solid #2e2e44; transition: opacity 0.15s;
}
.di-ref-imgs img:hover { opacity: 0.8; }

.di-actions {
  display: flex; gap: 10px; margin-top: 14px;
}
html.ios-wechat .di-actions {
  display: flex;
}

.di-btn {
  flex: 1; padding: 10px; border-radius: 10px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  text-align: center; transition: opacity 0.2s;
}
.di-btn:hover { opacity: 0.92; }
.di-btn-download {
  background: linear-gradient(135deg, #7c3aed, #2563eb);
  border: none; color: #fff;
}
.di-btn-delete {
  background: transparent; border: 1px solid #f87171; color: #f87171;
}

/* ===== 套餐余额 ===== */
.balance-card {
  background: #1a1a24; border: 0.5px solid #2e2e44; border-radius: 14px;
  padding: 16px; margin-bottom: 12px;
  display: none;
}
.balance-card.active { display: block; }
.balance-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 12px;
}
.balance-label { font-size: 11px; color: #5a5a7a; margin-bottom: 2px; }
.balance-plan { font-size: 15px; font-weight: 600; color: #e8e8f0; }
.balance-group { font-size: 12px; color: #7c7c9a; }
.balance-right { text-align: right; }
.balance-progress {
  background: #12121a; border-radius: 20px; height: 8px; overflow: hidden;
  margin-bottom: 8px;
}
.balance-progress-bar {
  height: 100%; border-radius: 20px; transition: width 0.4s ease;
  background: #639922;
}
.balance-footer {
  display: flex; justify-content: space-between; align-items: flex-end;
}
.balance-used { font-size: 18px; font-weight: 600; color: #e8e8f0; }
.balance-limit { font-size: 14px; font-weight: 500; color: #c0c0d0; }
.balance-slash { font-size: 14px; color: #5a5a7a; }
.balance-reset { font-size: 11px; color: #5a5a7a; }

/* ===== API Token ===== */
.api-token-card {
  background: #1a1a24; border: 0.5px solid #2e2e44; border-radius: 14px;
  padding: 16px; margin-bottom: 12px;
}
.api-token-header { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; margin-bottom:12px; }
.api-token-title { font-size:15px; font-weight:700; color:#e8e8f0; }
.api-token-desc { font-size:11px; color:#7c7c9a; line-height:1.5; margin-top:2px; }
.api-token-status { font-size:11px; color:#999; border:1px solid #3a3a4a; border-radius:999px; padding:3px 9px; white-space:nowrap; }
.api-token-status.enabled { color:#5DCAA5; border-color:rgba(93,202,165,.35); background:rgba(93,202,165,.08); }
.api-token-row { display:flex; justify-content:space-between; align-items:center; padding:6px 0; border-top:0.5px solid #252536; }
.api-token-label { font-size:11px; color:#5a5a7a; }
.api-token-value { font-size:12px; color:#c9c9dd; font-family:monospace; }
.api-token-new { margin-top:10px; padding:10px; background:#12121a; border-radius:10px; border:0.5px solid #2e2e44; }
.api-token-new-label { font-size:11px; color:#facc15; margin-bottom:6px; }
.api-token-new-box { display:flex; gap:8px; }
.api-token-new-box input { flex:1; min-width:0; height:34px; border:0.5px solid #2e2e44; background:#0f0f16; color:#e8e8f0; border-radius:7px; padding:0 10px; font-size:11px; font-family:monospace; }
.api-token-new-box button, .api-token-btn { border:0; border-radius:7px; height:34px; padding:0 12px; font-size:12px; cursor:pointer; }
.api-token-actions { display:flex; gap:8px; margin-top:12px; }
.api-token-btn.primary { background:#534AB7; color:#fff; }
.api-token-btn.danger { background:rgba(248,113,113,.1); color:#f87171; border:0.5px solid rgba(248,113,113,.3); }
.api-token-warning { margin-top:10px; font-size:10px; color:#7c7c9a; line-height:1.5; }

/* ===== Mask 画板 ===== */
.mask-overlay {
  position: fixed; inset: 0; z-index: 3000;
  background: rgba(0,0,0,0.92);
  display: none; flex-direction: column; align-items: center; justify-content: center;
  padding: 16px;
}
html.ios-wechat .mask-overlay {
  height: var(--app-height, 100dvh);
  overscroll-behavior: contain;
}
.mask-editor {
  background: #12121a; border: 0.5px solid #2e2e44; border-radius: 16px;
  width: 100%; max-width: 500px; display: flex; flex-direction: column;
  overflow: hidden;
}
.mask-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; border-bottom: 0.5px solid #2e2e44;
}
.mask-title { font-size: 13px; font-weight: 500; color: #e8e8f0; }
.mask-toolbar-right { display: flex; gap: 8px; }
.mask-actn { font-size: 11px; color: #7c7c9a; cursor: pointer; padding: 4px 10px; border-radius: 6px; }
.mask-actn:hover { background: #1a1a24; }
.mask-actn-danger { color: #fc8181; }
.mask-canvas-wrap {
  display: flex; align-items: center; justify-content: center;
  padding: 16px; min-height: 200px;
}
#mask-canvas { border-radius: 8px; cursor: crosshair; max-width: 100%; touch-action: none; }
.mask-footer {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-top: 0.5px solid #2e2e44;
}
.mask-brush-slider {
  flex: 1; display: flex; align-items: center; gap: 8px;
  font-size: 11px; color: #7c7c9a;
}
.mask-brush-slider input[type="range"] {
  flex: 1; height: 4px; -webkit-appearance: none; appearance: none;
  background: #2e2e44; border-radius: 4px; outline: none;
}
.mask-brush-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 14px; height: 14px;
  background: #7c3aed; border-radius: 50%; cursor: pointer;
}
#mask-brush-val { font-size: 10px; color: #7c7c9a; min-width: 28px; }
.mask-confirm-btn {
  background: #7c3aed; border: none; color: #fff;
  padding: 10px 24px; border-radius: 10px; font-size: 12px; cursor: pointer;
  white-space: nowrap;
}
.mask-confirm-btn:hover { opacity: 0.9; }

/* ===== V1.8 我的页面 ===== */
.profile-page {
  display: flex; flex-direction: column; gap: 16px;
}
.profile-card {
  background: #1a1a24; border: 1px solid #2a2a3a;
  border-radius: 16px; padding: 24px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.profile-avatar {
  width: 64px; height: 64px; border-radius: 50%;
  background: linear-gradient(135deg, #7c3aed, #2563eb);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 700; color: #fff;
}
.profile-username { font-size: 18px; font-weight: 700; color: #e8e8f0; }
.profile-role { font-size: 12px; color: #7c7c9a; }
.profile-stats {
  display: flex; gap: 20px; margin-top: 4px;
}
.profile-stat {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.profile-stat .ps-num { font-size: 20px; font-weight: 700; color: #a78bfa; }
.profile-stat .ps-label { font-size: 11px; color: #5a5a7a; }

/* 我的分享 */
.share-section {
  background: #1a1a24; border: 1px solid #2a2a3a; border-radius: 16px;
  padding: 16px; margin-bottom: 12px;
}
.myshare-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px; font-size: 14px; font-weight: 500; color: #e8e8f0;
}
.share-list { display: flex; flex-direction: column; gap: 10px; }
.share-item {
  display: flex; gap: 10px; align-items: flex-start;
  background: #14141e; border-radius: 10px; border: 0.5px solid #2a2a3a;
  padding: 10px;
}
.share-thumb {
  width: 60px; height: 60px; border-radius: 8px; object-fit: cover;
  flex-shrink: 0; border: 0.5px solid #2e2e44;
}
.share-body { flex: 1; min-width: 0; }
.share-title {
  font-size: 13px; font-weight: 500; margin-bottom: 2px;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.share-meta { font-size: 11px; color: #5a5a7a; margin-bottom: 6px; }
.share-status {
  display: inline-block; font-size: 10px; padding: 2px 8px;
  border-radius: 8px; border: 0.5px solid;
}

.profile-menu { background: #1a1a24; border: 1px solid #2a2a3a; border-radius: 16px; overflow: hidden; }
.profile-menu-item { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; border-bottom: 0.5px solid #2e2e44; cursor: pointer; font-size: 13px; color: #c0c0d0; }
.profile-menu-item:hover { background: #1f1f2e; }
.profile-menu-arrow { font-size: 12px; color: #5a5a7a; }

/* ===== V2.1 商家表单 ===== */
.card-tit{font-size:12px;font-weight:600;color:#a0a0c0;margin-bottom:12px;display:flex;align-items:center;gap:6px;letter-spacing:0.05em;text-transform:uppercase}
.card-tit .tag{font-size:10px;background:#2e2e44;color:#7c7c9a;padding:1px 8px;border-radius:4px;font-weight:400;text-transform:none;letter-spacing:normal}
.card-tit .r{font-size:10px;color:#5a5a7a;margin-left:auto;text-transform:none;letter-spacing:normal}
.fld{width:100%;padding:10px 12px;border-radius:8px;border:.5px solid #2e2e44;background:#1a1a24;color:#e8e8f0;font-size:13px;outline:none}
.fld:focus{border-color:#7c3aed}
.fld-lbl{font-size:11px;color:#7c7c9a;margin-bottom:4px;display:block}
.fld-row{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-bottom:0}
/* 平台选择 */
.plat-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.plat-crd{background:#1a1a24;border:.5px solid #2e2e44;border-radius:12px;padding:16px;cursor:pointer;display:flex;align-items:center;gap:12px;transition:all .15s}
.plat-crd:hover{border-color:#5a5a7a}
.plat-crd.on{border-color:#a78bfa;background:rgba(167,139,250,0.06)}
.plat-crd .pi{width:36px;height:36px;border-radius:8px;flex-shrink:0;display:flex;align-items:center;justify-content:center;font-size:18px}
.plat-crd .pn{font-size:13px;color:#c0c0d0;font-weight:500}
.plat-crd .ps{font-size:10px;color:#5a5a7a;margin-top:2px}
.plat-crd .pc{width:18px;height:18px;border-radius:50%;border:.5px solid #2e2e44;flex-shrink:0;display:flex;align-items:center;justify-content:center;font-size:10px;color:#2e2e44;margin-left:auto;transition:all .15s}
.plat-crd.on .pc{background:#7c3aed;border-color:#7c3aed;color:#fff}

/* 商家模板网格 */
.mt-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:8px}
.mt-crd{background:#1a1a24;border:.5px solid #2e2e44;border-radius:10px;padding:12px;cursor:pointer;display:flex;align-items:center;gap:10px;transition:all .15s}
.mt-crd:hover{border-color:#5a5a7a}
.mt-crd.on{border-color:#a78bfa;background:rgba(167,139,250,0.06)}
.mt-crd .mi{width:36px;height:36px;border-radius:6px;background:#2e2e44;flex-shrink:0;display:flex;align-items:center;justify-content:center}
.mt-crd .mi svg{width:22px;height:22px;opacity:.4}
.mt-crd .mn{font-size:12px;color:#c0c0d0}
.mt-crd .ms{font-size:10px;color:#5a5a7a;margin-top:1px}
.mt-crd .mc{width:18px;height:18px;border-radius:4px;border:.5px solid #2e2e44;flex-shrink:0;display:flex;align-items:center;justify-content:center;font-size:10px;color:#2e2e44;margin-left:auto;transition:all .15s}
.mt-crd.on .mc{background:#7c3aed;border-color:#7c3aed;color:#fff}

/* 尺寸对照 */
.sz-map{display:flex;gap:8px;margin-top:10px;padding:10px;background:#1a1a24;border-radius:10px;border:0.5px solid #2e2e44}
.sz-map .sc{flex:1}
.sz-map .sl{font-size:9px;color:#5a5a7a;margin-bottom:2px}
.sz-map .sv{font-size:11px;color:#c0c0d0;margin-bottom:1px}
.sz-map .arw{display:flex;align-items:center;color:#a78bfa;font-size:14px;padding:0 2px}

/* 上传区 */
.upzone{border:1px dashed #2e2e44;border-radius:10px;padding:24px 16px;text-align:center;cursor:pointer;transition:all .2s}
.upzone:hover{border-color:#7c7c9a}
.upzone .ui{font-size:24px;color:#5a5a7a;margin-bottom:4px}
.upzone .ut{font-size:11px;color:#5a5a7a}
.upzone .ut b{color:#7c7c9a}

/* 商家主按钮 */
.btn-mt{width:100%;padding:14px;border-radius:12px;border:none;font-size:14px;font-weight:500;cursor:pointer;transition:opacity .2s}
.btn-mt-pri{background:#7c3aed;color:#fff}
.btn-mt-pri:hover{opacity:.9}
.btn-mt-pri:disabled{opacity:.35;cursor:default}
.btn-mt-sec{background:transparent;border:.5px solid #2e2e44;color:#7c7c9a;padding:6px 14px;font-size:11px;border-radius:8px;cursor:pointer}
.btn-mt-sec:hover{background:#1a1a24}

/* 生成进度 */
.mt-progress{margin-top:4px}
.mt-pg{display:flex;align-items:center;gap:12px;padding:10px 12px;border-radius:8px;background:#1a1a24;border:.5px solid #2e2e44;margin-bottom:6px}
.mt-pi{width:28px;height:28px;border-radius:6px;flex-shrink:0;display:flex;align-items:center;justify-content:center;font-size:12px}
.mt-pi.wait{background:#2e2e44;color:#5a5a7a}
.mt-pi.run{background:rgba(167,139,250,.15);color:#a78bfa}
.mt-pi.ok{background:rgba(99,153,34,.15);color:#639922}
.mt-pi.fail{background:rgba(226,75,74,.15);color:#e24b4a}
.mt-pn{font-size:12px;color:#c0c0d0}
.mt-ps{font-size:10px;color:#5a5a7a;margin-top:1px}
.mt-pt{font-size:10px;color:#5a5a7a;margin-left:auto}

/* 结果网格 */
.mt-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:10px;margin-top:4px}
.mt-rc{background:#1a1a24;border:.5px solid #2e2e44;border-radius:10px;overflow:hidden}
.mt-rp{background:#2e2e44;display:flex;align-items:center;justify-content:center;color:#5a5a7a;font-size:10px;position:relative;overflow:hidden;min-height:70px}
.mt-rp .rl{position:absolute;bottom:6px;left:8px;font-size:9px;color:rgba(255,255,255,.5);padding:2px 8px;background:rgba(0,0,0,.5);border-radius:4px}
.mt-rb{padding:8px 10px;display:flex;justify-content:space-between;align-items:center}
.mt-rn{font-size:11px;color:#c0c0d0}
.mt-rs{font-size:10px;color:#5a5a7a;margin-top:1px}

/* ===== 灵感广场 ===== */
.gallery-page { padding: 0; height: 100%; overflow-y: auto; }
html.ios-wechat #page-gallery .gallery-page {
  height: auto;
  min-height: 100%;
  overflow: visible;
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
}
html.ios-wechat #page-gallery #gallery-load-more {
  margin-bottom: calc(24px + env(safe-area-inset-bottom));
}
.gallery-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 16px 8px; }
.gallery-title { font-size: 16px; font-weight: 700; color: var(--text-primary, #fff); }
.gallery-categories { display: flex; gap: 8px; padding: 0 16px 12px; flex-wrap: wrap; }
.gallery-cat-tag { padding: 5px 14px; border-radius: 16px; font-size: 12px; cursor: pointer; flex-shrink: 0; transition: all 0.15s; border: none; color: rgba(255,255,255,0.55); background: rgba(255,255,255,0.06); }
.gallery-cat-tag.active { background: var(--theme-purple, #534AB7); color: #fff; font-weight: 500; box-shadow: 0 0 12px rgba(83,74,183,0.3); }
.gallery-source-tab { padding: 3px 12px; border-radius: 4px; font-size: 11px; cursor: pointer; transition: all 0.15s; color: rgba(255,255,255,0.5); background: rgba(255,255,255,0.05); border: 0.5px solid rgba(255,255,255,0.08); }
.gallery-source-tab.active { background: var(--theme-purple, #534AB7); color: #fff; border-color: transparent; font-weight: 500; }
.gallery-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 0 16px 16px; }
.gallery-card { border-radius: 10px; overflow: hidden; cursor: pointer; transition: transform 0.15s; background: #1a1a24; border: 1px solid #2a2a3a; }
.gallery-card:hover { transform: translateY(-2px); border-color: #3a3a52; }
.gallery-card-img-wrap { aspect-ratio: 1; background: #12121a; display: flex; align-items: center; justify-content: center; overflow: hidden; position: relative; }
.gallery-card-img-wrap img { width: 100%; height: 100%; object-fit: cover; }
.gallery-card-source { position: absolute; top: 6px; left: 6px; padding: 1px 7px; border-radius: 4px; font-size: 10px; font-weight: 500; }
.gallery-card-source.official { background: rgba(167,139,250,0.15); color: #a78bfa; }
.gallery-card-source.user { background: rgba(251,146,60,0.15); color: #fb923c; }
.gallery-card-info { padding: 10px 12px; }
.gallery-card-title { font-size: 12px; font-weight: 500; color: #e8e8f0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-bottom: 3px; }
.gallery-card-cat { font-size: 11px; color: #7c7c9a; }
.gallery-card-featured { position: absolute; top: 6px; right: 6px; padding: 1px 7px; border-radius: 4px; font-size: 10px; font-weight: 500; background: rgba(234,179,8,0.15); color: #facc15; }
#gallery-detail-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.7); z-index: 1000; display: flex; align-items: flex-end; justify-content: center; overflow-y: auto; }
#gallery-detail-overlay .gd-content { background: #1a1a24; border-radius: 16px 16px 0 0; width: 100%; max-width: 500px; max-height: 90vh; overflow-y: auto; padding-bottom: calc(env(safe-area-inset-bottom) + 16px); position: relative; }
html.ios-wechat #gallery-detail-overlay {
  height: var(--app-height, 100dvh);
  align-items: flex-end;
  overflow: hidden;
  overscroll-behavior: contain;
}
html.ios-wechat #gallery-detail-overlay .gd-content {
  max-height: calc(var(--app-height, 100dvh) - 18px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
}
html.ios-wechat #gallery-detail-overlay .gd-image-wrap img {
  max-height: 48vh;
  object-fit: contain;
}
.gd-content .detail-close { position: absolute; right: 16px; top: 16px; background: rgba(0,0,0,0.5); color: #fff; border: none; border-radius: 50%; width: 30px; height: 30px; font-size: 15px; cursor: pointer; z-index: 1; }
.gd-image-wrap { width: 100%; border-radius: 0 0 8px 8px; overflow: hidden; }
.gd-image-wrap img { width: 100%; height: auto; display: block; }
.gd-info { padding: 16px 16px 8px; }
.gd-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.gd-title { font-size: 15px; font-weight: 600; color: #e8e8f0; }
.gd-cat { font-size: 12px; background: rgba(167,139,250,0.12); color: #a78bfa; padding: 3px 10px; border-radius: 12px; }
.gd-prompt-box { background: #12121a; border-radius: 8px; padding: 14px; margin-bottom: 14px; }
.gd-prompt-label { font-size: 11px; color: #7c7c9a; margin-bottom: 8px; }
.gd-prompt-text { font-size: 13px; line-height: 1.6; color: #c8c8d8; word-break: break-all; margin-bottom: 10px; }
.gd-copy-btn { text-align: right; padding: 6px 14px; border: 1px solid rgba(167,139,250,0.3); border-radius: 6px; color: #a78bfa; font-size: 12px; cursor: pointer; display: inline-block; float: right; clear: both; }
.gd-ref-section { margin-bottom: 14px; clear: both; }
.gd-ref-label { font-size: 11px; color: #7c7c9a; margin-bottom: 8px; }
.gd-ref-imgs { display: flex; gap: 8px; overflow-x: auto; }
.gd-ref-imgs img { width: 64px; height: 64px; border-radius: 6px; object-fit: cover; border: 1px solid #2a2a3a; flex-shrink: 0; }
.gd-do-same { width: 100%; padding: 13px 0; background: linear-gradient(135deg, #7c3aed, #a78bfa); color: #fff; border: none; border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer; margin-top: 6px; margin-bottom: 12px; }

/* 分享到灵感 */
.di-btn-share { background: rgba(167,139,250,0.12); color: #a78bfa; border: 1px solid rgba(167,139,250,0.2); }

.share-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.75); z-index: 10000; display: flex; align-items: center; justify-content: center; }
.share-box { background: #1a1a24; border-radius: 14px; padding: 20px 18px 24px; width: 340px; max-width: 90vw; }
.share-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; font-size: 15px; font-weight: 600; color: #e8e8f0; }
.share-field { margin-bottom: 14px; }
.share-field label { display: block; font-size: 12px; color: #7c7c9a; margin-bottom: 6px; }
.share-field input { width: 100%; padding: 8px 12px; background: #12121a; border: 1px solid #2a2a3a; border-radius: 8px; color: #e8e8f0; font-size: 13px; outline: 0; box-sizing: border-box; }
.share-field input:focus { border-color: #7c3aed; }
.share-cats { display: flex; flex-wrap: wrap; gap: 6px; }
.share-cat { padding: 4px 12px; border-radius: 14px; font-size: 12px; cursor: pointer; color: #7c7c9a; background: #12121a; border: 1px solid #2a2a3a; transition: all 0.15s; }
.share-cat.active { background: rgba(167,139,250,0.15); color: #a78bfa; border-color: rgba(167,139,250,0.3); }
.share-tip { font-size: 11px; color: #555; text-align: center; margin-bottom: 14px; }
.share-submit { width: 100%; padding: 11px 0; background: linear-gradient(135deg, #7c3aed, #a78bfa); color: #fff; border: none; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; }
