@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ==========================================
   Design Tokens — Dark Cyberpunk System
   ========================================== */

:root {
    /* Base Backgrounds */
    --bg-base: #080B14;
    --bg-surface: #0D1117;
    --bg-elevated: #161B26;
    --bg-overlay: rgba(13, 17, 23, 0.85);

    /* Text */
    --text-primary: #E8EAF0;
    --text-secondary: #6B7280;
    --text-muted: #374151;

    /* Accent — Blue/Purple gradient system */
    --accent-1: #4F8EF7;
    --accent-2: #A855F7;
    --accent-gradient: linear-gradient(135deg, #4F8EF7 0%, #A855F7 100%);
    --accent-glow: rgba(79, 142, 247, 0.35);
    --accent-glow-2: rgba(168, 85, 247, 0.25);

    /* Borders */
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-muted: rgba(255, 255, 255, 0.10);
    --border-bright: rgba(79, 142, 247, 0.40);

    /* Glass */
    --glass-bg: rgba(13, 17, 23, 0.72);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-blur: saturate(180%) blur(20px);

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.65);
    --shadow-glow: 0 0 24px rgba(79, 142, 247, 0.25);

    /* Agent Colors */
    --agent-1-color: #4F8EF7;
    /* DS  — 蓝 */
    --agent-2-color: #22C55E;
    /* GR  — 绿 */
    --agent-3-color: #A855F7;
    /* DS2 — 紫 */
    --agent-4-color: #F59E0B;
    /* DS3 — 琥珀 */

    /* Spacing */
    --sp-xs: 4px;
    --sp-sm: 8px;
    --sp-md: 16px;
    --sp-lg: 24px;
    --sp-xl: 32px;

    /* Radii */
    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 18px;
    --r-xl: 24px;
    --r-full: 9999px;

    /* Typography */
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --fs-xs: 11px;
    --fs-sm: 13px;
    --fs-md: 15px;
    --fs-lg: 17px;
    --fs-xl: 22px;
    --fs-2xl: 32px;
    --fs-3xl: 48px;
}

/* Light Mode Overrides */
[data-theme="light"] {
    --bg-base: #F0F2F7;
    --bg-surface: #FFFFFF;
    --bg-elevated: #F8F9FC;
    --bg-overlay: rgba(255, 255, 255, 0.85);

    --text-primary: #111827;
    --text-secondary: #6B7280;
    --text-muted: #9CA3AF;

    --border-subtle: rgba(0, 0, 0, 0.06);
    --border-muted: rgba(0, 0, 0, 0.10);
    --border-bright: rgba(79, 142, 247, 0.40);

    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(0, 0, 0, 0.08);

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.10);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.14);
    --shadow-glow: 0 0 24px rgba(79, 142, 247, 0.15);
}

/* ==========================================
   Reset & Base
   ========================================== */

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
}

body {
    font-family: var(--font);
    font-size: var(--fs-md);
    color: var(--text-primary);
    background: var(--bg-base);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    height: 100%;
    overflow: hidden;
    transition: background 0.35s ease, color 0.35s ease;
    position: relative;
}

/* ==========================================
   Blob Canvas Layer
   ========================================== */

#blob-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 1;
    transition: opacity 0.5s ease;
}

/* ==========================================
   Layout
   ========================================== */

.layout {
    display: flex;
    height: 100vh;
    position: relative;
    z-index: 1;
}

.app-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    transition: margin-left 0.3s ease;
}

/* ==========================================
   Sidebar
   ========================================== */

.sidebar {
    width: 260px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border-right: 1px solid var(--glass-border);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s ease;
    overflow: hidden;
    z-index: 200;
    position: relative;
}

.sidebar::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
            rgba(79, 142, 247, 0.04) 0%,
            transparent 40%,
            rgba(168, 85, 247, 0.03) 100%);
    pointer-events: none;
}

