/* ========== SeeWish AI - Shared Styles ========== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { overflow-x: hidden; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

/* Top Banner */
.top-banner {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4338ca 100%);
    color: #fff; text-align: center; padding: 10px 0; font-size: 14px; position: relative; overflow: hidden;
}
.top-banner::before {
    content: ''; position: absolute; top: 0; left: -50%; width: 200%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    animation: bannerShine 3s ease-in-out infinite;
}
@keyframes bannerShine { 0%, 100% { transform: translateX(-100%); } 50% { transform: translateX(0%); } }
.top-banner span { position: relative; z-index: 1; }
.top-banner .badge { display: inline-block; background: rgba(255,255,255,0.2); border-radius: 12px; padding: 2px 10px; margin-right: 8px; font-size: 12px; font-weight: 600; }

/* Header */
.header {
    position: sticky; top: 0; z-index: 1000;
    background: rgba(255,255,255,0.92); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0,0,0,0.06); transition: box-shadow 0.3s;
}
.header.scrolled { box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.header-inner { max-width: 1200px; margin: 0 auto; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 700; color: #1e1b4b; }
.logo-icon { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.nav { display: flex; align-items: center; gap: 32px; }
.nav a { color: #475569; font-size: 15px; font-weight: 500; transition: color 0.3s; position: relative; display: inline-flex; align-items: center; gap: 5px; }
.nav a .nav-icon { width: 15px; height: 15px; flex-shrink: 0; opacity: 0.65; transition: opacity 0.3s; }
.nav a:hover .nav-icon { opacity: 1; }
.nav a:hover, .nav a.active { color: #6366f1; }
.nav a::after {
    content: ''; position: absolute; bottom: -4px; left: 0; width: 0; height: 2px;
    background: #6366f1; transition: width 0.3s;
}
.nav a:hover::after { width: 100%; }
.header-cta {
    background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff; padding: 10px 20px;
    border-radius: 8px; font-size: 14px; font-weight: 600; transition: transform 0.3s, box-shadow 0.3s;
}
.header-cta:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(99,102,241,0.4); color: #fff; }

/* Dark Mode Toggle */
.dark-toggle { background: none; border: 1px solid #e2e8f0; cursor: pointer; padding: 6px 10px; border-radius: 8px; font-size: 15px; margin-right: 8px; transition: all 0.2s; }
.dark-toggle:hover { border-color: #6366f1; }

/* Dark Mode */
html.dark { --bg: #0f172a; --bg-card: #1e293b; --text: #e2e8f0; --text-muted: #94a3b8; --border: #334155; --header-bg: rgba(15,23,42,0.92); }
html { --bg: #fff; --bg-card: #fff; --text: #1e293b; --text-muted: #64748b; --border: #f1f5f9; --header-bg: rgba(255,255,255,0.92); }
html.dark body { background: var(--bg); color: var(--text); }
html.dark .header { background: var(--header-bg); border-color: var(--border); }
html.dark .section, html.dark .features, html.dark .gallery, html.dark .pricing, html.dark .process, html.dark .faq { background: var(--bg); }
html.dark .feature-card, html.dark .process-step, html.dark .gallery-item, html.dark .faq-item, html.dark .pricing-card { background: var(--bg-card); border-color: var(--border); }
html.dark .logo, html.dark h1, html.dark h2, html.dark h3, html.dark .section-title { color: var(--text); }
html.dark .section-desc, html.dark .feature-subtitle, html.dark p { color: var(--text-muted); }
html.dark .nav a { color: var(--text-muted); }
html.dark .nav a:hover { color: #818cf8; }
html.dark .feature-icon { background: #1e293b; }
html.dark .section-tag { background: #1e293b; color: #a5b4fc; }
html.dark .step-number, html.dark .step-line { background: #334155; }
html.dark .user-menu-trigger { background: #1e293b; border-color: #334155; color: var(--text); }
html.dark .user-dropdown { background: #1e293b; border-color: #334155; }
html.dark .dd-header { border-color: #334155; }
html.dark .dd-item:hover { background: #0f172a; }
html.dark .mobile-nav { background: #1e293b; }
html.dark .mobile-nav-group-title { color: #64748b; }
html.dark .mobile-nav a { color: var(--text-muted); }
html.dark .nav-overlay { background: rgba(0,0,0,0.9); }
html.dark .credits-badge { background: #312e81; color: #a5b4fc; }
html.dark .dd-divider { background: #334155; }
html.dark .mobile-user-section .mu-item { color: var(--text-muted); }

/* User Dropdown */
#authArea {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.user-menu { position: relative; display: inline-flex; align-items: center; }
.user-menu-trigger {
    display: flex; align-items: center; gap: 6px; cursor: pointer; padding: 6px 8px 6px 6px; border-radius: 10px;
    background: #f8fafc; border: 1px solid #e2e8f0; font-size: 13px; font-weight: 500; color: #1e293b; transition: all 0.2s;
    max-width: 108px; min-width: 0;
}
.user-menu-trigger .user-menu-label {
    flex: 1 1 0; min-width: 0; max-width: 64px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.user-menu-trigger:hover { border-color: #cbd5e1; background: #f1f5f9; }

/* Header Customer Service (same as draw app) */
.draw-app-header__service { position: relative; }
.draw-app-header__service-trigger {
    display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px;
    border-radius: 999px; border: 1px solid #e2e8f0; background: #fff; color: #64748b;
    font-size: 13px; cursor: default; transition: border-color 0.22s ease, box-shadow 0.22s ease, transform 0.22s ease;
    font: inherit;
}
.draw-app-header__service:hover .draw-app-header__service-trigger,
.draw-app-header__service:focus-within .draw-app-header__service-trigger {
    border-color: #c7d2fe; box-shadow: 0 8px 20px -14px rgba(99, 102, 241, 0.45); transform: translateY(-1px);
}
.draw-app-header__service-icon { display: flex; color: #6366f1; }
.draw-app-header__service-icon svg { width: 16px; height: 16px; }
.draw-app-header__service-label { font-weight: 600; color: #334155; }
.draw-app-header__service-popover {
    position: absolute; top: calc(100% + 10px); right: 0; min-width: 168px; padding: 12px;
    border-radius: 12px; border: 1px solid #e2e8f0; background: #fff;
    box-shadow: 0 16px 40px -20px rgba(15, 23, 42, 0.35);
    opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(4px);
    transition: opacity 0.18s ease, visibility 0.18s ease, transform 0.18s ease; z-index: 1200;
}
.draw-app-header__service:hover .draw-app-header__service-popover,
.draw-app-header__service:focus-within .draw-app-header__service-popover {
    opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0);
}
.draw-app-header__service-qr {
    display: block; width: 144px; height: 144px; object-fit: contain; border-radius: 8px; background: #f8fafc;
}
.draw-app-header__service-tip { margin: 8px 0 0; font-size: 12px; line-height: 1.4; color: #64748b; text-align: center; }
.draw-app-header__service-tip--empty { margin: 0; padding: 8px 4px; }
html.dark .draw-app-header__service-trigger { background: #1e293b; border-color: #334155; }
html.dark .draw-app-header__service-label { color: var(--text); }
html.dark .draw-app-header__service-popover { background: #1e293b; border-color: #334155; }
html.dark .draw-app-header__service-tip { color: var(--text-muted); }

.user-avatar {
    width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.user-dropdown {
    display: none; position: absolute; top: 100%; right: 0; margin-top: 8px;
    background: #fff; border: 1px solid #e2e8f0; border-radius: 14px;
    box-shadow: 0 20px 40px -8px rgba(0,0,0,0.12); min-width: 200px; z-index: 1050; overflow: hidden;
}
.user-dropdown.show { display: block; }
.user-dropdown .dd-header {
    padding: 14px 16px; border-bottom: 1px solid #f1f5f9; display: flex; align-items: center; gap: 10px;
}
.user-dropdown .dd-header .name { font-weight: 600; font-size: 14px; color: #1e293b; }
.user-dropdown .dd-header .email { font-size: 11px; color: #94a3b8; margin-top: 1px; }
.user-dropdown .dd-header-meta { min-width: 0; flex: 1; }
.user-dropdown .dd-tier {
    display: inline-block; margin-top: 6px; padding: 2px 8px; border-radius: 6px;
    font-size: 10px; font-weight: 700; letter-spacing: 0.02em;
}
.user-dropdown .dd-tier-free { background: #f1f5f9; color: #64748b; }
.user-dropdown .dd-tier-boost { background: #eef2ff; color: #6366f1; }
.user-dropdown .dd-tier-agent { background: #fce7f3; color: #db2777; }
.user-dropdown .dd-tier-custom { background: #fef9c3; color: #ca8a04; }
.mu-tier { font-size: 11px; font-weight: 600; margin-top: 2px; }
.mu-tier-free { color: #94a3b8; }
.mu-tier-boost { color: #6366f1; }
.mu-tier-agent { color: #db2777; }
.mu-tier-custom { color: #ca8a04; }
html.dark .dd-tier-free { background: #334155; color: #cbd5e1; }
html.dark .dd-tier-boost { background: #312e81; color: #c7d2fe; }
html.dark .dd-tier-agent { background: #500724; color: #fbcfe8; }
html.dark .dd-tier-custom { background: #422006; color: #fde68a; }
.user-dropdown .dd-item {
    display: flex; align-items: center; gap: 8px; padding: 10px 16px;
    font-size: 13px; color: #475569; cursor: pointer; transition: background 0.15s;
}
.user-dropdown .dd-item:hover { background: #f8fafc; color: #6366f1; }
.user-dropdown .dd-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.user-dropdown .dd-divider { height: 1px; background: #f1f5f9; }
.user-dropdown .dd-daily-claim {
    color: #4338ca; font-weight: 600; background: linear-gradient(135deg, #eef2ff, #faf5ff);
}
.user-dropdown .dd-daily-claim:hover { background: #e0e7ff; color: #4338ca; }
.user-dropdown .dd-daily-claim.is-done { color: #94a3b8; font-weight: 500; background: transparent; cursor: default; }
.user-dropdown .dd-daily-claim.is-done:hover { background: transparent; color: #94a3b8; }
.credits-badge {
    display: inline-flex; align-items: center; gap: 3px; background: #eef2ff;
    color: #6366f1; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 6px; margin-left: 4px;
}

/* Mobile Nav */
.mobile-menu-btn { display: block; background: none; border: none; cursor: pointer; padding: 8px; color: #1e293b; position: relative; z-index: 1120; }
.mobile-menu-btn svg { width: 24px; height: 24px; }
.nav-overlay {
    position: fixed; inset: 0; z-index: 1100; background: rgba(0,0,0,0.8);
    opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
.nav-overlay[data-state="open"] { opacity: 1; pointer-events: auto; }
.nav-overlay[data-state="closed"] { opacity: 0; pointer-events: none; }
.mobile-nav {
    position: fixed; top: 0; right: 0; bottom: 0; width: 300px; max-width: 85vw;
    background: #fff; z-index: 1110; padding: 80px 28px 28px;
    display: flex; flex-direction: column; gap: 0;
    transform: translateX(100%); transition: transform 0.35s cubic-bezier(0.23, 1, 0.32, 1);
    box-shadow: -8px 0 30px rgba(0,0,0,0.12); overflow-y: auto;
}
.mobile-nav[data-state="open"] { transform: translateX(0); }
.mobile-nav[data-state="closed"] { transform: translateX(100%); }
.mobile-nav-close {
    position: absolute; top: 20px; right: 20px; width: 36px; height: 36px;
    border-radius: 8px; border: none; background: #f1f5f9; cursor: pointer;
    display: flex; align-items: center; justify-content: center; color: #475569; transition: all 0.2s;
}
.mobile-nav-close:hover { background: #e2e8f0; color: #1e293b; }
.mobile-nav-close svg { width: 18px; height: 18px; }
.mobile-nav-group { margin-bottom: 20px; }
.mobile-nav-group-title { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: #94a3b8; margin-bottom: 8px; padding: 0 4px; }
.mobile-nav a { display: flex; align-items: center; gap: 10px; padding: 12px 16px; font-size: 16px; font-weight: 500; color: #334155; border-radius: 10px; transition: all 0.2s; }
.mobile-nav a:hover { background: #f8fafc; color: #6366f1; }
.mobile-nav a.nav-cta-mobile { margin-top: 16px; justify-content: center; background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff; font-weight: 600; border-radius: 12px; padding: 14px 24px; }

/* Mobile User Section */
.mobile-user-section { display: none; padding: 0 0 12px 0; }
.mobile-user-section.show { display: block; }
.mobile-user-section .mu-item {
    display: flex; align-items: center; gap: 8px; padding: 10px 4px;
    font-size: 14px; color: #475569; font-weight: 500;
}
.mobile-user-section .mu-item svg { width: 18px; height: 18px; opacity: 0.6; }
.mobile-user-section .mu-daily-claim {
    color: #4338ca; font-weight: 600;
    background: linear-gradient(135deg, #eef2ff, #faf5ff);
    border-radius: 10px; margin-bottom: 4px;
}
.mobile-user-section .mu-daily-claim.is-done { color: #94a3b8; font-weight: 500; background: transparent; }
.mobile-user-section .mu-logout {
    color: #ef4444; cursor: pointer; display: flex; align-items: center; gap: 8px;
    padding: 10px 4px; font-size: 14px; font-weight: 500;
}
.mobile-user-section .mu-logout svg { width: 18px; height: 18px; flex-shrink: 0; }

/* 等级权益入口：登录后显示（胶囊样式） */
.nav-pricing-link { display: none !important; }
body.logged-in .nav.draw-app-header__nav .nav-pricing-link,
body.logged-in .draw-app-header__nav .nav-pricing-link { display: inline-flex !important; }
body.logged-in .mobile-nav .nav-pricing-link { display: inline-flex !important; }
body.logged-in a.nav-pricing-link.nav-pricing-inline { display: inline-flex !important; }

/* 已迁移至 AI 视觉制图，主站顶栏隐藏旧入口 */
.header a[href="studio-genesis.html"],
.header a[href="/studio-genesis.html"],
.header a[href="clothing-studio.html"],
.header a[href="refinement-studio.html"],
.header a[href="image-editor.html"],
.header a[href="aesthetic-mirror.html"],
.header a[href="video-studio.html"],
.header a[href="/draw/home"],
.nav a[href="studio-genesis.html"],
.nav a[href="/studio-genesis.html"],
.nav a[href="clothing-studio.html"],
.nav a[href="refinement-studio.html"],
.nav a[href="image-editor.html"],
.nav a[href="aesthetic-mirror.html"],
.nav a[href="video-studio.html"],
.nav a[href="/draw/home"],
.mobile-nav a[href="studio-genesis.html"],
.mobile-nav a[href="/studio-genesis.html"],
.mobile-nav a[href="clothing-studio.html"],
.mobile-nav a[href="refinement-studio.html"],
.mobile-nav a[href="image-editor.html"],
.mobile-nav a[href="aesthetic-mirror.html"],
.mobile-nav a[href="video-studio.html"],
.mobile-nav a[href="/draw/home"] {
    display: none !important;
}

/* 顶栏模块较多：紧凑间距 + 横向滚动（旧纯文字链，已被 draw-app-header__nav 覆盖） */
.header-inner { gap: 12px; max-width: 100%; height: 72px; }

/* ========== 统一顶栏导航（主站 + draw 子应用） ========== */
.nav.draw-app-header__nav,
.draw-app-header__nav {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding: 4px 0;
}
.nav.draw-app-header__nav::-webkit-scrollbar,
.draw-app-header__nav::-webkit-scrollbar { display: none; }

.nav.draw-app-header__nav a::after,
.draw-app-header__nav-item::after { display: none !important; }

.draw-app-header__nav-item {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex-shrink: 0;
    padding: 9px 14px;
    border-radius: 12px;
    border: 1px solid transparent;
    background: transparent;
    color: #64748b;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition:
        color 0.22s ease,
        background 0.22s ease,
        border-color 0.22s ease,
        box-shadow 0.22s ease,
        transform 0.22s ease;
}

.draw-app-header__nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: #f8fafc;
    color: #94a3b8;
    transition: background 0.22s ease, color 0.22s ease, transform 0.22s ease;
}
.draw-app-header__nav-icon svg { width: 16px; height: 16px; }

.draw-app-header__nav-label { line-height: 1; }

.draw-app-header__nav-item:hover {
    color: #4338ca;
    background: #f8fafc;
    border-color: #e2e8f0;
    transform: translateY(-1px);
    box-shadow: 0 8px 20px -14px rgba(99, 102, 241, 0.55);
}
.draw-app-header__nav-item:hover .draw-app-header__nav-icon {
    background: #eef2ff;
    color: #6366f1;
    transform: scale(1.06);
}

.draw-app-header__nav-item.is-active,
.draw-app-header__nav-item.active {
    color: #4338ca;
    background: linear-gradient(135deg, #ffffff 0%, #eef2ff 100%);
    border-color: #c7d2fe;
    box-shadow: 0 10px 24px -16px rgba(99, 102, 241, 0.65);
}
.draw-app-header__nav-item.is-active .draw-app-header__nav-icon,
.draw-app-header__nav-item.active .draw-app-header__nav-icon {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
}

.draw-app-header__nav-item--pricing { margin-left: 2px; }
.draw-app-header__nav-item--pricing .draw-app-header__nav-icon {
    background: #fff7ed;
    color: #f97316;
}
.draw-app-header__nav-item--pricing:hover .draw-app-header__nav-icon {
    background: #ffedd5;
    color: #ea580c;
}

@media (max-width: 1100px) {
    .draw-app-header__nav-label { display: none; }
    .draw-app-header__nav-item { padding: 8px 10px; }
}

@media (max-width: 768px) {
    .header-inner { height: 64px; }
}

/* Container */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* Section Common */
.section { padding: 80px 0; }
.section-header { text-align: center; margin-bottom: 56px; }
.section-tag { display: inline-block; background: #eef2ff; color: #6366f1; font-size: 13px; font-weight: 600; padding: 4px 12px; border-radius: 6px; margin-bottom: 12px; }
.section-title { font-size: clamp(28px, 4vw, 40px); font-weight: 700; color: #1e1b4b; margin-bottom: 12px; line-height: 1.3; }
.section-desc { font-size: 17px; color: #64748b; max-width: 600px; margin: 0 auto; }
.fade-up { opacity: 0; transform: translateY(30px); transition: opacity 0.6s ease, transform 0.6s ease; }
.fade-up.visible { opacity: 1; transform: translateY(0); }

/* Toast */
.toast {
    position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
    background: #1e293b; color: #fff; padding: 12px 24px; border-radius: 10px;
    font-size: 13px; z-index: 2000; opacity: 0; pointer-events: none;
    transition: opacity 0.3s; box-shadow: 0 8px 30px rgba(0,0,0,0.25);
}
.toast.show { opacity: 1; }
.toast.success { background: #059669; }
.toast.error { background: #dc2626; }

/* Common Buttons */
.btn {
    display: inline-flex; align-items: center; gap: 8px; padding: 14px 32px;
    border-radius: 12px; font-size: 16px; font-weight: 600; cursor: pointer;
    transition: all 0.3s; border: none; white-space: nowrap;
}
.btn-primary {
    background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff;
    box-shadow: 0 4px 16px rgba(99,102,241,0.3);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(99,102,241,0.4); }
.btn-outline { background: #fff; color: #1e293b; border: 1.5px solid #e2e8f0; }
.btn-outline:hover { border-color: #6366f1; color: #6366f1; }

@media (max-width: 768px) {
    .nav { display: none; }
    .section { padding: 60px 0; }
}

/* ===== Studio Workspace Mobile Responsive ===== */
@media (max-width: 900px) {
    .workspace-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }
    .config-panel { position: relative !important; }
    .studio-hero { padding: 16px 0 8px !important; }
    .studio-hero h1 { font-size: 24px !important; }
    .studio-hero p { font-size: 14px !important; }

    /* Collapsible config panel on mobile */
    .config-panel-toggle {
        display: flex !important;
        align-items: center; justify-content: space-between;
        padding: 12px 16px; background: #fff; border: 1px solid #e2e8f0;
        border-radius: 14px; cursor: pointer; margin-bottom: 8px;
        font-size: 14px; font-weight: 600; color: #1e293b;
    }
    .config-panel.collapsed .config-card { display: none; }
    .config-panel.collapsed .config-card:first-child { display: block; }

    .result-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }
    .result-item { aspect-ratio: 1 !important; }

    .uploaded-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }

    .studio-workspace { padding: 16px 0 40px !important; }
    .config-card { padding: 16px !important; border-radius: 16px !important; }
    .tab-switcher { width: 100%; }
    .tab-switcher .tab-btn { flex: 1; text-align: center; font-size: 13px; padding: 8px 12px !important; }
}

@media (max-width: 480px) {
    .container { padding: 0 12px; }
    .header-inner { padding: 0 16px; height: 56px; }
    .workspace-grid { gap: 12px !important; }
    .result-grid { grid-template-columns: 1fr 1fr !important; gap: 6px !important; }
    .btn { padding: 10px 20px; font-size: 14px; }
}
