/* ==================== 登录页面专用CSS - 完整版 ==================== */

/* 基础重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
}

body {
    min-height: 100vh;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

/* ==================== 登录页面样式 ==================== */
#login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: url('../images/backgroud.jpg') center center / cover no-repeat;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
}

#login-page.hidden {
    display: none;
}

/* 注册模态框遮罩 */
.register-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

/* 注册模态框 */
.register-modal {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

/* 注册模态框头部 */
.register-modal-header {
    padding: 30px 30px 20px 30px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.register-modal-header h2 {
    font-size: 24px;
    color: #333;
    margin: 0;
}

.close-modal {
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
}

.close-modal:hover {
    background: #f5f5f5;
    color: #333;
}

/* 注册模态框内容 */
.register-modal-body {
    padding: 30px;
}

/* 注册选项卡样式 */
.register-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

.register-tab {
    flex: 1;
    padding: 12px;
    border: 2px solid #eee;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    color: #666;
    transition: all 0.3s;
    text-align: center;
}

.register-tab:hover {
    border-color: #667eea;
    color: #667eea;
}

.register-tab.active {
    border-color: #667eea;
    background: #667eea;
    color: white;
}

/* 注册表单样式 */
.register-form {
    display: none;
}

.register-form.active {
    display: block;
}

/* ==================== 表单组样式 ==================== */
/* 通用表单组 */
.form-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group:last-of-type {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.form-group input,
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="tel"],
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    color: #1f2937;
    background: #fff;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group input:hover,
.form-group select:hover {
    border-color: #d1d5db;
}

/* 注册表单中的特殊样式 */
.register-form .form-group {
    margin-bottom: 20px;
}

.register-form .form-group:last-of-type {
    margin-bottom: 0;
}

.register-form .form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.register-form .form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    color: #1f2937;
    background: #fff;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.register-form .form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.register-form .form-group input:hover {
    border-color: #d1d5db;
}

/* ==================== 登录容器 ==================== */
.login-container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
    width: 90%;
    max-width: 900px;
    display: flex;
}

.login-left {
    flex: 1;
    padding: 60px 50px;
    background: linear-gradient(135deg, #4A90E2 0%, #2563EB 100%);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-logo {
    margin-bottom: 20px;
    text-align: center;
}

.login-logo .logo-image {
    width: 120px;
    height: auto;
    max-width: 100%;
    filter: brightness(1.1) drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15));
}

.login-left h1 {
    font-size: 32px;
    margin-bottom: 20px;
}

.login-left p {
    font-size: 16px;
    opacity: 0.9;
    line-height: 1.8;
}

.login-features {
    margin-top: 40px;
}

.feature-item {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.feature-item .icon {
    font-size: 24px;
    margin-right: 12px;
}

.login-right {
    flex: 1;
    padding: 60px 50px;
}

.login-right h2 {
    font-size: 28px;
    margin-bottom: 10px;
    color: #1f2937;
}

.login-right p {
    color: #6b7280;
    margin-bottom: 40px;
}

.login-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid #e5e7eb;
}

.login-tab {
    padding: 12px 24px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    position: relative;
    transition: color 0.3s;
}

.login-tab.active {
    color: #667eea;
}

.login-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: #667eea;
}

.login-form {
    display: none;
}

.login-form.active {
    display: block;
}

.form-row {
    display: flex;
    gap: 10px;
}

.form-row .form-group {
    flex: 1;
}

.get-code-btn {
    padding: 12px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
}

.get-code-btn:disabled {
    background: #6b7280;
    cursor: not-allowed;
}

.login-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.forgot-password {
    color: #667eea;
    text-decoration: none;
    font-size: 14px;
}

.forgot-password:hover {
    text-decoration: underline;
}

.btn-login {
    width: 100%;
    padding: 14px 24px !important;
    font-size: 16px;
    font-weight: 600;
    display: block !important;
    text-align: center !important;
    line-height: 1.5;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* 注册表单中的按钮使用渐变背景 */
.register-form .btn-login {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    margin-top: 24px;
}

.register-form .btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    filter: brightness(0.95);
}

.register-form .btn-login:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.register-form .btn-login:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    filter: none;
}

/* 登录表单中的按钮 */
.login-form .btn-login {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.login-form .btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    filter: brightness(0.95);
}

.login-form .btn-login:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

/* 主题跟随按钮样式 */
.btn-theme-follow {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    transition: all 0.3s ease !important;
}

