/*
Theme Name: HandCraft AI
Theme URI: https://example.com
Author: You
Version: 1.2.6
Text Domain: handcraft
*/

:root {
  --primary: #D4958A;        /* 莫兰迪陶土粉 — 温柔、高级、不刺眼 */
  --secondary: #8FB9A8;      /* 鼠尾草绿 — 自然、清新、护眼 */
  --accent: #C9A87C;         /* 奶茶金 — 用于渐变与点缀 */
  --dark: #4A4A4A;           /* 暖炭灰 — 柔和文字色，不冷峻 */
  --light: #FAF8F6;          /* 奶油暖白 — 温馨背景 */
  --radius: 12px;
  --paper: #F3EDE6;          /* 暖米色纸张 */
}

/* ========== 全局布局修复：确保页面铺满高度，页脚沉底 ========== */
html, body {
  min-height: 100vh;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--light);
  color: var(--dark);
  line-height: 1.6;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

/* WordPress 主内容包裹层 */
#primary, #main, .site-main, main {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
}

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

/* ========== 容器宽度控制 ========== */
.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 12px 28px; border-radius: var(--radius); border: none;
  cursor: pointer; font-size: 15px; font-weight: 600;
  transition: all 0.2s; text-decoration: none; touch-action: manipulation;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; box-shadow: 0 4px 14px rgba(212,149,138,0.25);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(212,149,138,0.35); }
