/* ============================================================
   新剧档案 Web 端 · 自适应样式（手机 H5 / 电脑端共用）
   断点：768px 以下 = 手机（底部四宫格），以上 = 电脑（顶部导航）
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: #f5f6fa;
  color: #1f2430;
  font-size: 14px;
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img { display: block; }

/* ---------- 通用卡片 ---------- */
.drama-card {
  display: flex;
  background: #fff;
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 2px 10px rgba(31, 36, 48, .06);
  transition: transform .15s ease, box-shadow .15s ease;
}
.drama-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(31, 36, 48, .10); }
.drama-card .cover {
  width: 118px; height: 166px; border-radius: 8px; flex-shrink: 0;
  background: #eceef3; object-fit: cover;
}
.drama-card .info { flex: 1; margin-left: 14px; min-width: 0; display: flex; flex-direction: column; }
.drama-card .row { margin-bottom: 7px; }
.drama-card .title-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.drama-card .title { font-size: 17px; font-weight: 700; color: #1f2430; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drama-card .side { font-size: 12px; color: #ff7a45; flex-shrink: 0; }
.tag {
  display: inline-block; font-size: 11px; padding: 2px 9px; border-radius: 6px; margin-right: 7px;
  vertical-align: middle;
}
.tag.type { background: rgba(74, 125, 255, .12); color: #4a7dff; }
.drama-card .actors { font-size: 12px; color: #8b5cf6; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drama-card .summary { font-size: 12px; color: #8a90a0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- 置顶卡片：小程序码 ---------- */
.qr-card {
  position: sticky;
  top: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 10px 16px;
  background: #fff;
  border-bottom: 1px solid #eef0f4;
  box-shadow: 0 2px 10px rgba(31, 36, 48, .05);
}
.qr-card.hidden { display: none; }
.qr-img {
  display: block;
  width: 64px; height: 64px; max-width: 100%;
  border-radius: 8px; flex-shrink: 0;
  background: #fff; object-fit: cover;
}
.qr-text { flex: 1; min-width: 0; }
.qr-text h3 { font-size: 15px; font-weight: 700; color: #1f2430; margin-bottom: 3px; }
.qr-text p { font-size: 12px; color: #6b7280; }
.qr-text .qr-tip { color: #9aa0b0; font-size: 11px; margin-top: 2px; }
.qr-close {
  flex-shrink: 0; border: none; background: transparent; color: #9aa0b0;
  font-size: 14px; padding: 6px; line-height: 1; border-radius: 6px;
}
.qr-close:hover { background: #f0f1f5; color: #1f2430; }
@media (min-width: 768px) {
  .qr-card {
    top: 58px;
    max-width: 1120px;
    margin: 12px auto 0;
    padding: 12px 56px 12px 20px;
    justify-content: center;   /* 二维码+文字整体居中 */
    border: 1px solid #eef0f4;
    border-radius: 14px;
    box-shadow: 0 4px 14px rgba(31, 36, 48, .06);
  }
  .qr-close { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); }
  .qr-img { width: 84px; height: 84px; }
  .qr-text h3 { font-size: 16px; }
  .qr-text p { font-size: 13px; }
}

/* ---------- 桌面端顶部导航（≥768px） ---------- */
.topnav { display: none; }
@media (min-width: 768px) {
  .topnav {
    display: block;
    position: sticky; top: 0; z-index: 100;
    background: #fff;
    border-bottom: 1px solid #eef0f4;
  }
  .topnav-inner {
    max-width: 1120px; margin: 0 auto; padding: 0 20px;
    height: 58px; display: flex; align-items: center; gap: 28px;
  }
  .topnav .logo { font-size: 19px; font-weight: 800; color: #1f2430; white-space: nowrap; }
  .topnav-menu { display: flex; gap: 22px; }
  .topnav-menu a { font-size: 15px; color: #6b7280; padding: 4px 2px; border-bottom: 2px solid transparent; }
  .topnav-menu a:hover { color: #1f2430; }
  .topnav-menu a.on { color: #ff7a45; font-weight: 600; border-color: #ff7a45; }
}

/* ---------- 移动端底部导航（<768px） ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 100;
  display: flex; background: #fff; border-top: 1px solid #eef0f4;
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar .tab {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  padding: 8px 0 6px; color: #9aa0b0;
}
.tabbar .tab-icon { font-size: 20px; line-height: 1.2; }
.tabbar .tab-name { font-size: 10px; margin-top: 3px; }
.tabbar .tab.on { color: #ff7a45; }
@media (min-width: 768px) { .tabbar { display: none; } }

/* ---------- 主容器 ---------- */
.app { min-height: calc(100vh - 120px); padding-bottom: 90px; }
@media (min-width: 768px) {
  .app { max-width: 1120px; margin: 0 auto; padding: 24px 20px 60px; min-height: calc(100vh - 58px); }
}
.loading { text-align: center; color: #9aa0b0; padding: 80px 0; font-size: 14px; }
.empty { text-align: center; color: #9aa0b0; padding: 60px 20px; font-size: 13px; }

/* ---------- 页面头 ---------- */
.page-head { padding: 18px 16px 10px; }
.page-head h1 { font-size: 21px; font-weight: 800; color: #1f2430; text-align: center; }
.sub-title { font-size: 12px; color: #6b7280; padding: 2px 16px 8px; text-align: center; }
@media (min-width: 768px) {
  .page-head { padding: 6px 0 14px; }
  .page-head h1 { font-size: 24px; }
  .sub-title { padding: 0 0 10px; }
}

/* ---------- 筛选胶囊 ---------- */
.chips {
  display: flex; gap: 8px; overflow-x: auto; padding: 4px 16px 14px;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0; border: none; border-radius: 20px; padding: 7px 18px;
  font-size: 13px; color: #6b7280; background: #eef0f4; transition: all .15s;
}
.chip.on { background: #ff7a45; color: #fff; font-weight: 600; }
@media (min-width: 768px) {
  .chips { flex-wrap: wrap; overflow: visible; padding: 0 0 18px; }
}

/* ---------- 卡片网格 ---------- */
.card-grid { padding: 0 16px; }
.card-grid .drama-card { margin-bottom: 12px; }
@media (min-width: 768px) {
  .card-grid { padding: 0; }
  .card-grid.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(430px, 1fr)); gap: 16px; }
  .card-grid.grid .drama-card { margin-bottom: 0; }
  .card-grid .drama-card .cover { width: 132px; height: 186px; }
  .card-grid .drama-card .title { font-size: 18px; }
}

/* ---------- 今日开播分组 ---------- */
.section { margin-top: 6px; }
.section-head { display: flex; align-items: baseline; gap: 10px; padding: 14px 16px 10px; }
.section-head h2 { font-size: 16px; font-weight: 700; }
.section-date { font-size: 12px; color: #8a90a0; }
@media (min-width: 768px) {
  .section-head { padding: 18px 0 12px; }
  .section-head h2 { font-size: 18px; }
  .section .card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(430px, 1fr)); gap: 16px; }
  .section .card-grid .drama-card { margin-bottom: 0; }
}

/* ---------- 详情页 ---------- */
.detail .hero { position: relative; height: 240px; overflow: hidden; }
.detail .hero-img { width: 100%; height: 100%; object-fit: cover; object-position: center 30%; }
.detail .hero-mask { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20,22,31,.05) 45%, rgba(20,22,31,.78) 100%); }
.detail .hero-info {
  position: absolute; left: 16px; right: 16px; bottom: 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.detail .hero-title { font-size: 22px; font-weight: 800; color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,.4); flex: 1; }
.hero-status { font-size: 11px; padding: 4px 12px; border-radius: 8px; background: rgba(20,22,31,.45); color: #fff; flex-shrink: 0; }
.hero-status.st-up { color: #9db8ff; }
.hero-status.st-air { color: #ffc39a; }
.hero-status.st-end { color: #cfd4dd; }

.detail-body { padding: 14px 16px; max-width: 760px; margin: 0 auto; }
@media (min-width: 768px) {
  .detail .hero { height: 320px; border-radius: 0 0 18px 18px; max-width: 1120px; margin: 0 auto; }
  .detail-body { padding: 20px 0; }
}

.card {
  background: #fff; border-radius: 14px; padding: 18px; margin-bottom: 14px;
  box-shadow: 0 2px 10px rgba(31, 36, 48, .06);
}
.card-title { font-size: 16px; font-weight: 700; margin-bottom: 12px; }
.info-row { display: flex; padding: 9px 0; border-bottom: 1px solid #eef0f4; }
.info-row:last-child { border-bottom: none; }
.info-row .k { width: 90px; color: #8a90a0; flex-shrink: 0; }
.info-row .v { flex: 1; color: #1f2430; word-break: break-all; }
.chips-inline { display: flex; flex-wrap: wrap; gap: 8px; }
.platform-chip {
  display: inline-flex; align-items: center; padding: 5px 14px; border-radius: 18px;
  font-size: 12px; color: #fff; box-shadow: 0 2px 8px rgba(31,36,48,.15);
  transition: transform .12s;
}
.platform-chip:hover { transform: translateY(-1px); }
.summary { color: #4b5563; font-size: 14px; line-height: 1.75; }

.like-card { display: flex; gap: 12px; }
.like-btn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid transparent; border-radius: 10px; padding: 12px 0;
  font-size: 14px; color: #4b5563; background: #f0f1f5; transition: all .15s;
}
.like-btn .like-emoji { font-size: 16px; }
.like-btn:hover { border-color: #ffd9c4; }
.like-btn.voted { background: rgba(255, 122, 69, .15); color: #ff7a45; }

/* ---------- 评论 ---------- */
.comment-form { margin-bottom: 16px; }
.input {
  width: 100%; border: none; outline: none; border-radius: 10px;
  background: #f0f1f5; padding: 0 14px; height: 42px;
  font-size: 14px; color: #1f2430; margin-bottom: 10px; box-sizing: border-box;
}
.textarea { height: 96px; padding: 12px 14px; resize: vertical; line-height: 1.6; }
.captcha-row { display: flex; align-items: center; gap: 10px; }
.captcha-input { flex: 1; margin-bottom: 10px; }
.captcha-img { width: 110px; height: 42px; border-radius: 8px; background: #f5f5f5; cursor: pointer; margin-bottom: 10px; }
.btn {
  border: 1px solid #4a7dff; background: #4a7dff; color: #fff;
  border-radius: 8px; padding: 8px 16px; font-size: 14px;
}
.btn.ghost { background: #fff; color: #4a7dff; }
.btn.sm { padding: 6px 12px; font-size: 12px; }
.btn.submit {
  width: 100%; border: none; background: #ff7a45; color: #fff;
  border-radius: 10px; padding: 12px 0; font-size: 15px;
}
.btn.submit:active { opacity: .85; }
.no-comment { text-align: center; color: #9aa0b0; padding: 24px 0; font-size: 13px; }
.comment { border-top: 1px solid #eef0f4; padding: 12px 0; }
.comment-head { display: flex; justify-content: space-between; margin-bottom: 4px; }
.comment-name { color: #4a7dff; font-size: 13px; font-weight: 600; }
.comment-time { color: #9aa0b0; font-size: 11px; }
.comment-content { color: #374151; font-size: 14px; line-height: 1.6; word-break: break-word; }

/* ---------- 热播榜（猫眼网播热度） ---------- */
.heat-sub { color: #9aa0b0; font-size: 12px; margin: 0 0 14px; }
.heat-list { display: flex; flex-direction: column; gap: 12px; }
.heat-row {
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 4px 16px rgba(31, 36, 48, .06);
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.heat-row:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(31, 36, 48, .10); }
.heat-row.no-link { cursor: default; }
.heat-row.no-link:hover { transform: none; box-shadow: 0 4px 16px rgba(31, 36, 48, .06); }
.heat-row .rank {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 800;
  flex-shrink: 0;
  background: #eef0f4;
  color: #8a90a0;
}
.heat-row .rank.rk1 { background: linear-gradient(135deg, #ffd76a, #ffb52e); color: #7a4a00; }
.heat-row .rank.rk2 { background: linear-gradient(135deg, #e8edf5, #c3ccdb); color: #5b6472; }
.heat-row .rank.rk3 { background: linear-gradient(135deg, #f3c9a0, #e0a26b); color: #7a4a1d; }
.heat-row .heat-body { flex: 1; margin-left: 14px; min-width: 0; }
.heat-name-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.heat-name { font-size: 16px; font-weight: 700; color: #1f2430; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.heat-num { font-size: 17px; font-weight: 700; color: #ff7a45; flex-shrink: 0; }
.heat-meta { margin-top: 6px; font-size: 12px; color: #8a90a0; }
.heat-row .arrow { flex-shrink: 0; font-size: 20px; color: #c3c9d6; margin-left: 8px; }

@media (min-width: 768px) {
  .like-btn { font-size: 15px; padding: 14px 0; }
  .btn.submit { max-width: 240px; }
  .heat-row .rank { width: 42px; height: 42px; font-size: 19px; }
  .heat-name { font-size: 17px; }
  .heat-num { font-size: 18px; }
  .heat-meta { font-size: 13px; }
}
