.top-nav {
    height: 60px;
    background: #7b61ff;
    display: flex;
    align-items: center;
    padding: 0 20px;
    color: #fff;
    gap: 15px;
}
.top-nav .logo {
    font-size: 20px;
    font-weight: bold;
}
.top-nav .right-info{
    margin-left:auto;
    display:flex;
    align-items:center;
    gap:20px;
}
.top-nav a {
    color: #fff;
    text-decoration: none;
    opacity:0.9;
}
.top-nav a:hover {
    opacity:1;
}

.wrap {
    display: flex;
    height: calc(100% - 60px);
}

.left-menu {
    width: 220px;
    background: #fff;
    padding: 30px 0;
    box-shadow: 2px 0 5px #eee;
}
.menu-item {
    padding: 14px 30px;
    cursor: pointer;
    color: #555;
    transition: 0.2s;
}
.menu-item.active {
    background: #efeaff;
    color: #7b61ff;
    border-left: 4px solid #7b61ff;
}
.menu-item:hover {
    background: #f5f2ff;
}

.main-content {
    flex: 1;
    padding: 30px;
    overflow: auto;
}
.content-box {
    display: none;
}
.content-box.show {
    display: block;
}
.content-card {
    background: #ffffffdd;
    border-radius: 12px;
    box-shadow: 0 2px 8px #e6e2f5;
    margin-bottom: 20px;
    overflow: hidden;
}


.avatar-wrap{
    display:flex;
    gap:20px;
    padding:15px;
}
@media (max-width:768px){
    .avatar-wrap{flex-direction:column}
}

