﻿* {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ===== 暗色主题（默认） ===== */
:root, [data-theme="dark"] {
    --login-bg: #0f0b1a;
    --card-bg: rgba(255, 255, 255, 0.07);
    --card-border: rgba(255, 255, 255, 0.12);
    --card-border-hover: rgba(255, 255, 255, 0.18);
    --card-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    --card-shadow-hover: 0 12px 48px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    --input-bg: rgba(255, 255, 255, 0.05);
    --input-border: rgba(255, 255, 255, 0.1);
    --input-focus-bg: rgba(255, 255, 255, 0.08);
    --input-color: #f1f5f9;
    --input-placeholder: rgba(255, 255, 255, 0.4);
    --icon-color: rgba(255, 255, 255, 0.4);
    --text-muted: rgba(255, 255, 255, 0.4);
    --footer-bg: rgba(0, 0, 0, 0.3);
    --footer-border: rgba(255, 255, 255, 0.05);
    --footer-text: rgba(255, 255, 255, 0.4);
    --footer-link: rgba(167, 139, 250, 0.7);
    --footer-link-hover: #c4b5fd;
    --orb1: rgba(124,58,237,0.5);
    --orb2: rgba(59,130,246,0.4);
    --orb3: rgba(236,72,153,0.35);
    --error-bg: rgba(239, 68, 68, 0.1);
    --error-text: #fca5a5;
    --success-bg: rgba(34, 197, 94, 0.1);
    --success-text: #86efac;
    --spinner-track: rgba(255, 255, 255, 0.2);
    color-scheme: dark;
}

/* ===== 亮色主题 ===== */
[data-theme="light"] {
    --login-bg: #f0eef5;
    --card-bg: rgba(255, 255, 255, 0.65);
    --card-border: rgba(0, 0, 0, 0.08);
    --card-border-hover: rgba(0, 0, 0, 0.12);
    --card-shadow: 0 8px 32px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.5);
    --card-shadow-hover: 0 12px 48px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.6);
    --input-bg: rgba(255, 255, 255, 0.5);
    --input-border: rgba(0, 0, 0, 0.1);
    --input-focus-bg: rgba(255, 255, 255, 0.7);
    --input-color: #1e1b2e;
    --input-placeholder: rgba(0, 0, 0, 0.35);
    --icon-color: rgba(0, 0, 0, 0.35);
    --text-muted: rgba(0, 0, 0, 0.4);
    --footer-bg: rgba(255, 255, 255, 0.6);
    --footer-border: rgba(0, 0, 0, 0.06);
    --footer-text: rgba(0, 0, 0, 0.4);
    --footer-link: #7c3aed;
    --footer-link-hover: #6d28d9;
    --orb1: rgba(124,58,237,0.15);
    --orb2: rgba(59,130,246,0.1);
    --orb3: rgba(236,72,153,0.1);
    --error-bg: rgba(239, 68, 68, 0.08);
    --error-text: #dc2626;
    --success-bg: rgba(34, 197, 94, 0.08);
    --success-text: #16a34a;
    --spinner-track: rgba(0, 0, 0, 0.15);
    color-scheme: light;
}


body {
    background: var(--login-bg);
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    transition: background 0.3s ease;
}

/* 动态渐变光斑背景 */
.bg-decoration {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
}

.bg-circle {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    animation: drift 18s infinite ease-in-out;
    transition: background 0.5s ease;
}

.bg-circle:nth-child(1) {
    width: 500px; height: 500px;
    top: -15%; left: -10%;
    background: radial-gradient(circle, var(--orb1), transparent 70%);
    animation-delay: 0s;
}

.bg-circle:nth-child(2) {
    width: 400px; height: 400px;
    top: 40%; right: -8%;
    background: radial-gradient(circle, var(--orb2), transparent 70%);
    animation-delay: -6s;
}

.bg-circle:nth-child(3) {
    width: 350px; height: 350px;
    bottom: -10%; left: 25%;
    background: radial-gradient(circle, var(--orb3), transparent 70%);
    animation-delay: -12s;
}

@keyframes drift {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(40px, -30px) scale(1.08); }
    66% { transform: translate(-20px, 20px) scale(0.95); }
}

/* 登录容器 */
.login-container {
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(40px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* 玻璃态登录卡片 */
.login-card {
    background: var(--card-bg);
    backdrop-filter: blur(24px) saturate(1.4);
    -webkit-backdrop-filter: blur(24px) saturate(1.4);
    border: 1px solid var(--card-border);
    box-shadow: var(--card-shadow);
    transition: box-shadow 0.4s ease, border-color 0.4s ease, background 0.3s ease;
}

.login-card:hover {
    border-color: var(--card-border-hover);
    box-shadow: var(--card-shadow-hover);
}

/* 输入框 */
.input-group { position: relative; }

.input-icon {
    position: absolute;
    left: 16px; top: 50%;
    transform: translateY(-50%);
    color: var(--icon-color);
    transition: color 0.3s;
    z-index: 2;
    pointer-events: none;
    width: 18px; text-align: center;
}

.input-field {
    width: 100%;
    padding: 14px 16px 14px 48px;
    border: 1.5px solid var(--input-border);
    border-radius: 12px;
    background: var(--input-bg);
    color: var(--input-color);
    font-size: 14px;
    transition: all 0.3s;
    box-sizing: border-box;
}

.input-field::placeholder { color: var(--input-placeholder); }

.input-field:focus {
    outline: none;
    border-color: rgba(124, 58, 237, 0.7);
    background: var(--input-focus-bg);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

.input-field:focus + .input-icon,
.input-field:focus ~ .input-icon,
.input-field:not(:placeholder-shown) + .input-icon,
.input-field:not(:placeholder-shown) ~ .input-icon {
    color: #a78bfa;
}

/* 按钮 */
.btn-primary {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 50%, #5b21b6 100%);
    box-shadow: 0 4px 20px rgba(124, 58, 237, 0.35);
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}
.btn-primary::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    transition: left 0.5s;
}
.btn-primary:hover::before { left: 100%; }
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(124, 58, 237, 0.5);
}
.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
}
.btn-primary span { position: relative; z-index: 1; }

/* 消息提示 */
.message { animation: slideDown 0.3s ease-out; }

#error-message {
    background: var(--error-bg);
    color: var(--error-text);
}
#success-message {
    background: var(--success-bg);
    color: var(--success-text);
}

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

/* 加载动画 */
.spinner {
    border: 2px solid var(--spinner-track);
    border-top-color: white;
    border-radius: 50%;
    width: 20px; height: 20px;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* 底部备案 */
.login-footer {
    background: var(--footer-bg);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--footer-border);
    color: var(--footer-text);
}
.login-footer a {
    color: var(--footer-link);
}
.login-footer a:hover {
    color: var(--footer-link-hover);
}

/* 文字颜色适配 */
.text-muted-adaptive { color: var(--text-muted); }

/* 响应式 */
@media (max-width: 640px) {
    .login-card { margin: 0.5rem; padding: 1.5rem; }
    .bg-circle { filter: blur(60px); }
}

/* 主题过渡 */
body.theme-transitioning,
body.theme-transitioning * {
    transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease !important;
}