*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --primary: #7c3aed; --primary-hover: #6d28d9;
  --bg: #f8fafc; --card: #ffffff; --text: #1e293b; --muted: #64748b;
  --border: #e2e8f0; --radius: 12px;
  --gradient: linear-gradient(135deg, #7c3aed, #3b82f6);
}
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(180deg, #2d1b69 0%, #4a2079 15%, #6d28d9 30%, #7c3aed 45%, #a78bfa 60%, #ddd6fe 75%, #f5f3ff 88%, #f8fafc 100%);
  background-attachment: fixed;
  color: var(--text); min-height: 100vh; }
a { color: var(--primary); text-decoration: none; }

/* ── Header ── */
header { background: var(--card); border-bottom: 1px solid var(--border);
  padding: 12px 24px; position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; }
.logo { cursor: pointer; display: flex; align-items: center; }
.logo-wrap { position: relative; display: inline-flex; align-items: center; }
.logo-img { height: 32px; display: block; }
.logo-sub { position: absolute; bottom: -2px; right: -2px; font-size: 12px; color: #BBBBBB; font-weight: 600; line-height: 1; white-space: nowrap; }
.header-actions { display: flex; gap: 8px; align-items: center; }

/* ── Buttons ── */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 18px;
  border-radius: var(--radius); font-size: 14px; font-weight: 500;
  border: 1px solid var(--border); cursor: pointer; transition: all .2s;
  background: var(--card); color: var(--text); }
.btn:hover { opacity: .85; }
.btn-primary { background: var(--gradient); color: #fff; border: none; }
.btn-primary:hover { opacity: .9; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-ghost { background: transparent; border: none; color: var(--muted); }
.btn-ghost:hover { background: #f1f5f9; color: var(--text); }

/* 玻璃质感返回按钮 */
.btn-back {
  background: rgba(255,255,255,.18);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.25);
  color: #fff;
  padding: 8px 18px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all .25s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-shadow: 0 1px 2px rgba(0,0,0,.15);
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.btn-back:hover {
  background: rgba(255,255,255,.28);
  border-color: rgba(255,255,255,.4);
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
  transform: translateY(-1px);
}
.btn-back:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

/* ── Main Layout ── */
main { max-width: 1100px; margin: 0 auto; padding: 24px 16px 80px; }

/* ── Hero ── */
.hero { text-align: center; padding: 48px 0 32px; }
.hero h1 { font-size: 42px; font-weight: 800; line-height: 1.2; }
.hero h1 .hero-label { color: #fff; text-shadow: 0 2px 12px rgba(0,0,0,.2); }
.hero h1 span { background: var(--gradient); -webkit-background-clip: text;
  -webkit-text-fill-color: transparent; }
.hero p { color: rgba(255,255,255,.75); margin-top: 8px; font-size: 15px; letter-spacing: 2px; text-shadow: 0 1px 6px rgba(0,0,0,.15); }

/* ── 产品类目按钮 ── */
.category-bar { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 12px; margin-top: 8px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.category-bar::-webkit-scrollbar { display: none; }
.category-btn { display: flex; align-items: center; gap: 5px; padding: 8px 14px; border-radius: 20px;
  border: 1px solid rgba(255,255,255,.35); cursor: pointer; transition: all .25s; flex-shrink: 0;
  background: rgba(255,255,255,.6); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  user-select: none; }
.category-btn:hover { background: rgba(255,255,255,.85); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(124,58,237,.12); }
.category-btn.active { background: linear-gradient(135deg, #7c3aed, #6d28d9); border-color: transparent; box-shadow: 0 4px 14px rgba(124,58,237,.25); }
.category-btn .cat-icon { font-size: 16px; line-height: 1; }
.category-btn .cat-name { font-size: 12px; font-weight: 500; color: var(--text); white-space: nowrap; }
.category-btn.active .cat-name { color: #fff; }
.category-btn .cat-count { font-size: 10px; font-weight: 600; padding: 1px 7px; border-radius: 10px;
  background: rgba(124,58,237,.1); color: var(--primary); min-width: 18px; text-align: center; }
.category-btn.active .cat-count { background: rgba(255,255,255,.2); color: #fff; }

/* ── 公众号排版助手玻璃按钮 ── */
.gzh-btn {
  margin-left: auto;
  padding: 10px 18px;
  background: linear-gradient(135deg, rgba(124,58,237,.85), rgba(109,40,217,.9));
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.25);
  color: #fff;
  border-radius: 10px;
  font-size: 14px; font-weight: 600;
  cursor: pointer; white-space: nowrap;
  box-shadow: 0 2px 12px rgba(124,58,237,.25), inset 0 1px 0 rgba(255,255,255,.15);
  transition: all .25s;
  flex-shrink: 0;
  letter-spacing: .5px;
}
.gzh-btn:hover {
  background: linear-gradient(135deg, rgba(124,58,237,.95), rgba(109,40,217,1));
  box-shadow: 0 4px 20px rgba(124,58,237,.4), inset 0 1px 0 rgba(255,255,255,.2);
  transform: translateY(-1px);
}
.gzh-btn:active { transform: translateY(0); }
@media (max-width: 768px) {
  .gzh-btn { font-size: 13px; padding: 8px 14px; }
}

/* ── 毛玻璃通用样式 ── */
.glass-card { background: rgba(255,255,255,.72); backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px); border: 1px solid rgba(255,255,255,.4);
  box-shadow: 0 4px 24px rgba(0,0,0,.06); }

/* ── Generate Box ── */
.generate-box { background: rgba(255,255,255,.72); backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,.4);
  box-shadow: 0 4px 24px rgba(0,0,0,.06);
  border-radius: 16px; padding: 24px; margin-top: 16px; }
.generate-box textarea { width: 100%; min-height: 100px; padding: 12px;
  border: 1px solid var(--border); border-radius: var(--radius); font-size: 15px;
  resize: vertical; outline: none; font-family: inherit; }
.generate-box textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(124,58,237,.15); }

.generate-actions { display: flex; gap: 12px; align-items: center;
  margin-top: 12px; flex-wrap: wrap; }
.generate-actions .btn { flex: 1; justify-content: center; padding: 12px; font-size: 15px; }
.credit-badge { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 4px; }

/* ── Image Grid ── */
.image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px; margin-top: 20px; }
.image-card { background: rgba(255,255,255,.72); backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.35); overflow: hidden; transition: all .2s; }
.image-card:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0,0,0,.08); }
.image-card img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block;
  background: #f1f5f9; transition: transform .3s ease; }
.image-card:hover img { transform: scale(1.05); }
.image-card .info { padding: 8px 10px; }
.image-card .info p { font-size: 11px; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; line-height: 1.4; }
.image-card .info .time { font-size: 10px; color: #94a3b8; margin-top: 2px; }
.image-card .card-loading-inner { width: 100%; aspect-ratio: 1; border-radius: 0; background: #f1f5f9; display: flex; align-items: center; justify-content: center; }

/* ── Modal ── */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5);
  z-index: 100; align-items: center; justify-content: center; padding: 16px; }
.modal-overlay.active { display: flex; }
.modal { background: rgba(255,255,255,.88); backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,.5);
  border-radius: 20px; padding: 32px;
  width: 100%; max-width: 420px; max-height: 90vh; overflow-y: auto; }
