/* ==================== 全局样式 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --bg-color: #f7fafc;
    --card-bg: #ffffff;
    --text-primary: #1a202c;
    --text-secondary: #4a5568;
    --border-color: #e2e8f0;
    --success-color: #48bb78;
    --warning-color: #ed8936;
    --error-color: #f56565;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-hover: 0 10px 25px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* ==================== 返回按钮 ==================== */
.back-button {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
    background: var(--card-bg);
    padding: 12px 24px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.back-button:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.back-button a {
    text-decoration: none;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 16px;
}

/* ==================== 主容器 ==================== */
.container {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    padding: 100px 20px 40px 20px;
    gap: 40px;
}

/* ==================== 左侧说明区 ==================== */
.info-panel {
    flex: 1;
    background: var(--card-bg);
    padding: 40px;
    border-radius: 16px;
    box-shadow: var(--shadow);
    height: fit-content;
}

.info-panel h1 {
    font-size: 36px;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
}

.subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.feature-list {
    margin-bottom: 40px;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
    padding: 20px;
    background: var(--bg-color);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.feature-item:hover {
    transform: translateX(8px);
    box-shadow: var(--shadow);
}

.feature-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.feature-content h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.feature-content p {
    font-size: 14px;
    color: var(--text-secondary);
}

.stats-panel {
    background: var(--bg-color);
    padding: 24px;
    border-radius: 12px;
}

.stats-panel h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 14px;
}

.stat-value {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-color);
}

/* ==================== 右侧登录区 ==================== */
.login-panel {
    flex: 1;
    position: relative;
}

.login-container {
    background: var(--card-bg);
    padding: 40px;
    border-radius: 16px;
    box-shadow: var(--shadow);
}

/* Tab切换 */
.login-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 32px;
    border-bottom: 2px solid var(--border-color);
}

.tab-button {
    flex: 1;
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: -2px;
}

.tab-button:hover {
    color: var(--primary-color);
}

