/* 主题系统 - CSS变量定义 */

/* 默认主题（明亮主题） */
:root {
    /* 主色调 */
    --primary-color: #3b82f6;
    --primary-color-dark: #2563eb;
    --primary-color-light: #60a5fa;
    --primary-color-alpha: rgba(59, 130, 246, 0.1);

    /* 状态颜色 */
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #06b6d4;

    /* 背景色 */
    --bg-primary: #f9fafb;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-surface: #ffffff;

    /* 文本颜色 */
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-tertiary: #94a3b8;

    /* 边框和分割线 */
    --border-color: #e2e8f0;
    --border-color-light: #f1f5f9;

    /* 阴影 */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* 黑暗主题 */
[data-theme="dark"] {
    /* 主色调 */
    --primary-color: #60a5fa;
    --primary-color-dark: #3b82f6;
    --primary-color-light: #93c5fd;
    --primary-color-alpha: rgba(96, 165, 250, 0.1);

    /* 状态颜色 */
    --success-color: #34d399;
    --danger-color: #f87171;
    --warning-color: #fbbf24;
    --info-color: #22d3ee;

    /* 背景色 */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --bg-surface: #1e293b;

    /* 文本颜色 */
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-tertiary: #94a3b8;

    /* 边框和分割线 */
    --border-color: #334155;
    --border-color-light: #475569;

    /* 阴影 */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
}

/* 登录页面特殊样式 */
.login-page {
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    position: relative;
    width: 100%;
    max-width: 400px;
    padding: 2rem;
}

.login-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    border-radius: 1rem;
    z-index: -1;
}

.background-shape {
    position: absolute;
    border-radius: 50%;
    background: linear-gradient(45deg, var(--primary-color-alpha), transparent);
    animation: float 6s ease-in-out infinite;
}

.background-shape.shape-1 {
    width: 200px;
    height: 200px;
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.background-shape.shape-2 {
    width: 150px;
    height: 150px;
    bottom: -75px;
    right: -75px;
    animation-delay: 2s;
}

.background-shape.shape-3 {
    width: 100px;
    height: 100px;
    top: 50%;
    right: -50px;
    animation-delay: 4s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(180deg);
    }
}

.login-card {
    background-color: var(--bg-surface);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header .logo {
    justify-content: center;
    margin-bottom: 1rem;
}

.login-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.login-subtitle {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.login-form {
    margin-bottom: 1.5rem;
}

.login-form .form-group {
    margin-bottom: 1.5rem;
}

.login-form .form-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-weight: 500;
    color: var(--text-primary);
}

.label-icon {
    width: 16px;
    height: 16px;
    color: var(--text-secondary);
}

.login-form .form-group.focused .form-label {
    color: var(--primary-color);
}

.login-form .form-group.focused .label-icon {
    color: var(--primary-color);
}

.btn-login {
    width: 100%;
    justify-content: center;
    padding: 0.875rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

.btn-login.loading {
    opacity: 0.7;
    cursor: wait;
}

.btn-login.loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 0.5rem;
}

.login-footer {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.theme-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* 消息提示样式 */
.alert {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    border: 1px solid;
}

.alert-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.alert-success {
    background-color: rgba(16, 185, 129, 0.1);
    border-color: var(--success-color);
    color: var(--success-color);
}

.alert-error {
    background-color: rgba(239, 68, 68, 0.1);
    border-color: var(--danger-color);
    color: var(--danger-color);
}

.alert-info {
    background-color: rgba(6, 182, 212, 0.1);
    border-color: var(--info-color);
    color: var(--info-color);
}

/* 主题切换动画 */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* 系统偏好检测 */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        /* 如果用户没有明确设置主题，且系统偏好是暗色，则使用暗色主题 */
        --primary-color: #60a5fa;
        --primary-color-dark: #3b82f6;
        --primary-color-light: #93c5fd;
        --primary-color-alpha: rgba(96, 165, 250, 0.1);

        --success-color: #34d399;
        --danger-color: #f87171;
        --warning-color: #fbbf24;
        --info-color: #22d3ee;

        --bg-primary: #0f172a;
        --bg-secondary: #1e293b;
        --bg-tertiary: #334155;
        --bg-surface: #1e293b;

        --text-primary: #f1f5f9;
        --text-secondary: #cbd5e1;
        --text-tertiary: #94a3b8;

        --border-color: #334155;
        --border-color-light: #475569;

        --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
        --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
        --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
    }
}

/* 减少动画效果（用户偏好） */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .background-shape {
        animation: none;
    }
} 