/* ===== Image2 - 小红书风格 ===== */

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

:root {
    --primary: #FF2442;
    --primary-light: #FF6B81;
    --primary-bg: #FFF0F3;
    --primary-glow: rgba(255, 36, 66, 0.12);
    --accent: #8B5CF6;
    --accent-light: #A78BFA;
    --bg: #FAFAFA;
    --surface: #FFFFFF;
    --surface-hover: #FFF5F7;
    --border: #F0F0F0;
    --border-hover: #FFD6DD;
    --text: #333333;
    --text-secondary: #666666;
    --text-muted: #999999;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.08);
    --shadow-pink: 0 4px 20px rgba(255, 36, 66, 0.15);
    --font: 'Noto Sans SC', 'Inter', -apple-system, BlinkMacSystemFont, 'PingFang SC', sans-serif;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
}

/* ===== Navbar ===== */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text);
}

.brand-icon { font-size: 1.4rem; }
.brand-name { font-size: 1.1rem; font-weight: 700; letter-spacing: -0.02em; }

.nav-links {
    display: flex;
    gap: 0.25rem;
}

.nav-link {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s;
}

.nav-link:hover { color: var(--primary); background: var(--primary-bg); }
.nav-link.active { color: var(--primary); background: var(--primary-bg); font-weight: 600; }

.nav-right { display: flex; align-items: center; gap: 0.75rem; }

.guest-credits {
    font-size: 0.78rem;
    color: var(--text-muted);
    padding: 0.3rem 0.7rem;
    background: var(--primary-bg);
    border-radius: 12px;
}

.btn-login {
    padding: 0.45rem 1rem;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: white;
    color: var(--text);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font);
}
.btn-login:hover { border-color: var(--primary); color: var(--primary); }

.btn-register {
    padding: 0.45rem 1rem;
    border: none;
    border-radius: 20px;
    background: var(--primary);
    color: white;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font);
}
.btn-register:hover { background: var(--primary-light); transform: translateY(-1px); }

/* User menu */
.nav-user { position: relative; display: flex; align-items: center; gap: 0.75rem; }

.user-credits {
    font-size: 0.78rem;
    color: var(--primary);
    font-weight: 500;
    padding: 0.3rem 0.7rem;
    background: var(--primary-bg);
    border-radius: 12px;
}

.user-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 0.85rem; font-weight: 600;
    cursor: pointer; transition: transform 0.2s;
}
.user-avatar:hover { transform: scale(1.08); }

.user-menu {
    display: none;
    position: absolute;
    top: 48px; right: 0;
    background: white;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    min-width: 160px;
    overflow: hidden;
    z-index: 200;
}
.user-menu.show { display: block; }

.menu-header {
    padding: 0.75rem 1rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
    border-bottom: 1px solid var(--border);
}

.menu-item {
    display: block;
    padding: 0.6rem 1rem;
    font-size: 0.82rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.15s;
}
.menu-item:hover { background: var(--surface-hover); color: var(--primary); }

.menu-divider { height: 1px; background: var(--border); margin: 0.25rem 0; }

/* ===== Main Content ===== */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
}

.main-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: start;
}

.panel-left { display: flex; flex-direction: column; gap: 1rem; }
.panel-right { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 1rem; }

/* ===== Cards ===== */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.25rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: all 0.25s;
}
.card:hover { box-shadow: var(--shadow-lg); border-color: var(--border-hover); }

.card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.card-icon { font-size: 1.1rem; }
.card-header h3 { font-size: 0.9rem; font-weight: 600; flex: 1; }

/* ===== Prompt Card ===== */
.card-prompt textarea {
    width: 100%;
    min-height: 100px;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    resize: vertical;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    line-height: 1.7;
}
.card-prompt textarea:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px var(--primary-glow);
}
.card-prompt textarea::placeholder { color: var(--text-muted); }

.style-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.75rem;
}

.chip {
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--primary-bg);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}
.chip:hover {
    border-color: var(--primary-light);
    color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px var(--primary-glow);
}

