/* ==================== 基础样式 ==================== */
* {
    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(to bottom, #FFC446 0%, #FFF8E2 50%, #ffffff 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0px 4.167vw;
    padding-top: 28.333vw;
    position: relative;
}

/* ==================== 移动端布局 ==================== */
.main-wrapper {
    width: 100%;
    display: block;
}

.marketing-section {
    display: none;
}

.form-wrapper {
    width: 100%;
}

.footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    text-align: center;
    padding: 20px;
    color: #999999;
    font-size: 2.593vw;
}

/* ==================== 容器样式 ==================== */
.container {
    background: white;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    padding: 0;
    max-width: 450px;
    width: 100%;
    height: 74.5vh;
    overflow: hidden;
    position: relative;
}

/* ==================== 头部样式 ==================== */
.header {
    background: transparent;
    padding: 0 0 20px 0;
    text-align: left;
    max-width: 450px;
    width: 100%;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-left {
    margin-left: 3.519vw;
}

.header-left h1 {
    color: #333;
    font-size: 7.963vw;
    margin-bottom: 5px;
    font-weight: bold;
}

.header-left p {
    color: #444;
    font-weight: bold;
    font-size: 5.185vw;
}

.logo {
    width: 50px;
    height: 50px;
    background: white;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-right: 7.5vw;
}

/* ==================== Tab 标签页 ==================== */
.tabs {
    display: flex;
    background: #EDEDED;
}

.tab {
    flex: 1;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    color: #666;
    font-weight: 500;
    font-size: 15px;
    transition: all 0.3s ease;
    position: relative;
}

.tab::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: #FDA825;
    border-radius: 5px;
    transition: width 0.3s ease;
}

.tab.active {
    color: #333333;
    font-weight: bold;
    background: #FFFFFF;
}

.tab.active::after {
    width: 20%;
}

.tab-content {
    display: none;
    padding: 30px 5.093vw;
}

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

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

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

.form-group:nth-child(3) {
    margin-bottom: 3.426vw;
}

.input-wrapper {
    position: relative;
}

/* 输入框左侧图标 */
.input-icon-left {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    pointer-events: none;
}

.icon-phone {
    width: 3.889vw;
    height: 4.444vw;
}

.icon-password {
    width: 4.074vw;
    height: 4.722vw;
}

.icon-code {
    width: 4.259vw;
    height: 4.907vw;
}

.icon-eye {
    width: 5.278vw;
    height: 3.611vw;
}

/* 密码右侧显示/隐藏图标 */
.input-icon-right {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.pass-input-wrapper input {
    padding-right: 9vw;
}

/* ==================== 输入框样式 ==================== */
input[type="tel"],
input[type="text"],
input[type="password"] {
    width: 100%;
    padding: 12px 15px;
    padding-left: 45px;
    background: #F6F6F6;
    border: none;
    border-radius: 1.852vw;
    font-size: 3.889vw;
    transition: all 0.3s ease;
    outline: none;
}

input[type="tel"]:focus,
input[type="text"]:focus,
input[type="password"]:focus {
    border-color: #ff6101;
    box-shadow: 0 0 0 3px rgba(255, 97, 1, 0.1);
}

input::-webkit-input-placeholder {
    color: #C7C7C7;
}

input::-moz-placeholder {
    color: #C7C7C7;
}

input:-ms-input-placeholder {
    color: #C7C7C7;
}

input::placeholder {
    color: #C7C7C7;
}

/* ==================== 验证码输入框 ==================== */
.code-input-wrapper {
    position: relative;
}

.code-input-wrapper input {
    padding-right: 110px;
}

.get-code-btn {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    padding: 8px 16px;
    background: transparent;
    color: #268CFF;
    border: none;
    border-radius: 4px;
    font-size: 3.889vw;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.get-code-btn:hover:not(:disabled) {
    background: transparent;
}

.get-code-btn:disabled {
    cursor: not-allowed;
}

/* ==================== 按钮样式 ==================== */
.primary-btn {
    width: 100%;
    padding: 14px;
    background: #FF9E05;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 6.667vw;
}

.primary-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 97, 1, 0.3);
}

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

