/* ==========================================================================
   AI 图片创作系统 · UI V3 设计系统
   风格：深色科技风 + 毛玻璃 + 霓虹渐变
   ========================================================================== */

/* 1. 设计令牌 */
:root {
    /* 主色板 - 深色科技 */
    --bg-deep: #0b0d15;
    --bg: #0f1117;
    --bg-soft: #161822;
    --bg-mute: #1c1f2e;
    --surface: rgba(22, 24, 34, 0.7);
    --surface-glass: rgba(22, 24, 34, 0.65);
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.14);
    --border-glow: rgba(139, 92, 246, 0.4);

    --text: #e8e8f0;
    --text-2: #a0a0b8;
    --text-3: #6b6b80;
    --text-4: #4a4a5c;

    --primary: #8b5cf6;
    --primary-soft: rgba(139, 92, 246, 0.15);
    --primary-glow: rgba(139, 92, 246, 0.5);
    --primary-hover: #a78bfa;
    --primary-fg: #fff;

    --accent: #06b6d4;
    --accent-glow: rgba(6, 182, 212, 0.4);
    --pink: #ec4899;
    --pink-glow: rgba(236, 72, 153, 0.4);
    --orange: #f59e0b;
    --green: #10b981;
    --red: #ef4444;

    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.1);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.1);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.1);
    --info: #3b82f6;
    --info-bg: rgba(59, 130, 246, 0.1);

    --r-xs: 4px; --r-sm: 6px; --r-md: 8px; --r-lg: 12px; --r-xl: 16px; --r-2xl: 20px;
    --r-full: 9999px;
    --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px;
    --s-8: 32px; --s-10: 40px; --s-12: 48px; --s-16: 64px;
    --fs-xs: 12px; --fs-sm: 13px; --fs-md: 14px; --fs-lg: 15px; --fs-xl: 16px;
    --fs-2xl: 18px; --fs-3xl: 22px; --fs-4xl: 28px; --fs-5xl: 36px;
    --fw-n: 400; --fw-m: 500; --fw-s: 600; --fw-b: 700;
    --lh-tight: 1.25; --lh-snug: 1.4; --lh-base: 1.6; --lh-loose: 1.8;
    --nav-w: 240px; --nav-w-mini: 64px; --topbar-h: 56px; --content-max: 1280px;
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.2);
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-md: 0 6px 20px rgba(0,0,0,0.4), 0 0 40px rgba(139, 92, 246, 0.08);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.5), 0 0 60px rgba(139, 92, 246, 0.12);
    --shadow-neon: 0 0 20px rgba(139, 92, 246, 0.4), 0 0 40px rgba(139, 92, 246, 0.2), 0 0 80px rgba(139, 92, 246, 0.1);
    --tr-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --tr-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --tr-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

/* 亮色模式 */
[data-theme="light"] {
    --bg-deep: #f8f9fc;
    --bg: #ffffff;
    --bg-soft: #f3f4f8;
    --bg-mute: #e8eaf0;
    --surface: rgba(255, 255, 255, 0.85);
    --surface-glass: rgba(255, 255, 255, 0.75);
    --border: rgba(0, 0, 0, 0.06);
    --border-strong: rgba(0, 0, 0, 0.12);
    --border-glow: rgba(139, 92, 246, 0.3);
    --text: #1a1a2e;
    --text-2: #4a4a5c;
    --text-3: #7a7a8e;
    --text-4: #a0a0b0;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-md: 0 6px 20px rgba(0,0,0,0.08), 0 0 40px rgba(139, 92, 246, 0.05);
    --shadow-neon: 0 0 20px rgba(139, 92, 246, 0.25), 0 0 40px rgba(139, 92, 246, 0.1);
}

/* 2. 基础重置 */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    font-family: var(--font-sans); font-size: var(--fs-md); line-height: var(--lh-base);
    color: var(--text); background: var(--bg-deep);
    -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; transition: color var(--tr-fast); }
a:hover { color: var(--primary); }
img, svg, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; border: 0; background: transparent; outline: none; }
button { cursor: pointer; }
ul, ol { list-style: none; }
table { border-collapse: collapse; }
::selection { background: var(--primary-soft); color: var(--primary); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: var(--r-full); }
::-webkit-scrollbar-thumb:hover { background: var(--text-4); }

/* ==========================================================================
   3. 全局顶栏
   ========================================================================== */
.topbar {
    position: fixed; top: 0; left: 0; right: 0; height: var(--topbar-h);
    background: rgba(11, 13, 21, 0.85);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 24px; z-index: 100;
}
[data-theme="light"] .topbar {
    background: rgba(255, 255, 255, 0.8);
}
.topbar-brand { display: flex; align-items: center; gap: 12px; }
.topbar-logo {
    width: 34px; height: 34px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: var(--r-md);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 0 16px rgba(139, 92, 246, 0.35);
}
.topbar-logo svg { width: 20px; height: 20px; fill: #fff; }
.topbar-title {
    font-size: var(--fs-lg); font-weight: var(--fw-s); color: var(--text);
    white-space: nowrap;
}
.topbar-title small { font-size: 11px; color: var(--text-3); font-weight: var(--fw-n); display: block; margin-top: -1px; }

.topbar-actions { display: flex; align-items: center; gap: 4px; }
.topbar-btn {
    width: 36px; height: 36px; border-radius: var(--r-md);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-2); transition: all var(--tr-fast); position: relative;
    background: transparent; border: none;
}
.topbar-btn:hover { background: var(--bg-mute); color: var(--text); }
.topbar-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.topbar-btn .dot {
    position: absolute; top: 7px; right: 7px; width: 7px; height: 7px;
    background: var(--danger); border-radius: 50%; border: 2px solid var(--bg-deep);
}

.topbar-user { position: relative; }
.topbar-user-trigger {
    display: flex; align-items: center; gap: 8px; padding: 4px 8px 4px 4px;
    border-radius: var(--r-md); color: var(--text); transition: background var(--tr-fast);
    background: transparent; border: none;
}
.topbar-user-trigger:hover { background: var(--bg-mute); }
.topbar-avatar {
    width: 30px; height: 30px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--pink));
    display: flex; align-items: center; justify-content: center;
    font-weight: var(--fw-s); font-size: var(--fs-sm); color: #fff;
    position: relative;
}
.topbar-avatar .vip-badge {
    position: absolute; bottom: -2px; right: -2px; width: 14px; height: 14px;
    background: linear-gradient(135deg, #f59e0b, #f97316);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 8px; border: 2px solid var(--bg-deep);
}
[data-theme="light"] .topbar-avatar .vip-badge { border-color: var(--bg); }
.topbar-user-name { font-size: var(--fs-sm); font-weight: var(--fw-m); }
.topbar-user-arrow { width: 10px; height: 10px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; color: var(--text-3); }

.user-dropdown {
    position: absolute; top: calc(100% + 8px); right: 0;
    min-width: 200px; background: var(--bg-soft); border: 1px solid var(--border-strong);
    border-radius: var(--r-lg); box-shadow: var(--shadow-lg); padding: 6px; z-index: 200;
    opacity: 0; visibility: hidden; transform: translateY(-6px);
    transition: all var(--tr-base);
}
.topbar-user.is-open .user-dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.user-drop-item {
    display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: var(--r-sm);
    color: var(--text-2); font-size: var(--fs-sm); transition: all var(--tr-fast);
}
.user-drop-item:hover { background: var(--bg-mute); color: var(--text); }
.user-drop-item svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.user-drop-divider { height: 1px; background: var(--border); margin: 4px 0; }
.user-drop-balance { color: var(--primary); font-weight: var(--fw-s); }

/* ==========================================================================
   4. 左侧导航栏 (毛玻璃)
   ========================================================================== */
.sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; width: var(--nav-w);
    background: rgba(11, 13, 21, 0.7);
    backdrop-filter: blur(24px) saturate(1.4); -webkit-backdrop-filter: blur(24px) saturate(1.4);
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column; z-index: 90;
    padding-top: var(--topbar-h);
    transition: width var(--tr-base);
}
[data-theme="light"] .sidebar {
    background: rgba(248, 249, 252, 0.8);
}
.sidebar.collapsed { width: var(--nav-w-mini); }
.sidebar.collapsed .sidebar-name,
.sidebar.collapsed .sidebar-label,
.sidebar.collapsed .sidebar-arrow,
.sidebar.collapsed .sidebar-submenu,
.sidebar.collapsed .sidebar-section-text,
.sidebar.collapsed .sidebar-footer-text,
.sidebar.collapsed .sidebar-actions-text,
.sidebar.collapsed .sidebar-divider-text { display: none; }
.sidebar.collapsed .sidebar-item { justify-content: center; padding: 10px 0; }
.sidebar.collapsed .sidebar-brand { justify-content: center; padding: 16px 0; }
.sidebar.collapsed .sidebar-foot-item { justify-content: center; }