.modal h2 { font-size: 20px; margin-bottom: 20px; }
.modal .close { float: right; background: none; border: none; font-size: 24px;
  cursor: pointer; color: var(--muted); }

/* ── Form ── */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 14px; font-weight: 500;
  margin-bottom: 6px; color: var(--text); }
.form-group input { width: 100%; padding: 10px 14px; border: 1px solid var(--border);
  border-radius: var(--radius); font-size: 15px; outline: none; }
.form-group input:focus { border-color: var(--primary); }
.form-row { display: flex; gap: 8px; }
.form-row input { flex: 1; }
.form-row .btn { white-space: nowrap; }

/* ── SKU Cards ── */
.sku-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px; margin: 16px 0; }
.sku-card { border: 2px solid var(--border); border-radius: var(--radius);
  padding: 16px; text-align: center; cursor: pointer; transition: all .2s; }
.sku-card:hover { border-color: var(--primary); }
.sku-card.selected { border-color: var(--primary); background: #f5f3ff; }
.sku-card .price { font-size: 24px; font-weight: 700; color: var(--primary); }
.sku-card .name { font-size: 14px; color: var(--text); margin-top: 4px; }
.sku-card .credits { font-size: 12px; color: var(--muted); margin-top: 2px; }
.sku-card .badge { display: inline-block; background: var(--gradient); color: #fff;
  font-size: 10px; padding: 2px 8px; border-radius: 20px; margin-top: 6px; }

/* ── Tabs ── */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tab { padding: 10px 20px; cursor: pointer; font-size: 14px; font-weight: 500;
  color: var(--muted); border-bottom: 2px solid transparent; transition: all .2s; }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ── History ── */
.history-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); gap: 12px; }
.history-item { background: rgba(255,255,255,.72); backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.35);
  border-radius: var(--radius); overflow: hidden; }
