/* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* HTML和Body基础样式 */
html {
    height: 100%;
    height: -webkit-fill-available; /* iOS Safari兼容 */
}

body {
    height: 100%;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, Segoe UI, Arial, Roboto, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft Yahei', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
    overflow-x: hidden;
    background-color: #f7f8fa; /* 备用背景色 */
}

/* 背景图片全屏显示 - 使用伪元素确保最佳兼容性 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    background-image: url('img/bg-2.jpg');
    background-size: 100% 100%;
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: scroll; /* 移动端兼容性更好 */
    z-index: -1;
    -webkit-transform: translateZ(0); /* 硬件加速 */
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* 小屏幕手机优化 (320px-480px) */
@media screen and (max-width: 480px) {
    body::before {
        background-position: center top;
        min-height: calc(100vh + 100px); /* 额外高度确保完全覆盖 */
    }
}

/* iPhone SE (375x667) 专门优化 */
@media screen and (device-width: 375px) and (device-height: 667px) and (-webkit-device-pixel-ratio: 2) {
    html {
        height: -webkit-fill-available;
    }
    
    body {
        min-height: 100vh;
        min-height: -webkit-fill-available;
        position: relative;
    }
    
    body::before {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        min-height: calc(var(--vh, 1vh) * 100);
        min-height: calc(100vh + 120px); /* 增加额外高度确保顶部完全显示 */
        background-size: 100% 100%;
        background-position: center top; /* 改为顶部对齐，确保顶部内容可见 */
        background-repeat: no-repeat;
        background-attachment: scroll;
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
        -webkit-transform: translate3d(0, 0, 0);
        transform: translate3d(0, 0, 0);
    }
}

/* iPhone SE横屏模式特殊处理 */
@media screen and (device-width: 375px) and (device-height: 667px) and (orientation: landscape) {
    body::before {
        background-position: center center;
        background-size: 100% 100%;
        width: 100vw;
        height: 100vh;
        min-height: 100vh;
    }
}

/* iPhone XR (414x896) 专门优化 */
@media screen and (device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 2) {
    html {
        height: -webkit-fill-available;
    }
    
    body {
        min-height: 100vh;
        min-height: -webkit-fill-available;
    }
    
    body::before {
        position: absolute;
        min-height: calc(var(--vh, 1vh) * 100);
        background-size: 100% 100%;
        background-position: center center;
        -webkit-transform: translate3d(0, 0, 0);
        transform: translate3d(0, 0, 0);
    }
}

/* iPhone 12/13/14 (390x844) 专门优化 */
@media screen and (device-width: 390px) and (device-height: 844px) and (-webkit-device-pixel-ratio: 3) {
    html {
        height: -webkit-fill-available;
    }
    
    body {
        min-height: 100vh;
        min-height: -webkit-fill-available;
    }
    
    body::before {
        position: absolute;
        min-height: calc(var(--vh, 1vh) * 100);
        background-size: 100% 100%;
        background-position: center center;
    }
}

/* iPhone 12/13/14 Pro Max (428x926) 专门优化 */
@media screen and (device-width: 428px) and (device-height: 926px) and (-webkit-device-pixel-ratio: 3) {
    html {
        height: -webkit-fill-available;
    }
    
    body {
        min-height: 100vh;
        min-height: -webkit-fill-available;
    }
    
    body::before {
        position: absolute;
        min-height: calc(var(--vh, 1vh) * 100);
        background-size: 100% 100%; /* 改为拉伸模式，避免裁剪 */
        background-position: center center;
    }
}

/* 超大屏幕手机优化 (>428px宽度) */
@media screen and (min-width: 429px) and (max-width: 768px) {
    body::before {
        background-size: 100% 100%; /* 改为拉伸模式，避免裁剪 */
        background-position: center center;
    }
}

/* 新增：iPhone 15 Pro Max 及更大屏幕优化 */
@media screen and (min-width: 430px) and (max-height: 932px) {
    body::before {
        background-size: 100% 100%; /* 拉伸背景图片以完全填充屏幕 */
        background-position: center center;
        width: 100vw;
        height: 100vh;
        min-height: 100vh;
        min-height: -webkit-fill-available;
    }
}

/* 新增：超大屏幕手机通用优化 (宽度>430px) */
@media screen and (min-width: 431px) and (max-width: 768px) {
    body::before {
        background-size: 100% 100%; /* 拉伸背景图片以完全填充屏幕 */
        background-position: center center;
        width: 100vw;
        height: 100vh;
        min-height: 100vh;
        min-height: -webkit-fill-available;
    }
}

/* 安卓手机通用优化 */
@media screen and (max-width: 768px) and (max-height: 1024px) {
    body::before {
        background-attachment: scroll;
        background-size: 100% 100%;
        background-position: center center;
    }
}

/* 横屏模式优化 */
@media screen and (orientation: landscape) and (max-height: 500px) {
    body::before {
        background-size: 100% 100%;
        background-position: center center;
        width: 100vw;
        height: 100vh;
        min-height: 100vh;
    }
}

/* 超大屏幕手机优化 (>428px宽度) */
@media screen and (min-width: 429px) and (max-width: 768px) {
    body::before {
        background-size: 100% 100%;
        background-position: center center;
    }
}

/* iOS Safari特殊处理 */
@supports (-webkit-touch-callout: none) {
    body::before {
        min-height: -webkit-fill-available;
        height: -webkit-fill-available;
    }
}

/* 确保内容层在背景之上 */
.container,
.main-content,
#app {
    position: relative;
    z-index: 1;
    background: transparent;
}

.home_btn {
    width: 200px;
    height: 50px;
}

.btn_row {
    text-align: center;
    margin-bottom: 25px;
}

.register_row {
    width: 100%;
}

.register_btn {
    background-color: #fff;
    width: 100%;
    margin-bottom: 25px;
    height: 36px;
    border: 1px solid #ccc;
    padding-left: 10px;
}