/* 全局样式 */
:root {
  --primary-color: #8A2BE2;
  --secondary-color: #7B68EE;
  --background-color: #f8f8fc;
  --text-color: #333;
  --gray-light: #f4f4f8;
  --gray: #c0c0c8;
  --gray-dark: #8a8a96;
  --white: #ffffff;
  --black: #000000;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  --radius: 12px;
  --radius-sm: 8px;
  --font-main: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-main);
  background-color: var(--background-color);
  color: var(--text-color);
  -webkit-font-smoothing: antialiased;
}

/* 修复手机模型滚动问题：设备容器固定不动 */
.device-container {
  width: 390px;
  height: 844px;
  background-color: var(--white);
  border-radius: 44px;
  overflow: hidden; /* 防止内容溢出设备边框 */
  position: relative;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
  border: 12px solid var(--black);
  margin: 20px;
  /* 确保内容区域在边框内部 */
  display: flex;
  flex-direction: column;
}

.device-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden; /* 防止内容溢出 */
  height: 100%;
}

/* 特别重要：设置相对定位容器，使内部fixed元素相对于它定位 */
.device-container .device-content {
  position: relative;
  transform: translateZ(0); /* 创建新的堆叠上下文 */
  isolation: isolate; /* 创建新的堆叠上下文 */
}

.status-bar {
  height: 44px;
  width: 100%;
  background-color: var(--white);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  position: relative;
  z-index: 10;
}

.status-bar-left {
  display: flex;
  align-items: center;
}

.status-bar-right {
  display: flex;
  align-items: center;
}

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

.status-bar .battery, .status-bar .wifi, .status-bar .signal {
  margin-left: 6px;
}

/* 修改内容区域滚动设置，确保只有内容可滚动 */
.app-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  position: relative;
  padding-bottom: 20px;
  height: 100%;
}

/* 设备容器内的内容区域特殊处理 */
.device-container .app-content {
  padding-bottom: 20px;
}

/* 导航栏基本样式 */
.tab-bar {
  height: 80px;
  width: 100%;
  background-color: var(--white);
  display: flex;
  justify-content: space-around;
  align-items: center;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 20;
}

/* 设备容器中的特殊处理 */
.device-container .tab-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 11; /* 确保在mini-player之上 */
}

.tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--gray-dark);
  font-size: 10px;
  width: 20%;
}

.tab-item.active {
  color: var(--primary-color);
}

.tab-item i {
  font-size: 22px;
  margin-bottom: 4px;
}

/* 卡片组件 */
.card {
  background-color: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 16px;
}

/* 播客列表样式 */
.podcast-item {
  display: flex;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--gray-light);
}

.podcast-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.podcast-cover {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  margin-right: 12px;
}

.podcast-info {
  flex: 1;
}

.podcast-title {
  font-weight: 600;
  margin-bottom: 4px;
  font-size: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.podcast-author {
  color: var(--gray-dark);
  font-size: 14px;
  margin-bottom: 6px;
}

.podcast-description {
  font-size: 13px;
  color: var(--gray-dark);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

.player-progress {
  width: 100%;
  height: 4px;
  background-color: var(--gray-light);
  border-radius: 2px;
  margin: 8px 0;
  position: relative;
}

.player-progress-filled {
  position: absolute;
  height: 100%;
  background-color: var(--primary-color);
  border-radius: 2px;
}

.player-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.player-time {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--gray-dark);
}

/* 通用元素 */
.section-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 16px;
}

.btn {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn:hover {
  opacity: 0.9;
}

.btn-outline {
  background-color: transparent;
  border: 1px solid var(--primary-color);
  color: var(--primary-color);
}

.container {
  padding: 16px;
}

/* 分类标签 */
.categories {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  overflow-x: auto;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
}

.category {
  background-color: var(--gray-light);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  white-space: nowrap;
}

.category.active {
  background-color: var(--primary-color);
  color: white;
}

/* 搜索框 */
.search-bar {
  display: flex;
  background-color: var(--gray-light);
  border-radius: 20px;
  padding: 10px 16px;
  margin-bottom: 16px;
}

.search-bar input {
  flex: 1;
  border: none;
  background: none;
  font-size: 16px;
  outline: none;
  padding-left: 8px;
}

/* 播放小组件基本样式 */
.mini-player {
  height: 64px;
  background-color: var(--white);
  padding: 12px 16px;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  position: absolute;
  bottom: 80px;
  left: 0;
  right: 0;
  z-index: 15;
}

.mini-player img {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  margin-right: 12px;
  object-fit: cover; /* 确保图片正确填充容器 */
}

.mini-player-info {
  flex: 1;
}

.mini-player-title {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-player-author {
  font-size: 12px;
  color: var(--gray-dark);
}

.mini-player-controls {
  display: flex;
  gap: 16px;
}

.mini-player-controls button {
  background: none;
  border: none;
  color: var(--text-color);
  font-size: 20px;
}

/* 重要：固定元素的容器 */
.fixed-container {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
}

/* 在设备容器中固定位置的元素使用特殊处理 */
.device-container .mini-player {
  position: absolute; /* 使用absolute而非fixed */
  bottom: 80px;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 10; /* 确保在内容之上 */
} 