:root {
  --brand-pink: #ff4d88;
  --brand-pink-light: #ffe5ed;
  --brand-pink-dark: #d93b70;
  --bg-page: #f7f7f9;
  --bg-card: #ffffff;
  --text-main: #222222;
  --text-sub: #666666;
  --text-light: #999999;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --shadow-card: 0 4px 12px rgba(0,0,0,0.04);
  --shadow-float: 0 8px 24px rgba(255,77,136,0.2);
  --safe-bottom: env(safe-area-inset-bottom, 16px);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
  padding-bottom: calc(64px + var(--safe-bottom));
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { display: block; max-width: 100%; object-fit: cover; }

/* 骨架屏效果 */
.skeleton-img {
  background: linear-gradient(90deg, #ffeff4 25%, #ffe0e9 50%, #ffeff4 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
}
@keyframes skeleton-loading {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

/* 顶部栏 */
.top-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(10px);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(0,0,0,0.03);
}
.brand-area { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.brand-logo { height: 32px; width: auto; }
.brand-name { font-size: 18px; font-weight: 800; color: var(--brand-pink); letter-spacing: 1px; }
.search-bar {
  flex: 1;
  background: var(--bg-page);
  border-radius: 20px;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.search-bar input {
  border: none;
  background: transparent;
  font-size: 13px;
  color: var(--text-main);
  width: 100%;
  outline: none;
}
.search-bar input::placeholder { color: var(--text-light); }
.header-icons { display: flex; gap: 12px; flex-shrink: 0; }
.icon-btn { width: 24px; height: 24px; background: var(--brand-pink-light); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--brand-pink); }

/* 主内容区 */
.main-container { padding: 16px; display: flex; flex-direction: column; gap: 24px; }

/* 轮播 Banner */
.hero-banner {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 16/9;
  box-shadow: var(--shadow-card);
}
.hero-banner img { width: 100%; height: 100%; }
.banner-content {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 20px 16px 16px;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0) 100%);
  color: #fff;
}
.banner-title { font-size: 20px; font-weight: 800; margin-bottom: 6px; text-shadow: 0 2px 4px rgba(0,0,0,0.5); }
.banner-tags { display: flex; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.tag-badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(4px);
}
.tag-badge.highlight { background: var(--brand-pink); color: #fff; font-weight: bold; }

/* 分类导航 */
.category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px 8px;
  background: var(--bg-card);
  padding: 20px 16px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}
.category-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.cat-icon {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  background: var(--brand-pink-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--brand-pink);
}
.cat-name { font-size: 12px; font-weight: 500; color: var(--text-main); }

/* 通用区块 */
.section-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 12px; }
.section-title { font-size: 18px; font-weight: 800; color: var(--text-main); }
.section-more { font-size: 12px; color: var(--text-light); }

