/* 登录页面样式 */

:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-color: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --error-color: #ef4444;
    --success-color: #22c55e;
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    --radius: 12px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-box {
    background: var(--card-bg);
    border-radius: 20px;
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 420px;
    padding: 40px;
    animation: slideUp 0.5s ease;
}

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

/* Logo 区域 */
.logo-section {
    text-align: center;
    margin-bottom: 32px;
}

.logo-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 16px;
}

.logo-text {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 8px;
}

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

/* Tab 切换 */
.login-tabs {
    display: flex;
    background: #f1f5f9;
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 24px;
}

.tab-btn {
    flex: 1;
    padding: 10px 16px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn.active {
    background: white;
    color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.tab-btn:hover:not(.active) {
    color: var(--text-color);
}

/* Tab 内容 */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* 表单样式 */
.form-group {
    margin-bottom: 16px;
}

.phone-input-wrapper {
    display: flex;
    align-items: center;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color 0.3s ease;
}

.phone-input-wrapper:focus-within {
    border-color: var(--primary-color);
}

.country-code {
    padding: 14px 16px;
    background: #f8fafc;
    color: var(--text-color);
    font-weight: 500;
    border-right: 1px solid var(--border-color);
}

.phone-input-wrapper input {
    flex: 1;
    padding: 14px 16px;
    border: none;
    outline: none;
    font-size: 16px;
    color: var(--text-color);
}

.phone-input-wrapper input::placeholder {
    color: var(--text-muted);
}

.code-input-wrapper {
    display: flex;
    align-items: center;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color 0.3s ease;
}

.code-input-wrapper:focus-within {
    border-color: var(--primary-color);
}

.code-input-wrapper input {
    flex: 1;
    padding: 14px 16px;
    border: none;
    outline: none;
    font-size: 16px;
    color: var(--text-color);
}

.code-input-wrapper input::placeholder {
    color: var(--text-muted);
}

.send-code-btn {
    padding: 14px 20px;
    background: transparent;
    border: none;
    color: var(--primary-color);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.send-code-btn:hover:not(:disabled) {
    background: rgba(79, 70, 229, 0.08);
}

.send-code-btn:disabled {
    color: var(--text-muted);
    cursor: not-allowed;
}

/* 登录按钮 */
.login-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: var(--radius);
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 8px;
}

.login-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.login-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* 微信登录 */
.wechat-qrcode-container {
    text-align: center;
    padding: 20px 0;
}

.qrcode-placeholder {
    width: 200px;
    height: 200px;
    margin: 0 auto 16px;
    background: #f8fafc;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed var(--border-color);
}

.qrcode-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-muted);
    font-size: 14px;
}

.qrcode-loading span {
    margin: 4px 0;
}

.qrcode-tip {
    color: var(--text-muted);
    font-size: 14px;
}

/* 协议 */
.agreement {
    margin-top: 20px;
    text-align: center;
}

.checkbox-wrapper {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    font-size: 13px;
}

.checkbox-wrapper input {
    display: none;
}

.checkmark {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    margin-right: 8px;
    position: relative;
    transition: all 0.3s ease;
}

.checkbox-wrapper input:checked + .checkmark {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.checkbox-wrapper input:checked + .checkmark::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.agreement-text {
    color: var(--text-muted);
}

.agreement-text a {
    color: var(--primary-color);
    text-decoration: none;
}

.agreement-text a:hover {
    text-decoration: underline;
}

/* 底部 */
.footer {
    margin-top: 24px;
    text-align: center;
}

.footer p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
}

/* Toast 提示 */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

.toast {
    background: white;
    padding: 14px 20px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    animation: toastIn 0.3s ease;
    max-width: 320px;
}

.toast.success {
    border-left: 4px solid var(--success-color);
}

.toast.error {
    border-left: 4px solid var(--error-color);
}

.toast.info {
    border-left: 4px solid var(--primary-color);
}

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

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* 响应式 */
@media (max-width: 480px) {
    .login-box {
        padding: 30px 24px;
        border-radius: 16px;
    }
    
    .logo-icon {
        width: 56px;
        height: 56px;
        font-size: 24px;
    }
    
    .logo-text {
        font-size: 20px;
    }
}