.btn-secondary {
  background: #fff; color: var(--dark); border: 2px solid #E1E8ED;
}
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }
.btn-ghost {
  background: transparent; color: var(--primary); border: 2px solid var(--primary);
}
.btn-ghost:hover { background: var(--primary); color: #fff; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

.card {
  background: #fff; border-radius: var(--radius); padding: 24px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: left;
}

.grid-3 {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px;
  align-items: stretch;
}

.badge {
  display: inline-block; padding: 4px 12px; border-radius: 20px;
  font-size: 12px; font-weight: 600;
}
.badge-free { background: #E8F0EC; color: #5A8A7A; }
.badge-pro { background: #F5E6E0; color: #A67C72; }
.badge-urgent { background: #F5E6E6; color: #B86B6B; animation: pulse 2s infinite; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.header-bar {
  background: #fff; border-bottom: 1px solid #E1E8ED;
  padding: 16px 0; position: sticky; top: 0; z-index: 100;
  flex-shrink: 0;
}
.header-bar .container { display: flex; align-items: center; justify-content: space-between; }
.logo {
  font-size: 22px; font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  white-space: nowrap;
  text-decoration: none;   /* ← 修复：去掉站点名称下划线 */
}
.nav-links {
  display: flex; align-items: center; flex-shrink: 0;
}
.nav-links a {
  margin-left: 24px; color: var(--dark); text-decoration: none;
  font-weight: 500; font-size: 14px; white-space: nowrap;
}
.nav-links a:hover { color: var(--primary); }

.hero { padding: 50px 0 30px; text-align: center; }
.hero h1 { font-size: 40px; margin-bottom: 12px; letter-spacing: -0.5px; }
.hero p { color: #7F8C8D; font-size: 18px; max-width: 600px; margin: 0 auto 28px; }

.festival-bar {
  background: linear-gradient(135deg, #8FA89A 0%, #7A9E8E 100%);
  color: #fff; padding: 14px 0; text-align: center; font-size: 15px;
}
.festival-bar a { color: #FFE082; font-weight: 700; text-decoration: underline; margin-left: 8px; }

.first-order-banner {
  background: linear-gradient(135deg, #D4A5A5 0%, #C9A87C 100%);
  color: #fff; padding: 16px 0; text-align: center;
  position: relative; overflow: hidden;
}
.first-order-banner::before {
  content: "NEW"; position: absolute; left: -20px; top: -10px;
  background: #F5E6C8; color: #8A7A6A; font-size: 10px; font-weight: 800;
  padding: 20px 30px 4px; transform: rotate(-45deg);
}
.first-order-banner h4 { font-size: 18px; margin-bottom: 4px; }
.first-order-banner p { font-size: 14px; opacity: 0.95; }

.urgent-card {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; text-align: center; padding: 20px;
  border-radius: var(--radius); cursor: pointer;
  transition: transform 0.2s;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-decoration: none;   /* ← 修复：去掉自由创作卡片下划线 */
}
.urgent-card:hover { transform: translateY(-3px); }
.urgent-card h3 { font-size: 20px; margin-bottom: 6px; }
.urgent-card p { font-size: 13px; opacity: 0.9; }

.history-strip {
  display: flex; gap: 12px; overflow-x: auto; padding: 4px 0 16px;
  -webkit-overflow-scrolling: touch;
}
.history-item {
  flex-shrink: 0; width: 100px; text-align: center; cursor: pointer;
}
.history-item img {
  width: 100px; height: 140px; object-fit: cover; border-radius: 8px;
  border: 2px solid transparent; transition: border-color 0.2s;
}
.history-item:hover img { border-color: var(--primary); }
.history-item span { font-size: 11px; color: #95A5A6; margin-top: 4px; display: block; }

.theme-card { overflow: hidden; cursor: pointer; transition: transform 0.2s; }
.theme-card:hover { transform: translateY(-4px); }
.theme-card img {
  width: 100%; height: 180px; object-fit: cover; border-radius: 8px; margin-bottom: 12px; background: #f0f0f0;
}
.theme-card h3 { font-size: 16px; margin-bottom: 6px; }
.theme-card .meta { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: #95A5A6; }

/* ========== 生成页布局（仅修改此处，不影响其他页面） ========== */
.generate-wrap {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 28px;
  padding: 30px 0;
  align-items: stretch;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}

.gen-left-col { display: flex; flex-direction: column; }
.gen-left-col .card { width: 100%; flex: 1; }

.gen-right-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* 修复：删除 height: auto !important，让 Grid stretch 保持两列等高 */
.gen-right-col.has-result {
  /* height: auto !important; —— 已删除 */
}

.form-group { margin-bottom: 18px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 600; font-size: 14px; }
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%; padding: 12px 14px; border: 2px solid #E1E8ED;
  border-radius: 10px; font-size: 14px; outline: none; transition: border-color 0.2s;
  -webkit-appearance: none; appearance: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--primary); }

.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.tag-item {
  padding: 6px 14px; background: #f0f3f5; border-radius: 20px;
  font-size: 13px; cursor: pointer; transition: all 0.2s; border: 2px solid transparent;
}
.tag-item:hover { background: #e1e8ed; }
.tag-item.active {
  background: var(--primary); color: #fff; border-color: var(--primary);
}

.mode-tabs {
  display: flex; gap: 8px; margin-bottom: 20px; background: #f0f3f5;
  padding: 4px; border-radius: 10px;
}
.mode-tab {
  flex: 1; text-align: center; padding: 10px; border-radius: 8px;
  font-size: 14px; font-weight: 600; cursor: pointer; border: none; background: transparent;
}
.mode-tab.active { background: #fff; color: var(--primary); box-shadow: 0 2px 8px rgba(0,0,0,0.08); }

.batch-area { display: none; }
.batch-area textarea { min-height: 120px; font-size: 14px; }
.batch-hint { font-size: 12px; color: #95A5A6; margin-top: 6px; }
.batch-progress { margin-top: 16px; }
.batch-progress-bar {
  height: 8px; background: #e1e8ed; border-radius: 4px; overflow: hidden;
}
.batch-progress-fill {
  height: 100%; background: linear-gradient(90deg, var(--primary), var(--secondary));
  transition: width 0.3s; width: 0%;
}

.custom-area { display: none; }
.custom-area textarea {
  min-height: 140px; font-size: 14px; line-height: 1.6;
}

.preview-area {
  background: #fff; border-radius: var(--radius);
  flex: 1; min-height: 350px;
  display: flex; align-items: center; justify-content: center; flex-direction: column;
  border: 2px dashed #E1E8ED; position: relative;
}

/* 修复：生成图片后预览区继续 flex:1 填满右侧，与左侧等高对齐 */
.preview-area.has-image {
  border-style: solid; border-color: transparent;
  flex: 1;
  min-height: 0;
}

.preview-area img { max-width: 100%; max-height: 700px; border-radius: 8px; }

.print-toggle {
  position: absolute; top: 12px; right: 12px; z-index: 10;
  display: flex; gap: 8px;
}
.print-toggle button {
  padding: 6px 14px; font-size: 12px; border-radius: 6px; border: 1px solid #ddd;
  background: #fff; cursor: pointer;
}
.print-toggle button.active { background: var(--dark); color: #fff; }
.paper-bg { background: var(--paper) !important; }

.price-tag { font-size: 24px; font-weight: 800; color: var(--primary); }
.price-tag small { font-size: 14px; color: #95A5A6; font-weight: 500; }
.price-strike { text-decoration: line-through; color: #BDC3C7; font-size: 14px; margin-right: 6px; }

.user-sidebar { width: 260px; }
.user-main { flex: 1; }
.user-layout { display: flex; gap: 32px; padding: 40px 0; }

.stat-card { text-align: center; padding: 20px; }
.stat-card .num { font-size: 32px; font-weight: 800; color: var(--primary); }
.stat-card .label { font-size: 13px; color: #7F8C8D; margin-top: 4px; }

table.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data-table th,
table.data-table td { padding: 14px; text-align: left; border-bottom: 1px solid #E1E8ED; }
table.data-table th {
  font-weight: 600; color: #7F8C8D; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px;
}
.status-done { color: #5A8A7A; font-weight: 600; }
.status-wait { color: #C9A87C; font-weight: 600; }

/* ========== 充值页面完整修复 ========== */
.recharge-page {
  padding: 40px 0;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}

.recharge-page-header {
  text-align: center;
  margin-bottom: 32px;
}
.recharge-page-header h1 {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}
.recharge-page-header p {
  color: #7F8C8D;
  font-size: 16px;
}

/* 当前点数展示 */
.recharge-current-points {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  margin-bottom: 32px;
  box-shadow: 0 4px 20px rgba(212,149,138,0.25);
}
.recharge-current-points .label {
  font-size: 14px;
  opacity: 0.9;
  margin-bottom: 8px;
}
.recharge-current-points .num {
  font-size: 48px;
  font-weight: 800;
  line-height: 1;
}
.recharge-current-points .unit {
  font-size: 16px;
  opacity: 0.9;
  margin-left: 4px;
}

/* 充值卡片网格 - 固定3列，不随屏幕乱变 */
.recharge-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 24px;
}

.recharge-card {
  text-align: center;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.25s ease;
  position: relative;
  background: #fff;
  border-radius: var(--radius);
  padding: 28px 20px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.recharge-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}
.recharge-card.active {
  border-color: var(--primary);
  box-shadow: 0 4px 20px rgba(212,149,138,0.2);
  background: linear-gradient(135deg, #FDF8F5, #F5EDE6);
}
.recharge-card .points {
  font-size: 36px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 8px;
}
.recharge-card .unit {
  font-size: 14px;
  color: #95A5A6;
  font-weight: 500;
}
.recharge-card .price {
  font-size: 24px;
  font-weight: 700;
  margin: 12px 0 4px;
  color: var(--dark);
}
.recharge-card .price small {
  font-size: 14px;
  color: #95A5A6;
  font-weight: 500;
}
.recharge-card .save {
  display: inline-block;
  font-size: 12px;
  color: #5A8A7A;
  font-weight: 700;
  background: #E8F0EC;
  padding: 4px 10px;
  border-radius: 20px;
  margin-top: 8px;
}
.recharge-card .hot-tag {
  position: absolute;
  top: -10px;
  right: 12px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  box-shadow: 0 2px 8px rgba(212,149,138,0.3);
}
.recharge-card .check-icon {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 24px;
  height: 24px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}
.recharge-card.active .check-icon {
  display: flex;
}

/* 支付方式区域 */
.recharge-payment-area {
  margin-top: 32px;
  background: #fff;
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.recharge-payment-area h3 {
  font-size: 18px;
  margin-bottom: 20px;
  font-weight: 700;
}
.payment-methods {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
}
.payment-method {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px;
  border: 2px solid #E1E8ED;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 15px;
  font-weight: 600;
}
.payment-method:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.payment-method.active {
  border-color: var(--primary);
  background: linear-gradient(135deg, #FDF8F5, #F5EDE6);
  color: var(--primary);
}
.payment-method .icon {
  font-size: 20px;
}

.recharge-submit-btn {
  width: 100%;
  padding: 16px;
  font-size: 17px;
  font-weight: 700;
}

.recharge-tips {
  margin-top: 16px;
  padding: 14px;
  background: #F5F0E6;
  border: 1px solid #E8DDC8;
  border-radius: 8px;
  font-size: 13px;
  color: #7A6A5A;
}
.recharge-tips strong {
  color: #A67C72;
}

/* 充值记录 */
.recharge-history {
  margin-top: 40px;
}
.recharge-history h3 {
  font-size: 20px;
  margin-bottom: 20px;
  font-weight: 700;
}

.footer-bar {
  background: #fff; border-top: 1px solid #E1E8ED;
  padding: 24px 0; margin-top: auto;
  text-align: center;
  color: #95A5A6; font-size: 13px;
  flex-shrink: 0;
}

.toast {
  position: fixed; top: 24px; right: 24px; background: var(--dark);
  color: #fff; padding: 14px 24px; border-radius: 10px;
  font-size: 14px; z-index: 9999; opacity: 0;
  transform: translateY(-10px); transition: all 0.3s;
}
.toast.show { opacity: 1; transform: translateY(0); }

.loading-spin {
  width: 40px; height: 40px; border: 3px solid #E1E8ED;
  border-top-color: var(--primary); border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ========== 弹窗优化 ========== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  display: none; align-items: center; justify-content: center; z-index: 200;
  padding: 20px;
}
.modal-overlay.active { display: flex; }
.modal-box {
  background: #fff; border-radius: var(--radius); padding: 32px;
  max-width: 420px; width: 100%; text-align: center;
  position: relative;
}
.modal-close {
  position: absolute; top: 12px; right: 16px;
  background: none; border: none; font-size: 24px; color: #95A5A6;
  cursor: pointer; line-height: 1; padding: 0; width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; transition: all 0.2s;
}
.modal-close:hover { background: #f0f0f0; color: var(--dark); }
.qr-wrap img { width: 200px; height: 200px; margin: 16px auto; display: block; }

.wechat-tip {
  background: #E8F0EC; border: 1px solid #A8C6B8; border-radius: 8px;
  padding: 12px; font-size: 13px; color: #5A8A7A; margin-bottom: 12px;
}
.wechat-tip strong { color: #5A8A7A; }

.download-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px;
}
.download-card {
  text-align: center; padding: 20px; border-radius: 10px; position: relative;
}
.download-card.free { background: #f8f9fa; border: 2px solid #e1e8ed; }
.download-card.paid {
  background: linear-gradient(135deg, #FDF8F5, #F5EDE6);
  border: 2px solid #E8D5C8;
}
.download-card .icon { font-size: 32px; margin-bottom: 8px; }
.download-card h4 { font-size: 15px; margin-bottom: 6px; }
.download-card p { font-size: 12px; color: #7F8C8D; margin-bottom: 12px; }
.download-card .btn { width: 100%; padding: 10px; font-size: 14px; }

.color-ref-preview {
  margin-top: 12px; padding: 12px; background: #f8f9fa; border-radius: 8px;
}
.color-ref-preview img {
  max-height: 120px; border-radius: 6px; border: 2px solid #E8D5C8;
}
.color-ref-preview span { font-size: 12px; color: #95A5A6; }

@media print {
  body * { visibility: hidden; }
  .print-area, .print-area * { visibility: visible; }
  .print-area { position: absolute; left: 0; top: 0; width: 100%; }
}
.print-page { background: #fff; min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.print-area img { max-width: 100%; max-height: 100vh; object-fit: contain; }
.print-btn {
  position: fixed; bottom: 30px; right: 30px;
  padding: 14px 28px; background: var(--primary); color: #fff;
  border-radius: 50px; font-weight: 600; cursor: pointer; border: none;
  box-shadow: 0 4px 14px rgba(212,149,138,0.4);
}

/* ========== 登录注册页 ========== */
.auth-wrap { padding: 60px 0; flex: 1; display: flex; align-items: center; }
.auth-card {
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
  padding: 32px;
}
.auth-tabs {
  display: flex; gap: 8px; margin-bottom: 24px;
  background: #f0f3f5; padding: 4px; border-radius: 10px;
}
.auth-tab {
  flex: 1; text-align: center; padding: 10px;
  border-radius: 8px; font-size: 15px; font-weight: 600;
  cursor: pointer; border: none; background: transparent;
  transition: all 0.2s;
}
.auth-tab.active { background: #fff; color: var(--primary); box-shadow: 0 2px 8px rgba(0,0,0,0.08); }

/* ========== 广告系统样式（与 .card 完全一致） ========== */
.ad-section {
  background: #fff;
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.adimg-section {
  background: #fff;
  border-radius: var(--radius);
}
/* 生成结果出现后隐藏广告 */
.gen-right-col.has-result .ad-section {
  display: none;
}

/* 广告内容盒子 - 透明背景，无额外边框，融入外层 card */
.handcraft-ads-box {
  background: transparent;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}

.handcraft-ads-box.empty {
  padding: 0;
}

/* 空状态占位符 - 与预览区空状态风格统一 */
.ad-placeholder-inner {
  text-align: center;
  padding: 48px 20px;
  border: 2px dashed #E1E8ED;
  border-radius: 8px;
  color: #BDC3C7;
  background: transparent;
}
.ad-placeholder-inner p {
  font-size: 14px;
  margin-bottom: 8px;
  font-weight: 500;
}
.ad-placeholder-inner a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}
.ad-placeholder-inner a:hover {
  text-decoration: underline;
}

/* 广告分类标题 */
.ad-section-title {
  font-size: 13px;
  font-weight: 600;
  color: #95A5A6;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* 图片广告网格：单列3个，充分利用右侧宽度 */
.ad-image-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
.ad-image-card {
  display: block;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #f0f0f0;
  transition: transform 0.2s, box-shadow 0.2s;
}
.ad-image-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.ad-image-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}

/* 文字广告列表：两行三列 */
.ad-text-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.ad-text-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px;
  border-radius: 6px;
  text-decoration: none;
  color: var(--dark);
  font-size: 12px;
  transition: background 0.2s;
  background: #fafbfc;
  border: 1px solid #f0f0f0;
}
.ad-text-item:hover {
  background: #f0f3f5;
  color: var(--primary);
  border-color: var(--primary);
}
.ad-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
  opacity: 0.6;
}
.ad-text-content {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.4;
}

/* ========== 广告售卖页 ========== */
.ad-sale-wrap .ad-type-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  background: #f0f3f5;
  padding: 4px;
  border-radius: 10px;
}
.ad-sale-wrap .ad-type-tab {
  flex: 1;
  text-align: center;
  padding: 10px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: transparent;
}
.ad-sale-wrap .ad-type-tab.active {
  background: #fff;
  color: var(--primary);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* ========== 年级选择器样式 ========== */
#grade-group select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23999' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
#grade-group label small {
  font-weight: 400;
  color: #95A5A6;
  margin-left: 4px;
}

/* ========== 参考图上传区域 ========== */
#ref-upload-zone {
  transition: all 0.2s ease;
}
#ref-upload-zone:hover {
  border-color: var(--primary) !important;
  background: #FDF8F0 !important;
}
#ref-preview-wrap {
  position: relative;
}
#ref-preview-wrap button {
  transition: all 0.2s;
}
#ref-preview-wrap button:hover {
  background: rgba(0,0,0,0.8) !important;
  transform: scale(1.1);
}

/* 参考图上传 - 锁定状态 */
#reference-group .badge-pro {
  margin-left: 6px;
  vertical-align: middle;
  font-size: 10px;
  padding: 2px 8px;
}

/* ========== 点数感知卡片 ========== */
.points-info-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 20px 0 10px;
  padding: 10px 14px;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #E1E8ED;
}
.points-info-bar .cost-label {
  font-size: 13px;
  color: #7F8C8D;
}
.points-info-bar .cost-num {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
  margin-left: 4px;
}
.points-info-bar .remain-label {
  font-size: 13px;
  color: #7F8C8D;
}
.points-info-bar .remain-num {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary);
  margin-left: 4px;
}
.points-info-bar .remain-unit {
  font-size: 12px;
  color: #95A5A6;
}

/* ========== 生成按钮下方提示文字 ========== */
.gen-hint-text {
  text-align: center;
  margin-top: 12px;
  font-size: 12px;
  color: #95A5A6;
  line-height: 1.6;
}
.gen-hint-text a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}
.gen-hint-text a:hover {
  text-decoration: underline;
}

/* ========== 模式标签页 ========== */
.mode-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  background: #f0f3f5;
  padding: 4px;
  border-radius: 10px;
}
.mode-tab {
  flex: 1;
  text-align: center;
  padding: 10px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: transparent;
  transition: all 0.2s;
}
.mode-tab.active {
  background: #fff;
  color: var(--primary);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* ========== 移动端响应式 ========== */
@media (max-width: 768px) {
  .header-bar .container { padding: 0 16px; }
  .logo { font-size: 18px; }
  .nav-links a { margin-left: 12px; font-size: 13px; }

  .hero { padding: 30px 0 20px; }
  .hero h1 { font-size: 26px; }
  .hero p { font-size: 15px; }

  .grid-3 { grid-template-columns: 1fr; gap: 16px; align-items: stretch; }
  .generate-wrap {
    grid-template-columns: 1fr;
    padding: 16px 0;
    gap: 20px;
    max-width: 100%;
  }
  .gen-right-col { height: auto !important; }

  .card {
    padding: 16px;
  }
  .ad-section { padding: 16px; }

  .form-group { margin-bottom: 14px; }
  .form-group input,
  .form-group select,
  .form-group textarea {
    padding: 10px 12px;
    font-size: 16px;
  }

  .mode-tab { padding: 8px 4px; font-size: 13px; }

  .tag-cloud { gap: 6px; }
  .tag-item { padding: 5px 10px; font-size: 12px; }

  .custom-area textarea { min-height: 100px; }

  #orientation-group > div { gap: 8px !important; }
  #orientation-group label { padding: 8px 4px !important; }
  #orientation-group label div:first-child { font-size: 20px !important; margin-bottom: 2px !important; }
  #orientation-group label div:nth-child(2) { font-size: 12px !important; }
  #orientation-group label div:nth-child(3) { font-size: 10px !important; }

  .download-grid { grid-template-columns: 1fr; gap: 12px; }
  .download-card { padding: 16px; }
  .download-card .icon { font-size: 28px; }

  /* 移动端预览区不撑满，避免过高 */
  .preview-area {
    min-height: 280px;
    flex: 0 0 auto;
  }
  .preview-area img { max-height: 50vh; }

  .batch-area textarea { min-height: 100px; }
  .urgent-card {
    padding: 16px;
  }

  .first-order-banner h4 { font-size: 15px; }
  .first-order-banner p { font-size: 12px; }

  .festival-bar { font-size: 13px; padding: 10px 0; }

  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal-box { 
    max-width: 100%; width: 100%; border-radius: 16px 16px 0 0; 
    padding: 24px 20px 32px; max-height: 90vh; overflow-y: auto;
  }
  .modal-close { top: 8px; right: 12px; }
  .qr-wrap img { width: 160px; height: 160px; }

  .user-layout { flex-direction: column; gap: 20px; padding: 20px 0; }
  .user-sidebar { width: 100%; }

  table.data-table { display: block; overflow-x: auto; white-space: nowrap; }

  .history-strip { gap: 8px; }
  .history-item { width: 80px; }
  .history-item img { width: 80px; height: 110px; }

  /* ========== 移动端登录注册修复 ========== */
  .auth-wrap { padding: 20px 0; }
  .auth-card {
    max-width: 100%;
    width: calc(100% - 32px);
    margin: 0 16px;
    padding: 24px 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    border-radius: var(--radius);
    background: #fff;
  }

  .print-btn { bottom: 16px; right: 16px; padding: 12px 20px; font-size: 14px; }

  /* 移动端广告 */
  .ad-image-grid { grid-template-columns: 1fr; }
  .ad-image-card img { height: 140px; }
  .ad-placeholder-inner { padding: 36px 16px; }

  /* 移动端文字广告改为单列 */
  .ad-text-list { grid-template-columns: 2fr; }

  /* ========== 移动端充值页面修复 ========== */
  .recharge-page {
    padding: 20px 16px;
    max-width: 100%;
  }
  .recharge-page-header h1 {
    font-size: 24px;
  }
  .recharge-page-header p {
    font-size: 14px;
  }
  .recharge-current-points {
    padding: 20px;
    margin-bottom: 24px;
  }
  .recharge-current-points .num {
    font-size: 36px;
  }
  .recharge-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 16px;
  }
  .recharge-card {
    padding: 20px 12px;
  }
  .recharge-card .points {
    font-size: 28px;
  }
  .recharge-card .price {
    font-size: 20px;
  }
  .recharge-card .save {
    font-size: 11px;
    padding: 3px 8px;
  }
  .recharge-card .hot-tag {
    font-size: 10px;
    padding: 3px 8px;
    top: -8px;
    right: 8px;
  }
  .recharge-payment-area {
    padding: 20px;
    margin-top: 24px;
  }
  .payment-methods {
    flex-direction: column;
    gap: 10px;
  }
  .payment-method {
    padding: 12px;
    font-size: 14px;
  }
  .recharge-submit-btn {
    padding: 14px;
    font-size: 16px;
  }
  .recharge-history {
    margin-top: 32px;
  }
  .recharge-history h3 {
    font-size: 18px;
  }

  /* ========== 移动端新组件适配 ========== */
  #grade-group select {
    padding-right: 28px;
    font-size: 14px;
  }
  #grade-group label small {
    display: block;
    margin-left: 0;
    margin-top: 2px;
    font-size: 11px;
  }

  #ref-upload-zone {
    padding: 12px !important;
  }
  #ref-upload-zone div:first-child {
    font-size: 24px !important;
    margin-bottom: 4px !important;
  }
  #ref-upload-zone p {
    font-size: 12px !important;
  }
  #ref-upload-zone p:last-child {
    font-size: 11px !important;
  }
  #ref-preview-wrap {
    margin-top: 8px !important;
  }
  #ref-preview-wrap button {
    width: 28px !important;
    height: 28px !important;
    font-size: 16px !important;
  }

  .points-info-bar {
    padding: 8px 10px;
    margin: 14px 0 8px;
  }
  .points-info-bar .cost-num {
    font-size: 15px;
  }
  .points-info-bar .remain-num {
    font-size: 16px;
  }

  .gen-hint-text {
    font-size: 11px;
    margin-top: 8px;
  }

  .mode-tab {
    padding: 8px 4px;
    font-size: 13px;
  }
}

/* ========== 最新主题栏（生成页右侧） ========== */
.latest-themes-bar {
    background: #fff;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.latest-themes-bar h4 {
    font-size: 14px;
    color: #7F8C8D;
    margin-bottom: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
}
.latest-themes-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}
.latest-theme-item {
    text-align: center;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s;
}
.latest-theme-item:hover {
    transform: translateY(-2px);
}
.latest-theme-item img {
    width: 100%;
    aspect-ratio: 3/4;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 6px;
    background: #f0f3f5;
    display: block;
}
.latest-theme-placeholder {
    width: 100%;
    aspect-ratio: 3/4;
    background: linear-gradient(135deg, #f5f7fa, #c3cfe2);
    border-radius: 8px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}
.latest-theme-item span {
    font-size: 12px;
    color: var(--dark);
    font-weight: 500;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 生成结果出现后，自动隐藏最新主题+广告，避免干扰下载操作 */
.gen-right-col.has-result .latest-themes-bar,
.gen-right-col.has-result .ad-section {
    display: none;
}

/* ========== 移动端适配 ========== */
@media (max-width: 768px) {
    .latest-themes-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .latest-themes-bar {
        padding: 16px;
    }
}