.sidebar-brand {
    display: flex; align-items: center; gap: 10px; padding: 16px 20px;
    border-bottom: 1px solid var(--border); flex-shrink: 0;
    transition: padding var(--tr-base);
}
.sidebar-logo {
    width: 34px; height: 34px; flex-shrink: 0;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: var(--r-md);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 0 12px rgba(139, 92, 246, 0.3);
}
.sidebar-logo svg { width: 18px; height: 18px; fill: #fff; }
.sidebar-name { font-size: var(--fs-lg); font-weight: var(--fw-s); color: var(--text); white-space: nowrap; }
.sidebar-name small { display: block; font-size: 11px; color: var(--text-3); font-weight: var(--fw-n); margin-top: 1px; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 8px 10px; }
.sidebar-nav-group { margin-bottom: 4px; }
.sidebar-section {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 10px 4px; cursor: pointer; user-select: none;
}
.sidebar-section-text {
    font-size: 10px; color: var(--text-4); text-transform: uppercase;
    letter-spacing: 0.06em; font-weight: var(--fw-s);
}
.sidebar-arrow {
    width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
    color: var(--text-4); transition: transform var(--tr-base);
}
.sidebar-nav-group.is-open .sidebar-arrow { transform: rotate(90deg); }

.sidebar-item {
    display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--r-md);
    color: var(--text-2); font-size: var(--fs-md); font-weight: var(--fw-m);
    transition: all var(--tr-fast); position: relative; border: none; background: transparent;
    width: 100%; text-align: left;
}
.sidebar-item::before {
    content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
    width: 3px; height: 0; background: var(--primary); border-radius: 0 2px 2px 0;
    transition: height var(--tr-fast);
}
.sidebar-item:hover { background: var(--bg-mute); color: var(--text); }
.sidebar-item.active { background: var(--primary-soft); color: var(--primary); }
.sidebar-item.active::before { height: 20px; }
.sidebar-item svg { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sidebar-label { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-item .emoji { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }

.sidebar-submenu {
    max-height: 0; overflow: hidden; transition: max-height var(--tr-base);
    margin: 0 0 2px 20px; border-left: 1px solid var(--border); padding-left: 6px;
}
.sidebar-nav-group.is-open .sidebar-submenu { max-height: 200px; }
.sidebar-sub-item {
    display: block; padding: 7px 10px; border-radius: var(--r-sm);
    color: var(--text-3); font-size: var(--fs-sm); margin: 2px 0; transition: all var(--tr-fast);
    background: transparent; border: none; width: 100%; text-align: left; cursor: pointer;
}
.sidebar-sub-item:hover { color: var(--text); background: var(--bg-mute); }
.sidebar-sub-item.active { color: var(--primary); background: var(--primary-soft); font-weight: var(--fw-m); }

.sidebar-divider {
    height: 1px; background: var(--border); margin: 8px 10px;
}
.sidebar-divider-text {
    font-size: 10px; color: var(--text-4); padding: 6px 10px; text-transform: uppercase;
    letter-spacing: 0.06em; font-weight: var(--fw-s);
}

.sidebar-actions { padding: 4px 10px; flex-shrink: 0; }
.sidebar-action-item {
    display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: var(--r-sm);
    color: var(--text-3); font-size: var(--fs-sm); transition: all var(--tr-fast);
    background: transparent; border: none; width: 100%; text-align: left; cursor: pointer;
}
.sidebar-action-item:hover { color: var(--primary); background: var(--primary-soft); }
.sidebar-actions-text { flex: 1; }

.sidebar-footer {
    border-top: 1px solid var(--border); padding: 10px; flex-shrink: 0;
}
.sidebar-foot-item {
    display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: var(--r-sm);
    color: var(--text-3); font-size: var(--fs-sm); transition: all var(--tr-fast);
    background: transparent; border: none; width: 100%; text-align: left; cursor: pointer;
}
.sidebar-foot-item:hover { background: var(--bg-mute); color: var(--text); }
.sidebar-foot-item svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.sidebar-footer-text { flex: 1; }

/* ==========================================================================
   5. 主体区域
   ========================================================================== */
.app-body {
    margin-left: var(--nav-w); min-height: 100vh; transition: margin-left var(--tr-base);
    padding-top: var(--topbar-h);
}
.sidebar.collapsed ~ .app-body { margin-left: var(--nav-w-mini); }

/* 管理后台布局：复用前台 fixed sidebar/topbar，主区域需要避开 */
.admin-body { background: var(--bg-deep); }
.app-layout { display: block; min-height: 100vh; }
.admin-main {
    margin-left: var(--nav-w);
    padding-top: var(--topbar-h);
    min-height: 100vh;
    transition: margin-left var(--tr-base);
}
.sidebar.collapsed ~ .admin-main,
.app-layout:has(.sidebar.collapsed) .admin-main { margin-left: var(--nav-w-mini); }

/* 管理后台的 mobile 蒙层 */
.sb-mask {
    display: none; position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.5); z-index: 85;
    opacity: 0; transition: opacity var(--tr-base);
    backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
}
.sb-mask.is-show { opacity: 1; }
@media (max-width: 1024px) { .sb-mask { display: block; } }
@media (min-width: 1025px) { .sb-mask { display: none !important; } }

/* 响应式 */
@media (max-width: 1024px) {
    .sidebar { transform: translateX(-100%); transition: transform var(--tr-base); box-shadow: var(--shadow-lg); }
    .sidebar.is-open { transform: translateX(0); }
    .app-body { margin-left: 0 !important; }
    .admin-main { margin-left: 0 !important; }
    .mobile-toggle { display: flex !important; }
}
.mobile-toggle {
    display: none; width: 36px; height: 36px; border-radius: var(--r-md);
    align-items: center; justify-content: center; color: var(--text);
    background: transparent; border: none; margin-right: 8px;
}
.mobile-toggle svg { width: 20px; height: 20px; }
.nav-mask {
    display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.5);
    z-index: 80; opacity: 0; transition: opacity var(--tr-base); backdrop-filter: blur(2px);
}
.nav-mask.is-show { opacity: 1; }
@media (max-width: 1024px) { .nav-mask { display: block; } }

/* ==========================================================================
   6. 玻璃卡片
   ========================================================================== */
.glass {
    background: var(--surface-glass);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
}
.glass-lg {
    background: var(--surface-glass);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-xl);
}

/* ==========================================================================
   7. 按钮
   ========================================================================== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    height: 36px; padding: 0 16px; border-radius: var(--r-md); font-size: var(--fs-sm);
    font-weight: var(--fw-m); transition: all var(--tr-fast); white-space: nowrap;
    user-select: none; border: 1px solid transparent; cursor: pointer; font-family: inherit;
}
.btn-sm { height: 30px; padding: 0 12px; font-size: var(--fs-xs); }
.btn-lg { height: 44px; padding: 0 22px; font-size: var(--fs-md); }
.btn-xl { height: 50px; padding: 0 28px; font-size: var(--fs-lg); }
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    color: #fff; border-color: transparent;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}
.btn-primary:hover { background: linear-gradient(135deg, var(--primary-hover), var(--primary)); box-shadow: 0 4px 16px rgba(139, 92, 246, 0.4); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

.btn-accent { background: linear-gradient(135deg, var(--accent), #0891b2); color: #fff; border-color: transparent; box-shadow: 0 2px 8px rgba(6, 182, 212, 0.3); }
.btn-accent:hover { box-shadow: 0 4px 16px rgba(6, 182, 212, 0.4); transform: translateY(-1px); }

.btn-dark { background: var(--c-900, #18181b); color: #fff; border-color: transparent; }
.btn-dark:hover { background: var(--c-800, #27272a); }

.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--bg-mute); color: var(--text); }

.btn-outline { background: transparent; border: 1px solid var(--border-strong); color: var(--text-2); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }

.btn-danger { background: var(--danger); color: #fff; border-color: transparent; }
.btn-danger:hover { background: #dc2626; }

.btn[disabled], .btn.is-disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

.btn-neon {
    background: linear-gradient(135deg, var(--primary), var(--pink));
    color: #fff; border: none; box-shadow: var(--shadow-neon);
    animation: pulse-glow 3s ease-in-out infinite;
}
@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 20px rgba(139, 92, 246, 0.4), 0 0 40px rgba(139, 92, 246, 0.2); }
    50% { box-shadow: 0 0 30px rgba(139, 92, 246, 0.6), 0 0 60px rgba(139, 92, 246, 0.3), 0 0 80px rgba(236, 72, 153, 0.15); }
}

/* ==========================================================================
   8. 输入框
   ========================================================================== */
.input, textarea.input, select.input {
    display: block; width: 100%; height: 38px; padding: 0 12px;
    background: var(--bg-soft); color: var(--text);
    border: 1px solid var(--border-strong); border-radius: var(--r-md);
    font-size: var(--fs-sm); transition: all var(--tr-fast); font-family: inherit;
}
textarea.input { height: auto; min-height: 80px; padding: 10px 12px; line-height: var(--lh-base); resize: vertical; }
.input::placeholder, textarea.input::placeholder { color: var(--text-4); }
.input:focus, textarea.input:focus, select.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft), 0 0 12px rgba(139, 92, 246, 0.15); }
.input-lg { height: 46px; font-size: var(--fs-md); }
.input-sm { height: 32px; font-size: var(--fs-xs); }

/* ==========================================================================
   9. 标签 / 徽章
   ========================================================================== */
.tag {
    display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px;
    border-radius: var(--r-full); font-size: var(--fs-xs); font-weight: var(--fw-m);
    background: var(--bg-mute); color: var(--text-2); white-space: nowrap;
}
.tag-primary { background: var(--primary-soft); color: var(--primary); }
.tag-success { background: var(--success-bg); color: var(--success); }
.tag-warning { background: var(--warning-bg); color: var(--warning); }
.tag-danger { background: var(--danger-bg); color: var(--danger); }
.tag-info { background: var(--info-bg); color: var(--info); }

.badge {
    display: inline-flex; align-items: center; height: 18px; padding: 0 7px;
    background: var(--bg-mute); color: var(--text-2); border-radius: var(--r-full);
    font-size: 10px; font-weight: var(--fw-s);
}
.badge-primary { background: var(--primary-soft); color: var(--primary); }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-glow { background: var(--primary); color: #fff; box-shadow: 0 0 6px var(--primary-glow); }

/* ==========================================================================
   10. Toast / Flash
   ========================================================================== */
.toast-wrap {
    position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
    z-index: 9999; pointer-events: none; display: flex; flex-direction: column;
    gap: 8px; align-items: center;
}
.toast {
    background: var(--bg-soft); color: var(--text); padding: 10px 18px;
    border-radius: var(--r-md); font-size: var(--fs-sm);
    box-shadow: var(--shadow-md); border: 1px solid var(--border-strong);
    animation: toast-in 200ms ease-out; pointer-events: auto;
}
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

.flash {
    padding: 10px 16px; border-radius: var(--r-md); font-size: var(--fs-sm);
    margin-bottom: 16px; border: 1px solid;
}
.flash-success { background: var(--success-bg); color: var(--success); border-color: rgba(16,185,129,0.2); }
.flash-error { background: var(--danger-bg); color: var(--danger); border-color: rgba(239,68,68,0.2); }
.flash-info { background: var(--info-bg); color: var(--info); border-color: rgba(59,130,246,0.2); }
.flash-warning { background: var(--warning-bg); color: var(--warning); border-color: rgba(245,158,11,0.2); }

/* ==========================================================================
   11. 模态框
   ========================================================================== */
.modal-bg {
    position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px); z-index: 9998;
    display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-bg.show { display: flex; }
.modal {
    background: var(--bg-soft); border: 1px solid var(--border-strong);
    border-radius: var(--r-xl); max-width: 560px; width: 100%;
    max-height: 90vh; overflow: auto; padding: 24px; box-shadow: var(--shadow-lg);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.modal-title { font-size: var(--fs-lg); font-weight: var(--fw-s); color: var(--text); }
.modal-close {
    width: 32px; height: 32px; border-radius: var(--r-sm); background: transparent;
    color: var(--text-3); display: flex; align-items: center; justify-content: center;
    transition: all var(--tr-fast); border: none; font-size: 16px;
}
.modal-close:hover { background: var(--bg-mute); color: var(--text); }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }

/* ==========================================================================
   12. 灯箱
   ========================================================================== */
.lightbox {
    display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.9);
    z-index: 10000; align-items: center; justify-content: center; padding: 20px;
    backdrop-filter: blur(8px);
}
.lightbox.open, .lightbox.show { display: flex; }
.lightbox img { max-width: 90vw; max-height: 85vh; object-fit: contain; border-radius: var(--r-md); box-shadow: var(--shadow-lg); }
.lightbox-close {
    position: absolute; top: 16px; right: 16px; width: 40px; height: 40px;
    background: rgba(255,255,255,0.1); color: #fff; border-radius: var(--r-full);
    display: flex; align-items: center; justify-content: center; font-size: 20px;
    transition: background var(--tr-fast); border: none; cursor: pointer;
}
.lightbox-close:hover { background: rgba(255,255,255,0.2); }

/* ==========================================================================
   13. 分页
   ========================================================================== */