/* ===== Upload Card ===== */
.mode-badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.6rem;
    border-radius: 10px;
    background: #E8F5E9;
    color: #2E7D32;
    font-weight: 500;
}
.mode-badge.edit-mode { background: #FFF3E0; color: #E65100; }

.upload-area {
    border: 2px dashed var(--border-hover);
    border-radius: var(--radius-sm);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s;
    background: var(--primary-bg);
}
.upload-area:hover { border-color: var(--primary-light); background: #FFE8ED; }
.upload-area.dragover { border-color: var(--primary); background: #FFD6DD; }

.upload-placeholder { pointer-events: none; }
.upload-icon { font-size: 2rem; display: block; margin-bottom: 0.5rem; }
.upload-placeholder p { font-size: 0.85rem; color: var(--text-secondary); }
.upload-hint { font-size: 0.72rem; color: var(--text-muted); margin-top: 0.3rem; display: block; }

.upload-preview {
    position: relative;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
}
.upload-preview img { width: 100%; max-height: 200px; object-fit: contain; display: block; background: var(--bg); }
.btn-remove {
    position: absolute; top: 0.5rem; right: 0.5rem;
    width: 28px; height: 28px; border-radius: 50%;
    background: rgba(0,0,0,0.5); border: none;
    color: white; font-size: 0.85rem; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.2s;
}
.btn-remove:hover { background: var(--primary); }

/* ===== Params Card ===== */
.params-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.param-item label {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
}

.param-item select {
    width: 100%;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.82rem;
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    cursor: pointer;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' fill='%23999' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 2rem;
    transition: border-color 0.2s;
}
.param-item select:focus { border-color: var(--primary-light); }

.btn-generate {
    width: 100%;
    padding: 0.85rem;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: var(--shadow-pink);
}
.btn-generate:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(255, 36, 66, 0.3); }
.btn-generate:active:not(:disabled) { transform: translateY(0); }
.btn-generate:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.spinner {
    display: inline-block;
    width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 0.3rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

.shortcut-hint {
    text-align: center;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.6rem;
}
kbd {
    padding: 0.15rem 0.4rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.68rem;
    font-family: var(--font);
}

/* ===== Result Card ===== */
.result-empty {
    text-align: center;
    padding: 3rem 2rem;
}
.empty-illustration { font-size: 3rem; margin-bottom: 1rem; opacity: 0.7; }
.result-empty h4 { font-size: 1rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 0.4rem; }
.result-empty p { font-size: 0.82rem; color: var(--text-muted); max-width: 220px; margin: 0 auto; }

.result-display { animation: fadeUp 0.4s ease; }
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.result-image-wrap {
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg);
}
.result-image-wrap img { width: 100%; height: auto; display: block; }

.result-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.action-btn {
    flex: 1;
    padding: 0.55rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: white;
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 500;
    font-family: var(--font);
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
}
.action-btn:hover { border-color: var(--primary-light); color: var(--primary); }

/* ===== Carousel ===== */
.card-carousel .card-header { margin-bottom: 0.75rem; }
.view-more {
    font-size: 0.78rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}
.view-more:hover { text-decoration: underline; }

.carousel-wrap {
    position: relative;
    overflow: hidden;
}

.carousel-track {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    padding: 0.25rem 0;
}
.carousel-track::-webkit-scrollbar { display: none; }

.carousel-item {
    flex: 0 0 120px;
    height: 120px;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
}
.carousel-item:hover { border-color: var(--primary-light); transform: scale(1.03); }
.carousel-item img { width: 100%; height: 100%; object-fit: cover; }

.carousel-arrow {
    position: absolute;
    top: 50%; transform: translateY(-50%);
    width: 28px; height: 28px;
    border-radius: 50%;
    background: rgba(255,255,255,0.9);
    border: 1px solid var(--border);
    font-size: 1.1rem;
    color: var(--text-secondary);
    cursor: pointer;
    z-index: 2;
    display: flex; align-items: center; justify-content: center;
    box-shadow: var(--shadow);
    transition: all 0.2s;
}
.carousel-arrow:hover { background: white; border-color: var(--primary-light); color: var(--primary); }
.arrow-left { left: 4px; }
.arrow-right { right: 4px; }

/* ===== Pricing Section ===== */
.pricing-section {
    margin-top: 3rem;
    padding: 2rem 0;
    text-align: center;
}

.section-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.section-desc {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
    max-width: 900px;
    margin: 0 auto;
}

.price-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    transition: all 0.25s;
    position: relative;
}
.price-card:hover { border-color: var(--primary-light); box-shadow: var(--shadow-pink); transform: translateY(-4px); }
.price-card.popular { border-color: var(--primary); }
.price-card.popular::before {
    content: '热门';
    position: absolute; top: -10px; right: 16px;
    background: var(--primary);
    color: white;
    font-size: 0.68rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 8px;
}

.price-card h4 { font-size: 1rem; font-weight: 600; margin-bottom: 0.5rem; }
.price-card .price { font-size: 1.8rem; font-weight: 700; color: var(--primary); margin: 0.75rem 0; }
.price-card .price small { font-size: 0.82rem; font-weight: 400; color: var(--text-muted); }
.price-card .price-desc { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 1rem; }

.btn-buy {
    width: 100%;
    padding: 0.65rem;
    border: 1px solid var(--primary);
    border-radius: 10px;
    background: white;
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.2s;
}
.btn-buy:hover { background: var(--primary); color: white; }
.price-card.popular .btn-buy { background: var(--primary); color: white; }
.price-card.popular .btn-buy:hover { background: var(--primary-light); }

/* ===== Modals ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-card {
    background: white;
    border-radius: var(--radius);
    padding: 2rem;
    max-width: 380px;
    width: 100%;
    position: relative;
    box-shadow: var(--shadow-lg);
    animation: fadeUp 0.3s ease;
}

.modal-close {
    position: absolute;
    top: 1rem; right: 1rem;
    width: 32px; height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--bg);
    color: var(--text-muted);
    font-size: 1rem;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
}
.modal-close:hover { background: var(--primary-bg); color: var(--primary); }

.auth-form h2 { font-size: 1.3rem; font-weight: 700; margin-bottom: 0.3rem; }
.auth-subtitle { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 1.5rem; }

.form-group { margin-bottom: 0.85rem; }
.form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-family: var(--font);
    color: var(--text);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-group input:focus { border-color: var(--primary-light); box-shadow: 0 0 0 3px var(--primary-glow); }
.form-group input::placeholder { color: var(--text-muted); }

.btn-auth {
    width: 100%;
    padding: 0.8rem;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--primary);
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 0.5rem;
}
.btn-auth:hover { background: var(--primary-light); }

.auth-switch {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 1rem;
}
.auth-switch a { color: var(--primary); text-decoration: none; font-weight: 500; }
.auth-switch a:hover { text-decoration: underline; }

/* Image Modal */
.image-modal-card {
    background: white;
    border-radius: var(--radius);
    max-width: 600px;
    width: 100%;
    position: relative;
    box-shadow: var(--shadow-lg);
    animation: fadeUp 0.3s ease;
    overflow: hidden;
}
.image-modal-card img { width: 100%; max-height: 60vh; object-fit: contain; display: block; background: var(--bg); }
.modal-info { padding: 1.25rem; }
.modal-info h4 { font-size: 0.82rem; font-weight: 600; color: var(--text-muted); margin-bottom: 0.4rem; }
.modal-info p { font-size: 0.88rem; color: var(--text); line-height: 1.6; margin-bottom: 0.75rem; }
.modal-meta { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.modal-meta span {
    font-size: 0.72rem;
    color: var(--text-muted);
    padding: 0.2rem 0.6rem;
    background: var(--bg);
    border-radius: 6px;
}

/* Pay Modal */
.pay-modal { text-align: center; }
.pay-modal h2 { font-size: 1.1rem; margin-bottom: 0.5rem; }
.pay-info { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 1.5rem; }
.pay-methods { display: flex; gap: 1rem; justify-content: center; }
.pay-method {
    padding: 1rem 2rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: white;
    font-size: 0.9rem;
    font-weight: 500;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.2s;
    display: flex; align-items: center; gap: 0.5rem;
}
.pay-method:hover { border-color: var(--primary-light); box-shadow: var(--shadow); }
.pay-icon { font-size: 1.2rem; }

/* ===== Toast ===== */
.toast {
    position: fixed;
    top: 1.5rem;
    left: 50%;
    transform: translateX(-50%) translateY(-120%);
    padding: 0.7rem 1.4rem;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 500;
    z-index: 2000;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    background: white;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    color: var(--text);
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.error { border-color: #FECDD3; background: #FFF1F2; color: #BE123C; }
.toast.success { border-color: #BBF7D0; background: #F0FDF4; color: #166534; }

/* ===== Responsive ===== */
@media (max-width: 900px) {
    .main-grid { grid-template-columns: 1fr; }
    .panel-right { position: static; }
    .nav-links { display: none; }
    .params-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
    .main-content { padding: 1rem; }
    .params-grid { grid-template-columns: 1fr; }
    .pricing-grid { grid-template-columns: 1fr; }
    .pay-methods { flex-direction: column; }
}
