/* ==========================================================================
   疯情短剧 · 全站样式（暗色影院风 · 移动优先 · 自适应 PC/手机）
   ========================================================================== */

:root {
  --bg:       #ffffff;
  --bg-2:     #f7f8fa;
  --card:     #ffffff;
  --card-2:   #f1f3f6;
  --line:     #e6e8ec;
  --text:     #171a1f;
  --text-2:   #5a6472;
  --text-3:   #8d96a3;
  --brand:    #ff3b5c;
  --brand-2:  #ff7a59;
  --brand-g:  linear-gradient(135deg, #ff3b5c, #ff7a59);
  --radius:   12px;
  --shadow:   0 2px 10px rgba(20, 28, 40, .07);
  --header-h: 58px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
h1,h2,h3,h4 { margin: 0; font-weight: 700; }
ul { margin: 0; padding: 0; list-style: none; }

.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 14px; }

/* ---------- 顶栏 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(255,255,255,.88);
  backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  height: var(--header-h);
  display: flex; align-items: center; gap: 14px;
}
.logo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 17px; flex: none; white-space: nowrap; }
.logo-mark {
  width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center;
  background: var(--brand-g); color: #fff; font-size: 15px; box-shadow: 0 3px 9px rgba(255,59,92,.3);
}
.logo span:last-child { letter-spacing: .5px; }

.main-nav { display: flex; align-items: center; gap: 4px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; }
.main-nav::-webkit-scrollbar { display: none; }
.main-nav a {
  padding: 6px 11px; border-radius: 999px; font-size: 14px; color: var(--text-2);
  white-space: nowrap; flex: none; transition: .18s;
}
.main-nav a:hover { color: var(--text); background: var(--card-2); }
.main-nav a.on { color: #fff; background: var(--brand-g); font-weight: 600; }

.header-search { display: flex; align-items: center; flex: none; }
.header-search input {
  width: 160px; height: 34px; border-radius: 999px 0 0 999px; border: 1px solid var(--line);
  border-right: 0; background: var(--bg-2); padding: 0 14px; outline: none; transition: .2s;
}
.header-search input:focus { border-color: var(--brand); background: #fff; }
.header-search button {
  height: 34px; padding: 0 14px; border: 0; border-radius: 0 999px 999px 0;
  background: var(--brand-g); color: #fff; cursor: pointer;
}

/* ---------- 主体 ---------- */
.site-main { padding: 20px 14px 60px; max-width: 1240px; margin: 0 auto; }

.block { margin-top: 34px; }
.block:first-child { margin-top: 0; }
.block-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.block-title { font-size: 19px; display: flex; align-items: center; gap: 9px; }
.block-title::before { content: ""; width: 4px; height: 18px; border-radius: 3px; background: var(--brand-g); }
.block-title small { font-size: 12px; font-weight: 400; color: var(--text-3); }
.more { font-size: 13px; color: var(--text-2); }
.more:hover { color: var(--brand); }

/* ---------- 推荐位（白底：左封面 + 右信息） ---------- */
.hero {
  display: flex; border-radius: 16px; overflow: hidden;
  background: linear-gradient(135deg, #ffffff 45%, #fff4f5 100%);
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
.hero-bg { position: relative; flex: none; width: 215px; background: var(--card-2); }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; }
.hero-bg::after { display: none; }
.hero-inner {
  flex: 1; min-width: 0; padding: 26px 28px;
  display: flex; flex-direction: column; justify-content: center; gap: 11px;
}
.hero h1 { font-size: 26px; line-height: 1.28; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px; font-size: 12.5px; color: var(--text-2); align-items: center; }
.hero-meta b { color: #e08c00; font-size: 15px; }
.hero-intro { font-size: 13.5px; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hero-btns { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.hero-thumbs { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.hero-thumbs a {
  display: flex; align-items: center; gap: 7px; padding: 4px 12px 4px 4px; border-radius: 999px;
  background: #fff; border: 1px solid var(--line); font-size: 12.5px; color: var(--text-2); transition: .2s;
}
.hero-thumbs a:hover { border-color: var(--brand); color: var(--text); }
.hero-thumbs a.on { background: var(--brand-g); border-color: transparent; color: #fff; font-weight: 600; }
.hero-thumbs img { width: 26px; height: 34px; object-fit: cover; border-radius: 5px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 20px;
  border-radius: 999px; border: 0; cursor: pointer; font-size: 14px; font-weight: 600;
  transition: .2s; white-space: nowrap;
}
.btn-primary { background: var(--brand-g); color: #fff; box-shadow: 0 4px 14px rgba(255,59,92,.28); }
.btn-primary:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn-ghost { background: var(--card-2); color: var(--text); border: 1px solid var(--line); }
.btn-ghost:hover { background: #e8ebf0; }
.btn-sm { height: 32px; padding: 0 14px; font-size: 13px; }

/* ---------- 分类 chips ---------- */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips a {
  padding: 7px 15px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--line);
  font-size: 13.5px; color: var(--text-2); transition: .18s;
}
.chips a:hover { color: var(--text); border-color: var(--brand); }
.chips a.on { background: var(--brand-g); color: #fff; border-color: transparent; font-weight: 600; }

/* ---------- 海报网格 ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(138px, 1fr)); gap: 14px; }
.card { display: block; }
.card .poster {
  position: relative; aspect-ratio: 3/4; border-radius: var(--radius); overflow: hidden;
  background: var(--card-2); box-shadow: 0 2px 8px rgba(20,28,40,.09); transition: .25s;
}
.card:hover .poster { transform: translateY(-4px); box-shadow: 0 10px 22px rgba(20,28,40,.16); }
.card .poster img { width: 100%; height: 100%; object-fit: cover; }
.card .tag {
  position: absolute; top: 7px; left: 7px; padding: 2px 7px; border-radius: 6px;
  background: rgba(0,0,0,.6); font-size: 11px; color: #fff; backdrop-filter: blur(4px);
}
.card .tag.hot { background: var(--brand-g); font-weight: 600; }
.card .bar {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 8px 6px; font-size: 11.5px;
  color: #e8eaed; background: linear-gradient(transparent, rgba(0,0,0,.85));
  display: flex; justify-content: space-between; gap: 6px;
}
.card .tt {
  margin-top: 8px; font-size: 13.5px; font-weight: 600; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
.card .sub { font-size: 12px; color: var(--text-3); margin-top: 3px; }

/* ---------- 排行榜 ---------- */
.rank { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 10px 22px; }
.rank-item { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 10px; transition: .18s; }
.rank-item:hover { background: var(--card); }
.rank-no {
  flex: none; width: 26px; text-align: center; font-size: 17px; font-weight: 800;
  font-style: italic; color: var(--text-3);
}
.rank-item:nth-child(1) .rank-no { color: #e5484d; }
.rank-item:nth-child(2) .rank-no { color: #ef7c1a; }
.rank-item:nth-child(3) .rank-no { color: #d9a300; }
.rank-thumb { flex: none; width: 46px; height: 62px; border-radius: 8px; overflow: hidden; background: var(--card-2); }
.rank-thumb img { width: 100%; height: 100%; object-fit: cover; }
.rank-info { min-width: 0; flex: 1; }
.rank-info .t { display: block; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-info .m { display: block; font-size: 12px; color: var(--text-3); margin-top: 3px; }
.rank-info .m em { font-style: normal; color: #e08c00; }

/* ---------- 详情页 ---------- */
.detail-top { display: flex; gap: 22px; }
.detail-cover { flex: none; width: 210px; border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); }
.detail-cover img { width: 100%; aspect-ratio: 3/4; object-fit: cover; }
.detail-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.detail-info h1 { font-size: 25px; line-height: 1.3; }
.meta-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13px; color: var(--text-2); }
.meta-row .chip { padding: 3px 10px; border-radius: 6px; background: var(--card-2); font-size: 12.5px; }
.meta-row .score { color: #e08c00; font-size: 20px; font-weight: 800; }
.meta-row .score small { font-size: 12px; font-weight: 400; }
.detail-intro { font-size: 14px; color: var(--text-2); line-height: 1.75; }
.detail-acts { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 2px; }

/* 选集 */
.eps { display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 9px; }
.eps a, .eps span {
  display: grid; place-items: center; height: 42px; border-radius: 8px; font-size: 13px;
  background: var(--bg-2); border: 1px solid var(--line); color: var(--text-2); transition: .15s;
}
.eps a:hover { border-color: var(--brand); color: #fff; background: var(--card-2); }
.eps a.cur { background: var(--brand-g); color: #fff; border-color: transparent; font-weight: 700; }

/* ---------- 播放页 ---------- */
.play-wrap { display: grid; grid-template-columns: 1fr; gap: 20px; }
.player { border-radius: 14px; overflow: hidden; background: #000; box-shadow: var(--shadow); position: relative; }
.player video { width: 100%; aspect-ratio: 16/9; display: block; background: #000; }
.player-err {
  position: absolute; inset: 0; display: none; place-items: center; text-align: center;
  background: #0b0d11; color: var(--text-2); font-size: 14px; padding: 20px;
}
.player-err.show { display: grid; }
.play-head { margin-top: 14px; }
.play-head h1 { font-size: 19px; }
.play-head .sub { color: var(--text-3); font-size: 13px; margin-top: 5px; }
.play-nav { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.play-nav .btn[disabled] { opacity: .4; pointer-events: none; }

.play-side { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.play-side h3 { font-size: 15px; margin-bottom: 12px; display: flex; justify-content: space-between; }
.play-side h3 span { font-size: 12px; color: var(--text-3); font-weight: 400; }

/* ---------- 分页 ---------- */
.pager { display: flex; gap: 7px; justify-content: center; flex-wrap: wrap; margin-top: 26px; }
.pager .pg {
  min-width: 38px; height: 38px; padding: 0 12px; border-radius: 9px; display: grid; place-items: center;
  background: var(--bg-2); border: 1px solid var(--line); font-size: 13.5px; color: var(--text-2);
}
.pager a.pg:hover { border-color: var(--brand); color: #fff; }
.pager .pg.on { background: var(--brand-g); color: #fff; border-color: transparent; font-weight: 700; }
.pager .pg.off { opacity: .35; }
.pager .pg.dots { border: 0; background: transparent; }

/* ---------- 空状态 ---------- */
.empty { text-align: center; padding: 70px 20px; color: var(--text-3); }
.empty .big { font-size: 46px; margin-bottom: 12px; }

/* ---------- 页脚 ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-2); padding: 26px 0; margin-top: 40px; }
.footer-inner { text-align: center; color: var(--text-3); font-size: 12.5px; line-height: 2; }
.footer-inner a { color: var(--text-2); }
.footer-inner a:hover { color: var(--brand); }

/* ---------- 响应式 ---------- */
@media (max-width: 860px) {
  .detail-top { flex-direction: column; gap: 16px; }
  .detail-cover { width: 150px; }
  .hero-bg { width: 150px; }
  .hero h1 { font-size: 21px; }
  .hero-inner { padding: 20px 18px; gap: 9px; }
}
@media (max-width: 640px) {
  :root { --header-h: 52px; }
  .logo span:last-child { display: none; }
  .header-search input { width: 110px; }
  .main-nav a { padding: 5px 9px; font-size: 13px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 10px; }
  .card .tt { font-size: 12.5px; }
  .detail-cover { width: 128px; }
  .block-title { font-size: 17px; }
  .eps { grid-template-columns: repeat(auto-fill, minmax(50px, 1fr)); gap: 7px; }
  .eps a, .eps span { height: 38px; font-size: 12.5px; }
  .hero-bg { width: 112px; }
  .hero h1 { font-size: 18px; }
  .hero-inner { padding: 16px 14px; gap: 8px; }
  .hero-intro { -webkit-line-clamp: 2; font-size: 12.5px; }
  .hero-thumbs { display: none; }
}

/* ==========================================================================
   用户体系（注册 / 登录 / 收藏 / 观看进度）
   ========================================================================== */

/* ---------- 顶栏用户区 ---------- */
.header-user { position: relative; flex: none; display: flex; align-items: center; gap: 8px; }
.icon-search {
  display: none; flex: none; width: 34px; height: 34px; border-radius: 50%;
  background: var(--card-2); border: 1px solid var(--line); place-items: center; font-size: 15px;
}
.u-btn {
  display: flex; align-items: center; gap: 8px; max-width: 160px; cursor: pointer;
  background: var(--card-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px 3px 3px;
}
.u-btn:hover { border-color: var(--brand); }
.u-avatar {
  flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--brand-g); color: #fff; font-size: 14px; font-weight: 700;
}
.u-name { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.u-drop {
  position: absolute; right: 0; top: calc(100% + 10px); min-width: 150px; padding: 6px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow); z-index: 80; display: none;
}
.u-drop.open { display: block; }
.u-drop a { display: block; padding: 8px 12px; border-radius: 8px; font-size: 13.5px; color: var(--text-2); }
.u-drop a:hover { background: var(--card-2); color: var(--text); }

.btn-auth {
  display: inline-flex; align-items: center; height: 32px; padding: 0 14px; border-radius: 999px;
  background: var(--brand-g); color: #fff; font-size: 13.5px; font-weight: 600; white-space: nowrap;
}
.btn-auth:hover { filter: brightness(1.08); }
.btn-auth.ghost { background: transparent; border: 1px solid var(--line); color: var(--text-2); }
.btn-auth.ghost:hover { color: var(--text); border-color: var(--brand); }

/* ---------- 提示条 ---------- */
.toast {
  margin-bottom: 16px; padding: 11px 16px; border-radius: 10px; font-size: 13.5px;
  background: #fff1f3; border: 1px solid #ffd3da; color: #c0223d;
}

/* ---------- 表单基础 ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; color: var(--text-2); }
.field input, .field select, .field textarea {
  width: 100%; background: var(--bg-2); border: 1px solid var(--line); border-radius: 9px;
  padding: 10px 12px; color: var(--text); outline: none; font: inherit; transition: .18s;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand); background: var(--card); }

/* ---------- 登录 / 注册 ---------- */
.auth-wrap { display: grid; place-items: center; padding: 36px 0 60px; }
.auth-box {
  width: min(400px, 100%); background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; padding: 28px 26px; box-shadow: var(--shadow);
}
.auth-box h1 { font-size: 21px; margin-bottom: 6px; }
.auth-box .sub { margin: 0 0 20px; font-size: 13px; color: var(--text-3); }
.auth-box .field { margin-bottom: 14px; }
.auth-err {
  padding: 10px 14px; margin-bottom: 16px; border-radius: 9px; font-size: 13px;
  background: #fff1f3; border: 1px solid #ffd3da; color: #c0223d;
}
.auth-submit { width: 100%; justify-content: center; margin-top: 6px; }
.auth-foot { margin-top: 16px; text-align: center; font-size: 13px; color: var(--text-3); }
.auth-foot a { color: var(--brand); }

/* ---------- 收藏按钮 ---------- */
.fav-btn {
  display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 18px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--card-2);
  color: var(--text-2); cursor: pointer; font-size: 14px; font-weight: 600; transition: .2s;
}
.fav-btn:hover { border-color: var(--brand); color: var(--text); }
.fav-btn.on { background: var(--brand-g); border-color: transparent; color: #fff; }
.fav-btn .fav-ico { font-size: 16px; line-height: 1; }
.fav-btn.loading { opacity: .55; pointer-events: none; }

/* ---------- 个人中心 ---------- */
.user-head {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 20px 22px;
}
.user-avatar-lg {
  flex: none; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center;
  background: var(--brand-g); color: #fff; font-size: 26px; font-weight: 800;
}
.user-head-info { flex: 1; min-width: 180px; }
.user-head-info h1 { font-size: 21px; }
.user-head-info .sub { margin-top: 5px; font-size: 12.5px; color: var(--text-3); line-height: 1.7; }
.user-stats { display: flex; gap: 10px; }
.user-stats .us { min-width: 86px; padding: 10px 18px; border-radius: 12px; background: var(--card-2); text-align: center; }
.user-stats .us b {
  display: block; font-size: 20px; background: var(--brand-g);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.user-stats .us span { font-size: 12px; color: var(--text-3); }

.panel-lite {
  display: flex; flex-direction: column; gap: 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px;
}
.panel-lite h2 { font-size: 15px; }

.user-tabs {
  display: flex; gap: 6px; margin-top: 18px; border-bottom: 1px solid var(--line);
  overflow-x: auto; scrollbar-width: none;
}
.user-tabs::-webkit-scrollbar { display: none; }
.user-tabs a { padding: 9px 16px; font-size: 14px; color: var(--text-2); border-bottom: 2px solid transparent; white-space: nowrap; }
.user-tabs a:hover { color: var(--text); }
.user-tabs a.on { color: var(--text); border-bottom-color: var(--brand); font-weight: 600; }
.user-tabs a.right { margin-left: auto; color: var(--text-3); }

/* ---------- 收藏夹里的删除角标 ---------- */
.fav-cell { position: relative; }
.fav-del { position: absolute; top: 6px; right: 6px; margin: 0; z-index: 2; }
.fav-del button {
  width: 24px; height: 24px; border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(0,0,0,.66); color: #fff; font-size: 15px; line-height: 1;
  display: grid; place-items: center; backdrop-filter: blur(4px);
}
.fav-del button:hover { background: var(--brand); }

/* ---------- 观看记录 ---------- */
.his-list { display: flex; flex-direction: column; gap: 12px; }
.his-item {
  display: flex; align-items: center; gap: 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px;
}
.his-cover { flex: none; width: 64px; border-radius: 9px; overflow: hidden; background: var(--card-2); }
.his-cover img { width: 100%; aspect-ratio: 3/4; object-fit: cover; }
.his-info { flex: 1; min-width: 0; }
.his-title { display: block; font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.his-sub { margin-top: 4px; font-size: 12.5px; color: var(--text-3); }
.his-sub b { color: var(--brand); }
.his-bar { max-width: 320px; height: 4px; margin-top: 8px; border-radius: 3px; background: var(--card-2); overflow: hidden; }
.his-bar i { display: block; height: 100%; background: var(--brand-g); }
.his-time { margin-top: 6px; font-size: 12px; color: var(--text-3); }
.his-acts { flex: none; display: flex; flex-direction: column; gap: 8px; }

/* ---------- 首页「继续观看」横滑 ---------- */
.cw-row { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.cw-item { flex: none; width: 132px; }
.cw-cover { position: relative; border-radius: 10px; overflow: hidden; background: var(--card-2); }
.cw-cover img { width: 100%; aspect-ratio: 3/4; object-fit: cover; }
.cw-badge {
  position: absolute; left: 6px; bottom: 6px; padding: 2px 7px; border-radius: 5px;
  font-size: 11px; color: #fff; background: rgba(0,0,0,.72); backdrop-filter: blur(4px);
}
.cw-bar { position: absolute; left: 0; bottom: 0; display: block; height: 3px; background: var(--brand); }
.cw-tt { margin-top: 7px; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cw-sub { margin-top: 2px; font-size: 11.5px; color: var(--text-3); }

/* ---------- 响应式（覆盖前面的规则） ---------- */
@media (max-width: 760px) {
  .header-search { display: none; }
  .icon-search { display: grid; }
  .u-name { display: none; }
  .u-btn { padding: 3px; }
  .user-head { gap: 14px; padding: 16px; }
  .user-avatar-lg { width: 52px; height: 52px; font-size: 22px; }
}
@media (max-width: 560px) {
  .his-item { align-items: flex-start; }
  .his-acts { flex-direction: row; }
  .cw-item { width: 112px; }
  .auth-box { padding: 22px 18px; }
}