/* ==================== 提示文本 ==================== */
.hint-text {
    text-align: center;
    color: #687283;
    font-size: 3.519vw;
}

/* ==================== 错误消息 ==================== */
.error-message {
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    right: 0;
    color: #ef4444;
    font-size: 12px;
    line-height: 12px;
    display: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

/* ==================== 弹窗样式 ==================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.show {
    display: flex;
    animation: modalFadeIn 0.3s ease;
}

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

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 40px 30px;
    max-width: 350px;
    width: 90%;
    text-align: center;
    animation: modalSlideIn 0.3s ease;
}

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

.modal-icon {
    font-size: 50px;
    margin-bottom: 20px;
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.modal-message {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 20px;
}

/* ==================== 加载动画 ==================== */
.spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading .spinner {
    display: inline-block;
    margin-right: 8px;
}

/* ==================== 通用提示弹窗 ==================== */
.alert-modal-content {
    max-width: 320px;
}

.alert-icon {
    font-size: 60px;
}

.alert-btn {
    margin-top: 10px;
    padding: 12px 40px;
    width: 200px;
    display: inline-block;
}

.alert-btn:hover {
    transform: translateY(-1px);
}

/* ==================== 桌面端响应式样式 ==================== */
@media (min-width: 1024px) {
    body {
        background: #f5f5f5;
        padding: 0;
        min-height: 100vh;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* 隐藏移动端头部 */
    .header {
        display: none;
    }

    /* 主容器改为左右分栏 */
    .main-wrapper {
        display: grid;
        grid-template-columns: 460px 460px;
        width: 920px;
        height: 100%;
        background: white;
        border-radius: 0;
        overflow: hidden;
        padding: 0px;
    }

    /* 左侧营销图片区域 */
    .marketing-section {
        display: block !important;
        content: "";
        width: 460px;
        height: 100%;
        background: url('img/banner.webp') no-repeat 50%;
        background-size: cover;
        flex-shrink: 0;
    }

    /* 右侧表单区域 */
    .form-wrapper {
        display: flex;
        flex-direction: column;
    }

    .container {
        max-width: 460px;
        width: 100%;
        border-radius: 0;
        padding: 55px 0 47px;
        background: white;
        height: 100%;
    }

    /* Tab 样式 */
    .tabs {
        border-bottom: none;
        background: white;
        margin-top: 0;
        justify-content: center;
    }

    .tab {
        font-size: 20px;
        padding: 0;
        color: #333;
        flex: unset;
    }

    .tab.active {
        color: #333333;
        font-weight: bold;
    }

    .tab.active::after {
        width: 50px;
        height: 6px;
        border-radius: 3px;
        background: #044FF6;
        bottom: 0px;
    }

    .tab-content {
        padding: 35px 50px 0px 50px;
    }

    /* 输入框样式 */
    input[type="tel"],
    input[type="text"],
    input[type="password"] {
        font-size: 14px;
        padding: 14px 15px;
        padding-left: 45px;
        border-radius: 27px;
        border: none;
    }

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

    .form-group:nth-child(3) {
        margin-bottom: 16px;
    }

    .pass-input-wrapper input {
        padding-right: 50px;
    }

    /* 图标尺寸 */
    .icon-phone,
    .icon-password,
    .icon-code {
        width: 18px;
        height: 20px;
    }

    .icon-eye {
        width: 24px;
        height: 16px;
    }

    .get-code-btn {
        font-size: 14px;
        padding: 10px 18px;
    }

    .primary-btn {
        font-size: 18px;
        padding: 16px;
        border-radius: 27px;
        margin-top: 30px;
    }

    .hint-text {
        font-size: 14px;
        font-weight: 500;
    }

    /* 桌面端页脚 */
    .footer {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        text-align: center;
        padding: 20px;
        font-size: 12px;
        color: #999;
        background: transparent;
    }

    .modal-content {
        max-width: 450px;
    }
}

/* ==================== 平板适配 ==================== */
@media (min-width: 768px) and (max-width: 1023px) {
    .container {
        max-width: 600px;
    }

    .header-left h1 {
        font-size: 36px;
    }

    .header-left p {
        font-size: 18px;
    }
}