.sidebar.collapsed {
    width: 0;
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
        width: 260px;
        box-shadow: var(--shadow-lg);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay {
        display: block;
    }
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 150;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(4px);
}

.sidebar-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* Sidebar Header */
.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--sp-md);
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
}

.sidebar-title {
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    white-space: nowrap;
}

.new-chat-btn {
    width: 30px;
    height: 30px;
    border-radius: var(--r-sm);
    border: 1px solid var(--border-muted);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.new-chat-btn:hover {
    background: var(--accent-gradient);
    border-color: transparent;
    color: white;
    box-shadow: var(--shadow-glow);
    transform: scale(1.08);
}

/* Session List */
.session-list {
    flex: 1;
    overflow-y: auto;
    padding: var(--sp-sm);
}

.session-list::-webkit-scrollbar {
    width: 3px;
}

.session-list::-webkit-scrollbar-thumb {
    background: var(--border-muted);
    border-radius: 2px;
}

/* Session Item */
.session-item {
    display: flex;
    align-items: center;
    gap: var(--sp-sm);
    padding: 9px var(--sp-md);
    border-radius: var(--r-md);
    cursor: pointer;
    transition: all 0.15s ease;
    margin-bottom: 2px;
    position: relative;
    border: 1px solid transparent;
}

.session-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--border-subtle);
}

.session-item.active {
    background: rgba(79, 142, 247, 0.08);
    border-color: rgba(79, 142, 247, 0.20);
}

.session-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 20%;
    bottom: 20%;
    width: 3px;
    background: var(--accent-gradient);
    border-radius: 0 2px 2px 0;
}

[data-theme="light"] .session-item:hover {
    background: rgba(0, 0, 0, 0.04);
}

.session-icon {
    font-size: 13px;
    flex-shrink: 0;
    color: var(--text-muted);
}

.session-item.active .session-icon {
    color: var(--accent-1);
}

.session-title {
    flex: 1;
    font-size: var(--fs-sm);
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

.session-item.active .session-title {
    color: var(--text-primary);
    font-weight: 500;
}

.session-meta {
    font-size: var(--fs-xs);
    color: var(--text-muted);
    flex-shrink: 0;
    display: none;
}

.session-item:hover .session-meta,
.session-item.active .session-meta {
    display: block;
}

.session-delete-btn {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.session-item:hover .session-delete-btn {
    display: flex;
}

.session-delete-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #EF4444;
}

.session-empty {
    text-align: center;
    padding: var(--sp-xl) var(--sp-md);
    color: var(--text-muted);
    font-size: var(--fs-sm);
    line-height: 1.8;
}

/* ==========================================
   Top Navigation Bar
   ========================================== */

.nav-left {
    display: flex;
    align-items: center;
    gap: var(--sp-sm);
}

.nav-left .nav-title {
    margin-left: 4px;
}

.top-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: var(--glass-blur);
    background: var(--glass-bg);
    border-bottom: 1px solid var(--border-subtle);
    padding: var(--sp-md) var(--sp-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 0 var(--border-subtle), 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* Glowing bottom border on nav */
.top-nav::after {
    content: '';
    position: absolute;
    left: 5%;
    right: 5%;
    bottom: -1px;
    height: 1px;
    background: var(--accent-gradient);
    opacity: 0.4;
    border-radius: 1px;
}

.nav-title {
    font-size: var(--fs-xl);
    font-weight: 700;
    letter-spacing: -0.5px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-actions {
    display: flex;
    gap: var(--sp-sm);
    align-items: center;
}

.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--r-md);
    border: 1px solid var(--border-subtle);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    transition: all 0.2s ease;
}

.icon-btn:hover {
    background: rgba(79, 142, 247, 0.12);
    border-color: var(--border-bright);
    color: var(--accent-1);
    transform: scale(1.05);
    box-shadow: 0 0 12px rgba(79, 142, 247, 0.2);
}

.icon-btn:active {
    transform: scale(0.95);
}

[data-theme="light"] .icon-btn {
    background: rgba(0, 0, 0, 0.04);
}

/* ==========================================
   Chat Area
   ========================================== */

.chat-container {
    flex: 1;
    overflow-y: auto;
    padding: var(--sp-lg);
    scroll-behavior: smooth;
}

.chat-container::-webkit-scrollbar {
    width: 6px;
}

.chat-container::-webkit-scrollbar-track {
    background: transparent;
}

.chat-container::-webkit-scrollbar-thumb {
    background: var(--border-muted);
    border-radius: 3px;
}

.chat-container::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ==========================================
   Welcome Screen
   ========================================== */

.welcome-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
    padding: var(--sp-xl);
    animation: fadeInUp 0.6s ease both;
}

