/* =============================================
   AI Creation Platform - Acrylic Dark Theme
   ============================================= */

/* --- 公告组件 --- */
.announcement-container {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    display: flex;
    justify-content: center;
    padding: 0 20px;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.announcement-card {
    background: rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 24px 32px;
    min-width: 400px;
    max-width: 720px;
    box-shadow: 
        0 4px 24px rgba(0, 0, 0, 0.1),
        0 1px 2px rgba(255, 255, 255, 0.5) inset,
        0 0 0 1px rgba(255, 255, 255, 0.3) inset;
    transition: transform 0.15s ease-out;
    will-change: transform;
    animation: announcementSlideIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes announcementSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.announcement-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.announcement-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    color: #fff;
}

.announcement-title {
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
    flex: 1;
}

.announcement-close,
.announcement-edit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    border-radius: 50%;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
}

.announcement-close:hover,
.announcement-edit-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
}

.announcement-edit-btn {
    margin-right: 4px;
}

.announcement-content {
    font-size: 14px;
    line-height: 1.6;
    color: #fff;
    padding-left: 32px;
}

.welcome-card .announcement-content {
    color: #fff;
}

/* 新用户欢迎公告特殊样式 */
.welcome-card {
    background: rgba(16, 185, 129, 0.25) !important;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.welcome-card .announcement-icon {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
}

.welcome-card .announcement-title {
    color: #059669;
}

@media (max-width: 640px) {
    .announcement-card {
        min-width: auto;
        width: 100%;
        padding: 20px 24px;
    }
    
    .announcement-content {
        padding-left: 0;
    }
}

/* --- Design Tokens --- */
:root {
    /* Backgrounds - Pure black scale */
    --bg-primary: #000000;
    --bg-secondary: #0a0a0a;
    --bg-card: rgba(255, 255, 255, 0.05);
    --bg-card-hover: rgba(255, 255, 255, 0.08);
    --bg-elevated: rgba(255, 255, 255, 0.08);
    --bg-overlay: rgba(0, 0, 0, 0.7);

    /* Accent - White */
    --accent: #ffffff;
    --accent-dim: rgba(255, 255, 255, 0.6);
    --accent-subtle: rgba(255, 255, 255, 0.06);

    /* Text */
    --text-primary: #f5f5f5;
    --text-secondary: rgba(255, 255, 255, 0.5);
    --text-muted: rgba(255, 255, 255, 0.25);

    /* Borders */
    --border-color: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);

    /* Status */
    --success: #4ade80;
    --success-bg: rgba(74, 222, 128, 0.08);
    --error: #f87171;
    --error-bg: rgba(248, 113, 113, 0.08);
    --warning: #fbbf24;
    --warning-bg: rgba(251, 191, 36, 0.08);
    --info: rgba(255, 255, 255, 0.7);
    --info-bg: rgba(255, 255, 255, 0.05);

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.8);

    /* Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Transitions */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --duration-fast: 150ms;
    --duration-normal: 250ms;

    /* Acrylic Glass */
    --glass-bg: rgba(20, 20, 20, 0.75);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-blur: blur(24px);
}

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, 'Segoe UI', 'Microsoft YaHei', 'PingFang SC', 'Helvetica Neue', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    color-scheme: dark;
    line-height: 1.6;
    overflow-x: hidden;
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* --- Layout --- */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 1;
}

/* --- Animations --- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.97); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-12px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes ripple {
    0% { transform: scale(0); opacity: 0.4; }
    100% { transform: scale(4); opacity: 0; }
}

@keyframes notificationIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Navbar --- */
.navbar {
    background: rgba(10, 10, 10, 0.82);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: background var(--duration-normal) var(--ease-out);
}

.navbar.scrolled {
    background: rgba(0, 0, 0, 0.85);
    border-bottom-color: rgba(255, 255, 255, 0.04);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 56px;
}

.logo {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    width: 26px;
    height: 26px;
    background: var(--accent);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #000;
    font-weight: 800;
}

.logo-text-gradient {
    background: var(--accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    gap: 2px;
    align-items: center;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--duration-normal) var(--ease-out);
    font-size: 13px;
    font-weight: 500;
    padding: 7px 14px;
    border-radius: var(--radius-sm);
}

.nav-links a:hover {
    color: var(--text-primary);
    background: var(--accent-subtle);
}

.nav-links a.active {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
}

.balance {
    color: var(--text-primary);
    font-weight: 500;
    padding: 5px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    font-size: 12px;
    background: var(--accent-subtle);
    white-space: nowrap;
}

/* Mobile hamburger menu */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
}

/* --- Frosted Acrylic Button System --- */

