/**
 * login.css - 登录弹层样式
 * 作者：之马工场
 * 创建日期：2026-01-07
 */

/* ========== 登录弹层遮罩 ========== */
.login-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.2s ease;
}

/* ========== 登录弹窗 ========== */
.login-modal {
    position: relative;
    width: 100%;
    max-width: 400px;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    animation: slideInUp 0.3s ease;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.login-modal-inner {
    padding: 28px 32px;
    overflow-y: auto;
    flex: 1;
}

/* 自定义滚动条样式 */
.login-modal-inner::-webkit-scrollbar {
    width: 6px;
}

.login-modal-inner::-webkit-scrollbar-track {
    background: transparent;
}

.login-modal-inner::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.login-modal-inner::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    transition: all var(--transition-fast);
    z-index: 10;
}

.modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.modal-close svg {
    width: 18px;
    height: 18px;
}

/* ========== 登录头部 ========== */
.login-modal-header {
    text-align: center;
    margin-bottom: 20px;
}

.login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 8px;
}

.login-logo .logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    box-shadow: 0 4px 15px rgba(0, 168, 132, 0.3);
}

.login-logo .logo-name {
    font-size: 1.375rem;
    font-weight: 600;
    color: var(--text-primary);
}

.login-subtitle {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin: 0;
}

/* ========== 登录标签切换 ========== */
.login-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
    padding: 3px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.login-tab {
    flex: 1;
    padding: 10px 16px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.login-tab:hover {
    color: var(--text-primary);
}

.login-tab.active {
    background: var(--bg-card);
    color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

/* ========== 登录表单 ========== */
.login-form-container {
    animation: fadeIn 0.2s ease;
}

.login-form .form-group {
    margin-bottom: 14px;
}

.login-form .form-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.login-form .form-label .required {
    color: var(--danger-color);
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon svg {
    position: absolute;
    left: 12px;
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    pointer-events: none;
    z-index: 1;
    flex-shrink: 0;
}

.input-with-icon .form-input {
    padding-left: 38px;
    width: 100%;
    box-sizing: border-box;
}

.login-form .form-input {
    width: 100%;
    padding: 10px 32px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: all var(--transition-fast);
    box-sizing: border-box;
}

.login-form .form-input:focus {
    border-color: var(--primary-color);
    background: var(--bg-card);
    box-shadow: 0 0 0 3px rgba(0, 168, 132, 0.1);
}

.login-form .form-input::placeholder {
    color: var(--text-muted);
}

.login-form .form-select {
    appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 14px;
    padding-right: 36px;
}

/* ========== 验证码 ========== */
.verify-group {
    display: flex;
    gap: 10px;
}

.verify-input-wrapper {
    flex: 1;
}

.verify-img {
    width: 100px;
    height: 38px;
    border-radius: var(--radius-md);
    cursor: pointer;
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
}

.verify-img:hover {
    border-color: var(--primary-color);
}

/* ========== 表单选项 ========== */
.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.checkbox-label input[type="checkbox"] {
    width: 14px;
    height: 14px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.forgot-link {
    font-size: 0.8125rem;
    color: var(--primary-color);
}

.forgot-link:hover {
    text-decoration: underline;
}

/* ========== 表单协议 ========== */
.form-agreement {
    margin-bottom: 16px;
}

.form-agreement .checkbox-label {
    align-items: flex-start;
}

.form-agreement .checkbox-label span {
    line-height: 1.4;
}

.form-agreement .checkbox-label a {
    color: var(--primary-color);
}

.form-agreement .checkbox-label a:hover {
    text-decoration: underline;
}

/* ========== 按钮 ========== */
.btn-block {
    width: 100%;
    padding: 10px 16px;
}

/* ========== 弹窗底部 ========== */
.login-modal-footer {
    text-align: center;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.login-modal-footer p {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0;
}

/* ========== 未登录遮罩层 ========== */
.guest-overlay {
    position: fixed;
    top: 48px;
    left: 0;
    width: 100%;
    height: calc(100vh - 48px);
    background: rgba(10, 15, 26, 0.85);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 500;
}

[data-theme="light"] .guest-overlay,
:root .guest-overlay {
    background: rgba(248, 250, 252, 0.92);
}

.guest-overlay-content {
    text-align: center;
    padding: 60px 40px;
    max-width: 500px;
    animation: fadeIn 0.3s ease;
}

.guest-icon {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 32px;
    box-shadow: 0 8px 30px rgba(0, 168, 132, 0.3);
}

.guest-icon svg {
    width: 48px;
    height: 48px;
    color: white;
}

.guest-overlay-content h2 {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.guest-overlay-content p {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.guest-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
}

.guest-actions .btn {
    min-width: 140px;
    padding: 14px 32px;
    font-size: 1rem;
}

/* ========== 导航栏Logo调整 ========== */
.nav-logo {
    display: flex;
    align-items: center;
    gap: 0;
    text-decoration: none;
    margin-right: 32px;
    flex-shrink: 0;
}

.nav-logo .logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-item.login-trigger {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    color: white !important;
}

.nav-item.login-trigger:hover {
    opacity: 0.9;
}

.nav-item.login-trigger .nav-text {
    color: white;
}

/* ========== 响应式设计 ========== */
@media (max-width: 768px) {
    .login-modal {
        margin: 16px;
        max-width: calc(100% - 32px);
    }
    
    .login-modal-inner {
        padding: 24px 20px;
    }
    
    .guest-overlay {
        top: 56px;
        height: calc(100vh - 56px);
    }
    
    .guest-overlay-content {
        padding: 40px 24px;
    }
    
    .guest-icon {
        width: 80px;
        height: 80px;
    }
    
    .guest-icon svg {
        width: 40px;
        height: 40px;
    }
    
    .guest-overlay-content h2 {
        font-size: 1.5rem;
    }
    
    .guest-overlay-content p {
        font-size: 1rem;
    }
    
    .guest-actions {
        flex-direction: column;
    }
    
    .guest-actions .btn {
        width: 100%;
    }
    
    .nav-logo .logo-text {
        font-size: 1rem;
    }
}