.welcome-glow {
    position: relative;
    margin-bottom: var(--sp-lg);
}

.welcome-glow::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 160px;
    height: 160px;
    background: radial-gradient(circle, rgba(79, 142, 247, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    animation: glowPulse 3s ease-in-out infinite;
}

.welcome-icon {
    font-size: 56px;
    line-height: 1;
    position: relative;
}

.welcome-title {
    font-size: var(--fs-3xl);
    font-weight: 700;
    letter-spacing: -1.5px;
    line-height: 1.1;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--sp-md);
}

.welcome-subtitle {
    font-size: var(--fs-lg);
    color: var(--text-secondary);
    margin-bottom: var(--sp-xl);
    max-width: 380px;
}

.welcome-features {
    display: flex;
    gap: var(--sp-md);
    flex-wrap: wrap;
    justify-content: center;
    max-width: 560px;
}

.feature-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-md);
    padding: var(--sp-md);
    width: 155px;
    text-align: left;
    transition: all 0.2s ease;
    animation: fadeInUp 0.6s ease both;
}

.feature-card:nth-child(2) {
    animation-delay: 0.1s;
}

.feature-card:nth-child(3) {
    animation-delay: 0.2s;
}

.feature-card:hover {
    background: rgba(79, 142, 247, 0.07);
    border-color: rgba(79, 142, 247, 0.20);
    transform: translateY(-2px);
}

.feature-card-icon {
    font-size: 22px;
    margin-bottom: var(--sp-xs);
}

.feature-card-title {
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.feature-card-desc {
    font-size: var(--fs-xs);
    color: var(--text-muted);
    line-height: 1.5;
}

[data-theme="light"] .feature-card {
    background: rgba(0, 0, 0, 0.03);
}

/* ==========================================
   Messages
   ========================================== */

.message {
    margin-bottom: var(--sp-lg);
    animation: fadeInUp 0.3s ease both;
}

/* User Message */
.message.user {
    display: flex;
    justify-content: flex-end;
}

.user-bubble {
    max-width: 68%;
    background: var(--accent-gradient);
    color: white;
    padding: var(--sp-md) var(--sp-lg);
    border-radius: var(--r-xl);
    border-bottom-right-radius: var(--r-sm);
    box-shadow: 0 4px 20px rgba(79, 142, 247, 0.35), 0 1px 0 rgba(255, 255, 255, 0.1) inset;
    font-size: var(--fs-md);
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

/* AI Message */
.message.ai {
    display: flex;
    gap: var(--sp-md);
    align-items: flex-start;
}

/* AI Avatar */
.ai-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--fs-xs);
    font-weight: 700;
    flex-shrink: 0;
    color: white;
    position: relative;
    box-shadow: 0 0 16px var(--avatar-glow, rgba(79, 142, 247, 0.4));
    letter-spacing: 0;
}

/* AI Card */
.ai-card {
    max-width: 68%;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--r-xl);
    border-top-left-radius: var(--r-sm);
    padding: var(--sp-md) var(--sp-lg);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

/* Agent color top accent bar */
.ai-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--agent-accent, var(--accent-gradient));
    opacity: 0.9;
}