.tab-button.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 表单样式 */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="tel"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 密码输入框 */
.password-input {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input input {
    flex: 1;
    padding-right: 48px;
}

.toggle-password {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    font-size: 20px;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.toggle-password:hover {
    opacity: 1;
}

/* 密码强度检测 */
.password-strength {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 4px;
}

.strength-bar {
    flex: 1;
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    overflow: hidden;
}

.strength-fill {
    height: 100%;
    width: 0%;
    background: var(--error-color);
    transition: all 0.3s ease;
}

.strength-text {
    font-size: 12px;
    color: var(--text-secondary);
}

/* 滑动验证码 */
.slider-captcha {
    position: relative;
    height: 48px;
    background: var(--bg-color);
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
}

.slider-captcha.verified {
    border-color: var(--success-color);
    background: rgba(72, 187, 120, 0.1);
}

.slider-track {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slider-text {
    color: var(--text-secondary);
    font-size: 14px;
    user-select: none;
}

.slider-button {
    position: absolute;
    left: 0;
    top: 0;
    width: 48px;
    height: 100%;
    background: var(--primary-gradient);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.slider-button:hover {
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.slider-captcha.verified .slider-button {
    background: var(--success-color);
    cursor: default;
}

.slider-captcha.verified .slider-text {
    color: var(--success-color);
    font-weight: 600;
}

/* 图片验证码 */
.captcha-container {
    display: flex;
    gap: 12px;
    align-items: center;
}

.captcha-container input {
    flex: 1;
}

.captcha-image {
    width: 120px;
    height: 48px;
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
}

.captcha-image:hover {
    border-color: var(--primary-color);
}

.captcha-image canvas {
    width: 100%;
    height: 100%;
}

/* 表单选项 */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.forgot-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 14px;
    transition: opacity 0.3s ease;
}

.forgot-link:hover {
    opacity: 0.8;
}

/* 登录按钮 */
.login-button {
    width: 100%;
    padding: 14px;
    background: var(--primary-gradient);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.login-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.login-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.button-loader {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 8px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.login-button.loading .button-loader {
    display: inline-block;
}

.login-button.loading .button-text {
    opacity: 0.8;
}

/* 短信验证码 */
.sms-container {
    display: flex;
    gap: 12px;
}

.sms-container input {
    flex: 1;
}

.send-code-button {
    padding: 12px 20px;
    background: var(--primary-gradient);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.send-code-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.send-code-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 二维码登录 */
.qrcode-container {
    text-align: center;
    padding: 20px;
}

.qrcode-wrapper {
    display: inline-block;
    margin-bottom: 20px;
}

.qrcode-placeholder {
    position: relative;
    width: 200px;
    height: 200px;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}

.qrcode-placeholder canvas {
    width: 100%;
    height: 100%;
}

.qrcode-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
}

.scan-status {
    text-align: center;
}

.scan-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.qrcode-tips p {
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 14px;
}

.status-text {
    font-weight: 600;
    color: var(--primary-color);
}

.simulate-scan-button {
    width: 100%;
    margin-top: 16px;
    padding: 12px;
    background: var(--primary-gradient);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.simulate-scan-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.simulate-scan-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* 双因素认证弹窗 */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: var(--shadow-hover);
    max-width: 400px;
    width: 90%;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 24px 0 24px;
    margin-bottom: 20px;
}

.modal-header h2 {
    font-size: 24px;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal-close {
    background: none;
    border: none;
    font-size: 32px;
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
}

.modal-body {
    padding: 0 24px 24px 24px;
}

.modal-desc {
    color: var(--text-secondary);
    margin-bottom: 24px;
    text-align: center;
}

.totp-input {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 16px;
}

.totp-digit {
    width: 48px;
    height: 56px;
    text-align: center;
    font-size: 24px;
    font-weight: 600;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-color);
    transition: all 0.3s ease;
}

.totp-digit:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.totp-tips {
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
}

.modal-footer {
    display: flex;
    gap: 12px;
    padding: 0 24px 24px 24px;
}

.modal-button {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-button.secondary {
    background: var(--bg-color);
    color: var(--text-secondary);
}

.modal-button.secondary:hover {
    background: var(--border-color);
}

.modal-button.primary {
    background: var(--primary-gradient);
    color: white;
}

.modal-button.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* 登录成功弹窗 */
.success-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.success-modal.active {
    display: flex;
}

.success-content {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 48px;
    text-align: center;
    box-shadow: var(--shadow-hover);
    max-width: 400px;
    width: 90%;
    animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.success-icon {
    width: 80px;
    height: 80px;
    background: var(--success-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    margin: 0 auto 24px auto;
    font-weight: bold;
}

.success-content h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--success-color);
    margin-bottom: 12px;
}

.success-content p {
    color: var(--text-secondary);
    margin-bottom: 24px;
    font-size: 16px;
}

.success-button {
    padding: 14px 32px;
    background: var(--primary-gradient);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.success-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Toast消息提示 */
.toast-container {
    position: fixed;
    top: 100px;
    right: 20px;
    z-index: 3000;
}

.toast {
    background: var(--card-bg);
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: var(--shadow-hover);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideInRight 0.3s ease;
    max-width: 300px;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.success {
    border-left: 4px solid var(--success-color);
}

.toast.error {
    border-left: 4px solid var(--error-color);
}

.toast.warning {
    border-left: 4px solid var(--warning-color);
}

.toast-icon {
    font-size: 20px;
}

.toast-message {
    flex: 1;
    font-size: 14px;
    color: var(--text-primary);
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 1024px) {
    .container {
        flex-direction: column;
    }

    .info-panel,
    .login-container {
        padding: 32px;
    }
}

@media (max-width: 768px) {
    .back-button {
        top: 10px;
        left: 10px;
        padding: 10px 16px;
    }

    .back-button a {
        font-size: 14px;
    }

    .container {
        padding: 80px 16px 20px 16px;
        gap: 20px;
    }

    .info-panel,
    .login-container {
        padding: 24px;
    }

    .info-panel h1 {
        font-size: 28px;
    }

    .totp-digit {
        width: 40px;
        height: 48px;
        font-size: 20px;
    }

    .modal-content {
        max-width: 90%;
    }

    .qrcode-placeholder {
        width: 180px;
        height: 180px;
    }
}
