/* 禁止滚动超出边界 - 加强版 */
html, body {
    overscroll-behavior: none;
    overscroll-behavior-y: none;
    overflow-x: hidden;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* 隐藏滚动条 - 加强版 */
html::-webkit-scrollbar,
body::-webkit-scrollbar,
*::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
    background: transparent;
}

/* Firefox 隐藏滚动条 */
html, body {
    scrollbar-width: none;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Microsoft YaHei", sans-serif;
}

body {
    background: #f6f1e7;
    color: #333;
    padding-bottom: 90px;
}

.wrap {
    max-width: 480px;
    margin: 0 auto;
    background: #fffef8;
    min-height: 100vh;
    padding-bottom: 20px; /* 增加底部内边距 */
}

/* 封面区域 */
.cover {
    width: 100%;
    height: 240px;
    background: linear-gradient(rgba(90, 70, 40, 0.3), rgba(50, 35, 20, 0.7)),
                url('https://picsum.photos/id/146/1600/800') center/cover;
    position: relative;
    display: flex;
    justify-content: center;
    overflow: visible;
}

.cover::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(to bottom, transparent, rgba(255, 253, 245, 0.95));
    pointer-events: none;
}

/* 头像区域 */
.avatar-wrap {
    position: absolute;
    bottom: -60px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    box-shadow: 0 0 0 4px #fff, 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff;
}

/* 性别外圈 */
.avatar-ring {
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 50%;
    border: 3px solid;
    pointer-events: none;
    z-index: 5;
}

.avatar-ring.male {
    border-color: #4a89dc;
}

.avatar-ring.female {
    border-color: #ff6b9d;
}

/* 性别图标 */
.avatar-gender {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 26px;
    height: 26px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    z-index: 15;
    border: 2px solid #fff;
}

.avatar-gender.male {
    color: #4a89dc;
}

.avatar-gender.female {
    color: #ff6b9d;
}

/* 个人信息 */
.profile {
    margin-top: 70px;
    text-align: center;
    padding: 0 20px;
}

.name {
    font-size: 26px;
    font-weight: bold;
    color: #6d4c2d;
}

.level {
    background: #96653b;
    color: #fff;
    padding: 4px 14px;
    border-radius: 30px;
    font-size: 14px;
    display: inline-block;
    margin: 6px 0;
}

.sign {
    color: #7a573a;
    font-size: 15px;
}

/* 统计卡片 */
.info-bar {
    display: flex;
    padding: 15px 10px;
    background: #fff;
    margin: 15px 12px;
    border-radius: 14px;
    border: 1px solid #d3b897;
}

.info-bar .item {
    flex: 1;
    text-align: center;
}

.info-bar .num {
    font-size: 18px;
    font-weight: bold;
    color: #6d4c2d;
}

.info-bar .label {
    font-size: 12px;
    color: #666;
    margin-top: 2px;
}

/* 通用卡片 */
.section {
    background: #fff;
    margin: 12px;
    border-radius: 14px;
    padding: 18px 15px;
    border: 1px solid #d3b897;
}

/* 通用标题样式 - 所有板块共用 */
.section-title {
    font-size: 17px;
    font-weight: bold;
    color: #6d4c2d;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding-left: 10px;
    border-left: 4px solid #96653b;
}

/* 基础档案 */
.base-info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px 10px;
    font-size: 15px;
}

.base-info .item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    background: #fdfaf3;
    border-radius: 10px;
    border: 1px solid #f0e3d2;
}

.base-info .item i {
    color: #a87a4f;
    font-size: 14px;
}

.base-info .item label {
    color: #888;
    font-size: 14px;
}

/* 相册滚动 */
.album-slider {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 5px 2px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.album-slider img {
    width: 110px;
    height: 110px;
    border-radius: 10px;
    object-fit: cover;
    scroll-snap-align: start;
    cursor: pointer;
    transition: transform 0.2s;
}

.album-slider img:active {
    transform: scale(0.98);
}

.album-slider::-webkit-scrollbar {
    height: 0;
}

/* 荣誉勋章 */
.honor-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.honor {
    background: #96653b;
    color: #fff;
    padding: 10px 0;
    border-radius: 10px;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: transform 0.2s;
}

.honor:active {
    transform: scale(0.96);
}

/* 活动卡片 */
.activity-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: #fdfaf3;
    border-radius: 14px;
    border: 1px solid #e9d9c3;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.activity-item:active {
    transform: scale(0.98);
    background: #f6eedf;
}

.activity-img {
    width: 70px;
    height: 70px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.act-title {
    font-weight: bold;
    color: #6d4c2d;
    font-size: 15px;
}

.act-info {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 11px;
    color: #888;
}

.act-info i {
    color: #a87a4f;
    width: 14px;
    margin-right: 3px;
}

.act-progress {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: #96653b;
}

.progress-bar {
    flex: 1;
    height: 4px;
    background: #e9d9c3;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #96653b;
    border-radius: 4px;
}

/* 评论区域 */
.msg-item {
    padding: 10px 0;
    border-bottom: 1px dashed #eee;
}

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

.msg-head {
    display: flex;
    align-items: center;
    gap: 8px;
}

.msg-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.msg-name {
    font-weight: bold;
    font-size: 14px;
}

.msg-time {
    font-size: 12px;
    color: #999;
    margin-left: auto;
}

.msg-content {
    font-size: 14px;
    padding-left: 40px;
    margin-top: 4px;
}

.msg-footer {
    padding-left: 40px;
    margin-top: 6px;
    display: flex;
    gap: 15px;
}

.msg-like {
    font-size: 12px;
    color: #999;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.msg-like i {
    font-size: 12px;
}

.msg-like.active {
    color: #e74c3c;
}

.msg-like:active {
    opacity: 0.6;
}

/* 灯箱 */
#lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox-content {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #fff;
    font-size: 24px;
    transition: background 0.2s;
}

