html, body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    overflow-x: hidden;
    width: 100%;
    margin: 0;
    padding: 0;
    background-color: #f5f5f5;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
}

* { box-sizing: border-box; }

a { text-decoration: none; }

.user-info {
    background: linear-gradient(178.78deg, rgba(245, 211, 211, 1) 0%, rgba(241, 214, 182, 0.54) 0%, rgba(237, 218, 149, 0.01) 0%, rgba(0, 0, 0, 1) 19.91%, rgba(252, 222, 164, 1) 100%);
    padding: 20px;
    color: #333;
    display: flex;
    align-items: center;
    border-radius: 12px;
}

.user-info img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin-right: 15px;
    border: 2px solid #fff;
}

.user-details h2 {
    margin: 0;
    font-size: 1.2em;
    color: rgba(255, 255, 255, 1);
}

.user-details p {
    margin: 5px 0 0;
    font-size: 0.9em;
    color: rgba(255, 255, 255, 1);
}

.balance-section {
    background-color: #fff8e1;
    margin: 15px;
    padding: 15px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.balance-section span {
    font-size: 12px;
}

.balance-section .balance {
    font-size: 1.5em;
    font-weight: bold;
    color: #f4511e;
}

.balance-section button {
    background-color: #f4511e;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
}

/* 提示文字：放在按钮下方，占满一行 */
.balance-tip {
    width: 100%;
    margin: 6px 0 0 0;
    font-size: 12px;
    color: #888;
}

.menu-section {
    background-color: white;
    margin: 15px;
    border-radius: 12px;
    border: 1px solid rgba(214, 214, 214, 0.49);
}

.menu-item {
    padding: 10px;
    border-top: 1px solid #eee;
    border-left: 1px solid #eee;
    border-right: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-decoration: none;
    color: #333;
}

.menu-item:last-child {
    border-bottom: none;
}

.menu-item .arrow {
    font-size: 1.2em;
    color: #ccc;
}

.menu-left-content {
    display: flex;
    align-items: center;
    font-size: 0.8em;
}

/* 底部固定退出按钮（移动端与PC共用） */
.logout-button {
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(env(safe-area-inset-bottom) + 10px);
    width: 100%;
    max-width: none;
    height: 56px;
    line-height: 56px;
    margin: 0;
    padding: 0 16px;
    background-color: #f4511e;
    color: #fff;
    text-align: center;
    border: none;
    border-radius: 0;
    font-size: 16px;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.08);
    border-radius: 12px;
}

h3 {
    margin: 15px 15px 5px;
    color: #555;
}

.menu-icon {
    width: 24px;
    height: 24px;
    margin-right: 5px;
}

.header-icon {
    width: 24px;
    height: 24px;
    padding-right: 8px;
}

/* PC端布局（>=767px） */
@media (min-width: 767px) {
    body {
        width: 80%;
        margin: 0 auto;
    }


    /* 更紧凑的两列：顶部两卡片并排，其他内容满宽 */
    .user-center-wrap {
        max-width: 960px;
        margin: 14px auto 18px auto;
        padding: 0 8px;
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-column-gap: 14px;
        grid-row-gap: 14px;
        align-items: start;
    }

    /* 顶部两卡片微调排版 */
    .user-info {
        grid-column: auto;
        margin: 0;
        padding: 16px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
        border-radius: 10px;
        justify-self: stretch;
    }

    .user-info img {
        width: 68px;
        height: 68px;
        margin-right: 16px;
    }

    .user-details h2 {
        font-size: 18px;
    }

    .user-details p {
        font-size: 13px;
        opacity: 0.95;
    }

    .balance-section {
        grid-column: auto;
        margin: 0;
        padding: 14px 16px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
        border-radius: 10px;
        justify-self: stretch;
    }

    /* 顶部两卡片统一最高高度与溢出处理 */
    .user-info, .balance-section {
        max-height: 120px;
        min-height: 120px;
        overflow: hidden;
    }

    /* 允许余额卡片自适应高度，避免提示被裁剪 */
    .balance-section {
        max-height: none;
        min-height: auto;
        overflow: visible;
    }

    /* 菜单作为一张满宽卡片，内部做两列来减少空白 */
    .menu-section {
        grid-column: 1 / -1;
        margin: 0;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
        border-radius: 10px;
    }

    .menu-section h3 {
        margin: 14px 14px 8px;
        font-size: 16px;
        color: #444;
    }

    .menu-section nav {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-column-gap: 10px;
        grid-row-gap: 8px;
        padding: 8px 12px 12px;
    }

    /* 重置菜单条目边框，做成卡片式 */
    .menu-item {
        padding: 12px 14px;
        font-size: 15px;
        border: 1px solid #e9e9e9;
        border-radius: 10px;
        transition: background 0.18s, transform 0.06s, box-shadow 0.18s;
    }

    .menu-item:hover {
        background: #fafafa;
        transform: translateY(-1px);
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    }

    .menu-item:focus-visible {
        outline: 2px solid #f4511e;
        outline-offset: 2px;
    }

    .menu-item .arrow {
        color: #bbb;
        transition: color 0.18s;
    }

    .menu-item:hover .arrow {
        color: #999;
    }

    .menu-left-content {
        font-size: 0.95em;
    }

    .logout-button {
        position: fixed;
        left: 0;
        right: 0;
        bottom: calc(env(safe-area-inset-bottom) + 10px);
        width: 50% !important;
        margin: 0 !important;
        justify-self: center;
        border-radius: 12px;
    }
}

/* 更宽屏（>=1100px）菜单三列，进一步减少空白 */
@media (min-width: 1100px) {
    .user-center-wrap {
        max-width: 1040px;
    }

    .menu-section nav {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}