/* ====================================
   西梅故事 - 登录页面全屏设计
   整洁、现代、工整的全屏登录体验
   ==================================== */

/* ==================== CSS变量定义 ==================== */
:root {
    --primary-color: #ff6600;
    --primary-light: #ff8833;
    --primary-dark: #e65c00;
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --text-tertiary: #999999;
    --border-color: #e8e8e8;
    --bg-light: #f8f8f8;
    --bg-white: #ffffff;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(255, 102, 0, 0.12);
    --shadow-lg: 0 8px 24px rgba(255, 102, 0, 0.16);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==================== 页面整体布局 - 精美渐变背景 ==================== */
.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #667eea 100%);
    height: 100vh;
    min-height: 100vh;
    max-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
}

/* 动态渐变层 */
.login-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(120, 119, 198, 0.4) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(99, 102, 241, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(167, 139, 250, 0.3) 0%, transparent 50%);
    animation: gradientShift 15s ease infinite;
}

/* 书籍主题装饰层 */
.login-page::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(2px 2px at 20% 30%, rgba(255, 255, 255, 0.15), transparent),
        radial-gradient(2px 2px at 60% 70%, rgba(255, 255, 255, 0.1), transparent),
        radial-gradient(1px 1px at 50% 50%, rgba(255, 255, 255, 0.1), transparent),
        radial-gradient(2px 2px at 80% 10%, rgba(255, 255, 255, 0.15), transparent),
        radial-gradient(2px 2px at 90% 60%, rgba(255, 255, 255, 0.1), transparent);
    background-size: 200px 200px, 150px 150px, 100px 100px, 250px 250px, 180px 180px;
    background-position: 0 0, 40px 60px, 130px 270px, 70px 100px, 150px 50px;
    opacity: 0.6;
    animation: sparkle 20s linear infinite;
}

@keyframes gradientShift {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.85;
        transform: scale(1.02);
    }
}

@keyframes sparkle {
    0% {
        background-position: 0 0, 40px 60px, 130px 270px, 70px 100px, 150px 50px;
    }
    100% {
        background-position: 200px 200px, 240px 260px, 330px 470px, 270px 300px, 350px 250px;
    }
}

/* ==================== 背景装饰 - 书籍主题装饰 ==================== */
.login-page .background-decoration {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 1 !important;
    pointer-events: none !important;
    opacity: 1 !important;
    display: block !important;
}

.background-decoration .decoration-circle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(80px);
    border: 2px solid rgba(255, 255, 255, 0.08);
    box-shadow: 
        0 0 60px rgba(255, 255, 255, 0.1),
        inset 0 0 60px rgba(255, 255, 255, 0.05);
}

.background-decoration .circle-1 {
    width: 500px;
    height: 500px;
    top: -150px;
    left: -100px;
    animation: floatSlow 30s ease-in-out infinite;
}

.background-decoration .circle-2 {
    width: 350px;
    height: 350px;
    bottom: -100px;
    right: -80px;
    animation: floatSlow 25s ease-in-out infinite reverse;
}

.background-decoration .circle-3 {
    width: 280px;
    height: 280px;
    top: 45%;
    right: 8%;
    animation: floatSlow 28s ease-in-out infinite;
}

@keyframes floatSlow {
    0%, 100% {
        transform: translateY(0) translateX(0) scale(1) rotate(0deg);
    }
    33% {
        transform: translateY(-25px) translateX(25px) scale(1.08) rotate(3deg);
    }
    66% {
        transform: translateY(25px) translateX(-25px) scale(0.92) rotate(-3deg);
    }
}

/* 书籍元素 - 使用CSS绘制 */
.background-decoration .floating-elements {
    position: absolute;
    width: 100%;
    height: 100%;
    display: block;
}

.background-decoration .floating-book {
    position: absolute;
    font-size: 0;
    opacity: 0.4;
}