.pagination { display: flex; align-items: center; justify-content: center; gap: 4px; margin-top: 24px; }
.pagination a, .pagination span {
    min-width: 32px; height: 32px; padding: 0 10px; display: inline-flex;
    align-items: center; justify-content: center; border-radius: var(--r-sm);
    color: var(--text-2); font-size: var(--fs-sm); border: 1px solid var(--border);
    background: var(--surface); transition: all var(--tr-fast); cursor: pointer;
}
.pagination a:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.pagination .current { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ==========================================================================
   14. 空状态
   ========================================================================== */
.empty { text-align: center; padding: 48px 20px; color: var(--text-3); }
.empty-icon {
    width: 56px; height: 56px; margin: 0 auto 12px; background: var(--bg-mute);
    border-radius: var(--r-full); display: flex; align-items: center; justify-content: center;
    font-size: 24px; color: var(--text-4);
}

/* ==========================================================================
   响应式
   ========================================================================== */
@media (max-width: 1024px) {
    .app-body { margin-left: 0 !important; }
    .mobile-toggle { display: flex !important; }
}
@media (max-width: 640px) {
    .page-title { font-size: var(--fs-2xl); }
    .hero-title { font-size: var(--fs-3xl); }
}
.hidden { display: none !important; }

/* ==========================================================================
   15. V3 公共首页组件（home / gallery 共用）
   ========================================================================== */

/* Hero */
.v3-hero {
    background: linear-gradient(160deg, rgba(139,92,246,0.12), rgba(6,182,212,0.08), transparent 60%);
    border-bottom: 1px solid var(--border);
    padding: 64px 24px 56px;
}
.v3-hero-inner { max-width: var(--content-max); margin: 0 auto; }
.v3-hero-title {
    font-size: var(--fs-4xl); font-weight: var(--fw-b); color: var(--text);
    letter-spacing: -0.5px; margin: 14px 0 10px; line-height: var(--lh-tight);
}
.v3-hero-subtitle {
    font-size: var(--fs-lg); color: var(--text-2); max-width: 640px; line-height: var(--lh-snug);
}
.v3-tag {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 6px 12px 6px 10px; border-radius: var(--r-full);
    background: var(--primary-soft); color: var(--primary);
    font-size: var(--fs-xs); font-weight: var(--fw-s);
    border: 1px solid rgba(139,92,246,0.25);
}
.v3-tag-dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 0 0 rgba(139,92,246,0.55);
    animation: pulse-glow 2s ease-in-out infinite;
}
.v3-stat-row {
    display: grid; grid-template-columns: repeat(3, minmax(160px, 1fr));
    gap: 12px; margin-top: 28px;
}
.v3-stat-card {
    background: var(--surface-glass);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border); border-radius: var(--r-lg);
    padding: 18px 20px;
    transition: transform var(--tr-fast), box-shadow var(--tr-fast), border-color var(--tr-fast);
}
.v3-stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-glow);
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(139,92,246,0.08);
}
.v3-stat-value {
    font-size: var(--fs-3xl); font-weight: var(--fw-b); color: var(--text);
    letter-spacing: -0.3px; line-height: 1;
}
.v3-stat-label {
    font-size: var(--fs-xs); color: var(--text-3); margin-top: 6px; font-weight: var(--fw-m);
}

/* Create section */
.v3-create-section { padding: 28px 24px 12px; }
.v3-create-card {
    max-width: var(--content-max); margin: 0 auto;
    padding: 24px;
    background: var(--surface-glass);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-xl);
}
.v3-prompt-wrap {
    position: relative;
    background: var(--bg-soft);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-lg);
    transition: border-color var(--tr-fast), box-shadow var(--tr-fast);
}
.v3-prompt-wrap:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft), 0 0 24px rgba(139,92,246,0.12);
}
.v3-prompt-input {
    width: 100%; padding: 14px 44px 14px 16px;
    background: transparent; color: var(--text);
    border: 0; outline: none; resize: none;
    font: inherit; font-size: var(--fs-md); line-height: var(--lh-snug);
}
.v3-prompt-input::placeholder { color: var(--text-4); }
.v3-prompt-actions {
    position: absolute; right: 10px; top: 10px;
    display: flex; gap: 4px; align-items: center;
}
.v3-clear-btn {
    width: 28px; height: 28px; border-radius: var(--r-md);
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.04); color: var(--text-3);
    border: 1px solid transparent; cursor: pointer; transition: all var(--tr-fast);
}
.v3-clear-btn:hover { background: var(--bg-mute); color: var(--text); border-color: var(--border); }

.v3-toolbar {
    display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 14px;
}
.v3-tool-group { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; flex: 1 1 auto; }

.v3-select-wrap {
    position: relative; display: inline-flex; align-items: center; gap: 8px;
    height: 36px; padding: 0 10px 0 32px;
    background: var(--bg-soft); color: var(--text-2);
    border: 1px solid var(--border-strong); border-radius: var(--r-md);
}
.v3-select-icon {
    position: absolute; left: 9px; top: 50%; transform: translateY(-50%);
    width: 14px; height: 14px; color: var(--text-3); pointer-events: none;
}
.v3-select-native {
    position: absolute; inset: 0; width: 100%; height: 100%;
    opacity: 0; cursor: pointer;
    font: inherit; color: inherit; border: 0; background: transparent;
}
.v3-select-label {
    font-size: var(--fs-sm); font-weight: var(--fw-m);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px;
    pointer-events: none;
}

.v3-model-dropdown { position: relative; }
.v3-model-trigger {
    display: inline-flex; align-items: center; gap: 8px;
    height: 36px; padding: 0 32px 0 12px;
    background: var(--bg-soft); color: var(--text-2);
    border: 1px solid var(--border-strong); border-radius: var(--r-md);
    font: inherit; font-size: var(--fs-sm); cursor: pointer; position: relative;
    transition: border-color var(--tr-fast), box-shadow var(--tr-fast), color var(--tr-fast);
}
.v3-model-trigger:hover { border-color: rgba(255,255,255,0.16); color: var(--text); }
.v3-model-icon { width: 16px; height: 16px; color: var(--text-3); flex-shrink: 0; }
.v3-model-name { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v3-drop-arrow {
    position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
    width: 11px; height: 11px; color: var(--text-3); transition: transform var(--tr-fast);
    pointer-events: none;
}
.v3-model-dropdown.is-open .v3-drop-arrow { transform: translateY(-50%) rotate(180deg); }

.v3-model-menu {
    position: absolute; top: calc(100% + 6px); left: 0; min-width: 260px;
    background: var(--bg-soft); border: 1px solid var(--border-strong);
    border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
    padding: 6px; z-index: 60;
    opacity: 0; visibility: hidden; transform: translateY(-4px) scale(0.98);
    transition: all var(--tr-fast);
}
.v3-model-dropdown.is-open .v3-model-menu {
    opacity: 1; visibility: visible; transform: translateY(0) scale(1);
}
.v3-model-option {
    display: flex; flex-direction: column; gap: 2px;
    padding: 10px 12px; border-radius: var(--r-md);
    color: var(--text-2); cursor: pointer; transition: all var(--tr-fast);
}
.v3-model-option:hover { background: var(--bg-mute); color: var(--text); }
.v3-model-option.is-active {
    background: var(--primary-soft); color: var(--primary);
    border: 1px solid rgba(139,92,246,0.28);
}
.v3-model-meta { font-size: 11px; color: var(--text-3); }

.v3-counter {
    display: inline-flex; align-items: center; gap: 2px;
    background: var(--bg-soft); border: 1px solid var(--border-strong);
    border-radius: var(--r-md); padding: 2px; height: 36px;
}
.v3-counter-btn {
    width: 32px; height: 32px; border-radius: var(--r-md);
    display: inline-flex; align-items: center; justify-content: center;
    background: transparent; color: var(--text-2); border: none; cursor: pointer;
    transition: all var(--tr-fast); font-size: 16px; font-weight: var(--fw-s);
}
.v3-counter-btn:hover { background: var(--bg-mute); color: var(--text); }
.v3-counter-value {
    min-width: 28px; text-align: center;
    font-size: var(--fs-sm); font-weight: var(--fw-s); color: var(--text);
}
.v3-hint { font-size: var(--fs-xs); color: var(--text-3); margin-top: 12px; }

/* Tags */
.v3-tags-section { padding: 28px 24px 0; max-width: var(--content-max); margin: 0 auto; }
.v3-tags-label {
    font-size: 11px; font-weight: var(--fw-s); color: var(--text-3);
    text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 10px;
}
.tag-scroll {
    display: flex; flex-wrap: wrap; gap: 8px;
}
.tag-chip {
    display: inline-flex; align-items: center;
    padding: 7px 14px; border-radius: var(--r-full);
    background: rgba(255,255,255,0.03); color: var(--text-2);
    border: 1px solid var(--border); font-size: var(--fs-sm); font-weight: var(--fw-m);
    cursor: pointer; transition: all var(--tr-fast); white-space: nowrap;
}
.tag-chip:hover { background: var(--bg-mute); border-color: rgba(255,255,255,0.14); color: var(--text); transform: translateY(-1px); }
.tag-chip.is-active {
    background: linear-gradient(135deg, var(--primary), var(--pink));
    color: #fff; border-color: transparent;
    box-shadow: 0 4px 14px rgba(139,92,246,0.35);
}

/* Gallery section */
.v3-gallery-section { padding: 28px 24px 48px; max-width: var(--content-max); margin: 0 auto; }
.v3-gallery-header {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: 12px; margin-bottom: 18px;
}
.v3-gallery-title {
    font-size: var(--fs-2xl); font-weight: var(--fw-s); color: var(--text); letter-spacing: -0.2px;
}
.v3-gallery-subtitle { font-size: 13px; color: var(--text-3); margin-top: 4px; }

/* Tabs */
.v3-tabs { display: flex; gap: 4px; margin-bottom: 20px; flex-wrap: wrap; }
.v3-tab {
    padding: 7px 16px; border-radius: var(--r-full);
    font-size: var(--fs-sm); font-weight: var(--fw-m); color: var(--text-2);
    background: transparent; border: none; cursor: pointer;
    transition: all var(--tr-fast); white-space: nowrap;
}
.v3-tab:hover { background: var(--bg-mute); color: var(--text); }
.v3-tab.is-active {
    background: var(--primary-soft); color: var(--primary);
    box-shadow: inset 0 0 0 1px rgba(139,92,246,0.28);
}

/* Masonry */
.v3-masonry {
    columns: 4; column-gap: 12px;
}
.v3-masonry-item {
    break-inside: avoid; margin-bottom: 12px;
    border-radius: var(--r-lg); overflow: hidden;
    background: var(--bg-soft); border: 1px solid var(--border);
    cursor: pointer; position: relative;
    transition: transform var(--tr-fast), box-shadow var(--tr-fast), border-color var(--tr-fast);
}
.v3-masonry-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border-glow);
}
.v3-masonry-img {
    width: 100%; display: block; background: var(--bg-mute);
    min-height: 120px; object-fit: cover;
}
.v3-masonry-empty {
    display: flex; align-items: center; justify-content: center;
    height: 160px; font-size: 40px; background: var(--bg-mute);
}
.v3-masonry-overlay {
    position: absolute; left: 0; bottom: 0; right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.75), rgba(0,0,0,0), rgba(0,0,0,0));
    padding: 28px 12px 12px; opacity: 0; transition: opacity var(--tr-fast);
}
.v3-masonry-item:hover .v3-masonry-overlay { opacity: 1; }
.v3-masonry-info { display: flex; flex-direction: column; gap: 8px; }
.v3-masonry-prompt {
    font-size: var(--fs-sm); color: #fff; line-height: var(--lh-snug);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.v3-masonry-actions { display: flex; gap: 6px; }
.v3-masonry-act {
    width: 30px; height: 30px; border-radius: var(--r-full);
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.12); color: #fff;
    border: none; cursor: pointer; transition: all var(--tr-fast);
    backdrop-filter: blur(6px);
}
.v3-masonry-act:hover { background: rgba(255,255,255,0.22); }
.v3-masonry-act.is-liked { background: rgba(239,68,68,0.35); color: #fca5a5; }

/* Lightbox */
.v3-lightbox {
    position: fixed; inset: 0; z-index: 10000;
    display: none; align-items: center; justify-content: center;
    padding: 24px;
    background: rgba(0,0,0,0.88);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.v3-lightbox.is-show { display: flex; }
.v3-lightbox-backdrop {
    position: absolute; inset: 0; cursor: pointer;
}
.v3-lightbox-close {
    position: absolute; top: 16px; right: 16px;
    width: 40px; height: 40px; border-radius: var(--r-full);
    background: rgba(255,255,255,0.1); color: #fff;
    border: none; cursor: pointer; font-size: 18px;
    display: inline-flex; align-items: center; justify-content: center;
    transition: background var(--tr-fast); z-index: 2;
}
.v3-lightbox-close:hover { background: rgba(255,255,255,0.22); }
.v3-lightbox-img {
    max-width: 92vw; max-height: 88vh; object-fit: contain;
    border-radius: var(--r-lg); z-index: 1;
    box-shadow: 0 24px 80px rgba(0,0,0,0.5);
}

/* Gallery search / filters */
.v3-gallery-search-bar {
    display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
    justify-content: space-between; max-width: var(--content-max);
    margin: 0 auto; padding: 20px 24px 0;
}
.v3-search-wrap {
    flex: 1 1 280px; position: relative; min-width: 220px;
}
.v3-search-icon {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    width: 16px; height: 16px; color: var(--text-3); pointer-events: none;
}
.v3-search-input {
    width: 100%; height: 38px; padding: 0 36px 0 38px;
    background: var(--bg-soft); color: var(--text);
    border: 1px solid var(--border-strong); border-radius: var(--r-md);
    font: inherit; font-size: var(--fs-sm); outline: none;
    transition: border-color var(--tr-fast), box-shadow var(--tr-fast);
}
.v3-search-input::placeholder { color: var(--text-4); }
.v3-search-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.v3-search-clear {
    position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
    width: 26px; height: 26px; border-radius: var(--r-md);
    display: none; align-items: center; justify-content: center;
    background: transparent; color: var(--text-3); border: none; cursor: pointer;
    transition: all var(--tr-fast);
}
.v3-search-clear.is-show { display: inline-flex; }
.v3-search-clear:hover { background: var(--bg-mute); color: var(--text); }
.v3-gallery-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.v3-gallery-filter-btn {
    padding: 7px 14px; border-radius: var(--r-full);
    font-size: var(--fs-sm); font-weight: var(--fw-m); color: var(--text-2);
    background: rgba(255,255,255,0.03); border: 1px solid var(--border);
    text-decoration: none; transition: all var(--tr-fast); white-space: nowrap;
}
.v3-gallery-filter-btn:hover { background: var(--bg-mute); color: var(--text); border-color: rgba(255,255,255,0.12); }
.v3-gallery-filter-btn.is-active {
    background: var(--primary-soft); color: var(--primary);
    border-color: rgba(139,92,246,0.35);
}

/* Pagination (home/gallery) */
.v3-pagination {
    display: flex; align-items: center; justify-content: center;
    gap: 6px; padding: 20px 0 8px; flex-wrap: wrap;
}
.v3-page-item, .v3-page-btn {
    min-width: 34px; height: 34px; padding: 0 12px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: var(--r-md); font-size: var(--fs-sm);
    background: rgba(255,255,255,0.03); color: var(--text-2);
    border: 1px solid var(--border);
    text-decoration: none; transition: all var(--tr-fast);
    font-weight: var(--fw-m);
}
.v3-page-item:hover, .v3-page-btn:hover {
    background: var(--bg-mute); border-color: rgba(255,255,255,0.14); color: var(--text);
    transform: translateY(-1px);
}
.v3-page-item.is-active {
    background: rgba(139,92,246,0.22); border-color: rgba(139,92,246,0.45);
    color: #a78bfa; font-weight: var(--fw-s);
}

/* Empty */
.v3-empty {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 52px 20px; text-align: center; gap: 10px;
}
.v3-empty-icon { font-size: 44px; opacity: 0.8; }
.v3-empty-title { font-size: var(--fs-lg); font-weight: var(--fw-s); color: var(--text); }
.v3-empty-text { font-size: var(--fs-sm); color: var(--text-3); max-width: 360px; }

/* Modal family tokens */
.v3-modal-backdrop {
    position: fixed; inset: 0; z-index: 9998;
    display: flex; align-items: center; justify-content: center; padding: 20px;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.v3-modal-backdrop.is-hidden { display: none; }
.v3-modal-backdrop-bg { position: absolute; inset: 0; }
.v3-modal-card {
    position: relative; max-width: 720px; width: 100%;
    max-height: 85vh; overflow: auto; padding: 28px;
    background: var(--surface-glass);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-strong); border-radius: var(--r-xl);
    box-shadow: var(--shadow-lg);
    animation: v3-ann-in 220ms ease-out;
}
.card-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 20px;
}
.card-title {
    font-size: var(--fs-xl); font-weight: var(--fw-s); color: var(--text);
    letter-spacing: -0.2px;
}
.v3-close-btn {
    position: absolute; top: 14px; right: 14px;
    width: 32px; height: 32px; border-radius: var(--r-full);
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--bg-mute); color: var(--text-2);
    border: none; cursor: pointer; transition: all var(--tr-fast);
}
.v3-close-btn:hover { background: var(--bg-soft); color: var(--text); transform: scale(1.05); }