.ai-name {
    font-size: var(--fs-xs);
    font-weight: 600;
    color: var(--agent-color, var(--accent-1));
    margin-bottom: var(--sp-xs);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.ai-content {
    color: var(--text-primary);
    line-height: 1.7;
    font-size: var(--fs-md);
    white-space: pre-wrap;
    word-break: break-word;
}

.message-actions {
    display: flex;
    gap: var(--sp-xs);
    margin-top: var(--sp-sm);
}

.copy-btn {
    padding: 3px var(--sp-sm);
    border-radius: var(--r-sm);
    border: 1px solid var(--border-subtle);
    background: transparent;
    color: var(--text-muted);
    font-size: var(--fs-xs);
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.2s ease;
}

.copy-btn:hover {
    background: rgba(79, 142, 247, 0.1);
    border-color: var(--border-bright);
    color: var(--accent-1);
}

/* Thinking Animation */
.thinking {
    display: flex;
    gap: 5px;
    padding: var(--sp-sm) 0;
    align-items: center;
}

.thinking-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: thinkBounce 1.4s ease-in-out infinite;
}

.thinking-dot:nth-child(1) {
    background: var(--agent-1-color);
}

.thinking-dot:nth-child(2) {
    background: var(--agent-2-color);
    animation-delay: 0.2s;
}

.thinking-dot:nth-child(3) {
    background: var(--agent-3-color);
    animation-delay: 0.4s;
}

@keyframes thinkBounce {

    0%,
    80%,
    100% {
        transform: scale(0.7);
        opacity: 0.4;
    }

    40% {
        transform: scale(1.1);
        opacity: 1;
    }
}

/* ==========================================
   Input Area
   ========================================== */

.input-container {
    position: sticky;
    bottom: 0;
    backdrop-filter: var(--glass-blur);
    background: var(--glass-bg);
    border-top: 1px solid var(--border-subtle);
    padding: var(--sp-md) var(--sp-lg);
    box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.3);
}

.input-wrapper {
    display: flex;
    gap: var(--sp-md);
    align-items: flex-end;
    max-width: 820px;
    margin: 0 auto;
}

.input-field {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-muted);
    border-radius: var(--r-lg);
    padding: var(--sp-md) var(--sp-lg);
    font-family: var(--font);
    font-size: var(--fs-md);
    color: var(--text-primary);
    resize: none;
    max-height: 140px;
    transition: all 0.25s ease;
    line-height: 1.6;
}

.input-field::placeholder {
    color: var(--text-muted);
}

.input-field:focus {
    outline: none;
    border-color: var(--accent-1);
    background: rgba(79, 142, 247, 0.05);
    box-shadow:
        0 0 0 3px rgba(79, 142, 247, 0.15),
        0 0 20px rgba(79, 142, 247, 0.1);
}

[data-theme="light"] .input-field {
    background: rgba(0, 0, 0, 0.04);
}

.send-btn {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: none;
    background: var(--accent-gradient);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.2s ease;
    flex-shrink: 0;
    box-shadow: 0 4px 16px rgba(79, 142, 247, 0.4);
}

.send-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 24px rgba(79, 142, 247, 0.55);
}

.send-btn:active {
    transform: scale(0.95);
}

.send-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    box-shadow: none;
}

/* ==========================================
   Modals
   ========================================== */

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: var(--bg-elevated);
    border: 1px solid var(--border-muted);
    border-radius: var(--r-xl);
    padding: var(--sp-xl);
    max-width: 480px;
    width: 92%;
    max-height: 82vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg), 0 0 60px rgba(79, 142, 247, 0.08);
    transform: scale(0.92) translateY(12px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal.active .modal-content {
    transform: scale(1) translateY(0);
}

.modal-header {
    font-size: var(--fs-xl);
    font-weight: 700;
    margin-bottom: var(--sp-sm);
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.form-group {
    margin-bottom: var(--sp-lg);
}

.form-group label {
    display: block;
    font-size: var(--fs-sm);
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--sp-sm);
    letter-spacing: 0.02em;
}

.form-group input {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-muted);
    border-radius: var(--r-md);
    padding: var(--sp-md);
    font-family: var(--font);
    font-size: var(--fs-md);
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-1);
    box-shadow: 0 0 0 3px rgba(79, 142, 247, 0.12);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