.btn-theme-follow:hover:not(:disabled) {
    transform: translateY(-2px);
    filter: brightness(0.95);
}

.btn-theme-follow:active:not(:disabled) {
    transform: translateY(0);
}

.btn-theme-follow:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
    transform: none !important;
    filter: none !important;
}

/* 确保按钮内的所有内容都居中 */
.btn-login * {
    vertical-align: middle;
}

.divider {
    text-align: center;
    margin: 30px 0;
    color: #6b7280;
    position: relative;
}

.divider::before,
.divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 45%;
    height: 1px;
    background: #e5e7eb;
}

.divider::before {
    left: 0;
}

.divider::after {
    right: 0;
}

.wechat-login-btn {
    width: 100%;
    padding: 14px;
    background: #07C160;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: opacity 0.3s;
}

.wechat-login-btn:hover {
    opacity: 0.8;
}

.register-link {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: #6b7280;
}

.register-link a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.register-link a:hover {
    text-decoration: underline;
}

/* ==================== 成功弹窗样式 ==================== */
.success-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000000 !important;
    opacity: 1;
    backdrop-filter: blur(4px);
    margin: 0;
    padding: 0;
    overflow: auto;
    box-sizing: border-box;
}

.success-modal-overlay.show {
    opacity: 1;
}

.success-modal-dialog {
    position: relative;
    background: white;
    border-radius: 16px;
    padding: 40px 32px;
    min-width: 500px;
    max-width: 700px;
    width: auto;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: translateY(0) scale(1);
    text-align: center;
    margin: auto;
    flex-shrink: 0;
    align-self: center;
    justify-self: center;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.success-modal-overlay.show .success-modal-dialog {
    transform: translateY(0) scale(1);
}

.success-modal-icon {
    font-size: 64px;
    margin-bottom: 20px;
    line-height: 1;
    flex-shrink: 0;
}

.success-modal-message {
    font-size: 18px;
    font-weight: 500;
    color: #1f2937;
    margin-bottom: 32px;
    line-height: 1.6;
    max-height: calc(80vh - 280px);
    overflow-y: auto;
    word-wrap: break-word;
    word-break: break-word;
    flex: 1 1 auto;
    min-height: 0;
}

.success-modal-buttons {
    display: flex;
    justify-content: center;
    flex-shrink: 0;
    margin-top: auto;
}

.success-modal-ok {
    padding: 12px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    min-width: 120px;
}

.success-modal-ok:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    opacity: 0.9;
}

.success-modal-ok:active {
    transform: translateY(0);
}

/* 确认对话框按钮 */
.confirm-modal-ok,
.confirm-modal-cancel {
    padding: 12px 32px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 140px;
}

.confirm-modal-ok {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    margin-left: 10px;
    min-width: 160px;
}

.confirm-modal-ok:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.confirm-modal-cancel {
    background: #f3f4f6;
    color: #6b7280;
}

.confirm-modal-cancel:hover {
    background: #e5e7eb;
    color: #374151;
}

/* ==================== 登录进度条样式 ==================== */
/* 登录进度条容器 */
.login-progress-container {
    margin-top: 16px;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: opacity 0.3s ease, max-height 0.3s ease;
}

.login-progress-container.active {
    opacity: 1;
    max-height: 100px;
}

/* 进度条背景 */
.login-progress-bar {
    width: 100%;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

/* 进度条填充 */
.login-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 3px;
    transition: width 0.5s ease;
    width: 0%;
    position: relative;
    overflow: hidden;
}

/* 进度条光晕动画 */
.login-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255,255,255,0.4) 50%,
        transparent 100%);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* 进度文字 */
.login-progress-text {
    margin-top: 8px;
    font-size: 13px;
    color: #6b7280;
    text-align: center;
    min-height: 18px;
}

/* ==================== 响应式设计 ==================== */

/* 平板横屏 (835px - 1024px) */
@media (min-width: 835px) and (max-width: 1024px) {
    .login-container {
        max-width: 85vw;
    }

    .login-left {
        padding: 50px 40px;
    }

    .login-left h1 {
        font-size: 28px;
    }

    .login-left p {
        font-size: 15px;
    }

    .login-right {
        padding: 50px 40px;
    }

    .login-right h2 {
        font-size: 24px;
    }

    /* 表单优化 */
    .form-group input,
    .form-group select {
        font-size: 15px;
        padding: 12px 14px;
    }

    /* 按钮优化 */
    .btn-login,
    .get-code-btn {
        min-height: 44px;
        font-size: 15px;
    }

    /* 注册模态框 */
    .register-modal {
        max-width: 85vw;
    }

    /* 成功弹窗 */
    .success-modal-dialog {
        min-width: 450px;
        max-width: 85vw;
    }
}