/* 左上角书籍装饰 */
.background-decoration .book-1::before {
    content: '';
    position: absolute;
    width: 60px;
    height: 80px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.05) 100%);
    border-radius: 4px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-left-width: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    top: 15%;
    left: 10%;
    animation: bookFloat1 20s ease-in-out infinite;
}

/* 右上角书籍装饰 */
.background-decoration .book-2::before {
    content: '';
    position: absolute;
    width: 50px;
    height: 70px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.04) 100%);
    border-radius: 4px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-left-width: 6px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    top: 25%;
    right: 12%;
    animation: bookFloat2 18s ease-in-out infinite;
}

/* 左下角书籍装饰 */
.background-decoration .book-3::before {
    content: '';
    position: absolute;
    width: 55px;
    height: 75px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.03) 100%);
    border-radius: 4px;
    border: 2px solid rgba(255, 255, 255, 0.12);
    border-left-width: 7px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    bottom: 20%;
    left: 15%;
    animation: bookFloat3 22s ease-in-out infinite;
}

/* 右下角书籍装饰 */
.background-decoration .book-4::before {
    content: '';
    position: absolute;
    width: 65px;
    height: 85px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0.06) 100%);
    border-radius: 4px;
    border: 2px solid rgba(255, 255, 255, 0.18);
    border-left-width: 9px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    bottom: 15%;
    right: 18%;
    animation: bookFloat4 24s ease-in-out infinite;
}

@keyframes bookFloat1 {
    0%, 100% { transform: translateY(0) rotate(-5deg); }
    50% { transform: translateY(-20px) rotate(5deg); }
}

@keyframes bookFloat2 {
    0%, 100% { transform: translateY(0) rotate(8deg); }
    50% { transform: translateY(-15px) rotate(-8deg); }
}

@keyframes bookFloat3 {
    0%, 100% { transform: translateY(0) rotate(3deg); }
    50% { transform: translateY(-18px) rotate(-5deg); }
}

@keyframes bookFloat4 {
    0%, 100% { transform: translateY(0) rotate(-8deg); }
    50% { transform: translateY(-22px) rotate(6deg); }
}

/* ==================== 背景文字装饰 ==================== */
/* 中央大字水印 */
.background-decoration .circle-1::before {
    content: '西梅故事';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 120px;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.04);
    white-space: nowrap;
    pointer-events: none;
    z-index: -1;
    letter-spacing: 15px;
}

/* 左上角装饰文字 */
.background-decoration .circle-2::before {
    content: '阅读改变世界';
    position: absolute;
    top: -300px;
    left: -200px;
    font-size: 22px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.18);
    letter-spacing: 4px;
    pointer-events: none;
    z-index: 2;
}

/* 右上角装饰文字 */
.background-decoration .circle-3::before {
    content: '千万好书等您发现';
    position: absolute;
    top: -120px;
    right: -150px;
    font-size: 18px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.15);
    letter-spacing: 3px;
    pointer-events: none;
    z-index: 2;
}

/* 左下角装饰文字 */
.background-decoration .book-1::after {
    content: '书香';
    position: absolute;
    bottom: 15%;
    left: 8%;
    font-size: 32px;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.08);
    letter-spacing: 6px;
    pointer-events: none;
}

/* 右下角装饰文字 */
.background-decoration .book-4::after {
    content: '墨韵';
    position: absolute;
    bottom: 12%;
    right: 10%;
    font-size: 32px;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.08);
    letter-spacing: 6px;
    pointer-events: none;
}

/* ==================== 主容器 - 精致紧凑布局 ==================== */
body.login-page .login-container {
    position: relative !important;
    z-index: 10 !important;
    width: 100% !important;
    max-width: 460px !important;
    max-height: 90vh !important;
    display: flex !important;
    flex-direction: column !important;
    background: transparent !important;
    border-radius: 0 !important;
    overflow: visible !important;
    box-shadow: none !important;
    margin: 0 auto !important;
    grid-template-columns: none !important;
    align-items: center !important;
    justify-content: center !important;
}

