:root {
    --primary-color: #0F172A;
    --accent-color: #F97316;
    --text-main: #1E293B;
    --text-light: #64748B;
    --bg-color: #F8FAFC;
    --white: #FFFFFF;
    --wechat-green: #07C160;
    --border-color: #E2E8F0;
    --error-red: #EF4444;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif; }

body {
    background-color: var(--bg-color);
    background-image: radial-gradient(circle at 10% 20%, rgba(15, 23, 42, 0.04) 0%, transparent 25%),
    radial-gradient(circle at 90% 80%, rgba(249, 115, 22, 0.04) 0%, transparent 25%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { text-decoration: none; color: inherit; transition: 0.3s; }

/* --- 极简顶部 --- */
header {
    width: 100%;
    padding: 20px 40px;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 10;
}

.logo {
    font-size: 24px;
    font-weight: 800;
    color: var(--primary-color);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}
.logo span { color: var(--accent-color); }

/* --- 主体内容 --- */
main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 20px 40px;
}

.auth-container {
    background: var(--white);
    width: 100%;
    max-width: 420px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(15, 23, 42, 0.08);
    overflow: hidden;
    animation: slideUp 0.5s ease-out;
    border: 1px solid rgba(255,255,255,0.5);
}

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

.auth-header {
    text-align: center;
    padding: 35px 30px 10px;
}

.auth-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 8px;
}

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

.auth-body {
    padding: 20px 30px 30px;
}

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

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 8px;
}

.input-wrapper { position: relative; display: flex; align-items: center; }

.input-icon {
    position: absolute;
    left: 14px;
    color: #94A3B8;
    font-size: 16px;
    z-index: 2;
}

