/* ============================================================
   AI 生图平台 V2 — 全局样式
   移动端优先 · 渐变紫色主题 · 卡片式布局
   ============================================================ */

/* ---------- Tailwind CDN 基础覆盖 ---------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --primary:        #6366f1;
  --primary-dark:   #4f46e5;
  --primary-light:  #818cf8;
  --secondary:      #8b5cf6;
  --gradient:       linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  --gradient-hover: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  --bg:             #f5f3ff;
  --bg-card:        #ffffff;
  --bg-input:       #f9fafb;
  --text-primary:   #1f2937;
  --text-secondary: #6b7280;
  --text-muted:     #9ca3af;
  --border:         #e5e7eb;
  --border-focus:   #6366f1;
  --shadow-card:    0 2px 12px rgba(99, 102, 241, 0.08);
  --shadow-btn:     0 4px 14px rgba(99, 102, 241, 0.35);
  --radius:         12px;
  --radius-sm:      8px;
  --max-width:      480px;
}

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

html, body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ---------- 应用容器 ---------- */
#app {
  max-width: var(--max-width);
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
  padding-bottom: 70px;
}

/* ---------- 页面容器 ---------- */
.page {
  display: none;
  padding: 12px;
  animation: fadeIn 0.25s ease;
}
.page.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- 页面标题 ---------- */
.page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 20px;
}

/* ---------- 卡片 ---------- */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 12px;
  margin-bottom: 10px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.card:active {
  transform: scale(0.98);
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.card-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.btn-primary {
  background: var(--gradient);
  color: #fff;
  box-shadow: var(--shadow-btn);
}
.btn-primary:hover {
  background: var(--gradient-hover);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}
.btn-primary:active {
  transform: scale(0.96);
}
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-secondary {
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.btn-secondary.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 12px;
}

.btn-block {
  width: 100%;
}

.btn-danger {
  background: #ef4444;
  color: #fff;
}
.btn-danger:hover {
  background: #dc2626;
}

/* ---------- 输入框 ---------- */
.input-group {
  margin-bottom: 12px;
}

.input-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-input);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
.input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}
.input::placeholder {
  color: var(--text-muted);
}

textarea.input {
  resize: vertical;
  min-height: 100px;
  line-height: 1.6;
}

/* ---------- 选择器组 ---------- */
.select-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.select-item {
  padding: 8px 16px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  color: var(--text-secondary);
  background: var(--bg-card);
  cursor: pointer;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.select-item.active {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(99, 102, 241, 0.06);
  font-weight: 600;
}
.select-item:active {
  transform: scale(0.95);
}
.select-item.disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

/* ---------- 尺寸选择器组（Grid 7列两排对齐） ---------- */
.size-select-group {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 0;
}
.size-select-group .select-item {
  padding: 6px 0;
  font-size: 12px;
  text-align: center;
  border-radius: 8px;
  min-width: 0;
  white-space: nowrap;
}

/* 锁定比例提示条 */
.ratio-locked-tip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(99, 102, 241, 0.07);
  border: 1.5px solid rgba(99, 102, 241, 0.25);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--primary);
  margin-top: 2px;
}
.ratio-locked-tip .lock-icon {
  font-size: 15px;
}

/* ---------- 底部 Tab 导航 ---------- */
.tab-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--max-width);
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 6px 0 env(safe-area-inset-bottom, 8px);
  z-index: 100;
}

.tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 12px;
  color: var(--text-muted);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s;
  -webkit-tap-highlight-color: transparent;
  font-size: 10px;
}
.tab-item.active {
  color: var(--primary);
}
.tab-item .tab-icon {
  font-size: 22px;
  line-height: 1;
}
.tab-item .tab-text {
  font-weight: 500;
}

