*, *::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 { font-size: 22px; font-weight: 800; background: var(--gradient);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.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); }

/* ── 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; }

/* ── 毛玻璃通用样式 ── */
.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); } }

/* ── 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: #7c3aed; 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: 22px; font-weight: 800; 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-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; }

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

/* ── 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-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.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-img-card { width: 120px; flex-shrink: 0; 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); }
.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-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-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-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; }
.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; }
.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; }

/* 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; }

/* 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; }