/* Base btn shell - matte frosted acrylic */
.btn {
    padding: 9px 20px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition:
        background var(--duration-normal) var(--ease-out),
        border-color var(--duration-normal) var(--ease-out),
        transform var(--duration-normal) var(--ease-out),
        box-shadow var(--duration-normal) var(--ease-out);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    color: #fff;
    /* Frosted acrylic base */
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* Subtle top highlight line */
.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 8px;
    right: 8px;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.25) 20%,
        rgba(255, 255, 255, 0.35) 50%,
        rgba(255, 255, 255, 0.25) 80%,
        transparent 100%
    );
    pointer-events: none;
    opacity: 0.6;
}

.btn:hover {
    background: rgba(255, 255, 255, 0.10);
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
    background: rgba(255, 255, 255, 0.04);
    box-shadow:
        0 1px 4px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.btn:focus-visible {
    outline: 1.5px solid rgba(255, 255, 255, 0.3);
    outline-offset: 2px;
}

.btn .ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    animation: ripple 0.5s ease-out forwards;
    pointer-events: none;
}

/* --- Primary: solid frosted acrylic --- */
.btn-primary {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.20);
    color: #fff;
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.btn-primary::before {
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.35) 20%,
        rgba(255, 255, 255, 0.45) 50%,
        rgba(255, 255, 255, 0.35) 80%,
        transparent 100%
    );
    opacity: 0.8;
}

.btn-primary:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.28);
    box-shadow:
        0 6px 20px rgba(0, 0, 0, 0.30),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.btn-primary:active {
    background: rgba(255, 255, 255, 0.10);
}

/* --- Secondary: lighter frosted --- */
.btn-secondary {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.10);
    color: rgba(255, 255, 255, 0.85);
    box-shadow:
        0 2px 6px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    color: #fff;
}

/* --- Danger: red-tinted frosted --- */
.btn-danger {
    background: rgba(248, 113, 113, 0.10);
    border: 1px solid rgba(248, 113, 113, 0.25);
    color: var(--error);
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.btn-danger::before {
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(248, 113, 113, 0.30) 20%,
        rgba(248, 113, 113, 0.40) 50%,
        rgba(248, 113, 113, 0.30) 80%,
        transparent 100%
    );
}

.btn-danger:hover {
    background: rgba(248, 113, 113, 0.15);
    border-color: rgba(248, 113, 113, 0.35);
}

/* --- Ghost: minimal frosted --- */
.btn-ghost {
    background: transparent;
    border: 1px solid transparent;
    color: rgba(255, 255, 255, 0.55);
    box-shadow: none;
    padding: 7px 14px;
}

.btn-ghost::before {
    display: none;
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.10);
    color: #fff;
}

/* --- Sizes --- */
.btn-sm {
    padding: 5px 12px;
    font-size: 12px;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 12px 28px;
    font-size: 15px;
    border-radius: var(--radius-lg);
}

/* --- Page Header --- */
.page-header {
    padding: 40px 0 28px;
    text-align: center;
    animation: fadeInUp 0.4s var(--ease-out);
}

.page-header h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.page-header p {
    color: var(--text-muted);
    font-size: 14px;
}

/* --- Auth Pages --- */
.auth-container {
    max-width: 380px;
    margin: 80px auto;
    padding: 40px 36px;
    background: rgba(20, 20, 20, 0.8);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-xl);
    animation: scaleIn 0.3s var(--ease-out);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.auth-container h2 {
    text-align: center;
    margin-bottom: 6px;
    font-size: 22px;
    font-weight: 700;
}

.auth-container .auth-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 28px;
}

.auth-container .btn {
    width: 100%;
    margin-top: 8px;
    padding: 12px;
    font-size: 14px;
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    color: var(--text-muted);
    font-size: 13px;
}

.auth-footer a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--duration-fast);
}

.auth-footer a:hover {
    color: var(--text-primary);
}

/* --- Forms --- */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    transition: all var(--duration-normal) var(--ease-out);
    font-family: inherit;
}

.form-group select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='rgba(255,255,255,0.4)' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
    cursor: pointer;
}

.form-group select option {
    background: #1a1a1a;
    color: var(--text-primary);
    padding: 8px 12px;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.04);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.6;
}

/* --- Filters --- */
.filters {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    animation: fadeIn 0.3s var(--ease-out) 0.1s both;
}

.filters input {
    flex: 1;
    min-width: 200px;
    padding: 9px 16px 9px 40px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 13px;
    transition: all var(--duration-normal) var(--ease-out);
}

.filters input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.15);
}

.filters select {
    padding: 9px 32px 9px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-out);
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.3)' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.filters select:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.15);
}

/* --- Model Cards --- */
.models-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    padding: 16px 0 40px;
}

.model-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: all var(--duration-normal) var(--ease-out);
    cursor: pointer;
    position: relative;
    animation: fadeInUp 0.35s var(--ease-out) both;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    overflow: hidden;
    --mx: 50%;
    --my: 50%;
}

/* Win7-style hover glow — radial light follows the cursor */
.model-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(
        circle 260px at var(--mx) var(--my),
        rgba(255, 255, 255, 0.38) 0%,
        rgba(255, 255, 255, 0.1) 40%,
        transparent 70%
    );
    opacity: 0;
    transition: opacity var(--duration-normal) var(--ease-out);
    pointer-events: none;
    z-index: 0;
}