.history-item img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.history-item .prompt { padding: 8px; font-size: 12px; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ── Showcase Gallery ── */
.showcase-gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.showcase-gallery-card { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--card); cursor: pointer; transition: all .2s; }
.showcase-gallery-card:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0,0,0,.08); }
.showcase-gallery-card img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; background: #f1f5f9; transition: transform .3s; }
.showcase-gallery-card:hover img { transform: scale(1.05); }
.showcase-gallery-card .gallery-card-label { padding: 6px 8px 8px; font-size: 11px; color: var(--muted); }

/* ── Loading ── */
.spinner { display: inline-block; width: 20px; height: 20px;
  border: 2px solid var(--border); border-top-color: var(--primary);
  border-radius: 50%; animation: spin .6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes linkShine { 0% { background-position: 0% center; } 100% { background-position: 200% center; } }

/* ── Recharge Modal ── */
.recharge-modal { padding: 0; overflow: hidden; max-width: 480px; }
.recharge-modal .close { position: absolute; top: 12px; right: 16px; z-index: 2; color: #fff; font-size: 22px; }
.recharge-header { background: linear-gradient(135deg, #7c3aed, #6d28d9, #3b82f6); padding: 28px 24px 32px; text-align: center; color: #fff; }
.recharge-icon { font-size: 32px; margin-bottom: 8px; }
.recharge-title { font-size: 22px; font-weight: 800; }
.recharge-subtitle { font-size: 13px; opacity: .8; margin-top: 4px; }
.recharge-cards { display: flex; gap: 10px; padding: 16px; overflow-x: auto; }
.recharge-card { flex: 1; min-width: 100px; border: 2px solid #e2e8f0; border-radius: 12px; padding: 14px 10px; text-align: center; cursor: pointer; transition: all .2s; position: relative; background: #fff; }
.recharge-card:hover { border-color: #7c3aed; }
.recharge-card.selected { border-color: #7c3aed; background: #f5f3ff; }
.recharge-card.card-best { border-color: #e2e8f0; background: #faf5ff; }
.recharge-card .card-icon { font-size: 22px; margin-bottom: 4px; }
.recharge-card .card-name { font-size: 13px; font-weight: 600; color: #1e293b; }
.recharge-card .card-credits { font-size: 17px; font-weight: 700; color: #7c3aed; margin: 4px 0 2px; }
.recharge-card .card-price { font-size: 18px; font-weight: 800; color: #ef4444; }
.recharge-card .card-unit { font-size: 10px; color: #94a3b8; margin-top: 2px; }
/* 公众号订阅卡片微调 */
.recharge-card .card-credits.gzh { font-size: 16px; font-weight: 700; display: flex; align-items: baseline; justify-content: center; gap: 2px; }
.recharge-card .card-credits.gzh .num { font-size: 16px; font-weight: 700; }
.recharge-card .card-credits.gzh .unit { font-size: 11px; font-weight: 400; color: #94a3b8; }
.recharge-card .card-price .price-sub { font-size: 11px; font-weight: 400; color: #94a3b8; }
.recharge-card .card-price.gzh-price { font-size: 16px; font-weight: 700; white-space: nowrap; }
.recharge-badge { position: absolute; top: -1px; left: -1px; font-size: 10px; font-weight: 700; padding: 2px 10px; border-radius: 12px 0 12px 0; z-index: 1; }
.recharge-badge.badge-best { background: linear-gradient(135deg, #7c3aed, #6d28d9); color: #fff; }
.recharge-badge.badge-normal { background: #f1f5f9; color: #64748b; }
.recharge-redeem { padding: 0 16px 16px; }
.redeem-header { font-size: 13px; font-weight: 600; color: #1e293b; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.redeem-row { display: flex; gap: 8px; }
.redeem-row input { flex: 1; padding: 10px 14px; border: 1px solid #e2e8f0; border-radius: 10px; font-size: 14px; outline: none; text-align: center; letter-spacing: 4px; }
.redeem-row input:focus { border-color: #7c3aed; box-shadow: 0 0 0 3px rgba(124,58,237,.1); }
.redeem-btn { background: linear-gradient(135deg, #7c3aed, #6d28d9); color: #fff; border: none; padding: 10px 20px; border-radius: 10px; font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; }
.redeem-btn:hover { opacity: .9; }
.recharge-footer { padding: 12px 16px; font-size: 11px; color: #94a3b8; text-align: center; border-top: 1px solid #f1f5f9; }

/* ── Toast ── */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: #1e293b; color: #fff; padding: 12px 24px; border-radius: var(--radius);
  font-size: 14px; z-index: 200; opacity: 0; transition: all .3s; pointer-events: none; }
.toast.show { opacity: 1; }

/* ── 浮动邀请按钮 ── */
.floating-invite { position: fixed; bottom: 20px; left: 20px; z-index: 100;
  background: linear-gradient(135deg, #7c3aed, #6d28d9); color: #fff;
  border-radius: 16px; padding: 10px 14px; cursor: pointer;
  box-shadow: 0 4px 20px rgba(124,58,237,.35);
  display: flex; align-items: center; gap: 8px;
  transition: all .2s; animation: inviteBounce 2s ease-in-out infinite; }
.floating-invite:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(124,58,237,.45); }
.floating-invite-icon { font-size: 24px; }
.floating-invite-text { font-size: 11px; line-height: 1.4; font-weight: 500; }
@keyframes inviteBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* ── Footer ── */
.site-footer {
  background: #fff;
  border-top: 1px solid #f1f5f9;
  padding: 24px 20px 28px;
  text-align: center;
  margin-top: 40px;
}
.footer-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 4px;
  line-height: 2;
}
/* Friendly links */
.friendly-links-row { display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
  gap: 10px; margin-bottom: 12px; padding-bottom: 10px;
  border-bottom: 1px dashed #e2e8f0; }
.friendly-links-label { font-size: 13px; font-weight: 600; color: #64748b; }
#friendlyLinksList { display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: center; }
#friendlyLinksList a { font-size: 13px; color: #64748b; }
#friendlyLinksList .link-sep { color: #cbd5e1; font-size: 11px; margin: 0 2px; }
.friendly-link-apply { font-size: 11px !important; color: var(--primary) !important;
  border: 1px dashed var(--primary); border-radius: 10px; padding: 2px 10px;
  text-decoration: none !important; }
.footer-links {
  margin-bottom: 8px;
}
.footer-links a {
  color: #1e293b;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: color .2s;
}
.footer-links a:hover {
  color: var(--primary);
}
.footer-legal a,
.footer-legal span {
  color: #94a3b8;
  font-size: 12px;
  text-decoration: none;
  transition: color .2s;
}
.footer-legal a:hover {
  color: var(--primary);
}
.footer-sep {
  color: #cbd5e1;
  font-size: 12px;
  margin: 0 4px;
  user-select: none;
}

@media (max-width: 640px) {
  .site-footer {
    padding: 18px 12px 22px;
  }
  .footer-links { gap: 2px; }
  .footer-links a { font-size: 13px; }
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .hero h1 { font-size: 28px; }
  .sku-grid { grid-template-columns: repeat(2, 1fr); }
  header { padding: 10px 12px; }
  .showcase-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
}

/* ── Ratio Selector ── */
.ratio-selector { display: flex; gap: 6px; flex-wrap: wrap; margin: 16px 0; }
.ratio-btn { display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px;
  cursor: pointer; transition: all .2s; background: var(--card); min-width: 60px; }
.ratio-btn:hover { border-color: var(--primary); }
.ratio-btn.active { border-color: var(--primary); background: #f5f3ff; }
.ratio-btn svg { width: 24px; height: 24px; stroke: currentColor; fill: none; }
.ratio-btn span { font-size: 11px; color: var(--muted); white-space: nowrap; }
.ratio-btn.active span { color: var(--primary); font-weight: 600; }

/* ── Reference Upload ── */
.ref-upload { display: flex; align-items: center; gap: 12px; margin: 12px 0;
  padding: 12px; border: 1px dashed var(--border); border-radius: var(--radius);
  cursor: pointer; transition: all .2s; }
.ref-upload:hover { border-color: var(--primary); background: #faf5ff; }
.ref-upload .icon { width: 36px; height: 36px; border-radius: 8px;
  background: #f5f3ff; display: flex; align-items: center; justify-content: center;
  color: var(--primary); font-size: 18px; }
.ref-upload .text { font-size: 13px; color: var(--muted); }
.ref-upload .text strong { color: var(--primary); }
.ref-thumbs { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.ref-thumb { width: 56px; height: 56px; border-radius: 8px; overflow: hidden;
  position: relative; border: 1px solid var(--border); }
.ref-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ref-thumb .del { position: absolute; top: -4px; right: -4px; width: 18px; height: 18px;
  border-radius: 50%; background: #ef4444; color: #fff; font-size: 10px;
  display: flex; align-items: center; justify-content: center; cursor: pointer; }

/* ── Showcase ── */
.showcase { margin-top: 32px; padding: 20px 20px 16px; border-radius: 16px;
  background: rgba(255,255,255,.72); backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,.4);
  box-shadow: 0 4px 24px rgba(0,0,0,.06);
  min-height: 180px; }
.showcase h2 { font-size: 18px; font-weight: 700; margin-bottom: 14px; }
.showcase-item { display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 18px; border-radius: 24px; border: 1px solid var(--border);
  background: var(--card); color: var(--text); font-size: 13px;
  cursor: pointer; transition: all .2s; user-select: none; }
.showcase-item:hover { border-color: var(--primary); color: var(--primary);
  background: #f5f3ff; }
.showcase-item .index { display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%; background: var(--gradient);
  color: #fff; font-size: 11px; font-weight: 700; flex-shrink: 0; }
.showcase-item .count { font-size: 11px; color: var(--muted); white-space: nowrap; }

/* ── Showcase 图片卡片 ── */
.showcase-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.showcase-img-card { border-radius: 10px; overflow: hidden; border: 1px solid var(--border); background: var(--card); cursor: pointer; transition: all .2s; }
.showcase-img-card:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0,0,0,.08); }

/* ── 排版文章展示 ── */
.article-showcase { margin-top: 24px; padding: 20px 20px 16px; border-radius: 20px;
  background: rgba(245, 243, 255, 0.5); backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(167, 139, 250, 0.25);
  box-shadow: 0 4px 28px rgba(124, 58, 237, 0.07); }
.article-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
@media (max-width: 600px) { .article-card-grid { grid-template-columns: 1fr; } }
.article-card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 16px; cursor: pointer; transition: all .2s; display: flex; flex-direction: column; gap: 8px; }
.article-card:hover { border-color: var(--primary); box-shadow: 0 4px 16px rgba(124,58,237,.12); transform: translateY(-2px); }
.article-card .art-title { font-size: 15px; font-weight: 600; color: var(--text); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.article-card .art-author { font-size: 12px; color: var(--primary); }
.article-card .art-preview { font-size: 12px; color: var(--muted); line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.article-card .art-time { font-size: 11px; color: #94a3b8; }
.article-empty { grid-column: 1/-1; text-align: center; padding: 24px; color: var(--muted); font-size: 14px; }
.showcase-img-card img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; background: #f1f5f9; }
.showcase-img-card .showcase-img-label { padding: 5px 8px; font-size: 10px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.showcase-img-card .card-img-wrap { position: relative; overflow: hidden; }
.showcase-gallery-card .card-img-wrap { position: relative; overflow: hidden; }
.showcase-img-card .card-img-wrap img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; background: #f1f5f9; }
.card-tip { position: absolute; bottom: 0; left: 0; right: 0; background: rgba(0,0,0,.7); color: #fff; font-size: 9px; padding: 4px 6px; display: flex; flex-wrap: wrap; gap: 2px 6px; opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 2; line-height: 1.3; }
.card-tip span { white-space: nowrap; }
.card-img-wrap > .card-dl-btn { position: absolute; bottom: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; border: none; background: rgba(124,58,237,.85); color: #fff; font-size: 12px; cursor: pointer; display: flex; align-items: center; justify-content: center; z-index: 3; opacity: 0; transition: opacity .2s; line-height: 1; }
.card-img-wrap:hover .card-dl-btn { opacity: 1; }
.card-member-badge { position: absolute; top: 6px; left: 6px; z-index: 3;
  background: rgba(0,0,0,.55); color: rgba(255,255,255,.92); font-size: 10px;
  padding: 3px 8px; border-radius: 10px; text-decoration: none;
  white-space: nowrap; transition: background .2s; line-height: 1.4; }
.card-member-badge:hover { background: rgba(124,58,237,.85); color: #fff; }
.card-img-wrap:hover .card-tip { opacity: 1; }

/* ── 风格选择面板 ── */
.style-panel { margin-top: 14px; }
.style-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 10px; }
.style-tab { padding: 6px 14px; font-size: 12px; font-weight: 500; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; transition: all .2s; user-select: none; }
.style-tab:hover { color: var(--text); }
.style-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.style-grid { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.style-grid::-webkit-scrollbar { display: none; }
.style-card { flex-shrink: 0; width: 72px; cursor: pointer; border-radius: 10px; overflow: hidden; border: 2px solid transparent; transition: all .2s; background: var(--card); }
.style-card:hover { border-color: var(--primary); }
.style-card.active { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(124,58,237,.2); }
.style-card .style-img { width: 100%; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background-size: cover; background-position: center; }
.style-card .style-label { padding: 3px 0 2px; font-size: 10px; color: var(--text); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Showcase Tabs ── */
.showcase-tabs { display: flex; align-items: center; gap: 0; margin-bottom: 14px; border-bottom: 1px solid var(--border); padding-bottom: 0; }
.showcase-tab { padding: 8px 16px; font-size: 14px; font-weight: 600; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; transition: all .2s; user-select: none; }
.showcase-tab:hover { color: var(--text); }
.showcase-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

@media (max-width: 640px) {
  .showcase-grid { gap: 8px; }
  .showcase-item { padding: 8px 14px; font-size: 12px; }
}

/* ── History Page ── */
.history-page { display: none; }
.history-page.active { display: block; }
.history-header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.history-header h2 { font-size: 20px; font-weight: 700; color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,.25); }
.history-header .btn { margin-left: auto; }

/* ── User Dropdown ── */
.user-dropdown-wrap { position: relative; }
.user-dropdown { display: none; position: absolute; top: 38px; right: 0; z-index: 100;
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  min-width: 200px; box-shadow: 0 8px 30px rgba(0,0,0,.12); overflow: hidden; }
.user-dropdown.show { display: block; }
.user-dropdown .dropdown-header { padding: 12px 14px; border-bottom: 1px solid var(--border);
  font-size: 13px; color: var(--muted); }
.user-dropdown .dropdown-header .phone { color: var(--primary); font-weight: 600; }
.user-dropdown .dropdown-item { padding: 10px 14px; font-size: 13px; cursor: pointer;
  transition: background .15s; }
.user-dropdown .dropdown-item:hover { background: #f8fafc; }
.user-dropdown .dropdown-item.danger { color: #ef4444; border-top: 1px solid var(--border); }
.user-dropdown .dropdown-item.danger:hover { background: #fef2f2; }

/* ── Profile Page ── */
.profile-page { display: none; max-width: 800px; margin: 0 auto; padding: 24px 16px 80px; }
.profile-page.active { display: block; }
.profile-header { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.profile-header h2 { font-size: 20px; font-weight: 700; color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,.25); }

/* User Card */
.profile-card { background: rgba(255,255,255,.72); backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 16px; overflow: hidden; margin-bottom: 20px; }
.profile-card .card-main { display: flex; justify-content: space-between; align-items: center;
  padding: 20px; }
.profile-card .user-info { flex: 1; }
.profile-card .user-phone { font-size: 18px; font-weight: 700; color: var(--primary); }
.profile-card .user-meta { font-size: 12px; color: var(--muted); margin-top: 4px; }
.profile-card .user-badge { display: inline-block; margin-top: 6px; padding: 2px 10px;
  border-radius: 20px; background: #ede9fe; color: var(--primary); font-size: 11px; }
.profile-card .user-credits { text-align: center; padding-left: 16px; }
.profile-card .credits-num { font-size: 36px; font-weight: 800; color: var(--primary); line-height: 1; }
.profile-card .credits-label { font-size: 11px; color: var(--muted); margin-top: 4px; }
.profile-card .card-invite { padding: 12px 20px; border-top: 1px solid var(--border);
  background: #f8fafc; }
.profile-card .card-invite span { font-size: 12px; color: var(--muted); display: block; margin-bottom: 6px; }
.profile-card .invite-row { display: flex; gap: 8px; }
.profile-card .invite-row input { flex: 1; padding: 6px 10px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 12px; background: #fff; color: var(--text); outline: none; }

/* Status Cards */
.status-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.status-card { display: flex; align-items: center; gap: 12px; background: var(--card);
  border: 1px solid var(--border); border-radius: 12px; padding: 14px 18px; }
.status-card .status-icon { font-size: 28px; flex-shrink: 0; }
.status-card .status-info { flex: 1; min-width: 0; }
.status-card .status-title { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.status-card .status-detail { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.5; }

/* Profile Tabs */
.profile-tabs { display: flex; gap: 0; background: var(--card); border-radius: 12px;
  overflow-x: auto; border: 1px solid var(--border); margin-bottom: 16px; }
.profile-tab { padding: 12px 16px; font-size: 13px; font-weight: 500; cursor: pointer;
  border: none; background: transparent; color: var(--muted); white-space: nowrap;
  border-bottom: 2px solid transparent; transition: all .2s; }
.profile-tab:hover { color: var(--text); background: #f8fafc; }
.profile-tab.active { color: var(--primary); border-bottom-color: var(--primary); background: #faf5ff; }

.profile-tab-content { display: none; }
.profile-tab-content.active { display: block; }
.profile-tab-content h3 { font-size: 15px; font-weight: 600; margin-bottom: 14px; }

/* SKU Cards in Profile */
.sku-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.sku-card { border: 1px solid var(--border); border-radius: 12px; padding: 16px;
  text-align: center; background: var(--card);
  display: flex; flex-direction: column; }
.sku-card .sku-name { font-size: 15px; font-weight: 600; color: var(--text); }
.sku-card .sku-credits { font-size: 12px; color: var(--muted); margin-top: 4px; }
.sku-card .sku-price { font-size: 26px; font-weight: 800; color: var(--primary); margin: 10px 0; }
.sku-card .sku-price small { font-size: 14px; font-weight: 400; }
.sku-card .btn { width: 100%; justify-content: center; margin-top: auto; }

/* Orders */
.order-item { display: flex; justify-content: space-between; align-items: center;
  padding: 12px; border: 1px solid var(--border); border-radius: 10px;
  margin-bottom: 8px; background: var(--card); }
.order-item .order-info { font-size: 13px; }
.order-item .order-amount { font-weight: 700; color: var(--primary); }
.order-item .order-status { font-size: 11px; padding: 2px 8px; border-radius: 10px; }
.order-status.paid { background: #dcfce7; color: #166534; }
.order-status.pending { background: #fef9c3; color: #854d0e; }
.order-item .order-time { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* Usage Records */
.usage-record { display: flex; gap: 12px; padding: 12px; border: 1px solid var(--border);
  border-radius: 10px; margin-bottom: 8px; background: var(--card); align-items: flex-start; }
.usage-record .usage-img { width: 80px; height: 80px; border-radius: 8px; object-fit: cover;
  flex-shrink: 0; background: #f1f5f9; }
.usage-record .usage-info { flex: 1; min-width: 0; }
.usage-record .usage-prompt { font-size: 13px; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.usage-record .usage-meta { font-size: 11px; color: var(--muted); margin-top: 4px; }
.usage-record .usage-status { font-size: 11px; padding: 2px 8px; border-radius: 10px;
  flex-shrink: 0; align-self: center; }
.usage-status.success { background: #dcfce7; color: #166534; }
.usage-status.failed { background: #fee2e2; color: #991b1b; }
.usage-status.free { background: #e0f2fe; color: #075985; }

/* Profile Image Grid */
.profile-image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px,1fr)); gap: 10px; }
.profile-image-item { border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
  background: var(--card); }
.profile-image-item img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block;
  background: #f1f5f9; }
.profile-image-item .img-prompt { padding: 6px 8px; font-size: 11px; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.profile-image-item .img-time { padding: 0 8px 6px; font-size: 10px; color: #94a3b8; }

/* Invite Stats */
.invite-stats-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  margin-bottom: 16px; }
.invite-stat-card { background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 16px; text-align: center; }
.invite-stat-card .stat-num { font-size: 24px; font-weight: 800; }
.invite-stat-card .stat-label { font-size: 11px; color: var(--muted); margin-top: 4px; }
.invite-stat-card.purple .stat-num { color: var(--primary); }
.invite-stat-card.green .stat-num { color: #059669; }
.invite-stat-card.blue .stat-num { color: #3b82f6; }

/* Trend Chart */
.trend-chart-wrap { background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 16px; margin-bottom: 16px; }
.trend-chart-wrap h4 { font-size: 13px; font-weight: 600; margin-bottom: 12px; }
.trend-chart { width: 100%; height: 140px; position: relative; }
.invite-record-item .invite-time { font-size: 11px; color: var(--muted); }
.invite-record-item .invite-reward { color: var(--primary); font-weight: 600; }
.invite-records-list { margin-top: 12px; }
.invite-record-item { display: flex; justify-content: space-between; align-items: center;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px;
  margin-bottom: 6px; font-size: 13px; background: var(--card); }
.invite-record-item .invite-time { font-size: 11px; color: var(--muted); }
.invite-record-item .invite-reward { color: var(--primary); font-weight: 600; }

/* ── WeChat Pay Modal ── */
.pay-modal { max-width: 360px; text-align: center; }
.pay-qrcode-wrap { background: #fff; border: 2px solid var(--border); border-radius: 12px; padding: 12px; margin: 16px 0; display: inline-block; }
.pay-qrcode-wrap img { display: block; }
.pay-amount { font-size: 28px; font-weight: 700; color: var(--primary); margin: 8px 0; }
.pay-hint { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.pay-status { font-size: 14px; font-weight: 600; }

/* ── 我的收藏 ── */
.fav-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.fav-card.fav-user { display: flex; align-items: center; gap: 8px; padding: 10px 16px; background: var(--card); border-radius: 10px; text-decoration: none; color: var(--text); font-weight: 500; transition: all .2s; border: 1px solid var(--border); }
.fav-card.fav-user:hover { border-color: var(--primary); box-shadow: 0 2px 8px rgba(124,58,237,.15); }
.fav-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; flex-shrink: 0; }
.fav-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fav-img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.fav-img-card { position: relative; border-radius: 10px; overflow: hidden; aspect-ratio: 1; }
.fav-img-card img { width: 100%; height: 100%; object-fit: cover; }
.fav-img-author { position: absolute; bottom: 0; left:0;right:0; background: rgba(0,0,0,.5); color: #fff; font-size: 11px; padding: 4px 8px; }
.fav-art-list { display: flex; flex-direction: column; gap: 8px; }
.fav-art-card { display: block; padding: 12px 16px; background: var(--card); border-radius: 10px; text-decoration: none; color: var(--text); border: 1px solid var(--border); transition: all .2s; }
.fav-art-card:hover { border-color: var(--primary); box-shadow: 0 2px 8px rgba(124,58,237,.15); }
.fav-art-card h4 { margin: 0 0 4px; font-size: 15px; }
.fav-art-preview { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-bottom: 4px; }
.fav-art-author { font-size: 11px; color: var(--muted); }

/* ── 图片灯箱 ── */
.lightbox-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.92); z-index: 10000; align-items: center; justify-content: center; cursor: zoom-out; }
.lightbox-overlay.show { display: flex; }
.lightbox-close { position: absolute; top: 16px; right: 16px; z-index: 1; background: rgba(255,255,255,.15); border: none; color: #fff; width: 40px; height: 40px; border-radius: 50%; font-size: 20px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background .2s; }
.lightbox-close:hover { background: rgba(255,255,255,.3); }
.lightbox-img { max-width: 90vw; max-height: 85vh; object-fit: contain; border-radius: 8px; cursor: default; }
.lightbox-caption { position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%); color: rgba(255,255,255,.7); font-size: 13px; max-width: 80vw; text-align: center; word-break: break-all; }

/* 图片卡片上的放大镜 */
.img-zoom-btn { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 36px; height: 36px; border-radius: 50%; background: rgba(0,0,0,.5); backdrop-filter: blur(4px); border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 16px; opacity: 0.7; transition: opacity .2s, background .2s; z-index: 1; }
.img-zoom-btn:hover { background: rgba(0,0,0,.75); opacity: 1; }
.showcase-img-card:hover .img-zoom-btn,
.showcase-gallery-card:hover .img-zoom-btn,
.user-img-card:hover .img-zoom-btn,
.profile-image-item:hover .img-zoom-btn { opacity: 1; }
/* 移动端始终显示 */
@media (max-width: 768px) {
  .img-zoom-btn { opacity: 0.85; background: rgba(255,255,255,.25); backdrop-filter: blur(6px); }
}

/* 首页卡片爱心点赞 + 底部操作栏 */
.card-heart-btn { position: absolute; top: 6px; right: 6px; z-index: 3; width: 28px; height: 28px; border-radius: 50%; background: rgba(0,0,0,.35); backdrop-filter: blur(4px); border: none; cursor: pointer; font-size: 14px; display: flex; align-items: center; justify-content: center; padding: 0; transition: all .2s; }
.card-heart-btn:hover { background: rgba(0,0,0,.55); transform: scale(1.15); }
.card-heart-btn.liked { background: rgba(255,75,105,.35); }
.card-bottom-bar { position: absolute; bottom: 6px; right: 6px; display: flex; gap: 4px; z-index: 3; }
.card-bkm-btn, .card-dl-btn { width: 26px; height: 26px; border-radius: 6px; background: rgba(0,0,0,.35); backdrop-filter: blur(4px); border: none; cursor: pointer; font-size: 13px; display: flex; align-items: center; justify-content: center; padding: 0; text-decoration: none; color: #fff; transition: all .2s; }
.card-bkm-btn:hover, .card-dl-btn:hover { background: rgba(0,0,0,.55); transform: scale(1.15); }
.card-bkm-btn.liked { background: rgba(251,191,36,.35); }
@media (max-width: 768px) {
  .card-heart-btn, .card-bottom-bar { opacity: 1; }
  /* 移动端：收藏按钮移到卡片中间靠右，下载按钮留在底部 */
  .card-bottom-bar {
    flex-direction: column;
    align-items: center;
    top: 6px;
    bottom: 6px;
    right: 6px;
    gap: 0;
    justify-content: center;
  }
  .card-bottom-bar .card-dl-btn {
    position: absolute !important;
    bottom: 0;
    right: 0;
  }
}

