:root {
    /* Deep Aurora color system */
    --bg-deep: #0A0E1A;
    --bg-surface: #131B2F;
    --bg-elevated: #192134;
    --text-primary: #EDEDEF;
    --text-secondary: #8A8F98;
    --text-muted: #5B6170;
    --accent-blue: #4A7CFE;
    --accent-cyan: #22D3EE;
    --accent-indigo: #5E6AD2;
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);
    --glow-blue: 0 0 20px rgba(74, 124, 254, 0.15);
    --glow-cyan: 0 0 20px rgba(34, 211, 238, 0.12);

    /* Spacing & layout */
    --touch-primary: 56px;
    --touch-secondary: 48px;
    --touch-minimum: 44px;
    --nav-bar-height: 72px;
    --app-bar-height: 56px;
    --safe-area-top: env(safe-area-inset-top, 0px);
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
    --safe-area-left: env(safe-area-inset-left, 0px);
    --safe-area-right: env(safe-area-inset-right, 0px);

    /* Animation */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease-out;
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
}

.platform-ios {
    --card-corner-radius: 16px;
}

.platform-android {
    --card-corner-radius: 28px;
}

* {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

html, body {
    font-family: 'Inter', 'PingFang SC', 'Noto Sans SC', 'Microsoft YaHei', sans-serif;
    background: var(--bg-deep);
    color: var(--text-primary);
    overscroll-behavior: none;
    user-select: none;
    -webkit-user-select: none;
}

input, textarea {
    user-select: text;
    -webkit-user-select: text;
}

.touch-feedback {
    transition: transform var(--transition-fast), opacity var(--transition-fast);
}
.touch-feedback:active {
    transform: scale(0.96);
    opacity: 0.9;
}

.safe-area-top { padding-top: var(--safe-area-top) !important; }
.safe-area-bottom { padding-bottom: var(--safe-area-bottom) !important; }
.safe-area-left { padding-left: var(--safe-area-left) !important; }
.safe-area-right { padding-right: var(--safe-area-right) !important; }

/* Aurora background layer (applied to body by MainLayout) */
.aurora-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}
.aurora-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    will-change: transform;
}
.aurora-blob-1 {
    width: 300px; height: 300px;
    background: var(--accent-blue);
    opacity: 0.15;
    top: -80px; left: -60px;
    animation: auroraFloat1 8s ease-in-out infinite alternate;
}
.aurora-blob-2 {
    width: 250px; height: 250px;
    background: var(--accent-cyan);
    opacity: 0.1;
    bottom: -60px; right: 10%;
    animation: auroraFloat2 10s ease-in-out infinite alternate;
}
.aurora-blob-3 {
    width: 200px; height: 200px;
    background: var(--accent-indigo);
    opacity: 0.08;
    top: 30%; right: -40px;
    animation: auroraFloat3 7s ease-in-out infinite alternate;
}
@keyframes auroraFloat1 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(80px, 40px) scale(1.3); }
}
@keyframes auroraFloat2 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-60px, -30px) scale(1.2); }
}
@keyframes auroraFloat3 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-50px, 40px) scale(1.4); }
}

/* Force dark scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: var(--bg-surface); border-radius: 3px; }

/* Utility: glass panel */
.glass-panel {
    background: rgba(19, 27, 47, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-subtle);
}

/* Loading progress (dark theme) */
.loading-progress-text {
    color: var(--text-secondary) !important;
}
.loading-progress-text:after {
    content: var(--blazor-load-percentage-text, "Loading");
}
.splash-scan-line {
    animation: splashScan 2.5s ease-in-out infinite;
}

/* Blazor error ui */
#blazor-error-ui {
    background: #1a0a0a;
    color: #ff6b6b;
    border-top: 1px solid rgba(255, 107, 107, 0.2);
}
.blazor-error-boundary {
    background: #1a0a0a;
    color: #ff6b6b;
}

/* Page layout (replaces nested MudLayout in sub-pages) */
.page-layout {
    display: flex;
    flex-direction: column;
    min-height: 100%;
}
.page-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px;
    min-height: 56px;
    flex-shrink: 0;
}
.page-body {
    flex: 1;
    padding: 0;
}
