@import url("https://fonts.googleapis.com/css2?family=BIZ+Plex+Sans:wght@400;500;600;700&family=BIZ+Plex+Mono:wght@400;500;600&display=swap");

:root {
    --font-sans: "BIZ Plex Sans", "Segoe UI", "PingFang SC", "Noto Sans SC", sans-serif;
    --font-mono: "BIZ Plex Mono", "SFMono-Regular", Consolas, monospace;
    --radius-xl: 26px;
    --radius-lg: 16px;
    --radius-md: 8px;
    --radius-sm: 4px;
    --max-width: 1220px;
    --transition-standard: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Theme */
[data-theme="light"] {
    --bg: #edf3f8;
    --surface: rgba(255, 255, 255, 0.65);
    --surface-hover: rgba(255, 255, 255, 0.6);
    --text: #142033;
    --text-muted: #5a6982;
    --line: rgba(16, 34, 57, 0.15);
    --accent: #c23b22;
    --accent-strong: #9a2e19;
    --dijin-gradient: linear-gradient(180deg, rgba(255, 255, 255, 0.8), rgba(237, 243, 248, 0.95));
}

/* Dark Theme */
[data-theme="dark"] {
    --bg: #121619;
    --surface: rgba(30, 35, 41, 0.65);
    --surface-hover: rgba(45, 50, 56, 0.7);
    --text: #f4f4f4;
    --text-muted: #a8b2c1;
    --line: rgba(255, 255, 255, 0.12);
    --accent: #b8513f; 
    --accent-strong: #91493b;
    --dijin-gradient: linear-gradient(180deg, rgba(30, 35, 41, 0.8), rgba(18, 22, 25, 0.95));
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font-sans);
    color: var(--text);
    background: var(--bg) var(--dijin-gradient);
    background-attachment: fixed;
    min-height: 100vh;
    overflow-x: hidden;
    transition: background 0s, color 0.3s;
}

/* === Splash Screen === */
.splash-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.splash-overlay.theme-transition {
    animation: fade-to-theme 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.splash-content {
    position: relative;
    width: 100%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* === Thinking Title === */
.splash-thinking {
    font-size: 2.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 16px;
    opacity: 0;
    transition: all 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    animation: slide-up-in 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.splash-thinking.is-rising {
    animation: thinking-rise 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.splash-thinking.is-minified {
    position: fixed;
    right: 40px;
    bottom: 120px;
    font-size: 1.2rem;
    gap: 8px;
    opacity: 0.8;
}

.brain-icon {
    font-size: 3.2rem;
}

.splash-thinking.is-minified .brain-icon {
    font-size: 1.5rem;
}

/* === Info List === */
.splash-info {
    margin-top: 32px;
    font-family: var(--font-mono);
    font-size: 1rem;
    line-height: 2;
    color: var(--text-muted);
}

.info-item {
    opacity: 0;
    transform: translateY(-20px);
}

.info-item .highlight {
    color: var(--accent);
    font-weight: 600;
}

.info-item.is-visible {
    animation: item-slide-in 2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* === Exit Animation === */
.splash-exit {
    opacity: 0;
    filter: blur(20px);
    animation: splash-fade-out 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* === Reconfig Flash === */
.reconfig-flash {
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
}

[data-theme="light"] .reconfig-flash {
    background: #fff;
    animation: flash-burst 0.6s step-end;
}

[data-theme="dark"] .reconfig-flash {
    background: #000;
    animation: flash-burst 0.6s step-end;
}

/* === Loading Dots === */
.loading-dots {
    display: inline-block;
}

.loading-dots::after {
    content: '';
    animation: dots 1.5s steps(4, end) infinite;
}

/* === Keyframe Animations === */
@keyframes fade-to-theme {
    0% { background: #1a1a2e; }
    100% { background: var(--bg); }
}

@keyframes slide-up-in {
    0% { transform: translateY(60px); opacity: 0; filter: blur(5px); }
    100% { transform: translateY(0); opacity: 1; filter: blur(0); }
}

@keyframes thinking-rise {
    0% {
        transform: translateY(80px);
        opacity: 0;
        filter: blur(8px);
    }
    100% {
        transform: translateY(0);
        opacity: 1;
        filter: blur(0);
    }
}

@keyframes item-slide-in {
    0% {
        transform: translateY(60px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes splash-fade-out {
    to { opacity: 0; filter: blur(20px); }
}

@keyframes flash-burst {
    0% { opacity: 0; }
    50% { opacity: 1; }
    55% { opacity: 0; }
}

@keyframes dots {
    0%, 20% { content: ''; }
    40% { content: '.'; }
    60% { content: '..'; }
    80%, 100% { content: '...'; }
}