/* ---------- Toast 提示 ---------- */
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: #fff;
  background: rgba(0, 0, 0, 0.75);
  z-index: 9999;
  pointer-events: none;
  animation: toastIn 0.2s ease;
  text-align: center;
  max-width: 260px;
}
.toast.toast-success { background: rgba(34, 197, 94, 0.9); }
.toast.toast-error   { background: rgba(239, 68, 68, 0.9); }
.toast.toast-warning { background: rgba(234, 179, 8, 0.9); }

@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.9); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* ---------- Loading 遮罩 ---------- */
.loading-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9998;
}

.loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------- 图片网格 ---------- */
.image-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.image-item {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-input);
  aspect-ratio: 1;
  cursor: pointer;
}
.image-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-item .image-status {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 500;
}
.image-status.processing {
  background: rgba(99, 102, 241, 0.85);
  color: #fff;
}
.image-status.succeeded {
  background: rgba(34, 197, 94, 0.85);
  color: #fff;
}
.image-status.failed {
  background: rgba(239, 68, 68, 0.85);
  color: #fff;
}

.image-item .image-delete {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s;
}
.image-item:hover .image-delete {
  opacity: 1;
}

/* ---------- 图片预览弹窗 ---------- */
.image-preview-modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9997;
  cursor: pointer;
}
.image-preview-modal img {
  max-width: 95%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

/* ---------- 生成进度 ---------- */
.generate-progress {
  text-align: center;
  padding: 40px 20px;
}
.generate-progress .progress-icon {
  font-size: 48px;
  margin-bottom: 16px;
  animation: pulse 1.5s ease infinite;
}
.generate-progress .progress-text {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.generate-progress .progress-sub {
  font-size: 13px;
  color: var(--text-muted);
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.6; transform: scale(1.05); }
}

/* ---------- 参考图预览 ---------- */
.ref-images-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.ref-images-preview .ref-thumb {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
.ref-images-preview .ref-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ref-images-preview .ref-thumb .ref-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.85);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  cursor: pointer;
}

/* ---------- 充值套餐 ---------- */
.package-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.package-item {
  position: relative;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s;
}
.package-item.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}
.package-item .package-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}
.package-item .package-points {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
  margin: 4px 0;
}
.package-item .package-price {
  font-size: 14px;
  color: var(--text-secondary);
}
.package-item .package-original {
  text-decoration: line-through;
  color: var(--text-muted);
  font-size: 12px;
  margin-left: 6px;
}

/* ---------- 技能卡片网格（V2新样式） ---------- */
.skill-card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.skill-card-item {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s;
}
.skill-card-item:active {
  transform: scale(0.97);
  border-color: var(--primary);
}

.skill-card-thumb {
  width: 100%;
  aspect-ratio: 4/3;
  overflow: hidden;
  background: var(--bg-input);
}
.skill-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}
.skill-card-item:active .skill-card-thumb img {
  transform: scale(1.05);
}

.skill-card-icon {
  width: 100%;
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-input);
  font-size: 48px;
}

.skill-card-body {
  padding: 12px;
}
.skill-card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.skill-card-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 旧版技能卡片（兼容） */
.skill-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.skill-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}
.skill-card.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}
.skill-card .skill-icon {
  font-size: 36px;
  margin-bottom: 8px;
}
.skill-card .skill-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.skill-card .skill-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ---------- 技能详情页样式 ---------- */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  color: var(--primary);
  cursor: pointer;
  padding: 8px 0;
  margin-bottom: 12px;
  transition: opacity 0.2s;
}
.back-btn:active {
  opacity: 0.7;
}

.skill-hint {
  background: rgba(99, 102, 241, 0.06);
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 13px;
  color: var(--primary);
  margin-bottom: 16px;
  line-height: 1.5;
}

/* 技能详情页紧凑布局 */
#skillDetailContent .card {
  padding: 12px;
  margin-bottom: 10px;
}
#skillDetailContent .back-btn {
  padding: 2px 0;
  margin-bottom: 4px;
}