/* Animations */
@keyframes v3-ann-in {
    from { opacity: 0; transform: translateY(10px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ==========================================================================
   16. 登录 / 注册 通用鉴权页
   ========================================================================== */
.v3-auth-page {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    padding: 24px;
    background: var(--bg-deep);
    position: relative; overflow: hidden;
}
.v3-auth-bg {
    position: absolute; inset: 0; overflow: hidden; z-index: 0;
}
.v3-auth-orb {
    position: absolute; border-radius: 50%;
    filter: blur(90px); opacity: 0.35;
    animation: orbFloat 14s ease-in-out infinite;
}
.v3-auth-orb-1 {
    width: 420px; height: 420px;
    background: radial-gradient(circle, rgba(139,92,246,0.55), transparent 70%);
    top: -120px; left: -80px;
}
.v3-auth-orb-2 {
    width: 360px; height: 360px;
    background: radial-gradient(circle, rgba(6,182,212,0.45), transparent 70%);
    bottom: -100px; right: -60px;
    animation-delay: -7s; animation-direction: reverse;
}
@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(40px, -30px); }
}

.v3-auth-card {
    position: relative; z-index: 1;
    width: 100%; max-width: 400px;
    padding: 32px;
    background: var(--surface-glass);
    backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px);
    border: 1px solid var(--border-strong); border-radius: var(--r-xl);
    box-shadow: var(--shadow-lg);
    animation: v3-ann-in 240ms ease-out;
}
.v3-auth-logo {
    display: flex; align-items: center; gap: 12px;
    text-decoration: none; margin-bottom: 18px;
}
.v3-auth-logo-mark {
    width: 40px; height: 40px; border-radius: var(--r-lg);
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: inline-flex; align-items: center; justify-content: center;
    box-shadow: 0 0 18px rgba(139,92,246,0.4); flex-shrink: 0;
}
.v3-auth-logo-text {
    font-size: var(--fs-xl); font-weight: var(--fw-s); color: var(--text);
    letter-spacing: -0.2px;
}
.v3-auth-sub {
    font-size: 13px; color: var(--text-3); margin-bottom: 22px;
}
.v3-auth-form { display: flex; flex-direction: column; gap: 14px; }
.v3-auth-form .field { display: flex; flex-direction: column; gap: 6px; }
.v3-auth-form .field label {
    font-size: 12px; font-weight: var(--fw-m); color: var(--text-3);
    letter-spacing: 0.02em;
}
.v3-auth-form .input {
    height: 40px; padding: 0 14px;
    background: var(--bg-soft); color: var(--text);
    border: 1px solid var(--border-strong); border-radius: var(--r-md);
    font: inherit; font-size: var(--fs-sm); outline: none;
    transition: border-color var(--tr-fast), box-shadow var(--tr-fast);
}
.v3-auth-form .input::placeholder { color: var(--text-4); }
.v3-auth-form .input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft), 0 0 14px rgba(139,92,246,0.18);
}
.btn-block { width: 100%; height: 42px; margin-top: 4px; }

.v3-auth-link {
    font-size: 13px; color: var(--text-3); text-align: center; margin-top: 16px;
}
.v3-auth-link a { color: var(--primary); text-decoration: none; font-weight: var(--fw-m); }
.v3-auth-link a:hover { text-decoration: underline; }

/* Register reuse */
.v3-auth-page.register-page {
    background: linear-gradient(160deg, rgba(6,182,212,0.10), rgba(139,92,246,0.10), transparent 60%);
}

/* ==========================================================================
   17. AI 智能对话页 · v3-chat
   布局: 左侧会话历史 + 右侧主对话区
   ========================================================================== */
.v3-chat-page {
    display: flex;
    gap: 16px;
    padding: 16px;
    max-width: var(--content-max);
    margin: 0 auto;
    min-height: calc(100vh - var(--topbar-h));
    align-items: stretch;
}

/* --- 左侧会话历史侧栏 --- */
.v3-chat-sidebar {
    flex: 0 0 260px;
    display: flex;
    flex-direction: column;
    background: var(--surface-glass);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    overflow: hidden;
    min-height: 0;
}
.v3-chat-sidebar-head {
    padding: 14px 14px 12px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-soft);
    flex-shrink: 0;
}
.v3-chat-new-btn {
    width: 100%;
    justify-content: center;
}
.v3-chat-sidebar-body {
    flex: 1;
    overflow-y: auto;
    padding: 10px 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 0;
}
.v3-chat-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
    gap: 8px;
    color: var(--text-3);
}
.v3-chat-empty-icon { font-size: 32px; opacity: 0.6; }
.v3-chat-empty-text { font-size: var(--fs-sm); color: var(--text-3); }

.v3-chat-session-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 10px 12px;
    border-radius: var(--r-md);
    background: transparent;
    color: var(--text-2);
    cursor: pointer;
    text-align: left;
    transition: all var(--tr-fast);
    border: 1px solid transparent;
}
.v3-chat-session-item:hover {
    background: var(--bg-mute);
    color: var(--text);
}
.v3-chat-session-item.is-active {
    background: var(--primary-soft);
    color: var(--text);
    border-color: var(--border-glow);
}
.v3-chat-session-title {
    font-size: var(--fs-sm);
    font-weight: var(--fw-m);
    line-height: 1.4;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.v3-chat-session-time {
    font-size: 11px;
    color: var(--text-3);
    line-height: 1;
}

/* --- 右侧主聊天区 --- */
.v3-chat-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.v3-chat-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 4px 4px 0;
}
.v3-chat-title {
    font-size: var(--fs-2xl);
    font-weight: var(--fw-s);
    color: var(--text);
    line-height: 1.3;
    letter-spacing: -0.2px;
}
.v3-chat-subtitle {
    font-size: var(--fs-sm);
    color: var(--text-3);
    margin-top: 4px;
}
.v3-chat-points {
    flex-shrink: 0;
    font-size: var(--fs-sm);
    padding: 6px 12px;
}