.model-card:hover::before {
    opacity: 1;
}

/* Ensure card content stays above the glow */
.model-card .card-header,
.model-card p,
.model-card .card-action,
.model-card img,
.model-card .type-badge {
    position: relative;
    z-index: 1;
}

.model-card:nth-child(1) { animation-delay: 0.03s; }
.model-card:nth-child(2) { animation-delay: 0.06s; }
.model-card:nth-child(3) { animation-delay: 0.09s; }
.model-card:nth-child(4) { animation-delay: 0.12s; }
.model-card:nth-child(5) { animation-delay: 0.15s; }
.model-card:nth-child(6) { animation-delay: 0.18s; }

.model-card:hover {
    border-color: rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 50px rgba(255, 255, 255, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.model-card .card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}

.model-card .card-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.04);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.model-card .card-icon img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    border-radius: 4px;
}

.model-card .card-title-group {
    flex: 1;
    min-width: 0;
}

.model-card h3 {
    color: var(--text-primary);
    margin-bottom: 2px;
    font-size: 15px;
    font-weight: 600;
}

.model-card .type-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.type-badge.image {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.type-badge.video {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.type-badge.chat {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.model-card p {
    color: var(--text-muted);
    margin-bottom: 18px;
    font-size: 13px;
    line-height: 1.5;
}

.model-card .card-action {
    display: flex;
    justify-content: flex-end;
}

.model-card img {
    width: 100%;
    height: 70px;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-md);
    margin-bottom: 14px;
    padding: 8px;
}

/* --- Generator Pages (Full-screen Split Layout) --- */
.generator-container {
    display: flex;
    flex: 1;
    min-height: calc(100vh - 60px);
    overflow: hidden;
    animation: fadeIn 0.3s var(--ease-out);
}

/* Right panel — result/preview */
.generator-result {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Left panel — controls */
.generator-form {
    width: 360px;
    flex-shrink: 0;
    background: rgba(14, 14, 14, 0.95);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
}

.ref-images {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.ref-slots {
    display: flex;
    gap: 8px;
}

.ref-slot {
    width: 70px;
    height: 70px;
    border: 1px dashed rgba(255,255,255,0.15);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: var(--bg-card);
    position: relative;
    overflow: hidden;
}

.ref-slot:hover {
    border-color: rgba(255,255,255,0.3);
}

.ref-slot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ref-slot .remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    background: #e74c3c;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: pointer;
    color: #fff;
}

.ref-slot:hover .remove {
    display: flex;
}

@media (max-width: 768px) {
    .generator-container {
        flex-direction: column;
    }
    
    .generator-form {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        max-height: 50vh;
    }
}

/* Hide page-header when inside generator (full-screen mode) */
body:has(.generator-container) .page-header {
    display: none;
}

/* Right panel — result/preview */
.generator-result {
    padding: 20px;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    overflow: hidden;
}

.result-main {
    width: 100%;
    height: 100%;
    max-height: 90%;
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    gap: 8px;
}

/* 结果图片不再设置固定尺寸，由JS动态控制 */
.result-main > img,
.result-main .result-gallery img {
    object-fit: contain;
    border-radius: var(--radius-md);
}

.result-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    align-items: flex-start;
    width: 100%;
    max-width: 100%;
    padding: 10px;
    overflow-y: auto;
}

.result-gallery img {
    /* width: calc(50% - 6px); */
    /* max-width: calc(50% - 6px); */
    /* max-height: 40vh; */
    object-fit: contain;
    border-radius: var(--radius-md);
}

.history-title {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.history-sidebar {
    width: 160px;
    padding: 16px;
    background: var(--bg-card);
    border-left: 1px solid rgba(255,255,255,0.06);
    overflow-y: hidden;
    flex-shrink: 0;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: none;
    overflow-y: auto;
    scroll-behavior: smooth;
    max-height: calc(100vh - 280px);
}
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
}

.history-list img:hover {
    transform: scale(1.05);
    opacity: 0.85;
}

.history-row {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.history-row img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
    flex-shrink: 0;
}

.history-row img:hover {
    transform: scale(1.05);
    opacity: 0.85;
}

.result-placeholder {
    flex: 1;
    width: 90%;
    height: 80%;
    border: 1px dashed rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--text-muted);
}

.result-placeholder svg {
    width: 56px;
    height: 56px;
    opacity: 0.12;
}

.result-placeholder p {
    font-size: 14px;
}

/* ========== 错误提示卡片 ========== */
.result-error {
    flex: 1;
    width: 90%;
    max-width: 480px;
    padding: 28px 24px;
    background: var(--error-bg);
    border: 1px solid rgba(248, 113, 113, 0.2);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
    animation: scaleIn 0.3s var(--ease-out);
}

.result-error-icon {
    width: 56px;
    height: 56px;
    background: rgba(248, 113, 113, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--error);
}

.result-error-icon svg {
    width: 28px;
    height: 28px;
}

.result-error-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--error);
}