/* ---------- 案例图2x2网格 ---------- */
.example-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.example-item {
  border-radius: var(--radius-sm);
  overflow: hidden;
  aspect-ratio: 1;
  cursor: pointer;
  background: var(--bg-input);
}
.example-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}
.example-item:active img {
  transform: scale(1.05);
}

/* ---------- 短信验证码行 ---------- */
.sms-code-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.sms-code-row .input {
  flex: 1;
  min-width: 0;
}
.sms-code-btn {
  white-space: nowrap;
  flex-shrink: 0;
  padding: 8px 14px;
  font-size: 13px;
  min-width: 100px;
}
.sms-code-btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---------- "我的"页面样式 ---------- */
.my-menu-list {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.my-menu-item {
  display: flex;
  align-items: center;
  padding: 16px;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid var(--border);
}
.my-menu-item:last-child {
  border-bottom: none;
}
.my-menu-item:active {
  background: var(--bg-input);
}

.my-menu-icon {
  font-size: 20px;
  margin-right: 12px;
  width: 24px;
  text-align: center;
}

.my-menu-text {
  flex: 1;
  font-size: 15px;
  color: var(--text-primary);
}

.my-menu-arrow {
  font-size: 18px;
  color: var(--text-muted);
}

.my-subpage {
  margin-top: 16px;
}

/* ---------- 用户信息 ---------- */
.profile-header {
  text-align: center;
  padding: 24px 16px;
}
.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--gradient);
  color: #fff;
  font-size: 28px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
}
.profile-nickname {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}
.profile-phone {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.points-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 16px;
  background: var(--gradient);
  color: #fff;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  margin-top: 12px;
}

/* ---------- 模态框 ---------- */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9990;
  padding: 20px;
}