/* --- 聊天主卡片 --- */
.v3-chat-card {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: var(--surface-glass);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-xl);
    overflow: hidden;
}
.v3-chat-topbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-soft);
    flex-shrink: 0;
}

/* --- 消息区 --- */
.v3-chat-messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 20px 18px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.v3-chat-welcome {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 24px 4px 12px;
}
.v3-chat-welcome-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--r-md);
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    font-size: var(--fs-sm);
    font-weight: var(--fw-s);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.25);
}
.v3-chat-welcome-text {
    flex: 1;
    min-width: 0;
}
.v3-chat-welcome-title {
    font-size: var(--fs-lg);
    font-weight: var(--fw-s);
    color: var(--text);
    line-height: 1.4;
}
.v3-chat-welcome-sub {
    font-size: var(--fs-sm);
    color: var(--text-3);
    margin-top: 4px;
    line-height: 1.5;
}
.v3-chat-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}
.v3-chat-tag {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    font-size: var(--fs-sm);
    color: var(--text-2);
    background: var(--bg-mute);
    border: 1px solid var(--border);
    border-radius: var(--r-full);
    cursor: pointer;
    transition: all var(--tr-fast);
    user-select: none;
}
.v3-chat-tag:hover {
    background: var(--primary-soft);
    border-color: var(--border-glow);
    color: var(--primary);
}

/* --- 单条消息 --- */
.v3-chat-msg {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    max-width: 85%;
    animation: v3-msg-in 220ms ease-out;
}
@keyframes v3-msg-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.v3-chat-msg--user {
    align-self: flex-end;
    flex-direction: row-reverse;
}
.v3-chat-msg--ai { align-self: flex-start; }
.v3-chat-msg-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--r-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: var(--fw-s);
    flex-shrink: 0;
}
.v3-chat-msg--user .v3-chat-msg-avatar {
    background: var(--bg-mute);
    color: var(--text-2);
    border: 1px solid var(--border);
}
.v3-chat-msg--ai .v3-chat-msg-avatar {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
}
.v3-chat-msg-bubble {
    padding: 10px 14px;
    border-radius: var(--r-lg);
    font-size: var(--fs-sm);
    line-height: 1.65;
    color: var(--text);
    word-wrap: break-word;
    white-space: pre-wrap;
}
.v3-chat-msg--user .v3-chat-msg-bubble {
    background: var(--primary);
    color: #fff;
    border-bottom-right-radius: 4px;
}
.v3-chat-msg--ai .v3-chat-msg-bubble {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px;
}

/* --- 输入栏 --- */
.v3-chat-input-bar {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    padding: 12px 14px 14px;
    border-top: 1px solid var(--border);
    background: var(--bg-soft);
    flex-shrink: 0;
}
.v3-chat-input-wrap {
    flex: 1;
    min-width: 0;
    background: var(--bg);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-lg);
    padding: 4px 8px;
    transition: border-color var(--tr-fast), box-shadow var(--tr-fast);
}
.v3-chat-input-wrap:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}
.v3-chat-textarea {
    width: 100%;
    min-height: 36px;
    max-height: 160px;
    padding: 8px 4px;
    background: transparent;
    color: var(--text);
    font-family: inherit;
    font-size: var(--fs-sm);
    line-height: 1.5;
    border: none;
    outline: none;
    resize: none;
    display: block;
}
.v3-chat-textarea::placeholder { color: var(--text-4); }

/* --- 响应式 --- */
@media (max-width: 900px) {
    .v3-chat-page { flex-direction: column; padding: 12px; gap: 12px; }
    .v3-chat-sidebar { flex: 0 0 auto; max-height: 180px; }
    .v3-chat-toolbar { flex-direction: column; align-items: flex-start; }
    .v3-chat-msg { max-width: 95%; }
}


/* ==========================================================================
   11. Promo / 分销推广页（v3-promo-panel 整体重做）
   设计要点：
   - 去除红橙刺眼渐变，使用品牌紫主色
   - 卡片采用 surface 干净背景（非玻璃模糊），更适合双主题
   - 信息分层：状态徽章 → 标题 → 价格 → 进度 → 倒计时 → 操作
   - 圆角统一 12-16px，留白舒适
   ========================================================================== */

/* ---------- 页面头部 ---------- */
.v3-promo-hero {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 22px 24px;
    margin-bottom: 22px;
    width: 100%;
    box-sizing: border-box;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.10), rgba(34, 211, 238, 0.08));
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    position: relative;
    overflow: hidden;
}
.v3-promo-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 100% 0%, rgba(124, 58, 237, 0.18), transparent 50%),
        radial-gradient(circle at 0% 100%, rgba(34, 211, 238, 0.14), transparent 50%);
    pointer-events: none;
}
.v3-promo-hero-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, #7c3aed, #22d3ee);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
    box-shadow: 0 8px 22px rgba(124, 58, 237, 0.30);
}
.v3-promo-hero-text { flex: 1; min-width: 0; position: relative; z-index: 1; }
.v3-promo-hero-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-1);
    line-height: 1.3;
    margin-bottom: 4px;
}
.v3-promo-hero-sub {
    font-size: 13px;
    color: var(--text-3);
}

/* ---------- Tab 计数徽章 ---------- */
.v3-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 7px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    background: var(--bg-mute);
    color: var(--text-3);
    margin-left: 6px;
}
.v3-tab.is-active .v3-tab-count {
    background: rgba(255, 255, 255, 0.20);
    color: #fff;
}

/* ---------- 面板容器 ---------- */
.v3-promo-panel { display: block; width: 100%; box-sizing: border-box; }
.v3-promo-panel.is-hidden { display: none; }
.v3-promo-panel + .v3-promo-panel { margin-top: 28px; }

/* 强制 .gallery-page 子元素撑满 */
.gallery-page > * { width: 100%; max-width: 100%; box-sizing: border-box; }
.gallery-page .v3-tabs { width: 100%; }

/* ---------- 区块标题（正在秒杀 / 即将开始） ---------- */
.v3-promo-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 24px 0 14px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-1);
}
.section-gap { margin-top: 24px; }
.v3-pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ef4444;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.15);
    animation: v3Pulse 1.6s ease-in-out infinite;
    flex-shrink: 0;
}
.v3-pulse-dot.is-gray {
    background: #9ca3af;
    box-shadow: 0 0 0 4px rgba(156, 163, 175, 0.10);
    animation: none;
}
@keyframes v3Pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50%      { transform: scale(0.6); opacity: 0.6; }
}
.v3-promo-line {
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ============================================================
   秒杀卡片
   ============================================================ */
.v3-seckill-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}
.v3-seckill-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px;
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    position: relative;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.v3-seckill-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    box-shadow: 0 10px 30px rgba(124, 58, 237, 0.12);
}
.v3-seckill-card.is-upcoming { opacity: 0.65; }

.v3-seckill-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
    letter-spacing: 0.02em;
}
.v3-seckill-badge.is-gray {
    background: var(--bg-mute);
    color: var(--text-3);
}

.v3-seckill-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-1);
    line-height: 1.45;
    padding-right: 64px; /* 留出右上角徽章位置 */
}
.v3-seckill-points {
    display: flex;
    align-items: baseline;
    gap: 4px;
    color: var(--primary);
    margin-top: -4px;
}
.v3-seckill-points-num {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.01em;
}
.v3-seckill-points-unit {
    font-size: 12px;
    font-weight: 500;
    opacity: 0.8;
}

.v3-seckill-price-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px dashed var(--border);
}
.v3-seckill-price {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-3);
}
.v3-seckill-price span {
    font-size: 26px;
    font-weight: 800;
    color: #ef4444;
    margin-left: 2px;
    letter-spacing: -0.01em;
}
.v3-seckill-original {
    font-size: 12px;
    color: var(--text-4);
    text-decoration: line-through;
    margin-top: 2px;
}
.v3-seckill-save {
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    background: rgba(239, 68, 68, 0.10);
    color: #ef4444;
    white-space: nowrap;
}

.v3-seckill-progress {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.v3-seckill-progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-3);
}
.v3-seckill-progress-bar {
    height: 6px;
    border-radius: 99px;
    background: var(--bg-mute);
    overflow: hidden;
}
.v3-seckill-progress-fill {
    height: 100%;
    border-radius: 99px;
    background: linear-gradient(90deg, #ef4444, #f97316);
    transition: width 0.5s ease;
}

.v3-seckill-countdown {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-radius: var(--r-md);
    background: var(--bg-mute);
}
.v3-sc-label {
    font-size: 12px;
    color: var(--text-3);
}
.v3-sc-time {
    font-size: 15px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--text-1);
    letter-spacing: 0.04em;
}

/* ============================================================
   拼团卡片
   ============================================================ */
.v3-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}
.v3-group-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px;
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    position: relative;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.v3-group-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    box-shadow: 0 10px 30px rgba(124, 58, 237, 0.12);
}
.v3-group-ribbon {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    align-self: flex-start;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 700;
    background: rgba(124, 58, 237, 0.10);
    color: var(--primary);
    border-radius: 8px;
    letter-spacing: 0.02em;
}

.v3-group-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}
.v3-group-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-1);
    line-height: 1.45;
    flex: 1;
}
.v3-group-points {
    font-size: 11px;
    font-weight: 700;
    color: var(--primary);
    background: rgba(124, 58, 237, 0.10);
    padding: 3px 9px;
    border-radius: 6px;
    white-space: nowrap;
    flex-shrink: 0;
}

.v3-group-price-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--border);
}
.v3-group-price {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-3);
}
.v3-group-price span {
    font-size: 26px;
    font-weight: 800;
    color: var(--primary);
    margin-left: 2px;
    letter-spacing: -0.01em;
}
.v3-group-original {
    font-size: 12px;
    color: var(--text-4);
    text-decoration: line-through;
    margin-top: 2px;
}
.v3-group-save {
    text-align: right;
    flex-shrink: 0;
}
.v3-group-save-amount {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
}
.v3-group-save-pct {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-4);
    margin-top: 2px;
}