.result-error-message {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 380px;
}

.result-error-suggestions {
    margin-top: 8px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-md);
    text-align: left;
    width: 100%;
}

.result-error-suggestions-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-error-suggestions ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.result-error-suggestions li {
    font-size: 13px;
    color: var(--text-secondary);
    padding: 4px 0;
    padding-left: 16px;
    position: relative;
}

.result-error-suggestions li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--error);
}

.result-error-actions {
    display: flex;
    gap: 10px;
    margin-top: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.result-error-actions .btn {
    min-width: 100px;
}

/* ========== 警告提示卡片 ========== */
.result-warning {
    flex: 1;
    width: 90%;
    max-width: 480px;
    padding: 24px;
    background: var(--warning-bg);
    border: 1px solid rgba(251, 191, 36, 0.2);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
    animation: scaleIn 0.3s var(--ease-out);
}

.result-warning-icon {
    width: 48px;
    height: 48px;
    background: rgba(251, 191, 36, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--warning);
}

.result-warning-icon svg {
    width: 24px;
    height: 24px;
}

.result-warning-message {
    font-size: 14px;
    color: var(--text-secondary);
}

/* --- Options Grid --- */
.options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

/* --- Upload Area --- */
.upload-area {
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    padding: 14px 12px;
    text-align: center;
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-out);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 70px;
    position: relative;
    z-index: 200;
}

.upload-area:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: var(--accent-subtle);
}

.upload-area.dragover {
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.04);
}

.upload-area svg {
    width: 22px;
    height: 22px;
    opacity: 0.2;
}

.upload-area p {
    color: var(--text-muted);
    font-size: 11px;
}

.preview-image {
    max-width: 100%;
    max-height: 180px;
    border-radius: var(--radius-md);
    display: none;
    border: 1px solid var(--border-color);
    position: relative;
    z-index: 200;
}

/* --- Generator: Count Selector --- */
.count-group {
    display: flex;
    gap: 8px;
}

.count-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: var(--radius-sm);
    color: rgba(255, 255, 255, 0.60);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
    position: relative;
    overflow: hidden;
    box-shadow:
        0 1px 4px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.count-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 6px;
    right: 6px;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.20) 50%,
        transparent 100%
    );
    pointer-events: none;
}

.count-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    color: #fff;
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.count-btn.active {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-weight: 700;
    border-color: rgba(255, 255, 255, 0.22);
    box-shadow:
        0 3px 10px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

/* --- Generator: Submit Button (left panel bottom) --- */
.btn-generate {
    padding: 13px 24px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.08) 100%);
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: #fff;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-out);
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.btn-generate::before {
    content: '';
    position: absolute;
    top: 0;
    left: 10px;
    right: 10px;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.45) 20%,
        rgba(255, 255, 255, 0.55) 50%,
        rgba(255, 255, 255, 0.45) 80%,
        transparent 100%
    );
    pointer-events: none;
}

.btn-generate:hover:not(:disabled) {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0.12) 100%);
    border-color: rgba(255, 255, 255, 0.32);
    transform: translateY(-2px);
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.4),
        0 0 30px rgba(255, 255, 255, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-generate:active:not(:disabled) {
    transform: translateY(0);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.06) 100%);
}

.btn-generate:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-generate.loading {
    pointer-events: none;
}

.btn-generate.loading .btn-text {
    opacity: 0;
}

.btn-generate .loading-indicator {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.2s;
}

.btn-generate.loading .loading-indicator {
    opacity: 1;
}

/* --- Generator: Result Bottom Actions --- */
.result-actions {
    display: flex;
    gap: 10px;
    padding-top: 12px;
    justify-content: center;
}

.result-actions .btn {
    flex: 1;
    text-align: center;
}

/* --- Generator: Left Panel Section Label --- */
.panel-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 2px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    transition: all var(--duration-normal) var(--ease-out);
}

.panel-label:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

/* --- 加载状态优化 --- */
.loading-shimmer {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.03) 0%,
        rgba(255, 255, 255, 0.08) 50%,
        rgba(255, 255, 255, 0.03) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* --- 生成中状态优化 --- */
.generating-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 40px 20px;
    text-align: center;
}

.generating-state .spinner {
    width: 48px;
    height: 48px;
    border-width: 3px;
    border-color: rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent);
}

.generating-state p {
    font-size: 15px;
    color: var(--text-secondary);
}

.generating-state .sub-text {
    font-size: 12px;
    color: var(--text-muted);
}

/* --- 成功提示优化 --- */
.message.success {
    background: linear-gradient(135deg, var(--success-bg) 0%, rgba(74, 222, 128, 0.05) 100%);
    border: 1px solid rgba(74, 222, 128, 0.2);
}

