/* 通用样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-font-smoothing: antialiased;
    max-width: 100%; /* 确保所有元素不超出其容器 */
    overflow-x: hidden; /* 防止横向溢出 */
}

/* 设置根字体大小，便于使用rem */
html {
    font-size: 16px;
    height: 100%;
    overflow: hidden; /* 防止整个页面滚动 */
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background-color: #f9f9f9;
    color: #333;
    line-height: 1.5;
    width: 390px;
    height: 844px;
    position: relative;
    overflow: hidden;
    margin: 0 auto;
    border-radius: 50px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
}

/* iPhone 15 Pro模拟样式 */
.phone-container {
    width: 100%;
    height: 100%;
    position: relative;
    background-color: #fff;
    border-radius: 50px;
    overflow: hidden;
}

/* 状态栏 */
.status-bar {
    height: 44px;
    background-color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    position: relative;
    overflow: hidden; /* 防止内容溢出 */
    flex-shrink: 0; /* 防止被压缩 */
}

.status-bar__time {
    font-size: 14px;
    font-weight: 600;
}

.status-bar__icons {
    display: flex;
    align-items: center;
    gap: 5px;
    max-width: 30%; /* 限制图标区域宽度 */
}

.status-bar__icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0; /* 防止图标被压缩 */
}

/* 应用主容器 */
.app-container {
    width: 100%;
    height: calc(100% - 44px); /* 减去状态栏的高度 */
    overflow: hidden; /* 容器本身不滚动 */
    position: relative;
    background-color: #f9f9f9;
    display: flex;
    flex-direction: column;
}

/* 内容区域 - 唯一允许滚动的部分 */
.content {
    flex: 1;
    overflow-y: auto; /* 只有内容区域可以垂直滚动 */
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch; /* 平滑滚动 */
    padding: 15px;
    padding-bottom: 130px; /* 为mini播放器和导航栏留出空间 */
}

.content.scrollable {
    overflow-y: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.content.scrollable::-webkit-scrollbar {
    display: none; /* Chrome, Safari and Opera */
}

/* 底部导航栏 */
.nav-bar {
    height: 50px;
    background-color: #fff;
    display: flex;
    justify-content: space-between;
    border-top: 1px solid #eee;
    position: absolute; /* 改为absolute定位，相对于phone-container */
    bottom: 0;
    left: 0;
    width: 100%; /* 使用100%宽度填充容器 */
    z-index: 10;
    overflow: hidden; /* 防止内容溢出 */
    padding: 0; /* 确保没有内边距 */
    border-bottom-left-radius: 50px; /* 添加圆角与手机外框匹配 */
    border-bottom-right-radius: 50px; /* 添加圆角与手机外框匹配 */
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #999;
    height: 100%;
    flex: 1; /* 每个项目平均分配空间 */
    max-width: 25%; /* 确保导航项不超过容器的四分之一 */
}

.nav-item.active {
    color: #e40000;
}

.nav-item__icon {
    width: 24px;
    height: 24px;
    margin-bottom: 2px;
    flex-shrink: 0; /* 防止图标被压缩 */
}

.nav-item__text {
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Mini播放器样式 */
.mini-player {
    position: absolute; /* 改为absolute定位，相对于phone-container */
    bottom: 50px; /* 定位在导航栏上方 */
    left: 0;
    width: 100%; /* 使用100%宽度填充容器 */
    height: 60px;
    background-color: #fff;
    display: flex;
    align-items: center;
    padding: 0 15px;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    z-index: 9;
    overflow: hidden; /* 防止内容溢出 */
    flex-shrink: 0; /* 防止被压缩 */
}

.mini-player__cover {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    overflow: hidden;
    margin-right: 10px;
    flex-shrink: 0; /* 防止被压缩 */
}

.mini-player__cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mini-player__info {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.mini-player__title {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mini-player__artist {
    font-size: 12px;
    color: #999;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mini-player__controls {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-left: auto;
    flex-shrink: 0; /* 防止控制按钮被压缩 */
}

.mini-player__btn {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    flex-shrink: 0; /* 防止按钮被压缩 */
}

.mini-player__btn svg {
    width: 100%;
    height: 100%;
    max-width: 24px; /* 限制图标最大尺寸 */
    max-height: 24px; /* 限制图标最大尺寸 */
}

/* 网易云音乐主色调 */
.primary-color {
    color: #d33a31;
}

.bg-primary {
    background-color: #d33a31;
}

/* 通用动画 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

/* 卡片样式 */
.card {
    background-color: #fff;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* 滚动区域 */
.scrollable {
    overflow-y: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.scrollable::-webkit-scrollbar {
    display: none; /* Chrome, Safari and Opera */
}

/* 按钮样式 */
.btn {
    padding: 10px 20px;
    border-radius: 25px;
    border: none;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: #d33a31;
    color: white;
}

.btn-outline {
    background-color: transparent;
    border: 1px solid #d33a31;
    color: #d33a31;
}

/* 歌曲列表项 */
.song-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
    overflow: hidden; /* 防止内容溢出 */
}

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

.song-item__cover {
    width: 50px;
    height: 50px;
    border-radius: 6px;
    margin-right: 12px;
    overflow: hidden;
    flex-shrink: 0;
}

.song-item__cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.song-item__info {
    flex: 1;
    overflow: hidden;
}

.song-item__title {
    font-size: 15px;
    font-weight: 500;
    color: #333;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.song-item__artist {
    font-size: 12px;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.song-item__action {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    flex-shrink: 0; /* 防止被压缩 */
}

.song-item__action svg {
    width: 20px;
    height: 20px;
    max-width: 20px; /* 限制最大宽度 */
    max-height: 20px; /* 限制最大高度 */
}

/* 播放控制器样式 */
.player-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}

.player-control-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.player-progress {
    width: 100%;
    height: 4px;
    background-color: #eee;
    border-radius: 2px;
    position: relative;
    margin: 10px 0;
}

.player-progress__bar {
    position: absolute;
    height: 100%;
    background-color: #d33a31;
    border-radius: 2px;
}

.player-progress__handle {
    position: absolute;
    width: 12px;
    height: 12px;
    background-color: #d33a31;
    border-radius: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
}

/* 标题栏 */
.header {
    position: relative;
    height: 200px;
    overflow: hidden; /* 防止内容溢出 */
}

.header__title {
    font-size: 17px;
    font-weight: 600;
}

.header__action {
    display: flex;
    align-items: center;
    gap: 15px;
    max-width: 30%; /* 限制操作区域宽度 */
}

.header__action svg {
    width: 24px;
    height: 24px;
}

/* 页面内容区 */
.content {
    padding: 15px;
    height: calc(100% - 83px); /* 减去底部导航栏的高度 */
    overflow-y: auto;
}

/* 网格布局 */
.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

/* 音乐封面 */
.cover {
    width: 100%;
    padding-top: 100%; /* 保持1:1比例 */
    position: relative;
    border-radius: 8px;
    overflow: hidden;
}

.cover img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 专辑/歌单信息 */
.album-info {
    margin-bottom: 20px;
}

.album-info__title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
}

.album-info__artist {
    font-size: 14px;
    color: #888;
}

/* 页面过渡效果 */
.page-transition {
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* 链接样式 */
a {
    text-decoration: none;
    color: inherit;
} 