.modal-content {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  width: 100%;
  max-width: 380px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-title {
  font-size: 20px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 20px;
  color: var(--text-primary);
}

/* ---------- 积分流水 ---------- */

/* 类型筛选栏 */
.transactions-filter {
  display: flex;
  gap: 8px;
  padding: 0 0 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.transactions-filter-item {
  flex-shrink: 0;
  padding: 6px 14px;
  border: 1.5px solid var(--border);
  border-radius: 18px;
  font-size: 13px;
  color: var(--text-secondary);
  background: var(--bg-card);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  user-select: none;
}
.transactions-filter-item.active {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(99, 102, 241, 0.06);
  font-weight: 600;
}

/* 流水列表容器 */
.transactions-list {
  min-height: 120px;
}

/* 单条流水 */
.transaction-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.transaction-item:last-child {
  border-bottom: none;
}

/* 左侧：图标 + 信息 */
.transaction-left {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.transaction-icon {
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}
.transaction-info {
  min-width: 0;
}
.transaction-type {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}
.transaction-remark {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 右侧：金额 + 余额 + 时间 */
.transaction-right {
  flex-shrink: 0;
  text-align: right;
  min-width: 80px;
}
.transaction-amount {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 2px;
}
.transaction-amount.amount-positive {
  color: #22c55e;
}
.transaction-amount.amount-negative {
  color: #ef4444;
}
.transaction-balance {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 2px;
}
.transaction-time {
  font-size: 11px;
  color: var(--text-muted);
}

/* ---------- 空状态 ---------- */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}
.empty-state .empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
}
.empty-state .empty-text {
  font-size: 14px;
}

/* ---------- 工具类 ---------- */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.hidden { display: none !important; }
.w-full { width: 100%; }

/* ========== 美化版"我的"页面 ========== */

/* Hero 头部 */
.mypage-hero {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 16px;
  padding: 32px 20px 28px;
  text-align: center;
  color: #fff;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}
.mypage-hero::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 140px; height: 140px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
}
.mypage-hero::after {
  content: '';
  position: absolute;
  bottom: -30px; left: -20px;
  width: 100px; height: 100px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
}
.mypage-avatar {
  width: 68px; height: 68px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 10px;
  border: 3px solid rgba(255,255,255,0.3);
}
.mypage-name {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
}
.mypage-phone {
  font-size: 13px;
  opacity: 0.8;
  margin-bottom: 10px;
}
.mypage-points {
  display: inline-block;
  background: rgba(255,255,255,0.15);
  border-radius: 20px;
  padding: 6px 18px;
  font-size: 14px;
  font-weight: 600;
  backdrop-filter: blur(4px);
}
.mypage-login-btn {
  margin-top: 16px;
  background: rgba(255,255,255,0.2) !important;
  border: 1.5px solid rgba(255,255,255,0.4) !important;
  color: #fff !important;
}

/* 菜单 */
.mypage-menu {
  background: var(--bg-card);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.mypage-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 18px;
  font-size: 15px;
  color: var(--text-primary);
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.mypage-menu-item:last-child { border-bottom: none; }
.mypage-menu-item:active { background: var(--bg-input); }
.mypage-menu-left { display: flex; align-items: center; gap: 10px; }
.mypage-menu-danger { color: #ef4444; }

/* 子页面容器 */
.mypage-subpage {
  animation: fadeIn 0.25s ease;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.mypage-sub-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0 16px;
}
.mypage-back {
  font-size: 14px;
  color: var(--primary);
  cursor: pointer;
  padding: 4px 0;
}
.mypage-sub-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
}

/* 表单卡片 */
.form-card {
  background: var(--bg-card);
  border-radius: 14px;
  padding: 20px 18px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.form-card .input { margin-top: 8px; }
.form-card-phone {
  margin-top: 6px;
  padding: 10px 14px;
  background: var(--bg-input);
  border-radius: 8px;
  font-size: 15px;
  color: var(--text-secondary);
}
.form-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* 充值余额 */
.recharge-balance {
  text-align: center;
  padding: 20px 0 16px;
}
.recharge-balance-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.recharge-balance-val {
  font-size: 36px;
  font-weight: 700;
  color: var(--primary);
}

/* 套餐卡片 */
.package-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 14px;
  padding: 18px 16px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}
.package-card.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}
.package-card-name {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
}
.package-card-points {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}
.package-card-price {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}
.package-card-amount { font-weight: 600; }
.package-card-original {
  text-decoration: line-through;
  color: var(--text-muted);
  margin-left: 8px;
  font-size: 12px;
}
.package-card-btn {
  width: 100%;
  padding: 10px 0;
  font-size: 14px;
}

/* 套餐说明 */
.package-card-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
  padding: 6px 10px;
  background: var(--bg-input);
  border-radius: 6px;
  line-height: 1.5;
}

/* 卡密兑换区域（模态框内） */
.modal-content .input {
  margin-bottom: 4px;
}

/* 技能自定义字段多图预览 */
.custom-field-images-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.custom-field-image-item {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.custom-field-image-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.custom-field-image-del {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.85);
  color: #fff;
  border: none;
  font-size: 12px;
  line-height: 18px;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 生成任务列表 */
.mypage-history-list {
  min-height: 120px;
}
.image-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-input);
  color: var(--text-muted);
  font-size: 32px;
  border-radius: 10px;
  min-height: 120px;
}

/* 生成历史页面 */
.history-hero {
  background: linear-gradient(135deg, #1e293b, #334155);
  border-radius: 14px;
  padding: 14px 18px;
  margin-bottom: 16px;
  color: #fff;
}
.history-hero .mypage-sub-title { color: #fff; }
.history-hero .mypage-back { color: #94a3b8; }
.history-notice {
  background: rgba(255,193,7,0.08);
  border: 1px solid rgba(255,193,7,0.2);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  color: #b45309;
  margin-bottom: 14px;
  text-align: center;
}

/* 删除按钮优化 */
.image-item .image-delete {
  position: absolute;
  bottom: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: rgba(239, 68, 68, 0.88);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  opacity: 1;
  -webkit-tap-highlight-color: transparent;
  z-index: 2;
}
