﻿/* ========== 登录/解绑页面样式 - 全新毛玻璃设计 ========== */

:root {
    --bg-primary: #f8fafc;
    --bg-secondary: rgba(255, 255, 255, 0.72);
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-tertiary: #94a3b8;
    --border-color: rgba(255, 255, 255, 0.45);
    --input-bg: rgba(255, 255, 255, 0.65);
    --input-border: rgba(203, 213, 225, 0.6);
    --accent-color: #6366f1;
    --accent-hover: #4f46e5;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.15);
    --error-color: #ef4444;
    --success-color: #10b981;
    --radius-md: 12px;
    --radius-lg: 20px;
    --glass-blur: 18px;
    --bg-gradient-start: rgba(99, 102, 241, 0.3);
    --bg-gradient-end: rgba(139, 92, 246, 0.2);
}

[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: rgba(15, 23, 42, 0.75);
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-tertiary: #94a3b8;
    --border-color: rgba(148, 163, 184, 0.15);
    --input-bg: rgba(30, 41, 59, 0.65);
    --input-border: rgba(71, 85, 105, 0.5);
    --accent-color: #818cf8;
    --accent-hover: #a5b4fc;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px rgba(129, 140, 248, 0.15);
    --bg-gradient-start: rgba(99, 102, 241, 0.2);
    --bg-gradient-end: rgba(15, 23, 42, 0.8);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: var(--text-primary);
    position: relative;
    overflow-x: hidden;
    background: #0a0a1a;
}

/* 全屏背景图 - 渐进加载（先缩略图再高清） */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('/api/bg-tiny.php?v=20260508a') center/cover no-repeat, #0a0a1a;
    z-index: -2;
    transition: none;
}

body.bg-loaded::before {
    background-image: url('/api/bg.php?v=20260508a');
    background-image: -webkit-image-set(url('/api/bg.webp?v=20260508a') type('image/webp'),
            url('/api/bg.php?v=20260508a') type('image/jpeg'));
    background-image: image-set(url('/api/bg.webp?v=20260508a') type('image/webp'),
            url('/api/bg.php?v=20260508a') type('image/jpeg'));
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--bg-gradient-start), var(--bg-gradient-end));
    z-index: -1;
}


.container {
    width: 100%;
    max-width: 440px;
    position: relative;
    z-index: 1;
}

.theme-toggle-btn {
    position: absolute;
    top: -60px;
    right: 0;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    backdrop-filter: blur(12px);
    color: var(--text-primary);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s, border-color 0.3s, transform 0.3s, box-shadow 0.3s;
    box-shadow: var(--shadow-md);
}

.theme-toggle-btn:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
    transform: translateY(-2px) rotate(20deg);
    box-shadow: var(--shadow-glow);
}

.back-link {
    position: absolute;
    top: -60px;
    left: 0;
    padding: 10px 18px;
    background: var(--bg-secondary);
    backdrop-filter: blur(12px);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.3s, border-color 0.3s, transform 0.3s, box-shadow 0.3s;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: var(--shadow-md);
}

.back-link:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.login-card {
    background: var(--bg-secondary);
    backdrop-filter: blur(var(--glass-blur)) saturate(180%);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(180%);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg), var(--shadow-glow), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    padding: 44px 40px;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    animation: cardEntry 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #6366f1, #a855f7, #ec4899, #6366f1);
    background-size: 300% 100%;
    animation: gradientFlow 4s linear infinite;
}

.header {
    text-align: center;
    margin-bottom: 36px;
}

.header h1 {
    font-size: 26px;
    margin-bottom: 10px;
    font-weight: 700;
    color: var(--text-primary);
}

.subtitle {
    font-size: 14px;
    color: var(--text-secondary);
}

.input-group {
    margin-bottom: 24px;
}

.input-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.login-input {
    width: 100%;
    height: 50px;
    padding: 0 18px;
    font-size: 15px;
    border: 2px solid var(--input-border);
    border-radius: var(--radius-md);
    background: var(--input-bg);
    backdrop-filter: blur(8px);
    color: var(--text-primary);
    transition: border-color 0.3s, box-shadow 0.3s;
    outline: none;
}

.login-input::placeholder {
    color: var(--text-tertiary);
}

.login-input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12), 0 4px 12px rgba(99, 102, 241, 0.1);
}

.login-btn {
    width: 100%;
    height: 52px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s;
    position: relative;
    overflow: hidden;
}

.login-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.login-btn:active::after {
    width: 300px;
    height: 300px;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.login-btn:disabled {
    background: var(--text-tertiary);
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.alert-box {
    padding: 14px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    display: none;
    font-size: 14px;
    border: 1px solid transparent;
    backdrop-filter: none;
    font-weight: 500;
}

.alert-box.error {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.25);
    color: var(--error-color);
}

.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('/api/bg-tiny.php?v=20260508a') center/cover no-repeat, #0a0a1a;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.page-loader::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
}

.page-loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    border-top-color: #a5b4fc;
    border-right-color: #818cf8;
    animation: spin 0.8s ease-in-out infinite;
    z-index: 1;
}

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

@keyframes cardEntry {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes gradientFlow {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 300% 50%;
    }
}

/* 响应式 */
@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }

    .login-card {
        padding: 32px 24px;
    }

    h1 {
        font-size: 22px;
    }

    .subtitle {
        font-size: 13px;
    }

    .login-input {
        padding: 12px 14px;
        font-size: 16px;
    }

    .login-btn {
        padding: 13px;
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }

    .login-card {
        padding: 28px 18px;
        border-radius: 16px;
    }

    h1 {
        font-size: 20px;
    }

    .back-link {
        font-size: 13px;
        top: -50px;
        left: 0;
        padding: 8px 14px;
    }

    .theme-toggle-btn {
        top: -50px;
        right: 0;
        width: 38px;
        height: 38px;
    }
}

@media (max-width: 360px) {
    .login-card {
        padding: 22px 14px;
    }

    .login-input {
        padding: 11px 12px;
    }
}