/* 注册页面样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 20px;
    overflow-x: hidden;
    overflow-y: auto;
}

.register-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 450px;
    padding: 40px;
    animation: slideUp 0.5s ease-out;
}

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

.register-header {
    text-align: center;
    margin-bottom: 30px;
}

.register-header h1 {
    color: #1a1f36;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.register-header p {
    color: #6b7280;
    font-size: 14px;
}

.register-form {
    space-y: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: #374151;
    font-weight: 500;
    margin-bottom: 8px;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #f9fafb;
}

.form-group input:focus {
    outline: none;
    border-color: #6366f1;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group input.error {
    border-color: #ef4444;
    background: #fef2f2;
}

.form-group input.success {
    border-color: #10b981;
    background: #f0fdf4;
}

.error-message {
    color: #ef4444;
    font-size: 12px;
    margin-top: 5px;
    display: none;
}

.error-message.show {
    display: block;
}

.success-message {
    color: #10b981;
    font-size: 12px;
    margin-top: 5px;
    display: none;
}

.success-message.show {
    display: block;
}

.password-strength {
    margin-top: 8px;
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
}

.password-strength-bar {
    height: 100%;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.password-strength-bar.weak {
    background: #ef4444;
    width: 33%;
}

.password-strength-bar.medium {
    background: #f59e0b;
    width: 66%;
}

.password-strength-bar.strong {
    background: #10b981;
    width: 100%;
}

.password-strength-text {
    font-size: 12px;
    margin-top: 4px;
}

.password-strength-text.weak {
    color: #ef4444;
}

.password-strength-text.medium {
    color: #f59e0b;
}

.password-strength-text.strong {
    color: #10b981;
}

.register-button {
    width: 100%;
    padding: 14px 24px;
    background: #6366f1;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.register-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.3);
    background: #4f46e5;
}

.register-button:active {
    transform: translateY(0);
}

.register-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.register-button .spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

.register-button.loading .spinner {
    display: inline-block;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.register-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #e5e7eb;
}

.register-footer p {
    color: #6b7280;
    font-size: 14px;
}

.register-footer a {
    color: #6366f1;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.register-footer a:hover {
    color: #4f46e5;
    text-decoration: underline;
}

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    display: none;
}

.alert.show {
    display: block;
}

.alert-error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.alert-success {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

/* 响应式设计 */
@media (max-width: 480px) {
    .register-container {
        padding: 30px 20px;
        margin: 20px;
    }
    
    .register-header h1 {
        font-size: 24px;
    }
    
    .form-group input {
        padding: 12px 14px;
    }
    
    .register-button {
        padding: 12px 20px;
    }
}

/* Logo样式 */
.logo {
    width: 60px;
    height: 60px;
    margin: 0 auto 16px;
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    font-weight: bold;
}

/* 装饰性元素 */
.decoration {
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: rgba(240, 147, 251, 0.1);
    z-index: -1;
}

.decoration-1 {
    top: -100px;
    left: -100px;
}

.decoration-2 {
    bottom: -100px;
    right: -100px;
}

/* 条款复选框 */
.terms-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 20px;
}

.terms-checkbox input[type="checkbox"] {
    width: auto;
    margin-top: 2px;
}

.terms-checkbox label {
    font-size: 13px;
    color: #6b7280;
    cursor: pointer;
}

.terms-checkbox label a {
    color: #6366f1;
    text-decoration: none;
}

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

/* 密码要求提示样式 */
.password-requirements {
    margin-top: 8px;
    padding: 10px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.requirement-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 4px;
    transition: all 0.3s ease;
}

.requirement-item:last-child {
    margin-bottom: 0;
}

.requirement-item i {
    font-size: 8px;
    transition: all 0.3s ease;
}

.requirement-item.met {
    color: #10b981;
}

.requirement-item.met i {
    color: #10b981;
    transform: scale(1.2);
}

.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 16px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 10000;
    transition: transform 0.3s ease;
    max-width: 80%;
    text-align: center;
}

.toast.show {
    transform: translate(-50%, -50%) scale(1);
}

.toast.error {
    background: rgba(220, 38, 38, 0.9);
}

.toast.success {
    background: rgba(16, 185, 129, 0.9);
}

/* 双选项卡样式 - 注册页使用粉色主题 */
.auth-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 2px;
}

.tab-btn {
    flex: 1;
    padding: 12px 20px;
    background: transparent;
    border: none;
    color: #6b7280;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    border-radius: 8px 8px 0 0;
}

.tab-btn:hover {
    color: #f97316;
    background: rgba(240, 147, 251, 0.05);
}

.tab-btn.active {
    color: #ea580c;
    font-weight: 600;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    border-radius: 2px;
}

.tab-btn i {
    margin-right: 6px;
}

/* 选项卡内容 */
.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

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

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

.wechat-qr-box {
    width: 300px;              /* 改为固定宽度，避免 fit-content 失效 */
    height: 400px;             /* 明确高度，确保容纳二维码+顶部标题 */
    max-width: 100%;
    margin: 0 auto 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow: visible;         /* 关键：防止二维码被截断 */
    box-sizing: border-box;
    position: relative;        /* 为内部iframe提供定位上下文 */
}