.lightbox-nav:active {
    background: rgba(255, 255, 255, 0.5);
}

.lightbox-prev {
    left: 10px;
}

.lightbox-next {
    right: 10px;
}

/* 底部菜单 */
.footer-menu {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background: #fff;
    border-top: 1px solid #e6d7c3;
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 99;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.08);
    height: auto;
    padding: 8px 0 calc(8px + constant(safe-area-inset-bottom));
    padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
}

.menu-item {
    flex: 1;
    text-align: center;
    font-size: 12px;
    color: #666;
    cursor: pointer;
}

.menu-item i {
    display: block;
    font-size: 20px;
    margin-bottom: 4px;
    color: #96653b;
}

.menu-item:active {
    opacity: 0.6;
}

/* 弹窗遮罩 */
.mask {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.popup {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    background: #fff;
    border-radius: 16px;
    padding: 22px;
    opacity: 0;
    transition: all 0.3s ease;
    overflow: auto;
}

.popup.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.popup-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 15px;
    text-align: center;
    color: #6d4c2d;
}

.popup-input {
    width: 100%;
    height: 100px;
    border: 1px solid #d3b897;
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 15px;
    resize: none;
    outline: none;
    font-size: 14px;
}

.popup-input:focus {
    border-color: #96653b;
}

.popup-btn {
    width: 100%;
    height: 42px;
    background: #96653b;
    color: #fff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    transition: opacity 0.2s;
}

.popup-btn:active {
    opacity: 0.8;
}

.contact-item {
    padding: 12px 0;
    border-bottom: 1px dashed #eee;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.contact-item i {
    width: 24px;
    color: #96653b;
    font-size: 18px;
}

.contact-item .contact-value {
    flex: 1;
    color: #333;
}

.close {
    text-align: center;
    margin-top: 15px;
    color: #999;
    cursor: pointer;
    padding: 8px;
}

.close:active {
    opacity: 0.6;
}

/* 全部评论列表 */
.all-comment-list {
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 5px;
}

.all-comment-list::-webkit-scrollbar {
    width: 0;
}

.full-comment-item {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px dashed #eee;
}

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

.full-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.full-right {
    flex: 1;
}

.full-name {
    font-weight: bold;
    font-size: 14px;
}

.full-time {
    font-size: 12px;
    color: #999;
    margin-left: 8px;
}

.full-content {
    font-size: 14px;
    margin-top: 4px;
    line-height: 1.4;
}

.full-like {
    margin-top: 6px;
    font-size: 12px;
    color: #999;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.full-like.active {
    color: #e74c3c;
}

/* 全部履历列表 */
.all-route-list {
    max-height: 60vh;
    overflow-y: auto;
}

.all-route-list::-webkit-scrollbar {
    width: 0;
}

/* ========== 骑行履历板块专用样式 ========== */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    flex-wrap: nowrap;
    gap: 12px;
}

.section-header .section-title {
    flex-shrink: 0;
    white-space: nowrap;
    margin-bottom: 0;
}

.tab-switch {
    display: flex;
    flex-shrink: 0;
    background: #f0e8dd;
    border-radius: 30px;
    padding: 3px;
}

.tab-btn {
    padding: 5px 14px;
    font-size: 12px;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
    color: #7a5a3a;
    background: transparent;
    border: none;
    white-space: nowrap;
}

.tab-btn.active {
    background: #96653b;
    color: #fff;
    box-shadow: 0 2px 6px rgba(150, 101, 59, 0.3);
}

.route-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 260px;
}

.route-item {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    background: #fdfaf3;
    border-radius: 12px;
    border: 1px solid #e9d9c3;
}

.route-year {
    font-size: 13px;
    color: #96653b;
    font-weight: bold;
    min-width: 55px;
}

.route-info {
    flex: 1;
    padding: 0 10px;
}

.route-name {
    font-size: 15px;
    font-weight: bold;
    color: #6d4c2d;
    margin-bottom: 3px;
}

.route-desc {
    font-size: 12px;
    color: #888;
}

.route-tag {
    font-size: 11px;
    color: #fff;
    background: #a87a4f;
    padding: 3px 8px;
    border-radius: 30px;
    white-space: nowrap;
}

.route-tag.activity {
    background: #2e7d32;
}

.route-tag.personal {
    background: #96653b;
}

.more-btn {
    text-align: center;
    color: #96653b;
    padding: 12px 0 4px;
    font-size: 14px;
    cursor: pointer;
    margin-top: 12px;
    border-top: 1px solid #f0e3d2;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #aa8b68;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}