/* 推荐列表双列 */
.drama-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.drama-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
}
.drama-cover-wrap {
  position: relative;
  aspect-ratio: 3/4;
  width: 100%;
}
.drama-cover-wrap img { width: 100%; height: 100%; }
.ep-count {
  position: absolute;
  bottom: 6px; right: 6px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
}
.drama-info { padding: 10px; }
.drama-title { font-size: 14px; font-weight: 700; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drama-desc {
  font-size: 11px;
  color: var(--text-sub);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 8px;
  height: 33px;
}
.drama-actions { display: flex; gap: 6px; }
.btn-sm {
  flex: 1;
  padding: 4px 0;
  text-align: center;
  font-size: 11px;
  border-radius: 12px;
  background: var(--bg-page);
  color: var(--text-main);
}
.btn-sm.primary { background: var(--brand-pink); color: #fff; }

/* 横向滑动区 */
.h-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: none;
}
.h-scroll::-webkit-scrollbar { display: none; }
.h-card { flex-shrink: 0; width: 120px; }
.h-cover {
  width: 120px;
  aspect-ratio: 3/4;
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
  margin-bottom: 6px;
}
.h-cover img { width: 100%; height: 100%; }
.h-title { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.h-tag { font-size: 10px; color: var(--brand-pink); margin-top: 2px; }

/* 每日更新列表 */
.list-container {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.update-item { display: flex; gap: 12px; align-items: center; }
.update-thumb {
  width: 60px;
  aspect-ratio: 3/4;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
}
.update-thumb img { width: 100%; height: 100%; }
.update-info { flex: 1; overflow: hidden; }
.update-title { font-size: 14px; font-weight: 600; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.update-meta { font-size: 12px; color: var(--brand-pink); }

/* 排行榜 */
.rank-list {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.rank-item { display: flex; align-items: center; gap: 12px; }
.rank-num {
  font-size: 18px;
  font-weight: 900;
  color: var(--text-light);
  width: 24px;
  text-align: center;
  font-style: italic;
}
.rank-item:nth-child(1) .rank-num,
.rank-item:nth-child(2) .rank-num,
.rank-item:nth-child(3) .rank-num {
  color: var(--brand-pink);
}
.rank-cover { width: 44px; height: 58px; border-radius: 4px; overflow: hidden; }
.rank-cover img { width: 100%; height: 100%; }
.rank-info { flex: 1; }
.rank-title { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.rank-tags { display: flex; gap: 6px; }
.badge-mini { font-size: 10px; color: var(--brand-pink); border: 1px solid var(--brand-pink); padding: 0 4px; border-radius: 4px; }
.rank-heat { font-size: 12px; color: var(--text-light); }

/* 离线缓存入口 */
.cache-card {
  background: linear-gradient(135deg, #fff 0%, #ffe5ed 100%);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(255,77,136,0.1);
}
.cache-info h3 { font-size: 16px; font-weight: 800; color: var(--brand-pink-dark); margin-bottom: 4px; }
.cache-info p { font-size: 12px; color: var(--text-sub); }
.btn-cache {
  background: var(--brand-pink);
  color: #fff;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-float);
}

/* 下载区域 */
.download-section {
  text-align: center;
  padding: 24px 16px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}
.download-section h2 { font-size: 18px; margin-bottom: 12px; }
.btn-download {
  display: inline-block;
  background: var(--brand-pink);
  color: #fff;
  padding: 12px 32px;
  border-radius: 24px;
  font-size: 16px;
  font-weight: bold;
  box-shadow: var(--shadow-float);
}

/* 底部导航 */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: rgba(255,255,255,0.98);
  backdrop-filter: blur(10px);
  display: flex;
  justify-content: space-around;
  padding: 8px 0 calc(8px + var(--safe-bottom));
  border-top: 1px solid rgba(0,0,0,0.05);
  z-index: 100;
}
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: var(--text-light);
  font-size: 10px;
}
.nav-item.active { color: var(--brand-pink); }
.nav-icon { font-size: 20px; }

/* 页脚 */
.page-footer {
  text-align: center;
  padding: 24px 16px;
  font-size: 11px;
  color: var(--text-light);
  line-height: 1.8;
}
.page-footer a { color: var(--text-light); }

/* 响应式 */
@media (min-width: 768px) {
  .main-container { max-width: 768px; margin: 0 auto; padding: 24px; gap: 32px; }
  .hero-banner { aspect-ratio: 21/9; }
  .category-grid { grid-template-columns: repeat(8, 1fr); }
  .drama-grid { grid-template-columns: repeat(3, 1fr); }
  .drama-title { font-size: 15px; }
  .drama-desc { font-size: 12px; height: 36px; }
  .btn-sm { font-size: 12px; padding: 6px 0; }
  .h-card { width: 140px; }
  .h-cover { width: 140px; }
  .bottom-nav { display: none; }
  body { padding-bottom: 0; }
}
@media (min-width: 1024px) {
  .main-container { max-width: 1024px; }
  .drama-grid { grid-template-columns: repeat(4, 1fr); }
  .hero-banner { aspect-ratio: 24/9; }
}