.v3-group-progress {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.v3-group-avatars {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
}
.v3-group-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    border: 2px solid var(--surface-1);
    margin-right: -6px;
    flex-shrink: 0;
}
.v3-group-avatar svg { width: 13px; height: 13px; }
.v3-group-avatar--200 { background: #7c3aed; }
.v3-group-avatar--273 { background: #2563eb; }
.v3-group-avatar--346 { background: #0891b2; }
.v3-group-avatar--419 { background: #059669; }
.v3-group-avatar--137 { background: #d97706; }
.v3-group-avatar--50  { background: #db2777; }
.v3-group-avatar--123 { background: #4f46e5; }
.v3-group-avatar--68  { background: #0d9488; }
.v3-group-avatar--296 { background: #9333ea; }
.v3-group-avatar--5   { background: #6366f1; }

.v3-group-size-text {
    font-size: 13px;
    color: var(--text-3);
}
.v3-group-size-text strong { color: var(--primary); font-weight: 700; }

.v3-group-actions {
    display: flex;
    gap: 10px;
}
.v3-group-actions .btn { flex: 1; }
.v3-group-meta {
    padding-top: 10px;
    font-size: 12px;
    color: var(--text-4);
    border-top: 1px solid var(--border);
}

/* ============================================================
   拼团大厅 / 我的活动 卡片
   ============================================================ */
.v3-teams-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}
.v3-team-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 18px;
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.v3-team-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    box-shadow: 0 10px 30px rgba(124, 58, 237, 0.12);
}

.v3-team-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}
.v3-team-package {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-1);
    flex: 1;
    line-height: 1.45;
}
.v3-team-points {
    font-size: 11px;
    font-weight: 700;
    color: var(--primary);
    background: rgba(124, 58, 237, 0.10);
    padding: 3px 9px;
    border-radius: 6px;
    white-space: nowrap;
    flex-shrink: 0;
}
.v3-team-status {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 6px;
    white-space: nowrap;
    flex-shrink: 0;
}
.tm-status-label--pending  { background: rgba(124, 58, 237, 0.12); color: var(--primary); }
.tm-status-label--success  { background: rgba(16, 185, 129, 0.12); color: #10b981; }
.tm-status-label--failed   { background: rgba(239, 68, 68, 0.12);  color: #ef4444; }
.tm-status-label--refunded { background: var(--bg-mute); color: var(--text-3); }
.tm-status-label--default  { background: var(--bg-mute); color: var(--text-3); }

.v3-team-price-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    padding-top: 10px;
    border-top: 1px dashed var(--border);
}
.v3-team-price {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-3);
}
.v3-team-price span {
    font-size: 24px;
    font-weight: 800;
    color: var(--primary);
    margin-left: 2px;
    letter-spacing: -0.01em;
}
.v3-team-initiator {
    font-size: 12px;
    color: var(--text-4);
    white-space: nowrap;
}

.v3-team-progress-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.v3-team-progress-info {
    font-size: 12px;
    color: var(--text-3);
    display: flex;
    justify-content: space-between;
}
.v3-team-current {
    font-weight: 700;
    color: var(--primary);
}
.v3-team-progress-bar {
    height: 6px;
    border-radius: 99px;
    background: var(--bg-mute);
    overflow: hidden;
}
.v3-team-progress-fill {
    height: 100%;
    border-radius: 99px;
    background: linear-gradient(90deg, var(--primary), #22d3ee);
    transition: width 0.5s ease;
}

.v3-team-countdown {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-radius: var(--r-md);
    background: var(--bg-mute);
}
.v3-tc-label {
    font-size: 12px;
    color: var(--text-3);
}
.v3-tc-time {
    font-size: 14px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--text-1);
    letter-spacing: 0.04em;
}

/* ============================================================
   拼团详情弹窗内成员
   ============================================================ */
.v3-tm-price {
    font-size: 32px;
    font-weight: 800;
    color: var(--primary);
    text-align: center;
    letter-spacing: -0.01em;
    margin-bottom: 4px;
}
.v3-tm-sub {
    font-size: 13px;
    color: var(--text-3);
    text-align: center;
    margin-bottom: 16px;
}
.v3-tm-status-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-radius: var(--r-md);
    background: var(--bg-mute);
    font-size: 13px;
    margin-bottom: 14px;
}
.v3-tm-status-detail { color: var(--text-2); }
.v3-tm-status-label {
    font-weight: 700;
    font-size: 12px;
    padding: 2px 10px;
    border-radius: 6px;
}
.v3-tm-member {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--r-md);
    background: var(--surface-2);
    border: 1px solid var(--border);
    margin-bottom: 8px;
}
.v3-tm-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}
.v3-tm-avatar--45  { background: #7c3aed; }
.v3-tm-avatar--118 { background: #2563eb; }
.v3-tm-avatar--191 { background: #0891b2; }
.v3-tm-avatar--264 { background: #059669; }
.v3-tm-avatar--337 { background: #d97706; }
.v3-tm-avatar--73  { background: #db2777; }
.v3-tm-avatar--156 { background: #dc2626; }
.v3-tm-avatar--39  { background: #4f46e5; }
.v3-tm-avatar--267 { background: #0d9488; }
.v3-tm-avatar--184 { background: #9333ea; }
.v3-tm-member-info { flex: 1; min-width: 0; }
.v3-tm-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-1);
}
.v3-tm-badge-ini {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    margin-left: 6px;
    vertical-align: middle;
}
.v3-tm-time {
    font-size: 12px;
    color: var(--text-4);
    margin-top: 2px;
}
.v3-tm-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 14px;
    border-radius: var(--r-md);
    border: 1px dashed var(--border);
    margin-bottom: 8px;
    gap: 4px;
}
.v3-tm-placeholder-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--bg-mute);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: var(--text-4);
}
.v3-tm-placeholder-text {
    font-size: 12px;
    color: var(--text-4);
}
.v3-tm-divider {
    display: flex;
    flex-direction: column;
    gap: 0;
    max-height: 240px;
    overflow-y: auto;
    padding-right: 4px;
}
.v3-tm-divider::-webkit-scrollbar { width: 4px; }
.v3-tm-divider::-webkit-scrollbar-thumb {
    background: var(--surface-3);
    border-radius: 99px;
}
.v3-tm-actions { margin-top: 14px; }

/* ============================================================
   分享链接 / 窄弹窗 / 提示文字
   ============================================================ */
.v3-share-link {
    display: flex;
    gap: 10px;
    margin: 16px 0;
}
.v3-share-link input {
    flex: 1;
    padding: 10px 14px;
    border-radius: var(--r-md);
    border: 1px solid var(--border);
    background: var(--bg-mute);
    color: var(--text-2);
    font-size: 13px;
    font-family: inherit;
    outline: none;
    min-width: 0;
}
.v3-share-link input:focus { border-color: var(--primary); }
.v3-share-link button {
    padding: 10px 20px;
    border-radius: var(--r-md);
    border: none;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    background: var(--surface-2);
    color: var(--text-1);
    transition: background 0.2s;
    white-space: nowrap;
}
.v3-share-link button:hover { background: var(--surface-3); }

.v3-modal-card--narrow { max-width: 480px; }

.v3-promo-slot-ph {
    height: 100px;
    border-radius: var(--r-md);
    background: var(--bg-mute);
    border: 1px dashed var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-4);
    font-size: 13px;
}

.v3-alert-text {
    font-size: 12px;
    font-weight: 600;
    color: #f59e0b;
}

/* 兼容旧 .glass 类（让旧模板不至于崩溃，但不强制玻璃模糊） */
.v3-seckill-card.glass,
.v3-group-card.glass,
.v3-team-card.glass {
    background: var(--surface-1) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 768px) {
    .v3-promo-hero { padding: 16px; gap: 12px; }
    .v3-promo-hero-icon { width: 40px; height: 40px; font-size: 20px; }
    .v3-promo-hero-title { font-size: 17px; }
    .v3-seckill-grid,
    .v3-group-grid,
    .v3-teams-grid { grid-template-columns: 1fr; }
    .v3-group-actions { flex-direction: column; }
    .v3-team-card { padding: 16px; }
}

/* ==========================================================================
   18. 通用页面头 & 页脚（gallery-page, app-footer）
   ========================================================================== */
.gallery-page {
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 24px;
}
.page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.page-title {
    font-size: var(--fs-3xl);
    font-weight: var(--fw-b);
    color: var(--text);
    line-height: 1.3;
    letter-spacing: -0.3px;
}
.page-subtitle {
    font-size: var(--fs-sm);
    color: var(--text-3);
    margin-top: 4px;
}

/* --- App Footer --- */
.app-footer {
    margin-top: 48px;
    padding: 32px 24px 24px;
    background: var(--bg-soft);
    border-top: 1px solid var(--border);
    text-align: center;
}
.app-footer-name {
    font-size: var(--fs-md);
    font-weight: var(--fw-s);
    color: var(--text);
    margin-bottom: 12px;
}
.app-footer-links {
    display: flex;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.app-footer-links a {
    font-size: var(--fs-sm);
    color: var(--text-3);
    text-decoration: none;
    transition: color var(--tr-fast);
}
.app-footer-links a:hover { color: var(--primary); }
.footer-copy {
    font-size: 12px;
    color: var(--text-4);
    margin-top: 8px;
}

/* ==========================================================================
   19. 公告弹窗 (v3-ann-*)
   ========================================================================== */
.v3-ann-backdrop {
    position: fixed; inset: 0; z-index: 9999;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    animation: fadeIn 220ms ease-out;
}
.v3-ann-modal {
    position: relative;
    max-width: 520px; width: 100%;
    background: var(--surface-glass);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: v3-ann-in 240ms ease-out;
}
.v3-ann-close {
    position: absolute; top: 12px; right: 12px;
    width: 32px; height: 32px;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,0.3);
    color: #fff;
    border: none; border-radius: var(--r-full);
    cursor: pointer; font-size: 18px; line-height: 1;
    z-index: 2;
    transition: background var(--tr-fast);
}
.v3-ann-close:hover { background: rgba(0,0,0,0.5); }
.v3-ann-banner {
    position: relative;
    padding: 36px 28px 60px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    text-align: center;
    overflow: hidden;
}
.v3-ann-banner-icon {
    width: 56px; height: 56px;
    margin: 0 auto 14px;
    background: rgba(255,255,255,0.18);
    border-radius: var(--r-lg);
    display: flex; align-items: center; justify-content: center;
    backdrop-filter: blur(6px);
}
.v3-ann-banner-icon svg { width: 28px; height: 28px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.v3-ann-title {
    font-size: var(--fs-2xl);
    font-weight: var(--fw-b);
    line-height: 1.3;
    letter-spacing: -0.2px;
}
.v3-ann-sub {
    margin-top: 8px;
    font-size: var(--fs-sm);
    color: rgba(255,255,255,0.85);
    line-height: 1.5;
}
.v3-ann-tags {
    display: flex; flex-wrap: wrap; gap: 6px;
    justify-content: center;
    margin-top: 14px;
}
.v3-ann-tag {
    display: inline-flex;
    padding: 4px 10px;
    font-size: 11px;
    background: rgba(255,255,255,0.18);
    color: #fff;
    border-radius: var(--r-full);
    backdrop-filter: blur(4px);
}
.v3-ann-cta {
    position: absolute;
    left: 50%; bottom: -22px;
    transform: translateX(-50%);
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0 22px; height: 44px;
    background: #fff;
    color: var(--primary);
    font-size: var(--fs-sm); font-weight: var(--fw-s);
    text-decoration: none;
    border-radius: var(--r-full);
    box-shadow: 0 4px 16px rgba(0,0,0,0.18);
    transition: transform var(--tr-fast), box-shadow var(--tr-fast);
}
.v3-ann-cta:hover { transform: translateX(-50%) translateY(-1px); box-shadow: 0 6px 20px rgba(0,0,0,0.25); }
.v3-ann-body {
    padding: 32px 24px 16px;
    max-height: 40vh;
    overflow-y: auto;
    color: var(--text-2);
    font-size: var(--fs-sm);
    line-height: 1.7;
}
.v3-ann-actions {
    display: flex; gap: 8px; justify-content: flex-end;
    padding: 12px 20px 18px;
    border-top: 1px solid var(--border);
}
.v3-ann-btn {
    height: 36px; padding: 0 16px;
    border: 1px solid var(--border-strong);
    border-radius: var(--r-md);
    background: transparent;
    color: var(--text-2);
    font-size: var(--fs-sm);
    cursor: pointer;
    transition: all var(--tr-fast);
}
.v3-ann-btn-ghost:hover { background: var(--bg-mute); color: var(--text); }
.v3-ann-btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.v3-ann-btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }

/* ==========================================================================
   20. 悬浮聊天客服小部件 (v3-chat-fab, v3-chat-panel)
   注意：与聊天页 v3-chat-page 共用部分样式，但面板是浮层形态
   ========================================================================== */
.v3-chat-fab {
    position: fixed;
    right: 24px; bottom: 24px;
    width: 56px; height: 56px;
    border-radius: var(--r-full);
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
    border: none; cursor: pointer;
    z-index: 9990;
    transition: transform var(--tr-fast), box-shadow var(--tr-fast);
}
.v3-chat-fab:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(139, 92, 246, 0.5); }
.v3-chat-fab svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.v3-chat-fab-badge {
    position: absolute;
    top: -2px; right: -2px;
    min-width: 18px; height: 18px; padding: 0 5px;
    background: var(--red);
    color: #fff;
    font-size: 11px; font-weight: var(--fw-s);
    border-radius: var(--r-full);
    display: inline-flex; align-items: center; justify-content: center;
    border: 2px solid var(--bg);
}

.v3-chat-panel {
    position: fixed;
    right: 24px; bottom: 92px;
    width: 360px; max-width: calc(100vw - 32px);
    height: 540px; max-height: calc(100vh - 120px);
    background: var(--surface-glass);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-lg);
    z-index: 9991;
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: v3-ann-in 220ms ease-out;
}
.v3-chat-panel.is-show { display: flex; }
.v3-chat-panel-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    flex-shrink: 0;
}
.v3-chat-panel-head-info { display: flex; align-items: center; gap: 10px; }
.v3-chat-panel-avatar {
    width: 36px; height: 36px;
    background: rgba(255,255,255,0.2);
    color: #fff;
    border-radius: var(--r-md);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: var(--fs-sm); font-weight: var(--fw-s);
}
.v3-chat-panel-title { font-size: var(--fs-md); font-weight: var(--fw-s); line-height: 1.2; }
.v3-chat-panel-sub { font-size: 12px; color: rgba(255,255,255,0.85); margin-top: 1px; }
.v3-chat-panel-close {
    width: 28px; height: 28px;
    background: rgba(255,255,255,0.15);
    color: #fff;
    border: none; border-radius: var(--r-md);
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    transition: background var(--tr-fast);
}
.v3-chat-panel-close:hover { background: rgba(255,255,255,0.28); }
.v3-chat-panel-close svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

.v3-chat-body {
    flex: 1; min-height: 0;
    overflow-y: auto;
    padding: 14px;
    display: flex; flex-direction: column; gap: 10px;
    background: var(--bg);
}
.v3-chat-foot {
    display: flex; align-items: flex-end; gap: 8px;
    padding: 10px 12px 12px;
    border-top: 1px solid var(--border);
    background: var(--bg-soft);
    flex-shrink: 0;
}
.v3-chat-input {
    flex: 1; min-width: 0;
    min-height: 36px; max-height: 100px;
    padding: 8px 10px;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-md);
    font: inherit; font-size: var(--fs-sm);
    line-height: 1.5;
    resize: none; outline: none;
    transition: border-color var(--tr-fast), box-shadow var(--tr-fast);
}
.v3-chat-input::placeholder { color: var(--text-4); }
.v3-chat-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.v3-chat-send {
    width: 36px; height: 36px;
    background: var(--primary);
    color: #fff;
    border: none; border-radius: var(--r-md);
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    transition: background var(--tr-fast);
}
.v3-chat-send:hover { background: var(--primary-hover); }
.v3-chat-send svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* 面板里的消息气泡基础样式（共享 chat 页） */
.v3-chat-panel .v3-chat-msg {
    max-width: 85%;
    padding: 8px 12px;
    border-radius: var(--r-md);
    font-size: var(--fs-sm);
    line-height: 1.5;
    color: var(--text);
    word-wrap: break-word;
    white-space: pre-wrap;
}
.v3-chat-panel .v3-chat-msg--ai {
    align-self: flex-start;
    background: var(--bg-mute);
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px;
}
.v3-chat-panel .v3-chat-msg--user {
    align-self: flex-end;
    background: var(--primary);
    color: #fff;
    border-bottom-right-radius: 4px;
}

@media (max-width: 480px) {
    .v3-chat-panel {
        right: 12px; left: 12px; bottom: 84px;
        width: auto; height: calc(100vh - 110px);
    }
    .v3-chat-fab { right: 16px; bottom: 16px; }
}

/* ==========================================================================
   21. 通用 Switch / 开关
   ========================================================================== */
.switch {
    position: relative;
    display: inline-block;
    width: 40px; height: 22px;
    flex-shrink: 0;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider {
    position: absolute; cursor: pointer; inset: 0;
    background: var(--bg-mute);
    border-radius: var(--r-full);
    transition: background var(--tr-fast);
}
.switch-slider::before {
    content: '';
    position: absolute;
    left: 3px; top: 3px;
    width: 16px; height: 16px;
    background: #fff;
    border-radius: var(--r-full);
    transition: transform var(--tr-fast);
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.switch input:checked + .switch-slider { background: var(--primary); }
.switch input:checked + .switch-slider::before { transform: translateX(18px); }

/* ==========================================================================
   22. AI 创作工作台 / Generate 页面 (gen-*, v3-model-list)
   ========================================================================== */
.gen-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 360px);
    gap: 20px;
    align-items: start;
}
@media (max-width: 980px) {
    .gen-grid { grid-template-columns: 1fr; }
}
.gen-panel {
    display: flex; flex-direction: column; gap: 16px;
}
.gen-result {
    position: sticky;
    top: calc(var(--topbar-h) + 16px);
    min-height: 380px;
    display: flex; flex-direction: column;
}

.gen-prompt {
    position: relative;
    background: var(--bg);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-md);
    padding: 10px 12px;
    transition: border-color var(--tr-fast), box-shadow var(--tr-fast);
}
.gen-prompt:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.gen-ref-list {
    display: flex; flex-wrap: wrap; gap: 6px;
    margin-bottom: 8px;
}
.gen-ref-list:empty { display: none; }
.gen-ref-list > div {
    position: relative;
    width: 56px; height: 56px;
    border-radius: var(--r-sm);
    overflow: hidden;
    border: 1px solid var(--border);
}
.gen-ref-list img { width: 100%; height: 100%; object-fit: cover; }
.gen-ref-del {
    position: absolute; top: 2px; right: 2px;
    width: 18px; height: 18px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    border: none; border-radius: var(--r-full);
    cursor: pointer;
    font-size: 12px; line-height: 1;
    display: inline-flex; align-items: center; justify-content: center;
}
.gen-prompt-toolbar {
    display: flex; align-items: center; gap: 6px;
    margin-top: 8px;
    flex-wrap: wrap;
}
.gen-tool {
    display: inline-flex; align-items: center; gap: 4px;
    height: 30px; padding: 0 10px;
    background: var(--bg-mute);
    color: var(--text-2);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    font-size: 12px;
    cursor: pointer;
    transition: all var(--tr-fast);
    position: relative;
}
.gen-tool:hover { background: var(--primary-soft); color: var(--primary); border-color: var(--border-glow); }
.gen-tool-badge {
    min-width: 16px; height: 16px; padding: 0 4px;
    background: var(--primary);
    color: #fff;
    font-size: 10px; font-weight: var(--fw-s);
    border-radius: var(--r-full);
    display: inline-flex; align-items: center; justify-content: center;
}
.gen-tool-spacer { flex: 1; }
.gen-counter { font-size: 12px; color: var(--text-3); padding: 0 4px; }

.gen-param-row {
    display: flex; gap: 16px; flex-wrap: wrap;
    align-items: flex-start;
}
.gen-param-row > div { display: flex; flex-direction: column; gap: 8px; }
.gen-pills {
    display: flex; gap: 6px; flex-wrap: wrap;
}
.gen-pill {
    display: inline-flex; align-items: center; justify-content: center;
    height: 30px; padding: 0 12px;
    background: var(--bg-mute);
    color: var(--text-2);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    font-size: var(--fs-sm);
    cursor: pointer;
    transition: all var(--tr-fast);
}
.gen-pill:hover { border-color: var(--primary); color: var(--primary); }
.gen-pill.is-active {
    background: var(--primary-soft);
    color: var(--primary);
    border-color: var(--primary);
}
.gen-hidden-select { display: none; }

.gen-style-grid {
    display: flex; gap: 6px; flex-wrap: wrap;
}
.gen-style-chip {
    display: inline-flex; align-items: center; justify-content: center;
    height: 30px; padding: 0 12px;
    background: var(--bg-mute);
    color: var(--text-2);
    border: 1px solid var(--border);
    border-radius: var(--r-full);
    font-size: 12px;
    cursor: pointer;
    transition: all var(--tr-fast);
}
.gen-style-chip:hover { border-color: var(--primary); color: var(--primary); }
.gen-style-chip.is-active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.gen-helper-actions {
    display: flex; gap: 8px; flex-wrap: wrap;
    margin-top: 8px;
}

.gen-cost-bar {
    display: flex; align-items: center; gap: 16px;
    padding: 12px 16px;
    background: var(--bg-soft);
    border-radius: var(--r-md);
    margin: 12px 0 16px;
}
.gen-cost-item { display: flex; flex-direction: column; gap: 2px; }
.gen-cost-label { font-size: 11px; color: var(--text-3); }
.gen-cost-item strong { font-size: var(--fs-md); color: var(--text); font-weight: var(--fw-s); }
.gen-cost-balance { color: var(--primary); }
.gen-cost-divider { width: 1px; height: 24px; background: var(--border); }

.gen-result-head-ok {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 14px;
    background: var(--success-bg);
    color: var(--success);
    border-radius: var(--r-md);
    margin-bottom: 12px;
    font-size: var(--fs-sm); font-weight: var(--fw-s);
}
.gen-result-images {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}
.gen-result-card {
    position: relative;
    border-radius: var(--r-md);
    overflow: hidden;
    background: var(--bg-mute);
    border: 1px solid var(--border);
    transition: transform var(--tr-fast);
}
.gen-result-card:hover { transform: translateY(-1px); }
.gen-result-card img { width: 100%; display: block; aspect-ratio: 1; object-fit: cover; }
.gen-image-actions {
    position: absolute; top: 8px; right: 8px;
    display: flex; gap: 4px;
    opacity: 0;
    transition: opacity var(--tr-fast);
}
.gen-result-card:hover .gen-image-actions { opacity: 1; }
.gen-image-actions .btn { font-size: 11px; height: 26px; padding: 0 10px; }
.gen-image-index {
    position: absolute; top: 8px; left: 8px;
    min-width: 22px; height: 22px; padding: 0 6px;
    background: rgba(0,0,0,0.5);
    color: #fff;
    font-size: 11px; font-weight: var(--fw-s);
    border-radius: var(--r-full);
    display: inline-flex; align-items: center; justify-content: center;
}
.gen-result-prompt {
    margin-top: 14px;
    padding: 12px 14px;
    background: var(--bg-soft);
    border-radius: var(--r-md);
    border: 1px solid var(--border);
}
.gen-rp-label { font-size: 11px; color: var(--text-3); margin-bottom: 4px; }
.gen-rp-text { font-size: var(--fs-sm); color: var(--text); line-height: 1.6; word-break: break-word; }
.gen-result-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.gen-result-error {
    text-align: center;
    padding: 40px 20px;
}
.gen-btn-text { display: inline-flex; align-items: center; gap: 4px; }
.gen-img-view { background: var(--bg-mute); }

/* v3-model-list: 模型卡片 */
.v3-model-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 10px;
}
.v3-model-card {
    display: block;
    padding: 12px 14px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    cursor: pointer;
    transition: all var(--tr-fast);
}
.v3-model-card:hover { border-color: var(--primary); }
.v3-model-card.is-active {
    background: var(--primary-soft);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}
.v3-model-info { display: flex; flex-direction: column; gap: 4px; }

/* ==========================================================================
   23. 订单 / 套餐卡片 (v3-package-*, v3-data-table, v3-filter-chips, v3-chip)
   ========================================================================== */
.v3-packages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}
.v3-package-card {
    position: relative;
    padding: 20px 18px;
    display: flex; flex-direction: column; gap: 12px;
    border-radius: var(--r-lg);
    transition: transform var(--tr-fast), box-shadow var(--tr-fast);
}
.v3-package-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.v3-package-card--hot {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary-soft), 0 4px 16px rgba(139, 92, 246, 0.18);
}
.v3-package-badge {
    position: absolute; top: 12px; right: 12px;
    padding: 2px 10px;
    background: linear-gradient(135deg, var(--primary), var(--pink));
    color: #fff;
    font-size: 11px; font-weight: var(--fw-s);
    border-radius: var(--r-full);
}
.v3-package-name {
    font-size: var(--fs-lg);
    font-weight: var(--fw-s);
    color: var(--text);
    line-height: 1.3;
    padding-right: 50px;
}
.v3-package-points {
    display: flex; align-items: baseline; gap: 6px;
}
.v3-package-points-num {
    font-size: 28px;
    font-weight: var(--fw-b);
    color: var(--primary);
    line-height: 1;
}
.v3-package-points-label { font-size: var(--fs-sm); color: var(--text-3); }
.v3-package-price {
    display: flex; align-items: center; gap: 8px;
    flex-wrap: wrap;
}
.v3-package-price-original {
    font-size: 13px;
    color: var(--text-3);
    text-decoration: line-through;
}
.v3-package-price-discount {
    font-size: 11px;
    color: var(--success);
    background: var(--success-bg);
    padding: 2px 6px;
    border-radius: var(--r-xs);
}
.v3-package-price-current {
    display: inline-flex; align-items: baseline;
    color: var(--text);
    font-weight: var(--fw-b);
}
.v3-package-currency { font-size: 14px; margin-right: 1px; }
.v3-package-price-current { font-size: 22px; }
.v3-package-features {
    display: flex; flex-direction: column; gap: 6px;
    padding: 12px 0;
    border-top: 1px dashed var(--border);
    border-bottom: 1px dashed var(--border);
}
.v3-package-feature {
    display: flex; align-items: center; gap: 6px;
    font-size: var(--fs-sm);
    color: var(--text-2);
}
.v3-package-feature::before {
    content: '✓';
    color: var(--success);
    font-weight: var(--fw-s);
}