.message.error {
    background: linear-gradient(135deg, var(--error-bg) 0%, rgba(248, 113, 113, 0.05) 100%);
    border: 1px solid rgba(248, 113, 113, 0.2);
}

.message.warning {
    background: linear-gradient(135deg, var(--warning-bg) 0%, rgba(251, 191, 36, 0.05) 100%);
    border: 1px solid rgba(251, 191, 36, 0.2);
}

/* --- Generator: Prompt Area (left panel) --- */
.prompt-section textarea {
    min-height: 150px;
    resize: vertical;
}

.prompt-area textarea {
    min-height: 80px;
    resize: none;
}

.prompt-footer {
    display: flex;
    justify-content: flex-end;
}

/* --- Progress Bar --- */
.progress-bar {
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    margin-top: 14px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 0.5s var(--ease-out);
    width: 0%;
}

/* --- Chat --- */
.chat-sidebar {
    width: 240px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    padding: 14px;
    overflow-y: auto;
    flex-shrink: 0;
}

.chat-sidebar-header {
    margin-bottom: 14px;
}

.chat-sessions-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.chat-session-item {
    padding: 10px 12px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all var(--duration-fast) var(--ease-out);
    font-size: 13px;
    color: var(--text-secondary);
}

.chat-session-item:hover {
    background: var(--accent-subtle);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.chat-session-item.active {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.chat-session-item .delete-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all var(--duration-fast);
    flex-shrink: 0;
}

.chat-session-item .delete-btn:hover {
    color: var(--error);
    background: var(--error-bg);
}

.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    min-width: 0;
}

.chat-header {
    padding: 12px 18px;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-header select {
    padding: 7px 32px 7px 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.3)' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.chat-header select option {
    background: #1a1a1a;
    color: var(--text-primary);
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.chat-message {
    max-width: 72%;
    padding: 12px 16px;
    border-radius: var(--radius-lg);
    animation: fadeInUp 0.2s var(--ease-out);
    line-height: 1.6;
    word-break: break-word;
}

.chat-message.user {
    align-self: flex-end;
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
    border-bottom-right-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.chat-message.assistant {
    align-self: flex-start;
    background: rgba(20, 20, 20, 0.8);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom-left-radius: 4px;
    color: var(--text-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.chat-message .message-content {
    font-size: 14px;
}

.chat-message pre {
    background: rgba(255, 255, 255, 0.03);
    padding: 12px;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    margin: 8px 0;
    font-size: 13px;
}

.chat-message code {
    background: rgba(255, 255, 255, 0.06);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
    font-family: 'Cascadia Code', 'Fira Code', monospace;
}

.chat-message pre code {
    background: none;
    padding: 0;
}

.chat-message.typing .message-content {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
}

.chat-message.typing .message-content::after {
    content: '';
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--text-secondary);
    animation: pulse 1.2s infinite;
}

.message-image {
    max-width: 200px;
    border-radius: var(--radius-md);
    margin-top: 10px;
}

.chat-input-area {
    padding: 14px 18px;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-top: 1px solid var(--glass-border);
}

.drop-zone {
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 8px;
    margin-bottom: 8px;
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
    transition: all var(--duration-normal) var(--ease-out);
    display: none;
}

.drop-zone.visible {
    display: block;
}

.drop-zone.has-image {
    border-color: var(--success);
    background: var(--success-bg);
    color: var(--success);
}

.drop-zone.dragover {
    border-color: rgba(255, 255, 255, 0.2);
    background: var(--accent-subtle);
}

.chat-input-area textarea {
    width: 100%;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    resize: none;
    margin-bottom: 10px;
    font-size: 14px;
    font-family: inherit;
    line-height: 1.5;
    transition: all var(--duration-normal) var(--ease-out);
}

.chat-input-area textarea:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.15);
}

.chat-input-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
}

.chat-input-area .btn {
    float: none;
}

.upload-btn-inline {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.10);
    color: rgba(255, 255, 255, 0.55);
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--duration-fast);
    font-size: 16px;
    position: relative;
    overflow: hidden;
    box-shadow:
        0 1px 4px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.upload-btn-inline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 6px;
    right: 6px;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.20) 50%,
        transparent 100%
    );
    pointer-events: none;
}

.upload-btn-inline:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    color: #fff;
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* --- History --- */
.history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
    padding: 16px 0 40px;
}