.avatar-preview{
    flex:1;
    background:#fff;
    border-radius:16px;
    box-shadow:0 4px 12px rgba(123,97,255,0.15);
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    padding:20px;
    min-height:480px;
    position:relative;
}
.preview-bg{
    position:absolute;
    top:0;left:0;right:0;bottom:0;
    background:linear-gradient(180deg,#efeaff,#fff);
    border-radius:16px;
    z-index:1;
}
.avatar-3d{
    width:180px;
    height:240px;
    z-index:2;
}
.avatar-3d img{
    width:100%;
    height:100%;
    object-fit:contain;
    filter: drop-shadow(0 12px 20px #ff88b060);
    animation: float 3s ease-in-out infinite;
}
@keyframes float {
    0%,100% { transform: translateY(0px); }
    50% { transform: translateY(-12px); }
}
/* 新增：视角切换按钮组 */
.view-btn-group{
    z-index:2;
    display:flex;
    gap:8px;
    margin-bottom:15px;
}
.view-btn{
    padding:6px 12px;
    border:none;
    border-radius:16px;
    background:#f3edff;
    color:#6b4e9e;
    cursor:pointer;
    font-size:12px;
}
.view-btn.active{
    background:#7b61ff;
    color:#fff;
}
.show-user-info{
    z-index:2;
    margin-top:20px;
    text-align:center;
}
.show-user-info h3{
    color:#4b2e83;
    font-size:20px;
    margin-bottom:5px;
    padding:0;
}
.show-user-info p{
    color:#8871a8;
    font-size:14px;
}

.level-box{
    width:80%;
    margin:12px auto;
    z-index: 2;
}
.level-text{
    display:flex;
    justify-content:space-between;
    font-size:13px;
    color:#6b4e9e;
    margin-bottom:4px;
}
.exp-bar{
    width:100%;
    height:8px;
    background:#e6dfff;
    border-radius:4px;
    overflow:hidden;
}
.exp-progress{
    height:100%;
    background:#7b61ff;
    border-radius:4px;
    transition:0.5s all;
}

.attr-panel{
    width:100%;
    margin-top:15px;
    background:rgba(123,97,255,0.08);
    border-radius:10px;
    padding:12px;
    z-index: 2;
}
.attr-item{
    display:flex;
    justify-content:space-between;
    padding:4px 0;
    font-size:14px;
    color:#555;
}

.avatar-panel{
    flex:1.2;
    background:#fff;
    border-radius:16px;
    box-shadow:0 4px 12px rgba(123,97,255,0.15);
    padding:20px;
    display:flex;
    flex-direction:column;
}
.tab-bar{
    display:flex;
    gap:10px;
    margin-bottom:15px;
    flex-wrap:wrap;
}
.tab-item{
    padding:8px 16px;
    background:#f3edff;
    border-radius:20px;
    color:#6b4e9e;
    font-size:14px;
    cursor:pointer;
    transition:0.2s;
}
.tab-item.active{
    background:#7b61ff;
    color:#fff;
}

.list-container{
    flex:1;
    margin-bottom:15px;
}
/* 核心修改：自动换行，每行7个 */
.list-row{
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.hide{display: none;}

.avatar-card{
    width:90px;height:120px;background:#faf7ff;border-radius:12px;
    display:flex;flex-direction:column;align-items:center;justify-content:center;
    cursor:pointer;border:2px solid transparent;transition:0.2s;position:relative;
}
.avatar-card:hover{transform:translateY(-3px);box-shadow:0 3px 8px rgba(123,97,255,0.2);}
.avatar-card.checked{border-color:#7b61ff;background:#f0e9ff;}
.avatar-card.lock{filter:grayscale(0.8);cursor:not-allowed;}
.avatar-card.lock::after{content:"🔒";position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);font-size:22px;}
.avatar-card.checked::after{content:"✓";position:absolute;top:5px;right:5px;width:18px;height:18px;background:#7b61ff;color:#fff;border-radius:50%;font-size:12px;display:flex;align-items:center;justify-content:center;}
.avatar-card img{width:60px;height:80px;object-fit:contain;}
.avatar-card span{font-size:12px;color:#7a649c;margin-top:5px;}

.btn-bar{display:flex;gap:12px;margin-top:15px;}
.btn{flex:1;padding:10px;border-radius:25px;border:none;font-size:15px;cursor:pointer;transition:0.2s;}
.btn-save{background:#7b61ff;color:#fff;}
.btn-reset{background:#f0e9ff;color:#6b4e9e;}
.open-face-btn {
    margin-top: 10px;
    padding: 8px 20px;
    background: #7b61ff;
    color: #fff;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    z-index: 2;
    position: relative;
}

/* 捏脸弹窗样式 */
.face-mask {
    display: none;
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}
.face-mask.show {
    display: flex;
}
.face-box {
    width: 780px;
    max-width: 96%;
    background: #fff;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(123,97,255,0.25);
}
.face-head {
    background: linear-gradient(90deg, #7b61ff, #a38cff);
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #fff;
}
.face-close {
    border: none;
    background: rgba(255,255,255,0.2);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
}
.face-body {
    display: flex;
    padding: 20px;
    gap: 20px;
}
.face-preview {
    width: 280px;
    background: linear-gradient(180deg,#efeaff,#fff);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 380px;
}
.face-layer {
    position: relative;
    width: 170px;
    height: 220px;
    animation: float 3s ease-in-out infinite;
}
.face-layer img {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 10px 18px #ff88b060);
}
.face-edit {
    flex: 1;
    display: flex;
    flex-direction: column;
}
.face-tab {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}
.face-tab-item {
    padding: 6px 14px;
    background: #f3edff;
    border-radius: 18px;
    font-size: 13px;
    color: #6b4e9e;
    cursor: pointer;
}
.face-tab-item.active {
    background: #7b61ff;
    color: #fff;
}
.face-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    max-height: 240px;
    overflow-y: auto;
}
.face-item {
    width: 72px;
    height: 92px;
    background: #faf7ff;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 2px solid transparent;
    cursor: pointer;
}
.face-item.active {
    border-color: #7b61ff;
    background: #f0e9ff;
}
.face-item img {
    width: 48px;
    height: 62px;
    object-fit: contain;
}
.face-item span {
    font-size: 11px;
    color: #7a649c;
    margin-top: 3px;
}
.face-foot {
    padding: 12px 20px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 12px;
}
.face-btn {
    flex: 1;
    padding: 9px 0;
    border-radius: 22px;
    border: none;
    cursor: pointer;
    font-size: 14px;
}
.face-save {
    background: #7b61ff;
    color: #fff;
}
.face-reset {
    background: #f0e9ff;
    color: #6b4e9e;
}
@media(max-width:768px){
    .wrap{flex-direction:column;}
    .left-menu{width:100%;height:auto;display:flex;overflow-x:auto;}
    .menu-item{white-space:nowrap;}
}