/* Data Table */
.v3-data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--fs-sm);
}
.v3-data-table th, .v3-data-table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.v3-data-table th {
    font-weight: var(--fw-s);
    color: var(--text-3);
    background: var(--bg-soft);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.v3-data-table tbody tr:hover { background: var(--bg-mute); }
.v3-data-table td { color: var(--text-2); }

/* Filter chips */
.v3-filter-chips {
    display: flex; gap: 6px; flex-wrap: wrap;
    margin-bottom: 14px;
}
.v3-chip {
    display: inline-flex; align-items: center; gap: 4px;
    height: 30px; padding: 0 14px;
    background: var(--bg-soft);
    color: var(--text-2);
    border: 1px solid var(--border);
    border-radius: var(--r-full);
    font-size: var(--fs-sm);
    cursor: pointer;
    text-decoration: none;
    transition: all var(--tr-fast);
}
.v3-chip:hover { border-color: var(--primary); color: var(--primary); }
.v3-chip.is-active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ==========================================================================
   24. 我的作品 / Records (v3-work-*)
   ========================================================================== */
.v3-works-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}
.v3-work-card {
    overflow: hidden;
    border-radius: var(--r-lg);
    transition: transform var(--tr-fast);
}
.v3-work-card:hover { transform: translateY(-2px); }
.v3-work-image-wrap {
    position: relative;
    aspect-ratio: 1;
    background: var(--bg-mute);
    overflow: hidden;
}
.v3-work-image {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform var(--tr-slow);
}
.v3-work-card:hover .v3-work-image { transform: scale(1.05); }
.v3-work-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.65), transparent 50%);
    display: flex; align-items: flex-end; justify-content: center;
    padding: 12px;
    opacity: 0;
    transition: opacity var(--tr-fast);
}
.v3-work-card:hover .v3-work-overlay { opacity: 1; }
.v3-work-actions {
    display: flex; gap: 6px;
}
.v3-work-act-btn {
    width: 34px; height: 34px;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.18);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.22);
    border-radius: var(--r-md);
    color: #fff;
    cursor: pointer;
    text-decoration: none;
    transition: background var(--tr-fast);
}
.v3-work-act-btn:hover { background: rgba(255,255,255,0.32); color: #fff; }
.v3-work-act-emoji { font-size: 15px; line-height: 1; }
.v3-work-badge {
    position: absolute; top: 8px; left: 8px;
    padding: 2px 8px;
    background: rgba(0,0,0,0.5);
    color: #fff;
    font-size: 10px; font-weight: var(--fw-s);
    border-radius: var(--r-full);
    backdrop-filter: blur(6px);
}
.v3-work-info { padding: 12px 14px 14px; }
.v3-work-meta-top {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 6px;
    font-size: 11px; color: var(--text-3);
}
.v3-work-prompt {
    font-size: var(--fs-sm);
    color: var(--text-2);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 36px;
}
.v3-work-footer {
    display: flex; align-items: center; justify-content: space-between;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-3);
}
.v3-work-buttons {
    display: flex; gap: 6px; flex-wrap: wrap;
    margin-top: 10px;
}
.v3-work-btn {
    flex: 1; min-width: 60px;
    height: 28px; padding: 0 10px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--bg-mute);
    color: var(--text-2);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    font-size: 12px;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--tr-fast);
}
.v3-work-btn:hover { background: var(--primary-soft); color: var(--primary); border-color: var(--border-glow); }
.v3-work-remove-wm.is-done { background: var(--success-bg); color: var(--success); border-color: var(--success); }