.history-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--duration-normal) var(--ease-out);
    animation: fadeInUp 0.35s var(--ease-out) both;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.history-card:hover {
    border-color: rgba(255, 255, 255, 0.14);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.history-card:nth-child(1) { animation-delay: 0.02s; }
.history-card:nth-child(2) { animation-delay: 0.04s; }
.history-card:nth-child(3) { animation-delay: 0.06s; }
.history-card:nth-child(4) { animation-delay: 0.08s; }
.history-card:nth-child(5) { animation-delay: 0.10s; }
.history-card:nth-child(6) { animation-delay: 0.12s; }
.history-card:nth-child(7) { animation-delay: 0.14s; }
.history-card:nth-child(8) { animation-delay: 0.16s; }

.history-card img,
.history-card video {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: var(--bg-secondary);
    transition: transform 0.4s var(--ease-out);
}

.history-card:hover img {
    transform: scale(1.02);
}

.history-card-content {
    padding: 14px;
}

.history-card h4 {
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-card .meta {
    display: flex;
    justify-content: space-between;
    color: var(--text-muted);
    font-size: 11px;
    margin-bottom: 8px;
}

.history-card .status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 10px;
    font-weight: 500;
}

.status.completed {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid rgba(74, 222, 128, 0.15);
}

.status.processing {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.08);
    animation: pulse 2s infinite;
}

.status.failed {
    background: var(--error-bg);
    color: var(--error);
    border: 1px solid rgba(248, 113, 113, 0.15);
}

.history-actions {
    display: flex;
    gap: 6px;
    margin-top: 10px;
}

.history-actions .btn {
    flex: 1;
    padding: 6px 8px;
    font-size: 12px;
    text-align: center;
}

/* --- Tabs --- */
.tabs {
    display: flex;
    gap: 2px;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.02);
    padding: 3px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    animation: fadeIn 0.3s var(--ease-out);
}

.tab {
    padding: 8px 18px;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--duration-normal) var(--ease-out);
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}

.tab:hover {
    color: var(--text-primary);
    background: var(--accent-subtle);
}

.tab.active {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
}

/* --- Profile --- */
.profile-container {
    max-width: 600px;
    margin: 36px auto;
    padding: 36px;
    background: rgba(20, 20, 20, 0.8);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-xl);
    animation: fadeInUp 0.4s var(--ease-out);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.profile-header {
    text-align: center;
    margin-bottom: 28px;
    padding-bottom: 28px;
    border-bottom: 1px solid var(--border-color);
}

.profile-header .avatar {
    width: 72px;
    height: 72px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    margin: 0 auto 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.profile-header h2 {
    color: var(--text-primary);
    margin-bottom: 4px;
    font-size: 20px;
    font-weight: 600;
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 28px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: 18px;
    text-align: center;
    transition: all var(--duration-normal) var(--ease-out);
    animation: fadeInUp 0.35s var(--ease-out) both;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.stat-card:nth-child(2) {
    animation-delay: 0.05s;
}

.stat-card:hover {
    border-color: rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.08);
}

.stat-card h3 {
    color: var(--text-primary);
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 4px;
}

.stat-card p {
    color: var(--text-muted);
    font-size: 12px;
}

/* --- Recharge Form --- */
.recharge-form {
    display: flex;
    gap: 10px;
}

.recharge-form input {
    flex: 1;
}

/* --- Video Controls --- */
.video-controls {
    width: 100%;
    margin-top: 8px;
}

.video-controls input[type="range"] {
    width: 100%;
    margin-bottom: 8px;
    accent-color: var(--text-secondary);
}

.video-controls .speed-controls {
    display: flex;
    gap: 4px;
    justify-content: center;
}

.speed-btn {
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.10);
    color: rgba(255, 255, 255, 0.55);
    border-radius: var(--radius-full);
    cursor: pointer;
    font-size: 11px;
    transition: all var(--duration-fast);
    position: relative;
    overflow: hidden;
    box-shadow:
        0 1px 4px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.speed-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 4px;
    right: 4px;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.20) 50%,
        transparent 100%
    );
    pointer-events: none;
}

.speed-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    color: #fff;
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.speed-btn.active {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.20);
    box-shadow:
        0 3px 10px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

/* --- Messages / Alerts --- */
.message {
    padding: 10px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 14px;
    font-size: 13px;
    animation: notificationIn 0.25s var(--ease-out);
    display: flex;
    align-items: center;
    gap: 8px;
}

.message.success::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success);
    flex-shrink: 0;
}

.message.error::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--error);
    flex-shrink: 0;
}

.message.success {
    background: var(--success-bg);
    border: 1px solid rgba(74, 222, 128, 0.12);
    color: var(--success);
}

.message.error {
    background: var(--error-bg);
    border: 1px solid rgba(248, 113, 113, 0.12);
    color: var(--error);
}

.message.warning {
    background: var(--warning-bg);
    border: 1px solid rgba(251, 191, 36, 0.12);
    color: var(--warning);
}

/* --- Empty State --- */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state svg {
    width: 48px;
    height: 48px;
    margin-bottom: 14px;
    opacity: 0.12;
}

.empty-state p {
    font-size: 13px;
}

/* --- Modal --- */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.15s var(--ease-out);
}

.modal.active {
    display: flex;
}

.modal-content {
    background: rgba(24, 24, 24, 0.97);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-xl);
    padding: 24px;
    max-width: 90%;
    max-height: 90%;
    overflow: auto;
    animation: scaleIn 0.2s var(--ease-out);
    box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.modal-content img {
    max-width: 100%;
    border-radius: var(--radius-md);
}