/* ==================== 隐藏左侧品牌区域 ==================== */
.brand-section {
    display: none;
}

.brand-content,
.logo-section,
.brand-logo,
.brand-logo-text,
.brand-slogan,
.brand-features,
.feature-item,
.feature-icon,
.feature-text {
    display: none;
}

/* ==================== 表单区域 - 精致白色卡片 ==================== */
body.login-page .form-section {
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    background: transparent !important;
    overflow: hidden !important;
    flex: none !important;
}

body.login-page .form-container {
    max-width: 460px !important;
    min-width: 460px !important;
    width: 460px !important;
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(20px);
    border-radius: 20px !important;
    padding: 32px 36px 28px !important;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset !important;
    overflow-y: auto !important;
    max-height: 90vh !important;
    animation: none !important;
    border: none !important;
    box-sizing: border-box !important;
}

.form-container::-webkit-scrollbar {
    width: 6px;
}

.form-container::-webkit-scrollbar-track {
    background: transparent;
}

.form-container::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

.form-container::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.2);
}

/* ==================== 顶部Logo区域 - 全新书籍SVG Logo ==================== */
.login-page .form-container::before {
    content: '';
    display: block;
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    background: 
        url('../../assets/icons/login-logo.svg') no-repeat center center,
        linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    background-size: 60px 60px, 100% 100%;
    border-radius: 20px;
    box-shadow: 
        0 10px 35px rgba(255, 102, 0, 0.4),
        0 0 0 4px rgba(255, 255, 255, 1),
        inset 0 2px 12px rgba(255, 255, 255, 0.3);
    position: relative;
}

.login-page .back-to-home {
    position: absolute !important;
    top: 30px !important;
    left: 30px !important;
    z-index: 100 !important;
}

.login-page .back-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 12px 24px !important;
    background: rgba(255, 255, 255, 0.95) !important;
    color: var(--primary-color) !important;
    border-radius: var(--radius-md) !important;
    text-decoration: none !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    transition: var(--transition) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
    backdrop-filter: blur(10px);
    border: none !important;
}

.login-page .back-btn:hover {
    background: var(--bg-white) !important;
    transform: translateX(-4px) !important;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15) !important;
}

/* ==================== 表单标签切换 ==================== */
.form-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 20px;
    background: var(--bg-light);
    padding: 4px;
    border-radius: 10px;
}

.tab-btn {
    flex: 1;
    padding: 9px 16px;
    background: transparent;
    border: none;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.tab-btn:hover {
    color: var(--primary-color);
    background: rgba(255, 102, 0, 0.05);
}

.tab-btn.active {
    background: var(--bg-white);
    color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

/* ==================== 表单头部 ==================== */
.form-header {
    margin-bottom: 20px;
    text-align: center;
}

.form-header h3 {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 5px 0;
}

.form-header p {
    font-size: 12px;
    color: var(--text-tertiary);
    margin: 0;
}

/* ==================== 表单输入框 ==================== */
.input-group {
    margin-bottom: 14px;
}

.input-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    color: var(--text-tertiary);
    font-size: 15px;
    pointer-events: none;
    z-index: 1;
}

.input-wrapper input {
    width: 100%;
    padding: 12px 14px 12px 40px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-white);
    transition: var(--transition);
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 102, 0, 0.08);
}

.input-wrapper input::placeholder {
    color: #bbb;
}

.password-toggle {
    position: absolute;
    right: 14px;
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 4px;
    transition: var(--transition);
    z-index: 1;
}

.password-toggle:hover {
    color: var(--primary-color);
}

/* ==================== 验证码输入框特殊样式 ==================== */
.verification-wrapper {
    gap: 10px;
}

.verification-wrapper input {
    flex: 1;
}

.send-code-btn {
    padding: 12px 16px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: var(--bg-white);
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
}

/* 移除hover效果 */
/* .send-code-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
} */