.form-input {
    width: 100%;
    padding: 12px 15px 12px 42px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 15px;
    color: var(--text-main);
    transition: all 0.2s;
    background: #F8FAFC;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-color);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

.form-input.error {
    border-color: var(--error-red);
    background: #FEF2F2;
}

/* --- 图形验证码区域 --- */
.captcha-group {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}

.captcha-input-wrapper {
    flex: 1;
    position: relative;
}

.captcha-img-box {
    width: 110px;
    height: 44px;
    background: #E2E8F0;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

.captcha-img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.captcha-refresh-btn {
    position: absolute;
    right: 5px;
    top: 5px;
    width: 30px;
    height: 30px;
    background: rgba(255,255,255,0.8);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
    cursor: pointer;
    transition: 0.2s;
    z-index: 5;
}
.captcha-refresh-btn:hover { background: var(--white); color: var(--accent-color); transform: rotate(90deg); }

.sms-code-btn {
    position: absolute;
    right: 6px;
    top: 6px;
    bottom: 6px;
    padding: 0 12px;
    border: none;
    background: #EFF6FF;
    color: #2563EB;
    font-size: 13px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.2s;
}
.sms-code-btn:hover { background: #DBEAFE; }
.sms-code-btn:disabled { background: #F1F5F9; color: #CBD5E1; cursor: not-allowed; }

.btn-submit {
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, var(--accent-color), #FB923C);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.25);
}
.btn-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(249, 115, 22, 0.35);
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 24px 0;
    color: #94A3B8;
    font-size: 13px;
}
.divider::before, .divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #E2E8F0;
}
.divider span { padding: 0 12px; }

.btn-wechat {
    width: 100%;
    padding: 12px;
    background: var(--wechat-green);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: 0.2s;
}
.btn-wechat:hover { background: #06AD56; }

.auth-footer-links {
    text-align: center;
    font-size: 14px;
    color: var(--text-light);
    margin-top: 24px;
}
.auth-footer-links a {
    color: var(--accent-color);
    font-weight: 600;
    margin: 0 4px;
}
.auth-footer-links a:hover { text-decoration: underline; }

.forgot-pwd-link {
    display: block;
    text-align: right;
    font-size: 13px;
    color: var(--text-light);
    margin-top: -10px;
    margin-bottom: 20px;
}
.forgot-pwd-link:hover { color: var(--accent-color); }

.error-msg {
    color: var(--error-red);
    font-size: 12px;
    margin-top: 6px;
    display: none;
    align-items: center;
    gap: 4px;
}

/* --- 底部 --- */
footer {
    width: 100%;
    padding: 20px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
    background: transparent;
}
.beian { margin-top: 6px; }
.beian a { color: #CBD5E1; text-decoration: none; }
.beian a:hover { color: var(--accent-color); }

.page-view { display: none; }
.page-view.active { display: block; }

/* --- 微信扫码弹窗 (新增) --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.wechat-modal {
    background: var(--white);
    width: 360px;
    border-radius: 16px;
    padding: 30px;
    text-align: center;
    position: relative;
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.active .wechat-modal {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #F1F5F9;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}
.modal-close:hover { background: #E2E8F0; color: var(--text-main); }

.qr-code-box {
    width: 180px;
    height: 180px;
    margin: 0 auto 20px;
    border: 1px solid #E2E8F0;
    padding: 10px;
    border-radius: 8px;
    background: #fff;
}

.qr-code-box img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 8px;
}

.modal-timer {
    font-size: 14px;
    color: var(--error-red);
    margin-bottom: 20px;
    font-weight: 500;
}

.modal-agreement {
    font-size: 12px;
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 25px;
    padding: 0 10px;
}
.modal-agreement a {
    color: #2563EB;
    text-decoration: none;
}
.modal-agreement a:hover { text-decoration: underline; }

.modal-tabs {
    display: flex;
    justify-content: center;
    gap: 20px;
    border-top: 1px solid #F1F5F9;
    padding-top: 20px;
}

.modal-tab-item {
    font-size: 14px;
    color: var(--text-light);
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 4px;
    transition: 0.2s;
}
.modal-tab-item:hover { color: var(--text-main); background: #F8FAFC; }
.modal-tab-item.active {
    color: var(--wechat-green);
    font-weight: 600;
    background: #ECFDF5;
}

.demo-switcher {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255,255,255,0.9);
    padding: 8px 16px;
    border-radius: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    z-index: 999;
    display: flex;
    gap: 8px;
    backdrop-filter: blur(5px);
    border: 1px solid #E2E8F0;
}
.demo-btn {
    padding: 6px 12px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 15px;
    font-size: 12px;
    color: var(--text-light);
    font-weight: 500;
}
.demo-btn.active { background: var(--primary-color); color: var(--white); }

@media (max-width: 480px) {
    header { padding: 15px 20px; }
    main { padding: 70px 15px 30px; }
    .demo-switcher { display: none; }
    .captcha-group { flex-direction: column; gap: 8px; }
    .captcha-img-box { width: 100%; height: 50px; }
    .wechat-modal { width: 90%; }
}

/* 行为验证样式 */
.behavior-verify-mask {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

.behavior-verify-mask.behavior-verify-show {
    display: flex;
}

.behavior-verify-box {
    background: var(--white);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    padding: 30px;
    min-width: 380px;
    max-width: 90%;
    animation: verifySlideDown 0.3s ease-out;
}

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

.verify-header {
    text-align: center;
    margin-bottom: 20px;
}

.verify-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 4px;
}

.verify-header p {
    font-size: 13px;
    color: var(--text-light);
}

.verify-target {
    text-align: center;
    margin-bottom: 16px;
    padding: 12px;
    background: #F8FAFC;
    border-radius: 8px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.verify-target-icon {
    font-size: 28px;
}

.verify-image {
    position: relative;
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    margin-bottom: 20px;
    overflow: hidden;
}

.verify-item {
    position: absolute;
    font-size: 20px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--white);
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.2s;
}

.verify-item:hover {
    transform: scale(1.1);
}

.verify-item.clicked {
    background: var(--accent-color);
    color: var(--white);
    opacity: 0.5;
    pointer-events: none;
}

.verify-footer {
    display: flex;
    gap: 12px;
}

.verify-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.verify-btn-primary {
    background: linear-gradient(135deg, var(--accent-color), #FB923C);
    color: var(--white);
}

.verify-btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
}

.verify-btn-primary:disabled {
    background: #E2E8F0;
    color: #94A3B8;
    cursor: not-allowed;
}

.verify-btn-secondary {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.verify-btn-secondary:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}