.close-modal {
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    transition: all var(--duration-fast);
}

.close-modal:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
}

/* --- Pagination --- */
.pagination {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin: 20px 0 40px;
}

.pagination button {
    padding: 7px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: var(--radius-sm);
    color: rgba(255, 255, 255, 0.60);
    cursor: pointer;
    font-size: 12px;
    transition: all var(--duration-fast);
    position: relative;
    overflow: hidden;
    box-shadow:
        0 1px 4px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.pagination button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 6px;
    right: 6px;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.20) 50%,
        transparent 100%
    );
    pointer-events: none;
}

.pagination button.active {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.20);
    box-shadow:
        0 3px 10px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.pagination button:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    color: #fff;
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* --- Admin Inline Controls --- */
.admin-controls {
    margin-top: 12px;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    padding: 12px;
    background: var(--warning-bg);
    border: 1px solid rgba(251, 191, 36, 0.1);
    border-radius: var(--radius-md);
}

.admin-controls input {
    width: 70px;
    padding: 5px 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 12px;
}

.admin-controls input:focus {
    outline: none;
    border-color: rgba(251, 191, 36, 0.3);
}

.admin-controls label {
    font-size: 12px;
    color: var(--text-secondary);
}

/* --- Loading Spinner --- */
.spinner {
    width: 28px;
    height: 28px;
    border: 2px solid var(--border-color);
    border-top-color: var(--text-secondary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin: 20px auto;
}

/* --- Tooltip --- */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 5px 10px;
    background: rgba(30, 30, 30, 0.95);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 11px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--duration-fast);
}

[data-tooltip]:hover::after {
    opacity: 1;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    .generator-container {
        flex-direction: column;
        min-height: auto;
    }

    .generator-form {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        box-shadow: none;
        position: static;
    }

    body:has(.generator-container) .page-header {
        display: block;
    }

    .page-header h1 {
        font-size: 24px;
    }
}

@media (max-width: 768px) {
    .navbar .container {
        flex-wrap: wrap;
    }

    .menu-toggle {
        display: block;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        padding: 10px 0 6px;
        gap: 2px;
        order: 3;
        animation: slideDown 0.2s var(--ease-out);
        background: var(--bg-primary);
        margin: 0 -12px;
        padding: 10px 12px 6px;
        border-radius: 0 0 var(--radius-md) var(--radius-md);
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links a {
        padding: 9px 14px;
        width: 100%;
        border-radius: var(--radius-sm);
    }

    .nav-links a.active {
        background: rgba(255, 255, 255, 0.06);
    }

    .balance {
        order: 2;
        font-size: 11px;
        padding: 4px 10px;
    }

    .models-grid {
        grid-template-columns: 1fr;
    }

    .options-grid {
        grid-template-columns: 1fr;
    }

    .history-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }

    .chat-sidebar {
        display: none;
        position: fixed;
        left: 0;
        top: 56px;
        bottom: 0;
        z-index: 50;
        width: 260px;
        background: var(--bg-secondary);
        border-right: 1px solid var(--border-color);
    }

    .chat-sidebar.open {
        display: block;
        animation: slideInLeft 0.2s var(--ease-out);
    }

    .chat-sidebar-toggle {
        display: block;
    }

    .page-header h1 {
        font-size: 22px;
    }

    .page-header {
        padding-top: 28px;
        padding-bottom: 18px;
    }

    .auth-container {
        margin: 40px auto;
        padding: 28px 22px;
    }

    .profile-container {
        padding: 22px;
        margin: 20px auto;
    }

    .profile-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .btn {
        min-height: 40px;
    }

    .btn-sm {
        min-height: 32px;
    }

    .tab {
        padding: 7px 12px;
        font-size: 12px;
        white-space: nowrap;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }

    .filters {
        flex-direction: column;
    }

    .filters input {
        min-width: 0;
    }

    .tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .tabs::-webkit-scrollbar {
        display: none;
    }

    .chat-message {
        max-width: 88%;
    }
    
    .page-header h1 {
        font-size: 20px;
    }
    
    .model-card {
        padding: 12px;
    }
    
    .history-card {
        min-height: 180px;
    }
    
    .history-card img,
    .history-card video {
        height: 140px !important;
    }
}

    .filters {
        flex-direction: column;
    }

    .filters input {
        min-width: 0;
    }

    .tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .tabs::-webkit-scrollbar {
        display: none;
    }

    .chat-message {
        max-width: 88%;
    }

    .page-header h1 {
        font-size: 20px;
    }

    .profile-container {
        padding: 18px 14px;
    }

    .stat-card {
        padding: 14px;
    }

    .stat-card h3 {
        font-size: 20px;
    }

    .history-actions {
        flex-direction: column;
    }

    .recharge-form {
        flex-direction: column;
    }

    .recharge-form .btn {
        width: 100%;
    }
}