/* 平板竖屏 (768px - 834px) */
@media (min-width: 768px) and (max-width: 834px) and (orientation: portrait) {
    .login-container {
        flex-direction: column;
        max-width: 90vw;
    }

    .login-left {
        padding: 40px 32px;
    }

    .login-logo .logo-image {
        width: 110px;
    }

    .login-left h1 {
        font-size: 26px;
    }

    .login-left p {
        font-size: 14px;
    }

    .login-features {
        margin-top: 30px;
    }

    .feature-item {
        margin-bottom: 16px;
    }

    .login-right {
        padding: 40px 32px;
    }

    .login-right h2 {
        font-size: 22px;
    }

    /* 表单优化 */
    .form-group input,
    .form-group select {
        font-size: 16px; /* 防止iOS自动缩放 */
        min-height: 44px;
    }

    /* 按钮优化 */
    .btn-login,
    .wechat-login-btn {
        min-height: 48px;
        font-size: 16px;
    }

    .get-code-btn {
        min-height: 44px;
        padding: 12px 16px;
    }

    /* 标签优化 */
    .login-tab,
    .register-tab {
        min-height: 44px;
        padding: 12px 20px;
        font-size: 14px;
    }

    /* 注册模态框 */
    .register-modal {
        max-width: 90vw;
    }

    .register-modal-header {
        padding: 24px;
    }

    .register-modal-header h2 {
        font-size: 20px;
    }

    .register-modal-body {
        padding: 24px;
    }

    /* 成功弹窗 */
    .success-modal-dialog {
        min-width: 320px;
        max-width: 90vw;
        padding: 36px 28px;
    }

    .success-modal-icon {
        font-size: 56px;
    }

    .success-modal-message {
        font-size: 17px;
    }
}

/* 通用平板 (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
    /* 表单行优化 */
    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .form-row .form-group {
        margin-bottom: 20px;
    }

    /* 登录操作优化 */
    .login-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .remember-me {
        font-size: 14px;
    }

    .forgot-password {
        font-size: 14px;
    }

    /* 关闭按钮优化 */
    .close-modal {
        width: 36px;
        height: 36px;
        font-size: 24px;
    }

    /* 确认按钮优化 */
    .confirm-modal-ok,
    .confirm-modal-cancel,
    .success-modal-ok {
        min-height: 44px;
        padding: 12px 28px;
    }
}

/* 平板触摸优化 */
@media (min-width: 768px) and (max-width: 1024px) and (hover: none) and (pointer: coarse) {
    /* 所有可点击元素 */
    .btn-login,
    .wechat-login-btn,
    .get-code-btn,
    .login-tab,
    .register-tab {
        min-height: 48px;
    }

    /* 输入框 */
    .form-group input,
    .form-group select {
        min-height: 48px;
        font-size: 16px;
    }

    /* 复选框 */
    .remember-me input[type="checkbox"] {
        width: 20px;
        height: 20px;
    }

    /* 关闭按钮 */
    .close-modal {
        width: 40px;
        height: 40px;
    }

    /* 确认按钮 */
    .confirm-modal-ok,
    .confirm-modal-cancel,
    .success-modal-ok {
        min-height: 48px;
        padding: 14px 32px;
    }
}

/* 手机端 (小于 768px) */
@media (max-width: 767px) {
    .login-container {
        flex-direction: column;
        width: 95%;
        max-width: none;
    }

    .login-left {
        padding: 40px 30px;
    }

    .login-right {
        padding: 40px 30px;
    }

    .login-logo .logo-image {
        width: 100px;
    }

    .login-left h1 {
        font-size: 24px;
    }

    .login-left p {
        font-size: 14px;
    }

    .login-right h2 {
        font-size: 20px;
    }

    .success-modal-dialog {
        padding: 32px 24px;
        min-width: 280px;
        max-width: calc(100vw - 40px);
    }

    .success-modal-icon {
        font-size: 48px;
    }

    .success-modal-message {
        font-size: 16px;
    }

    .login-progress-text {
        font-size: 12px;
    }

    .register-modal {
        width: 95%;
        max-width: none;
    }

    .register-modal-header {
        padding: 24px 20px 16px;
    }

    .register-modal-body {
        padding: 24px 20px;
    }

    .form-row {
        flex-direction: column;
    }
}