.send-code-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.send-code-btn.countdown {
    background: var(--bg-light);
    color: var(--text-tertiary);
}

/* ==================== 输入提示 ==================== */
.input-hint {
    margin-top: 5px;
    font-size: 11px;
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.input-hint svg {
    width: 12px;
    height: 12px;
}

.optional-text {
    color: var(--text-tertiary);
    font-weight: 400;
}

/* ==================== 表单选项 ==================== */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.checkbox-wrapper input[type="checkbox"] {
    display: none;
}

.checkbox-custom {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.checkbox-wrapper input[type="checkbox"]:checked + .checkbox-custom {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border-color: var(--primary-color);
}

.checkbox-wrapper input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '✓';
    color: var(--bg-white);
    font-size: 12px;
    font-weight: bold;
}

.checkbox-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.checkbox-label a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.checkbox-label a:hover {
    text-decoration: underline;
}

/* ==================== 提交按钮 ==================== */
.auth-submit-btn {
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    color: var(--bg-white);
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.auth-submit-btn:active:not(:disabled) {
    transform: translateY(0);
}

.auth-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* ==================== 表单底部链接 ==================== */
.form-footer {
    text-align: center;
    margin-top: 24px;
}

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

.form-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.form-footer a:hover {
    color: var(--primary-light);
    text-decoration: underline;
}

/* ==================== 表单切换样式 ==================== */
.login-form-wrapper,
.register-form-wrapper {
    width: 100%;
}

.register-form-wrapper {
    display: none;
}

.login-form-wrapper {
    display: block;
}

/* ==================== 消息提示Toast ==================== */
.message-toast {
    position: fixed;
    top: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    z-index: 9999;
    background: var(--bg-white);
    padding: 16px 24px;
    border-radius: var(--radius-md);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.message-toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toast-icon {
    font-size: 20px;
}

.message-toast.success .toast-icon {
    color: #22c55e;
}

.message-toast.error .toast-icon {
    color: #ef4444;
}

.message-toast.info .toast-icon {
    color: #3b82f6;
}

.message-toast.warning .toast-icon {
    color: #f59e0b;
}

.toast-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

/* ==================== 加载动画 ==================== */
.btn-loader {
    display: none;
    width: 20px;
    height: 20px;
}

.btn-loader .spinner {
    width: 100%;
    height: 100%;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--bg-white);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.auth-submit-btn .btn-loader {
    display: none;
}

.send-code-btn .countdown-text {
    display: none;
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 768px) {
    .login-container {
        max-width: 90%;
        margin: 0 auto;
    }
    
    .form-container {
        padding: 32px 26px 28px;
    }
    
    .form-container::before {
        width: 52px;
        height: 52px;
        margin-bottom: 18px;
    }
    
    .back-to-home {
        position: static;
        margin-bottom: 20px;
    }
    
    .back-btn {
        width: 100%;
        justify-content: center;
    }
    
    .form-header h3 {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .login-container {
        max-width: 95%;
    }
    
    .form-container {
        padding: 28px 22px 24px;
    }
    
    .form-tabs {
        gap: 6px;
        padding: 4px;
    }
    
    .tab-btn {
        padding: 8px 14px;
        font-size: 13px;
    }
    
    .input-group {
        margin-bottom: 12px;
    }
    
    .input-wrapper input {
        padding: 11px 12px 11px 38px;
        font-size: 14px;
    }
    
    .input-icon {
        left: 12px;
        font-size: 14px;
    }
    
    .auth-submit-btn {
        padding: 13px 18px;
        font-size: 14px;
    }
    
    .verification-wrapper {
        flex-direction: column;
    }
    
    .send-code-btn {
        width: 100%;
    }
}

/* ==================== 页面加载动画 ==================== */
.login-page {
    opacity: 0;
    animation: fadeIn 0.6s ease-out forwards;
}

.login-page.loaded {
    opacity: 1;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.form-container {
    animation: slideUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.2s backwards;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}