﻿/* 全局样式 - 使用兼容IE的写法 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
}

body {
    font-family: "Microsoft YaHei", Arial, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 顶部导航栏 */
.header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 30px;
}

.logo-area {
    display: flex;
    align-items: center;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: #f4b59d;
    margin-right: 5px;
}

.site-name {
    font-size: 22px;
    font-weight: bold;
    color: #333;
}

/* 导航和用户信息容器 */
.nav-and-user {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    position: relative;
}

.nav {
    display: flex;
    flex-wrap: wrap;
    margin-right: 25px;
    padding-right: 25px;
    border-right: 1px solid #e0e0e0;
}

    .nav a {
        text-decoration: none;
        color: #666;
        padding: 8px 15px;
        margin: 0 5px;
        border-radius: 4px;
        transition: all 0.3s;
        white-space: nowrap;
    }

        .nav a:hover {
            background-color: #f0f0f0;
            color: #f4b59d;
        }

        .nav a.active {
            color: #f4b59d;
            background-color: #f0f0f0;
        }

/* 用户信息区域 - 重新设计 */
.user-info-container {
    position: relative;
}

.user-info {
    display: flex;
    align-items: center;
    white-space: nowrap;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 6px;
    transition: background-color 0.3s;
}

    .user-info:hover {
        background-color: #f0f0f0;
    }

.user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #f4b59d;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 20px;
    margin-right: 12px;
    flex-shrink: 0;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-id {
    color: #333;
    font-weight: bold;
    font-size: 14px;
    line-height: 1.4;
}

.user-points {
    color: #f5222d;
    font-size: 16px;
    font-weight: bold;
    line-height: 1.4;
}

.points-label {
    color: #666;
    font-weight: normal;
}


/* 主要内容区域 */
.main-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
}

.left-panel {
    width: 65%;
    min-width: 300px;
}

.right-panel {
    width: 32%;
    min-width: 280px;
    background-color: white;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-top: 20px;
}

/* 套餐选择区域 */
.section-title {
    font-size: 22px;
    margin-bottom: 20px;
    color: #333;
    padding-bottom: 10px;
    border-bottom: 2px solid #f4b59d;
    display: inline-block;
}

.packages {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
}

.package {
    width: calc(50% - 20px);
    margin: 10px;
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s;
    cursor: pointer;
    border: 2px solid transparent;
}

    .package:hover {
        box-shadow: 0 5px 15px rgba(0,0,0,0.1);
        transform: translateY(-3px);
        border-color: #f4b59d;
    }

    .package.active {
        border-color: #f4b59d;
        background-color: #f0f8ff;
    }

.package-points {
    font-size: 28px;
    font-weight: bold;
    color: #EB6354;
    margin-bottom: 10px;
}

.package-price {
    font-size: 24px;
    color: #f5222d;
    margin-bottom: 5px;
}

.package-original-price {
    font-size: 16px;
    color: #999;
    text-decoration: line-through;
}

/* 支付方式 */
.payment-methods {
    margin-top: 30px;
}

.payment-title {
    font-size: 18px;
    margin-bottom: 15px;
    color: #333;
}

.payment-method {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background-color: white;
    border-radius: 6px;
    margin-bottom: 10px;
    border: 1px solid #e0e0e0;
    cursor: pointer;
    transition: all 0.3s;
}

    .payment-method:hover {
        border-color: #f4b59d;
    }

    .payment-method.active {
        border-color: #f4b59d;
        background-color: #f0f8ff;
    }