/* --- Utility --- */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

body {
    animation: fadeIn 0.2s var(--ease-out);
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

::selection {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.form-group input:focus-visible,
.form-group textarea:focus-visible,
.form-group select:focus-visible {
    outline: 1px solid rgba(255, 255, 255, 0.2);
    outline-offset: 1px;
}

/* --- Model Section Layout (Grouped by Type) --- */

/* Search box */
.search-box {
    position: relative;
    margin-bottom: 32px;
}

.search-box-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    opacity: 0.35;
    pointer-events: none;
    color: var(--text-primary);
}

.search-box input {
    width: 100%;
    padding: 13px 18px 13px 44px;
    font-size: 14px;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-full);
    outline: none;
    transition: all var(--duration-normal) var(--ease-out);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.search-box input:hover {
    border-color: rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.06);
}

.search-box input:focus {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* Model section header */
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    margin-top: 36px;
}

.model-section-header:first-child {
    margin-top: 0;
}

.section-title-group {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.section-title-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.model-count {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 400;
}

/* Section grids */
.model-section-grid {
    display: grid;
    gap: 12px;
    margin-bottom: 8px;
}

.model-section-grid.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.model-section-grid.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* Compact card (horizontal layout) */
.model-card-compact {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: inherit;
    transition: all var(--duration-normal) var(--ease-out);
    animation: fadeInUp 0.35s var(--ease-out) both;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    height: 80px;
    position: relative;
    overflow: hidden;
    --mx: 50%;
    --my: 50%;
}

/* Win7-style hover glow for compact cards */
.model-card-compact::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(
        circle 260px at var(--mx) var(--my),
        rgba(255, 255, 255, 0.38) 0%,
        rgba(255, 255, 255, 0.1) 40%,
        transparent 70%
    );
    opacity: 0;
    transition: opacity var(--duration-normal) var(--ease-out);
    pointer-events: none;
    z-index: 0;
}

.model-card-compact:hover::before {
    opacity: 1;
}

.model-card-compact .card-compact-icon,
.model-card-compact .card-compact-info {
    position: relative;
    z-index: 1;
}

.model-card-compact:hover {
    border-color: rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4), 0 0 50px rgba(255, 255, 255, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.card-compact-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--text-secondary);
    overflow: hidden;
}

.card-compact-icon img {
    width: 30px;
    height: 30px;
    object-fit: contain;
    border-radius: 4px;
}

.card-compact-icon svg {
    width: 26px;
    height: 26px;
}

.card-compact-info {
    flex: 1;
    min-width: 0;
}

.card-compact-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-compact-desc {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Type icon color variants */
.type-icon-chat {
    color: rgba(255, 255, 255, 0.5);
}
.type-icon-image {
    color: rgba(255, 255, 255, 0.5);
}
.type-icon-video {
    color: rgba(255, 255, 255, 0.5);
}

/* Model type icon with subtle gradient */
.type-icon-chat {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(99, 102, 241, 0.05) 100%);
    border-color: rgba(99, 102, 241, 0.2);
}

.type-icon-image {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.15) 0%, rgba(34, 197, 94, 0.05) 100%);
    border-color: rgba(34, 197, 94, 0.2);
}

.type-icon-video {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.15) 0%, rgba(249, 115, 22, 0.05) 100%);
    border-color: rgba(249, 115, 22, 0.2);
}

/* Responsive: grouped sections */
@media (max-width: 1024px) {
    .model-section-grid.grid-4 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .model-section-grid.grid-3,
    .model-section-grid.grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .model-card-compact {
        height: 72px;
        padding: 12px;
        gap: 10px;
    }

    .card-compact-icon {
        width: 42px;
        height: 42px;
    }
}

@media (max-width: 480px) {
    .model-section-grid.grid-3,
    .model-section-grid.grid-4 {
        grid-template-columns: 1fr;
    }

    .model-section-header {
        margin-top: 28px;
    }
    
    /* Mobile fixes */
    .navbar .container {
        padding: 0 12px;
    }
    
    .nav-links {
        gap: 12px;
        font-size: 13px;
    }
    
    .balance {
        font-size: 12px;
    }
    
    .btn {
        padding: 8px 14px;
        font-size: 13px;
    }
    
    .page-header {
        padding: 20px 12px;
    }
    
    .page-header h1 {
        font-size: 22px;
    }
    
    .auth-container {
        padding: 24px 16px;
        margin: 12px;
    }
    
    .form-group input,
    .form-group textarea,
    .form-group select {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .chat-container {
        flex-direction: column;
    }
    
    .chat-sidebar {
        width: 100%;
        max-height: 200px;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    
    .chat-main {
        flex: 1;
    }
    
    .history-grid {
        grid-template-columns: 1fr;
    }
    
    .profile-card {
        padding: 16px;
    }
    
    .guide-grid {
        grid-template-columns: 1fr;
    }
}
