* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "PingFang SC", "Microsoft Yahei", sans-serif;
}

body {
    background: url('../images/bg.jpg') no-repeat center center fixed;
    background-size: cover;
    color: #fff;
    min-height: 100vh;
    max-height: 100vh;
    overflow-x: hidden !important;;
    overflow-y: auto !important; /* 强制允许垂直滚动，关键！ */
    -webkit-tap-highlight-color: transparent;
    
    /* 只保留必要的底部安全区 padding */
    padding-bottom: env(safe-area-inset-bottom) !important;
    /* 防止body被裁剪 */
    position: relative;
    z-index: 1;
}

.bg-decoration {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.1;
    pointer-events: none;
    z-index: 0;
    background-image: url('../images/bg.jpg');
    background-size: 200px 200px;
}

.container {
    position: relative;
    z-index: 2; /* 高于背景，低于导航 */
    padding-top: env(safe-area-inset-top); /* 适配刘海屏 */
    padding-bottom: 20px; /* 仅留页脚空间，导航用body padding */
    min-height: 100vh;
    background-color: rgba(10, 10, 26, 0.7);
    max-width: 480px;
    margin: 0 auto;
    /* 关键：解除所有裁剪限制 */
    overflow: visible !important;
    transform: none !important;
}

/* 头部 - 手机端精细化适配 */
.header {
    padding: 16px 12px 16px; /* 缩小内边距，适配小屏 */
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.logo {
    width: 44px; /* 缩小logo，适配小屏 */
    height: 44px;
    background-color: #1a1a2e;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo svg {
    width: 28px; /* 同步缩小svg */
    height: 28px;
    fill: #d4af37;
}

.gift-btn {
    width: 36px; /* 缩小礼物按钮 */
    height: 36px;
    background-color: #1a1a2e;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.gift-btn::after {
    content: '';
    position: absolute;
    top: 4px;
    right: 4px;
    width: 7px; /* 缩小小红点 */
    height: 7px;
    background-color: #ff9800;
    border-radius: 50%;
}

.gift-btn svg {
    width: 20px; /* 同步缩小svg */
    height: 20px;
    fill: #d4af37;
}

.header-title h1 {
    font-size: 28px; /* 适配手机字体大小 */
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.2; /* 优化行高 */
}

.header-title p {
    font-size: 14px;
    color: #ddd;
    font-style: italic;
    line-height: 1.3;
}

.edit-profile {
    margin-top: 12px;
    text-align: right;
}

.edit-profile button {
    background-color: rgba(212, 175, 55, 0.15);
    color: #d4af37;
    border: 1px solid #d4af37;
    border-radius: 18px; /* 优化圆角 */
    padding: 4px 14px; /* 缩小按钮内边距 */
    font-size: 13px; /* 缩小字体 */
    cursor: pointer;
    touch-action: manipulation;
}

/* 标签栏 - 手机端适配 */
.tabs {
    display: flex;
    gap: 20px; /* 缩小标签间距 */
    padding: 0 12px 12px; /* 适配内边距 */
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 16px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.tabs::-webkit-scrollbar {
    display: none;
}

.tab {
    font-size: 16px; /* 适配手机字体 */
    color: #888;
    padding-bottom: 6px;
    cursor: pointer;
    white-space: nowrap;
    touch-action: manipulation;
}

.tab.active {
    color: #d4af37;
    border-bottom: 2px solid #d4af37;
    font-weight: 500;
}

/* 内容切换容器样式 - 新增核心样式 */
.content-wrapper {
    width: 100%;
    /* 精准计算高度：屏幕高度 - 头部 - 标签栏 - 预留空间 */
    max-height: calc(100vh - 180px - env(safe-area-inset-bottom)) !important;
    overflow-y: auto !important;
    /* 滚动条美化 */
    scrollbar-width: thin;
    scrollbar-color: rgba(212, 175, 55, 0.3) transparent;
}
.content-wrapper::-webkit-scrollbar {
    width: 4px;
}
.content-wrapper::-webkit-scrollbar-thumb {
    background-color: rgba(212, 175, 55, 0.3);
    border-radius: 2px;
}
.content-section {
    display: none; /* 所有内容区默认隐藏 */
    width: 100%;
}
.content-section.active {
    display: block; /* 激活的内容区显示 */
}

/* 咨询师列表 - 手机端核心适配 */
.consultant-list {
    padding: 0 12px; /* 缩小内边距 */
    display: flex;
    flex-direction: column;
    gap: 14px; /* 缩小列表间距 */
}

.consultant-item {
    background-color: rgba(255,255,255,0.08);
    border-radius: 14px; /* 优化圆角 */
    padding: 14px; /* 缩小内边距 */
    display: flex;
    align-items: flex-start;
    gap: 14px; /* 缩小头像与文字间距 */
}

.avatar {
    width: 54px; /* 缩小头像 */
    height: 54px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.info {
    flex: 1;
    min-width: 0; /* 防止文字溢出 */
    /* 精准限制宽度，适配繁体 */
    max-width: calc(100% - 114px) !important;
}

.name {
    font-size: 18px; /* 适配手机字体 */
    font-weight: 500;
    color: #ffd78c;
    margin-bottom: 6px;
    line-height: 1.2;
}

.meta {
    font-size: 13px; /* 缩小描述字体 */
    color: #ccc;
    margin-bottom: 3px;
    line-height: 1.4; /* 优化行高 */
    /* 文字省略：强制生效 */
    display: -webkit-box !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 2 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: normal !important;
    word-break: break-all !important;
}

.consult-btn {
    align-self: flex-start;
    margin-top: 8px;
    background-color: rgba(212, 175, 55, 0.15);
    color: #d4af37;
    border: 1px solid #d4af37;
    border-radius: 18px;
    padding: 4px 16px; /* 适配按钮大小 */
    font-size: 13px; /* 缩小字体 */
    cursor: pointer;
    touch-action: manipulation;
    /* 适配点击区域 */
    min-width: 60px;
    text-align: center;
    text-decoration: none; /* 去除a标签下划线 */
}

/* 塔罗内容区样式 - 新增 */
.tarot-content {
    padding: 0 12px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    color: #fff;
}
.tarot-item {
    background-color: rgba(255,255,255,0.08);
    border-radius: 14px;
    padding: 14px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
}
.tarot-info {
    flex: 1;
    min-width: 0; /* 防止塔罗文字溢出 */
}
.tarot-info h3 {
    color: #ffd78c;
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 6px;
}
.tarot-info p {
    font-size: 13px;
    color: #ccc;
    line-height: 1.5;
    margin-bottom: 3px;
    /* 塔罗内容省略 */
    display: -webkit-box !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 2 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}
.tarot-item:active {
    background-color: rgba(255,255,255,0.12); /* 点击时背景加深 */
}

/* 雷诺曼/星盘默认内容样式 */
.other-content {
    padding: 20px 12px;
    text-align: center;
    color: #ccc;
    font-size: 14px;
}

/* 页脚 - 手机端适配 */
.footer {
    text-align: center;
    font-size: 11px; /* 缩小字体 */
    color: #666;
    margin: 24px 0 16px;
    line-height: 1.6;
    padding: 0 12px;
}

.footer a {
    color: #888;
    text-decoration: none;
    margin: 0 6px;
}

/* 底部导航 - 终极修复版（所有手机必显示） */
.bottom-nav {
    /* 强制固定在视口底部，不受任何父容器影响 */
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 99999 !important; /* 最高层级，不被任何元素覆盖 */
    /* 样式与布局 */
    background-color: #121222 !important;
    border-top: 1px solid rgba(255,255,255,0.1) !important;
    display: flex !important;
    justify-content: space-around !important;
    align-items: center !important;
    /* 适配安全区+高度 */
    height: 88px !important;
    padding: 10px 0 max(12px, env(safe-area-inset-bottom)) !important;
    /* 限制宽度，和内容容器对齐 */
    max-width: 480px !important;
    margin: 0 auto !important;
    /* 兼容iOS/Android定位 */
    transform: none !important;
    /* 触发GPU渲染，修复fixed失效 */
    will-change: transform;
    backface-visibility: hidden;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px; /* 缩小图标与文字间距 */
    color: #888;
    font-size: 11px; /* 缩小字体 */
    cursor: pointer;
    touch-action: manipulation;
}

.nav-item.active {
    color: #d4af37;
}

.nav-item svg {
    width: 22px; /* 缩小图标 */
    height: 22px;
    fill: currentColor;
}

/* 响应式断点 - 适配不同手机尺寸 */
@media (max-width: 320px) {
    .header-title h1 {
        font-size: 24px;
    }
    .consultant-item {
        padding: 12px;
        gap: 12px;
    }
    .avatar {
        width: 48px;
        height: 48px;
    }
    .name {
        font-size: 16px;
    }
    .meta {
        font-size: 12px;
        -webkit-line-clamp: 1 !important; /* 小屏只显示1行 */
    }
    .bottom-nav {
        height: 78px !important; /* 小屏缩小导航高度 */
    }
}

@media (min-width: 428px) {
    .container {
        padding: 0 20px 20px;
        padding-top: env(safe-area-inset-top);
    }
}

/* 横屏适配 */
@media (orientation: landscape) {
    .container {
        max-width: 100%;
    }
    .consultant-list {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
    }
    .consultant-item {
        width: calc(50% - 7px);
    }
    .bottom-nav {
        height: 60px !important; /* 横屏缩小导航高度 */
        padding: 8px 0 !important;
    }
    body {
        padding-bottom: 60px !important;
    }
}

/* 编辑资料按钮样式（增强优先级，确保生效） */
.edit-profile .edit-profile-btn {
    background-color: rgba(212, 175, 55, 0.15) !important;
    color: #d4af37 !important;
    border: 1px solid #d4af37 !important;
    border-radius: 18px !important;
    padding: 4px 14px !important;
    font-size: 13px !important;
    cursor: pointer !important;
    touch-action: manipulation !important;
    text-decoration: none !important; /* 去除下划线 */
    display: inline-block !important;
    background-image: none !important;
    box-shadow: none !important;
}

/* 点击反馈 */
.edit-profile .edit-profile-btn:active {
    background-color: rgba(212, 175, 55, 0.25) !important;
}