.payment-icon {
    width: 30px;
    height: 30px;
    background-color: #1890ff;
    border-radius: 4px;
    margin-right: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

.payment-name {
    font-size: 16px;
    font-weight: bold;
    color: #333;
}

/* 订单汇总 */
.order-summary {
    margin-top: 25px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px dashed #e0e0e0;
}

.summary-label {
    color: #666;
}

.summary-value {
    font-weight: bold;
    color: #333;
}

.total {
    font-size: 20px;
    color: #f5222d;
}

.qr-code {
    text-align: center;
    margin: 25px 0;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 8px;
}

.qr-placeholder {
    width: 180px;
    height: 180px;
    background-color: #e0e0e0;
    margin: 0 auto 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 14px;
}

.qr-text {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

.pay-button {
    display: block;
    width: 100%;
    background-color: #f4b59d;
    color: white;
    border: none;
    padding: 15px;
    font-size: 18px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s;
    text-align: center;
    text-decoration: none;
    margin-top: 20px;
}

    .pay-button:hover {
        background-color: #EB6354;
    }

/* 响应式设计 */
@media (max-width: 1100px) {
    .nav-and-user {
        width: 100%;
        justify-content: space-between;
        margin-top: 15px;
    }

    .nav {
        margin-right: 10px;
        padding-right: 10px;
    }
}

@media (max-width: 992px) {
    .left-panel, .right-panel {
        width: 100%;
    }

    .package {
        width: calc(50% - 20px);
    }
}

@media (max-width: 768px) {
    .header {
        flex-direction: column;
        align-items: flex-start;
    }

    .logo-area {
        margin-bottom: 15px;
    }

    .nav-and-user {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
    }

    .nav {
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
        padding-right: 0;
        padding-bottom: 15px;
        margin-bottom: 15px;
        margin-right: 0;
        width: 100%;
    }

    .user-info-container {
        width: 100%;
    }

    .user-info {
        width: 100%;
        justify-content: flex-start;
    }

    .user-dropdown {
        right: auto;
        left: 0;
    }

    .package {
        width: 100%;
    }

    .qr-placeholder {
        width: 150px;
        height: 150px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 15px;
    }

    .package {
        padding: 15px;
    }

    .right-panel {
        padding: 20px;
    }

    .package-points {
        font-size: 24px;
    }

    .package-price {
        font-size: 20px;
    }

    .nav a {
        padding: 8px 10px;
        margin: 0 3px;
    }

    .user-avatar {
        width: 40px;
        height: 40px;
        font-size: 16px;
        margin-right: 10px;
    }

    .user-dropdown {
        width: 160px;
    }
}

/* IE兼容性调整 */
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
    .main-container {
        display: block;
    }

    .left-panel, .right-panel {
        width: 100%;
        float: left;
    }

    .packages {
        display: block;
    }

    .package {
        width: 48%;
        float: left;
        margin: 1%;
    }

    .nav-and-user {
        display: block;
        width: 100%;
        float: left;
        margin-top: 15px;
    }

    .nav {
        float: left;
        border-right: 1px solid #e0e0e0;
        padding-right: 25px;
        margin-right: 25px;
        margin-bottom: 0;
    }

    .user-info-container {
        float: left;
        position: relative;
    }

    .user-info {
        display: inline-block;
    }

    .user-dropdown {
        position: absolute;
        top: 60px;
        right: 0;
        left: auto;
    }

    @media (max-width: 768px) {
        .package {
            width: 98%;
        }

        .nav {
            float: none;
            width: 100%;
            border-right: none;
            border-bottom: 1px solid #e0e0e0;
            padding-right: 0;
            padding-bottom: 15px;
            margin-right: 0;
            margin-bottom: 15px;
        }

        .user-info-container {
            float: none;
            width: 100%;
        }

        .user-dropdown {
            left: 0;
            right: auto;
        }
    }

    /* 清除浮动 */
    .clearfix::after {
        content: "";
        display: table;
        clear: both;
    }
}

/* 兼容旧版IE的flexbox回退方案 */
.no-flexbox .header,
.no-flexbox .nav-and-user,
.no-flexbox .main-container,
.no-flexbox .packages,
.no-flexbox .payment-method,
.no-flexbox .nav,
.no-flexbox .user-info {
    display: block;
}

.no-flexbox .nav-and-user {
    overflow: hidden;
}

.no-flexbox .nav {
    float: left;
    border-right: 1px solid #e0e0e0;
    padding-right: 25px;
    margin-right: 25px;
}

.no-flexbox .user-info-container {
    float: left;
    position: relative;
}

.no-flexbox .user-info {
    display: inline-block;
}
