/* ============================================================
   智行监测系统 - 共享主题样式 V3.0
   仅做背景装饰，不侵入各页面自有布局
   ============================================================ */

/* ========== CSS 变量：主题色板 ========== */
:root {
    --bg-start: #dce4f0;
    --bg-mid: #e4eaf3;
    --bg-end: #eef2f8;
    --accent-color: #4a90d9;
    --accent-glow: rgba(74, 144, 217, 0.20);
    --deco-color-1: rgba(74, 144, 217, 0.14);
    --deco-color-2: rgba(100, 180, 255, 0.10);
}

/* 绿色主题 - 日必做 */
body.theme-green {
    --bg-start: #d4e8d7;
    --bg-mid: #dfede1;
    --bg-end: #ecf5ed;
    --accent-color: #4CAF50;
    --accent-glow: rgba(76, 175, 80, 0.20);
    --deco-color-1: rgba(76, 175, 80, 0.14);
    --deco-color-2: rgba(129, 199, 132, 0.10);
}

/* 蓝色主题 - 日积分 */
body.theme-blue {
    --bg-start: #d6e3f5;
    --bg-mid: #dfe9f7;
    --bg-end: #ecf2fb;
    --accent-color: #2196f3;
    --accent-glow: rgba(33, 150, 243, 0.20);
    --deco-color-1: rgba(33, 150, 243, 0.14);
    --deco-color-2: rgba(100, 181, 246, 0.10);
}

/* 暖色主题 - 大单业绩 */
body.theme-warm {
    --bg-start: #fce4d6;
    --bg-mid: #fdebe1;
    --bg-end: #fdf3ec;
    --accent-color: #ff7043;
    --accent-glow: rgba(255, 112, 67, 0.20);
    --deco-color-1: rgba(255, 112, 67, 0.14);
    --deco-color-2: rgba(255, 171, 145, 0.10);
}

/* 紫色主题 - 管理后台 */
body.theme-admin {
    --bg-start: #e3d8f2;
    --bg-mid: #eae1f5;
    --bg-end: #f2ecf8;
    --accent-color: #7c3aed;
    --accent-glow: rgba(124, 58, 237, 0.20);
    --deco-color-1: rgba(124, 58, 237, 0.14);
    --deco-color-2: rgba(167, 139, 250, 0.10);
}

/* 深蓝主题 - 登录页 */
body.theme-login {
    --bg-start: #0f1a3a;
    --bg-mid: #14264e;
    --bg-end: #1a3366;
    --accent-color: #4CAF50;
    --accent-glow: rgba(76, 175, 80, 0.25);
    --deco-color-1: rgba(255,255,255,0.06);
    --deco-color-2: rgba(255,255,255,0.04);
}

/* ========== 页面背景渐变 ========== */
body {
    background: linear-gradient(160deg, var(--bg-start) 0%, var(--bg-mid) 45%, var(--bg-end) 100%);
    background-attachment: fixed;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* ========== 几何装饰 ========== */

/* 四角光晕 */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-image:
        radial-gradient(ellipse 600px 500px at 95% 0%, var(--deco-color-1), transparent 70%),
        radial-gradient(ellipse 500px 450px at 0% 95%, var(--deco-color-2), transparent 70%),
        radial-gradient(ellipse 350px 350px at 75% 55%, var(--deco-color-1), transparent 70%),
        radial-gradient(ellipse 250px 250px at 10% 12%, var(--deco-color-2), transparent 70%);
    animation: bgFloat 18s ease-in-out infinite;
}

/* 顶部柔光 */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 260px;
    pointer-events: none;
    z-index: 0;
    background: radial-gradient(ellipse 70% 100% at 50% 0%, var(--deco-color-1), transparent);
    animation: topGlow 12s ease-in-out infinite;
}

body.theme-login::after {
    opacity: 0.15;
}

@keyframes bgFloat {
    0%, 100% { opacity: 0.7; transform: translate(0, 0) scale(1); }
    25%      { opacity: 1;   transform: translate(-15px, -10px) scale(1.03); }
    50%      { opacity: 0.6; transform: translate(8px, 15px) scale(0.97); }
    75%      { opacity: 0.9; transform: translate(12px, -8px) scale(1.02); }
}

@keyframes topGlow {
    0%, 100% { opacity: 0.6; }
    50%      { opacity: 1; }
}

/* ========== 页面载入动画 ========== */
@keyframes pageFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

body .container {
    animation: pageFadeIn 0.5s ease-out;
    position: relative;
    z-index: 1;
}

/* ========== 登录页卡片发光边框 ========== */
body.theme-login .login-container {
    position: relative;
    z-index: 1;
}

body.theme-login .login-container::before {
    content: '';
    position: absolute;
    top: -2px; left: -2px; right: -2px; bottom: -2px;
    background: linear-gradient(135deg, var(--accent-color), var(--accent-glow), transparent 70%);
    border-radius: 10px;
    z-index: -1;
    opacity: 0.35;
}

/* ========== 滚动条美化 ========== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.25); }

/* ========== 响应式 ========== */
@media (max-width: 768px) {
    body::before {
        background-image:
            radial-gradient(ellipse 300px 300px at 95% 5%, var(--deco-color-1), transparent 70%),
            radial-gradient(ellipse 250px 250px at 5% 95%, var(--deco-color-2), transparent 70%);
    }
}
