:root {
  --brand: #ff4d88;
  --brand-soft: #ffe3ec;
  --brand-grad: linear-gradient(135deg, #ff8fb1, #ff4d88);
  --bg: #f5f6f8;
  --card: #ffffff;
  --text: #1f2329;
  --text-sub: #6e7580;
  --text-light: #9aa0a8;
  --line: #eef0f3;
  --shadow: 0 2px 12px rgba(31, 35, 41, 0.06);
  --radius: 14px;
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { width: 100%; overflow-x: hidden; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  padding-bottom: calc(64px + env(safe-area-inset-bottom));
}

/* 顶部栏 */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 7px; flex-shrink: 0; }
.brand img { height: 32px; width: auto; display: block; }
.brand-name { font-weight: 700; font-size: 16px; color: var(--brand); letter-spacing: 0.5px; white-space: nowrap; }
.search-box {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f2f3f5;
  border-radius: 20px;
  padding: 7px 12px;
  font-size: 12px;
  color: var(--text-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-box .icon { color: var(--brand); font-size: 13px; flex-shrink: 0; }
.top-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.top-btn {
  font-size: 11px;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 12px;
  padding: 5px 8px;
  white-space: nowrap;
}

/* 通用区块 */
main { max-width: 720px; margin: 0 auto; padding: 0 0 10px; }
section { padding: 18px 14px 4px; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.sec-head h2 { font-size: 18px; font-weight: 700; letter-spacing: 0.2px; }
.sec-head h2 em { font-style: normal; color: var(--brand); }
.sec-head .more { font-size: 12px; color: var(--text-light); white-space: nowrap; }
.sec-sub { font-size: 12px; color: var(--text-sub); margin-top: -6px; margin-bottom: 12px; }

/* 首屏 */
.hero { padding-top: 20px; }
.hero h1 { font-size: 25px; line-height: 1.3; font-weight: 800; letter-spacing: 0.3px; }
.hero h1 span { color: var(--brand); }
.hero .lead { margin-top: 10px; font-size: 14px; color: var(--text-sub); }
.hero .badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.badge {
  font-size: 12px;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 20px;
  padding: 5px 11px;
  white-space: nowrap;
}
.hero-actions { display: flex; align-items: center; gap: 12px; margin-top: 18px; }
.btn-primary {
  display: inline-block;
  background: var(--brand-grad);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  padding: 12px 30px;
  border-radius: 26px;
  text-decoration: none;
  box-shadow: 0 6px 16px rgba(255, 77, 136, 0.32);
}
.btn-ghost { font-size: 13px; color: var(--text-sub); text-decoration: none; border-bottom: 1px dashed #d9dce1; padding-bottom: 2px; }

/* 轮播 */
.slider {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 6px;
}
.slider::-webkit-scrollbar, .hscroll::-webkit-scrollbar { display: none; }
.slide {
  position: relative;
  flex: 0 0 82%;
  scroll-snap-align: start;
  border-radius: 16px;
  overflow: hidden;
  background: var(--brand-soft);
  box-shadow: var(--shadow);
}
.slide img { width: 100%; height: 210px; object-fit: cover; display: block; }
.slide-mask {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 34px 14px 12px;
  background: linear-gradient(to top, rgba(0,0,0,0.78), rgba(0,0,0,0));
  color: #fff;
}
.slide-mask h3 { font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slide-mask p { font-size: 12px; opacity: 0.86; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slide-tags { display: flex; gap: 6px; margin-top: 6px; }
.slide-tags span { font-size: 10px; background: rgba(255,255,255,0.22); border-radius: 10px; padding: 2px 7px; }
.slide-corner {
  position: absolute; top: 10px; left: 10px;
  font-size: 10px; color: #fff; background: var(--brand); border-radius: 10px; padding: 3px 8px;
}

/* 分类网格 */
.cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 8px; background: var(--card); border-radius: var(--radius); padding: 16px 10px; box-shadow: var(--shadow); }
.cat-item { display: flex; flex-direction: column; align-items: center; gap: 6px; text-decoration: none; color: var(--text); }
.cat-icon {
  width: 44px; height: 44px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: var(--brand);
  background: var(--brand-soft);
}
.cat-item:nth-child(3n) .cat-icon { background: #fdeaf2; }
.cat-item:nth-child(4n) .cat-icon { background: #fff0e8; color: #ff7a45; }
.cat-name { font-size: 12px; color: var(--text-sub); white-space: nowrap; }

/* 推荐列表 */
.drama-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.drama-card { background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.cover-wrap { position: relative; background: var(--brand-soft); }
.cover-wrap img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; display: block; }
.cover-tag { position: absolute; top: 8px; left: 8px; font-size: 10px; color: #fff; background: var(--brand); border-radius: 8px; padding: 2px 7px; }
.cover-ep { position: absolute; right: 8px; bottom: 8px; font-size: 10px; color: #fff; background: rgba(0,0,0,0.55); border-radius: 8px; padding: 2px 7px; }
.drama-body { padding: 9px 10px 10px; display: flex; flex-direction: column; gap: 5px; }
.drama-title { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drama-tags { display: flex; gap: 5px; flex-wrap: wrap; }
.drama-tags span { font-size: 10px; color: var(--brand); background: var(--brand-soft); border-radius: 6px; padding: 1px 6px; }
.drama-desc {
  font-size: 12px; color: var(--text-sub);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; line-height: 1.5; min-height: 36px;
}
.drama-ops { display: flex; gap: 6px; margin-top: 2px; }
.op { flex: 1; text-align: center; font-size: 12px; color: var(--brand); background: var(--brand-soft); border-radius: 10px; padding: 6px 0; text-decoration: none; white-space: nowrap; }
.op.primary { background: var(--brand-grad); color: #fff; }

/* 横向滑动 */
.hscroll { display: flex; gap: 12px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding-bottom: 6px; }
.ai-card { flex: 0 0 46%; background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.ai-card img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; display: block; background: var(--brand-soft); }
.ai-card-body { padding: 8px 9px 10px; }
.ai-card-body h3 { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-card-body p { font-size: 11px; color: var(--text-sub); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 每日更新 */
.update-list { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 4px 14px; }
.update-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.update-item:last-child { border-bottom: none; }
.update-item img { width: 56px; height: 74px; object-fit: cover; border-radius: 9px; background: var(--brand-soft); flex-shrink: 0; }
.update-info { flex: 1; min-width: 0; }
.update-info h3 { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.update-info p { font-size: 12px; color: var(--text-sub); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.update-time { font-size: 11px; color: var(--brand); background: var(--brand-soft); border-radius: 8px; padding: 3px 8px; white-space: nowrap; flex-shrink: 0; }

/* 排行榜 */
.rank-list { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px 14px; }
.rank-item { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--text); }
.rank-item:last-child { border-bottom: none; }
.rank-no { width: 24px; font-size: 16px; font-weight: 800; color: var(--text-light); text-align: center; flex-shrink: 0; }
.rank-item.top .rank-no { color: var(--brand); }
.rank-item img { width: 42px; height: 56px; object-fit: cover; border-radius: 8px; background: var(--brand-soft); flex-shrink: 0; }
.rank-info { flex: 1; min-width: 0; }
.rank-info h3 { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-info p { font-size: 11px; color: var(--text-light); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-tag { font-size: 10px; color: var(--brand); background: var(--brand-soft); border-radius: 8px; padding: 2px 7px; white-space: nowrap; flex-shrink: 0; }

/* 缓存卡片 */
.cache-card {
  background: linear-gradient(135deg, #fff2f7, #ffe0ec);
  border-radius: 16px;
  padding: 18px 16px;
  box-shadow: var(--shadow);
}
.cache-card h2 { font-size: 17px; font-weight: 700; color: #b3265a; }
.cache-card p { font-size: 12px; color: #a24d69; margin-top: 6px; }
.cache-row { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; gap: 10px; flex-wrap: wrap; }
.cache-count { font-size: 13px; color: #8f3b56; }
.cache-count strong { font-size: 22px; color: var(--brand); margin-right: 2px; }
.cache-btn { font-size: 13px; font-weight: 700; color: #fff; background: var(--brand-grad); border-radius: 20px; padding: 8px 20px; text-decoration: none; white-space: nowrap; }

/* 图片墙 */
.wall { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.wall img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 10px; display: block; background: var(--brand-soft); }

/* 关于 */
.about-card { background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.about-card h2 { font-size: 17px; margin-bottom: 8px; }
.about-card p { font-size: 13px; color: var(--text-sub); margin-bottom: 8px; }
.about-card h3 { font-size: 14px; margin: 12px 0 6px; }
.dl-btn { display: inline-block; margin-top: 8px; }

/* 底部导航 */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 120;
  display: flex;
  background: rgba(255,255,255,0.98);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
  backdrop-filter: blur(8px);
}
.nav-item { flex: 1; text-align: center; padding: 8px 0 7px; text-decoration: none; color: var(--text-light); font-size: 11px; }
.nav-item .nav-icon { display: block; font-size: 18px; line-height: 1.2; margin-bottom: 1px; }
.nav-item.active { color: var(--brand); font-weight: 700; }

/* 页脚 */
.footer { padding: 22px 16px 26px; text-align: center; color: var(--text-light); font-size: 11px; line-height: 1.9; }
.footer p { margin-bottom: 2px; }
.footer a { color: var(--text-light); text-decoration: none; }
.footer .update-time { font-size: 11px; color: #b6bbc2; }

/* 断点 */
@media (min-width: 768px) {
  body { font-size: 15px; }
  .slide { flex: 0 0 56%; }
  .slide img { height: 300px; }
  .cat-grid { grid-template-columns: repeat(8, 1fr); }
  .drama-grid { grid-template-columns: repeat(3, 1fr); }
  .ai-card { flex: 0 0 30%; }
  .wall { grid-template-columns: repeat(5, 1fr); }
  .hero h1 { font-size: 32px; }
}
@media (min-width: 1024px) {
  main { max-width: 980px; }
  section { padding: 24px 20px 6px; }
  .slide { flex: 0 0 40%; }
  .slide img { height: 340px; }
  .drama-grid { grid-template-columns: repeat(4, 1fr); }
  .ai-card { flex: 0 0 22%; }
  .hero h1 { font-size: 38px; }
  .update-list { padding: 4px 20px; }
}