* {
    /* 移除全局width:100%，避免覆盖容器宽度 */
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* 新增：固定宽度容器（核心） */
.container {
    width: 92%;
    max-width: 450px;
    margin: 0 auto;
    position: relative;
    height: 100%;
    overflow: hidden;
}

html {
    height: 100%;
}

/* 和平精英军事背景 */
body {
    background: linear-gradient(135deg, #0D141E 0%, #172536 50%, #24344D 100%);
    background-blend-mode: overlay;
    height: 100%;
    min-height: 100dvh;
    color: #EAEAEA;
    position: relative;
    overflow: hidden;
    margin: 0;
}

/* H5 主容器：内容不足一屏时不出现整页滚动条 */
#page-login {
    width: 100%;
    max-width: 450px;
    min-height: 100dvh;
    margin: 0 auto;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(13, 20, 30, 0.65);
    z-index: -1;
}

/* 页面：高度随内容，不强行撑满视口（避免 min-height:100vh + margin 产生多余滚动） */
.page {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    box-sizing: border-box;
    margin-top: max(24px, env(safe-area-inset-top, 0px));
    padding: 0 22px calc(24px + env(safe-area-inset-bottom, 0px));
    animation: fadeIn 0.3s ease forwards;
}
.page.active {
    display: flex;
}
.page.center-page {
    min-height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    margin-top: 0;
    justify-content: center;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 行布局：极致紧凑 */
.row {
    display: flex;
    align-items: center;
    justify-content: flex-start;  /* 左对齐 */
    margin-bottom: 14px;
    font-size: 14px;
    color: #D0DCEB;
}
.row:last-child {
    margin-bottom: 0;
}
.row label {
    width: 75px;  /* 减小 label 宽度，让输入框更靠左 */
    font-size: 14px;
    color: #C0CFE2;
    font-weight: 500;
    flex-shrink: 0;  /* 防止 label 被压缩 */
}

/* 输入框：紧凑精致（宽度相对于容器） */
.input-order,
.input-field {
    width: 100%;
    height: 46px;
    background: rgba(255,255,255,0.07);
    border: 2px solid rgba(110, 150, 190, 1);
    border-radius: 12px;
    padding: 0 16px;
    font-size: 15px;
    color: #fff;
    backdrop-filter: blur(8px);
    transition: all 0.2s;
}
.input-field {
    height: 42px;
    max-width: 220px;  /* 玩家 UID 和昵称输入框变短 */
}
.input-order:focus,
.input-field:focus {
    outline: none;
    border-color: #519CFF;
    background: rgba(81, 156, 255, 0.1);
}
input::placeholder {
    color: #8A9BB1;
    font-size: 14px;
}

/* 按钮：紧凑（宽度相对于容器） */
.btn {
    width: 70%;
    height: 48px;
    background: linear-gradient(90deg, #4287F3 0%, #2563EB 100%);
    color: #fff;
    border: none;
    border-radius: 14px;
    font-size: 17px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.3px;
}
.btn:active {
    transform: scale(0.97);
}

/* 礼包信息：超级紧凑 */
.gift-info {
    text-align: center;
    margin-bottom: 16px;
}
.gift-info h2 {
    font-size: 18px;
    margin-bottom: 8px;
    color: #F0F4FC;
    font-weight: 500;
    letter-spacing: 0;
}
.gift-img {
    width: 160px;
    height: auto;
    border-radius: 10px;
}

/* 卡片：紧凑（宽度相对于容器） */
.account-info,
.order-info {
    width: 100%;
    background: rgba(22, 34, 48, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(100, 140, 180, 0.25);
    border-radius: 14px;
    padding: 18px 16px;
    margin-bottom: 18px;
}
.account-info h2,
.order-info h2 {
    font-size: 18px;
    margin-bottom: 16px;
    text-align: center;
    font-weight: 500;
}

/* 选择框 */
.checkbox-group {
    display: flex;
    gap: 22px;
}
.checkbox-item {
    display: flex;
    align-items: center;
    gap: 6px;
}
.checkbox-item input {
    width: 17px;
    height: 17px;
    accent-color: #4287F3;
}

/* 如何获取 */
.tip {
    color: #519CFF;
    font-size: 12px;
    margin-left: 6px;
    cursor: pointer;
    line-height: 1.5;
}

.tip:hover {
    color: #74B0FF;
    text-decoration: underline;  /* 悬停时保持下划线 */
}

/* 订单信息展示 */
.order-info .row span:first-child {
    color: #A0B4CD;
    font-weight: 500;
}
.order-info .row span:last-child {
    color: #fff;
    font-weight: 500;
}
.account-info,
.order-info {
    width: 100%;
    background: rgba(22, 34, 48, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(100, 140, 180, 0.25);
    border-radius: 14px;
    padding: 22px 20px;  /* 内边距加大，更宽松 */
    margin-bottom: 20px;
}

.btn {
    width: 100%;        /* 更宽 */
    height: 52px;      /* 更高 */
    background: linear-gradient(90deg, #4287F3 0%, #2563EB 100%);
    color: #fff;
    border: none;
    border-radius: 14px;
    font-size: 18px;   /* 字体稍大 */
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.3px;
}

/* 弹层容器：全屏 + 绝对居中 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.92);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}
/* 内部容器：确保居中 */
.modal-content {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
/* 图片：居中 + 自适应 */
.modal-img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 12px;
    display: block;
    margin: 10px auto;
}

/* 动态箭头动画 */
.animated-arrow {
    display: inline-block;
    font-size: 18px;
    color: #ff1500;
    animation: bounce 1s infinite;
    font-weight: bold;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
        opacity: 1;
    }
    50% {
        transform: translateY(8px);
        opacity: 0.6;
    }
}

/* ---------- Layer 弹窗：与页面暗色军事风一致 ---------- */
.layui-layer.h5-layer {
    background: rgba(22, 34, 48, 0.96) !important;
    border: 1px solid rgba(100, 140, 180, 0.35) !important;
    border-radius: 16px !important;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55) !important;
    backdrop-filter: blur(12px);
    overflow: hidden;
    max-width: 92vw;
}

.layui-layer.h5-layer .layui-layer-title {
    background: transparent !important;
    border-bottom: 1px solid rgba(100, 140, 180, 0.22) !important;
    color: #F0F4FC !important;
    font-size: 17px !important;
    font-weight: 500 !important;
    height: 50px !important;
    line-height: 50px !important;
    padding: 0 44px 0 20px !important;
}

.layui-layer.h5-layer .layui-layer-setwin .layui-layer-close1 {
    filter: brightness(2);
    opacity: 0.75;
}

.layui-layer.h5-layer .layui-layer-content {
    color: #D0DCEB !important;
    font-size: 15px !important;
    line-height: 1.6 !important;
}

.layui-layer.h5-layer.layui-layer-dialog .layui-layer-content {
    padding: 22px 22px 8px !important;
    text-align: center;
}

.layui-layer.h5-layer .layui-layer-btn {
    text-align: center !important;
    padding: 12px 16px 18px !important;
    border-top: 1px solid rgba(100, 140, 180, 0.18);
    display: flex;
    gap: 12px;
    justify-content: center;
}

.layui-layer.h5-layer .layui-layer-btn a {
    flex: 1;
    max-width: 148px;
    height: 44px !important;
    line-height: 44px !important;
    margin: 0 !important;
    padding: 0 12px !important;
    border-radius: 12px !important;
    font-size: 15px !important;
    font-weight: 500;
    box-sizing: border-box;
}

/* 左：返回修改 */
.layui-layer.h5-layer .layui-layer-btn .layui-layer-btn0 {
    border: 1px solid rgba(110, 150, 190, 0.55) !important;
    background: rgba(255, 255, 255, 0.06) !important;
    color: #C0CFE2 !important;
}

/* 右：确认提交 */
.layui-layer.h5-layer .layui-layer-btn .layui-layer-btn1 {
    border: none !important;
    background: linear-gradient(90deg, #4287F3 0%, #2563EB 100%) !important;
    color: #fff !important;
}

.layui-layer.h5-layer-msg {
    background: rgba(22, 34, 48, 0.94) !important;
    border: 1px solid rgba(100, 140, 180, 0.3) !important;
    border-radius: 12px !important;
    color: #EAEAEA !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4) !important;
}

.layui-layer.h5-layer-msg .layui-layer-content {
    color: #EAEAEA !important;
    padding: 14px 22px !important;
}

/* 确认弹窗内容 */
.h5-confirm {
    text-align: center;
    padding: 4px 4px 8px;
}

.h5-confirm__label {
    font-size: 14px;
    color: #A0B4CD;
    margin-bottom: 10px;
}

.h5-confirm__uid {
    font-size: 26px;
    font-weight: 600;
    letter-spacing: 2px;
    color: #fff;
    margin-bottom: 12px;
    word-break: break-all;
}

.h5-confirm__spec-img {
    width: 72px;
    height: 72px;
    border-radius: 10px;
    object-fit: cover;
    margin-bottom: 8px;
}

.h5-confirm__spec {
    font-size: 16px;
    font-weight: 500;
    color: #fff;
    margin-bottom: 16px;
    word-break: break-all;
}

.h5-confirm__hint {
    font-size: 12px;
    color: #519CFF;
    line-height: 1.5;
}

/* 扫码绑定弹窗 */
.layui-layer.h5-layer-qr {
    width: 302px !important;
    max-width: 92vw !important;
    border-radius: 16px !important;
}

.layui-layer.h5-layer-qr .layui-layer-content {
    padding: 18px 18px 22px !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    box-sizing: border-box;
}

.h5-bind-qr {
    text-align: center;
    padding: 0;
}

.h5-bind-qr__box {
    margin: 0 auto 14px;
    padding: 14px;
    background: #fff;
    border-radius: 12px;
    display: inline-block;
    line-height: 0;
}

.h5-bind-qr__box img,
.h5-bind-qr__box canvas {
    display: block;
    width: 200px !important;
    height: 200px !important;
}

.h5-bind-qr__tip {
    margin: 0;
    font-size: 13px;
    color: #A0B4CD;
    line-height: 1.5;
}

.h5-bind-qr-dialog {
    text-align: center;
    font-size: 14px;
    line-height: 1.5;
    color: #D0DCEB;
}

.h5-bind-qr-dialog__meta {
    margin: 0 0 6px;
    font-size: 14px;
    font-weight: 400;
    color: #fff;
    text-align: center;
}

.h5-bind-qr-dialog__meta--title {
    margin-bottom: 8px;
    font-size: 15px;
    font-weight: 600;
}

.h5-bind-qr-dialog__sides {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 10px auto;
    gap: 0;
}

.h5-bind-qr-dialog__side {
    max-width: 3.2em;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.2;
    color: #ff6b6b;
    text-align: center;
}

.h5-bind-qr-dialog__box {
    padding: 10px;
    background: #fff;
    border-radius: 8px;
}

.h5-bind-qr-dialog .h5-bind-qr__tip {
    margin: 12px 0 0;
    text-align: center;
    font-size: 13px;
    color: #A0B4CD;
}