/* ==========================================================================
   25. VIP 会员中心 (v3-vip-*)
   ========================================================================== */
.v3-vip-hero {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #1f1b3a 0%, #4c1d95 50%, #6d28d9 100%);
    color: #fff;
    padding: 32px 28px;
    border: 1px solid var(--border-strong);
    margin-bottom: 24px;
}
.v3-vip-hero::before {
    content: '';
    position: absolute; top: -50%; right: -10%;
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.4), transparent 60%);
    border-radius: 50%;
    filter: blur(40px);
    pointer-events: none;
}
.v3-vip-hero-inner {
    position: relative;
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; flex-wrap: wrap;
}
.v3-vip-hero-title {
    font-size: var(--fs-3xl);
    font-weight: var(--fw-b);
    line-height: 1.2;
}
.v3-vip-hero-sub { font-size: var(--fs-sm); color: rgba(255,255,255,0.8); margin-top: 6px; }
.v3-vip-plans {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}
.v3-vip-plan {
    position: relative;
    padding: 22px 18px;
    text-align: center;
    display: flex; flex-direction: column; gap: 10px;
    border-radius: var(--r-lg);
    transition: transform var(--tr-fast);
}
.v3-vip-plan:hover { transform: translateY(-2px); }
.v3-vip-plan--rec {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary-soft), 0 6px 20px rgba(139, 92, 246, 0.2);
}
.v3-vip-rec-badge {
    position: absolute; top: -10px; left: 50%;
    transform: translateX(-50%);
    padding: 4px 14px;
    background: linear-gradient(135deg, var(--primary), var(--pink));
    color: #fff;
    font-size: 11px; font-weight: var(--fw-s);
    border-radius: var(--r-full);
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.4);
    white-space: nowrap;
}
.v3-vip-plan-name { font-size: var(--fs-lg); font-weight: var(--fw-s); color: var(--text); }
.v3-vip-plan-price { font-size: 30px; font-weight: var(--fw-b); color: var(--primary); line-height: 1.1; }
.v3-vip-plan-meta { font-size: 12px; color: var(--text-3); }
.v3-vip-plan-features { display: flex; flex-direction: column; gap: 6px; text-align: left; padding: 10px 0; }
.v3-vip-feature { display: flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--text-2); }
.v3-vip-feature::before { content: '👑'; font-size: 12px; }

/* ==========================================================================
   26. 帮助中心 (v3-help-*, v3-help-article-content)
   ========================================================================== */
.v3-help-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}
.v3-help-card {
    display: flex; gap: 12px;
    padding: 16px;
    text-decoration: none;
    color: inherit;
    border-radius: var(--r-lg);
    transition: transform var(--tr-fast), box-shadow var(--tr-fast);
}
.v3-help-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); color: inherit; }
.v3-help-card-icon {
    width: 44px; height: 44px;
    flex-shrink: 0;
    background: var(--primary-soft);
    color: var(--primary);
    border-radius: var(--r-md);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 20px;
}
.v3-help-card-body { flex: 1; min-width: 0; }
.v3-help-card-title {
    font-size: var(--fs-md);
    font-weight: var(--fw-s);
    color: var(--text);
    line-height: 1.4;
    margin-bottom: 4px;
}
.v3-help-card-meta {
    display: flex; align-items: center; gap: 8px;
    font-size: 12px; color: var(--text-3);
    margin-top: 6px;
}
.v3-help-card-more {
    color: var(--primary);
    font-weight: var(--fw-m);
    margin-left: auto;
}

.v3-help-article-content {
    color: var(--text-2);
    font-size: var(--fs-md);
    line-height: 1.8;
}
.v3-help-article-content h1, .v3-help-article-content h2, .v3-help-article-content h3 {
    color: var(--text);
    margin: 1.4em 0 0.6em;
    line-height: 1.4;
}
.v3-help-article-content h1 { font-size: var(--fs-2xl); }
.v3-help-article-content h2 { font-size: var(--fs-xl); }
.v3-help-article-content h3 { font-size: var(--fs-lg); }
.v3-help-article-content p { margin: 0.8em 0; }
.v3-help-article-content a { color: var(--primary); text-decoration: none; }
.v3-help-article-content a:hover { text-decoration: underline; }
.v3-help-article-content code {
    background: var(--bg-mute);
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 13px;
}
.v3-help-article-content pre {
    background: var(--bg-mute);
    padding: 12px 14px;
    border-radius: var(--r-md);
    overflow-x: auto;
    margin: 1em 0;
}
.v3-help-article-content ul, .v3-help-article-content ol { padding-left: 1.4em; margin: 0.8em 0; }
.v3-help-article-content li { margin: 0.3em 0; }