[data-theme="light"] .form-group input {
    background: rgba(0, 0, 0, 0.04);
}

.modal-actions {
    display: flex;
    gap: var(--sp-md);
    margin-top: var(--sp-xl);
}

.btn {
    flex: 1;
    padding: var(--sp-md) var(--sp-lg);
    border-radius: var(--r-md);
    border: none;
    font-family: var(--font);
    font-size: var(--fs-md);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 16px rgba(79, 142, 247, 0.35);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(79, 142, 247, 0.50);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    border: 1px solid var(--border-muted);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.10);
}

[data-theme="light"] .btn-secondary {
    background: rgba(0, 0, 0, 0.04);
}

/* ==========================================
   Background Style Modal
   ========================================== */

.bg-style-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--sp-md);
    margin: var(--sp-lg) 0;
}

.bg-style-option {
    border-radius: var(--r-md);
    overflow: hidden;
    cursor: pointer;
    border: 2px solid var(--border-subtle);
    transition: all 0.2s ease;
}

.bg-style-option:hover {
    border-color: var(--border-bright);
    transform: translateY(-2px);
}

.bg-style-option.active {
    border-color: var(--accent-1);
    box-shadow: 0 0 16px rgba(79, 142, 247, 0.3);
}

.bg-preview {
    height: 56px;
    border-radius: var(--r-sm) var(--r-sm) 0 0;
}

.bg-preview-default {
    background: var(--bg-base);
}

.bg-preview-gradient {
    background: linear-gradient(135deg, #0a1929, #1a0a30);
}

.bg-preview-grid {
    background: #080B14;
    background-image: linear-gradient(rgba(79, 142, 247, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(79, 142, 247, 0.08) 1px, transparent 1px);
    background-size: 20px 20px;
}

.bg-preview-glow {
    background: radial-gradient(circle at 30% 40%, #0d1f40, #080B14 60%);
}

.bg-preview-shadow {
    background: linear-gradient(135deg, #0d1117, #1a0530);
}

.bg-style-name {
    font-size: var(--fs-xs);
    font-weight: 600;
    padding: var(--sp-xs) var(--sp-sm) 2px;
    color: var(--text-primary);
}

.bg-style-desc {
    font-size: var(--fs-xs);
    padding: 0 var(--sp-sm) var(--sp-sm);
    color: var(--text-muted);
}

/* ==========================================
   Toast Notification
   ========================================== */

.toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--bg-elevated);
    border: 1px solid var(--border-muted);
    color: var(--text-primary);
    padding: 10px 20px;
    border-radius: var(--r-full);
    box-shadow: var(--shadow-lg), 0 0 20px rgba(79, 142, 247, 0.1);
    z-index: 10000;
    font-size: var(--fs-sm);
    font-weight: 500;
    animation: toastIn 0.3s ease forwards;
    white-space: nowrap;
}

.toast.hide {
    animation: toastOut 0.3s ease forwards;
}

/* ==========================================
   Utility Classes
   ========================================== */

.text-center {
    text-align: center;
}

.text-secondary {
    color: var(--text-secondary);
}

.mb-md {
    margin-bottom: var(--sp-md);
}

.mb-lg {
    margin-bottom: var(--sp-lg);
}

/* ==========================================
   Keyframe Animations
   ========================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(14px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes glowPulse {

    0%,
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.6;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.3);
        opacity: 1;
    }
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }

    to {
        opacity: 0;
        transform: translateX(-50%) translateY(10px);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% center;
    }

    100% {
        background-position: 200% center;
    }
}