.wechat-qr-box iframe {
    width: 100% !important;    /* 填充容器 */
    height: 100% !important;   /* 填充容器 */
    min-width: 280px;          /* 微信登录最小宽度要求 */
    min-height: 380px;         /* 微信登录最小高度要求（含标题栏） */
    border: none !important;
    display: block !important;
}

/* 响应式调整 */
@media (max-width: 480px) {
    .wechat-qr-box {
        width: 90vw;
        max-width: 320px;        /* 限制最大宽度 */
        height: 380px;           /* 保持足够高度，不能 auto */
        padding: 15px;
        /* 如果屏幕太小，整体缩放 */
        transform: scale(0.85);
        transform-origin: center top;
        margin: 0 auto 10px;
    }

    .wechat-qr-box iframe {
        width: 100% !important;
        height: 100% !important; /* 恢复固定高度 */
        min-width: 280px;        /* 恢复最小宽度 */
        min-height: 340px;       /* 恢复最小高度 */
        aspect-ratio: auto;      /* 取消 1:1 限制 */
    }
}

.wechat-tips {
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 12px;
}

.wechat-status {
    margin-top: 16px;
    font-size: 14px;
    min-height: 20px;
}

.wechat-status.success {
    color: #10b981;
}

.wechat-status.error {
    color: #ef4444;
}

.wechat-notice {
    margin-top: 20px;
    padding: 12px;
    background: #fdf2f8;
    border: 1px solid #fbcfe8;
    border-radius: 8px;
    color: #be185d;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.wechat-notice i {
    font-size: 16px;
}

.contact-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    transition: all 0.3s ease;
}

.contact-type-hint {
    font-size: 12px;
    margin-top: 6px;
    height: 20px;
    transition: all 0.3s ease;
}

.hint-phone {
    color: #10b981;
    display: flex;
    align-items: center;
    gap: 4px;
}

.hint-email {
    color: #6366f1;
    display: flex;
    align-items: center;
    gap: 4px;
}

.hint-unknown {
    color: #f59e0b;
    display: flex;
    align-items: center;
    gap: 4px;
}

.send-code-btn {
    width: auto !important;      /* 关键：覆盖 register-button 的 width: 100% */
    flex: 0 0 auto !important;   /* 关键：不增长，不收缩，按自身宽度 */
    min-width: 140px;            /* 最小宽度 */
    white-space: nowrap;
    padding: 14px 20px;
    font-size: 14px;
}

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

/* ============================================
   验证码区域 Flex 布局修复
   ============================================ */

/* 父容器确保是 Flex */
.form-group > div:has(#verify_code) {
    display: flex;
    gap: 10px;
    width: 100%;
    align-items: center;
}

/* 验证码输入框 - 关键：允许被压缩 */
.form-group input#verify_code {
    flex: 1 1 auto !important;  /* 占据剩余空间 */
    min-width: 0 !important;     /* 关键：允许压缩到0 */
    width: 100% !important;
    box-sizing: border-box;
}

/* 发送验证码按钮 - 关键：固定宽度不伸缩 */
.form-group button#sendCodeBtn,
.form-group button.send-code-btn {
    width: auto !important;
    min-width: 140px !important;
    max-width: 140px !important;
    flex: 0 0 140px !important;  /* 不增长，不收缩，固定140px */
    white-space: nowrap;
    padding: 14px 20px !important;
    font-size: 14px !important;
    box-sizing: border-box;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* 深色模式 */
body.dark-mode {
    background: linear-gradient(180deg, #1a1f36 0%, #0f1219 100%);
}

body.dark-mode .register-container {
    background: rgba(30, 35, 50, 0.95);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

body.dark-mode .register-header h1 {
    color: #f1f5f9;
}

body.dark-mode .register-header p {
    color: #94a3b8;
}

body.dark-mode .form-group label {
    color: #e2e8f0;
}

body.dark-mode .form-group input {
    background: #1e293b;
    border-color: #334155;
    color: #f1f5f9;
}

body.dark-mode .form-group input::placeholder {
    color: #64748b;
}

body.dark-mode .form-group input:focus {
    border-color: #6366f1;
    background: #1e293b;
}

body.dark-mode .register-footer {
    border-top-color: #334155;
}

body.dark-mode .register-footer p {
    color: #94a3b8;
}

body.dark-mode .tab-btn {
    color: #94a3b8;
}

body.dark-mode .tab-btn:hover {
    color: #f97316;
    background: rgba(249, 115, 22, 0.1);
}

body.dark-mode .tab-btn.active {
    color: #f97316;
}

body.dark-mode .tab-btn.active::after {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
}

body.dark-mode .auth-tabs {
    border-bottom-color: #334155;
}

body.dark-mode .wechat-qr-box {
    background: #1e293b;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

body.dark-mode .wechat-tips {
    color: #94a3b8;
}

body.dark-mode .wechat-notice {
    background: rgba(190, 24, 93, 0.1);
    border-color: rgba(190, 24, 93, 0.3);
    color: #ec4899;
}

body.dark-mode .terms-checkbox label {
    color: #94a3b8;
}

body.dark-mode .password-requirements {
    background: #1e293b;
    border-color: #334155;
}

body.dark-mode .requirement-item {
    color: #94a3b8;
}

body.dark-mode .toast {
    background: rgba(0, 0, 0, 0.9);
}

body.dark-mode .decoration {
    background: rgba(249, 115, 22, 0.05);
}

body.dark-mode .contact-icon {
    color: #64748b;
}