:root {
    --bg-base: #020408;
    --bg-elevated: #080c16;
    --bg-raised: #0d1018;
    --bg-sunken: #0b1017;
    --bg-panel: #14161a;
    --bg-panel-raised: #1b1f24;

    --bg-surface: rgba(255, 255, 255, 0.02);
    --bg-surface-hover: rgba(255, 255, 255, 0.05);
    --bg-surface-active: rgba(255, 255, 255, 0.08);

    --text-primary: #f0f0f5;
    --text-secondary: #7d829a;
    --text-muted: #4a4f65;
    --text-on-accent: #ffffff;
    --text: var(--text-primary);

    --accent: #6366f1;
    --accent-hover: #4f46e5;
    --accent-soft: color-mix(in srgb, var(--accent) 8%, transparent);
    --accent-tint: color-mix(in srgb, var(--accent) 14%, transparent);
    --accent-fill: color-mix(in srgb, var(--accent) 22%, transparent);
    --accent-edge: color-mix(in srgb, var(--accent) 26%, transparent);
    --accent-glow: color-mix(in srgb, var(--accent) 35%, transparent);
    --accent-text: color-mix(in srgb, var(--accent) 62%, #ffffff);
    --accent-light: var(--accent-tint);
    --accent-dim: var(--accent-tint);

    --danger: #f43f5e;
    --danger-deep: #be123c;
    --danger-light: color-mix(in srgb, var(--danger) 10%, transparent);
    --danger-edge: color-mix(in srgb, var(--danger) 22%, transparent);
    --success: #10b981;
    --success-light: color-mix(in srgb, var(--success) 10%, transparent);
    --success-edge: color-mix(in srgb, var(--success) 22%, transparent);
    --warning: #f59e0b;
    --warning-light: color-mix(in srgb, var(--warning) 10%, transparent);
    --warning-edge: color-mix(in srgb, var(--warning) 22%, transparent);
    --info: #06b6d4;
    --info-light: color-mix(in srgb, var(--info) 12%, transparent);

    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);
    --border-strong: rgba(255, 255, 255, 0.18);
    --border-focus: var(--accent-edge);
    --glass-border: rgba(255, 255, 255, 0.08);

    --radius: 4px;
    --radius-sm: 2px;
    --r-xs: var(--radius);
    --r-sm: var(--radius);
    --r-md: var(--radius);
    --r-lg: var(--radius);
    --r-xl: var(--radius);
    --r-full: var(--radius);

    --sp-1: 4px;
    --sp-2: 8px;
    --sp-3: 12px;
    --sp-4: 16px;
    --sp-5: 20px;
    --sp-6: 24px;
    --sp-7: 32px;
    --sp-8: 40px;
    --sp-9: 56px;
    --sp-10: 80px;

    --fs-2xs: 0.6875rem;
    --fs-xs: 0.75rem;
    --fs-sm: 0.8125rem;
    --fs-md: 0.875rem;
    --fs-base: 0.9375rem;
    --fs-lg: 1.0625rem;
    --fs-xl: 1.3125rem;
    --fs-2xl: 1.625rem;
    --fs-3xl: 2rem;
    --fs-4xl: 2.5rem;
    --fs-5xl: 3.5rem;

    --lh-tight: 1.25;
    --lh-snug: 1.4;
    --lh-normal: 1.55;
    --lh-loose: 1.65;

    --track-tight: -0.03em;
    --track-title: -0.02em;
    --track-wide: 0.06em;
    --track-caps: 0.08em;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.6);
    --shadow-inset: inset 0 2px 4px rgba(0, 0, 0, 0.3), inset 0 1px 2px rgba(0, 0, 0, 0.1);
    --shadow-lift: 0 3px 14px rgba(0, 0, 0, 0.25), inset 0 1px 1px rgba(255, 255, 255, 0.1);
    --shadow-lift-hover: 0 8px 32px rgba(0, 0, 0, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.1);

    --glass-blur: blur(24px);
    --glass-bg: rgba(8, 12, 22, 0.8);
    --scrim: rgba(2, 4, 8, 0.88);

    --ease: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
    --t-fast: 150ms var(--ease);
    --t-base: 280ms var(--ease);
    --t-slow: 450ms var(--ease);

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', 'Cascadia Code', Consolas, monospace;

    --surface-3: var(--bg-surface-hover);
}

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

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

body {
    font-family: var(--font-sans);
    background: var(--bg-base);
    color: var(--text-primary);
    line-height: var(--lh-normal);
    min-height: 100vh;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 50% 100%, var(--accent-soft) 0%, transparent 50%),
        radial-gradient(ellipse 50% 40% at 80% 0%, rgba(139, 92, 246, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse 40% 30% at 20% 80%, rgba(59, 130, 246, 0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.02'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
    opacity: 0.5;
}

button {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

a {
    text-decoration: none;
    color: inherit;
}

input,
textarea,
select {
    font-family: inherit;
}

img {
    max-width: 100%;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: var(--radius);
}

::selection {
    background: var(--accent-fill);
    color: var(--text-primary);
}

::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--bg-surface-active);
    border-radius: var(--radius);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-strong);
}

.hidden {
    display: none !important;
}

.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-center { text-align: center; }
.font-mono { font-family: var(--font-mono); }

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

.logo-icon {
    color: var(--accent);
    font-size: 22px;
    filter: drop-shadow(0 0 8px var(--accent-glow));
}

.logo-text {
    font-size: var(--fs-base);
    font-weight: 700;
    letter-spacing: var(--track-title);
    color: var(--text-primary);
}

.avatar {
    width: 30px;
    height: 30px;
    min-width: 30px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 50%, #ec4899));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-on-accent);
    font-size: 16px;
    box-shadow: 0 0 16px var(--accent-fill);
}

.avatar-img {
    width: 100%;
    height: 100%;
    border-radius: var(--radius);
    object-fit: cover;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--sp-9) var(--sp-5);
    text-align: center;
}

.empty-state .material-symbols-outlined {
    font-size: 48px;
    color: var(--text-muted);
    margin-bottom: var(--sp-4);
    opacity: 0.4;
}

.empty-state h3 {
    font-size: var(--fs-lg);
    font-weight: 600;
    margin-bottom: var(--sp-2);
    color: var(--text-secondary);
}

.empty-state p {
    font-size: var(--fs-md);
    color: var(--text-muted);
    max-width: 320px;
}

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

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

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

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

@keyframes pulse {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.15); }
}

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

.animate-fade-in {
    animation: fadeIn 0.5s var(--ease-out) forwards;
    opacity: 0;
}

.animate-slide-in {
    animation: slideIn 0.4s var(--ease-out) forwards;
    opacity: 0;
}

.animate-scale-in {
    animation: scaleIn 0.4s var(--ease-out) forwards;
    opacity: 0;
}

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

.view-skeleton {
    padding-top: var(--sp-1);
}

.skeleton-block {
    background: linear-gradient(100deg, rgba(255, 255, 255, 0.03) 40%, rgba(255, 255, 255, 0.07) 50%, rgba(255, 255, 255, 0.03) 60%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.6s ease-in-out infinite;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.skeleton-title {
    width: 220px;
    height: 28px;
    margin-bottom: var(--sp-7);
}

.skeleton-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: var(--sp-4);
}

.skeleton-card {
    height: 150px;
}

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