/* ============ 动漫剧场 · 前台样式 ============ */
:root {
  --bg: #08080c;
  --bg-soft: #101117;
  --panel: #14161d;
  --panel-2: #191b24;
  --line: rgba(255, 255, 255, 0.09);
  --text: #f4f5f8;
  --muted: #9aa0ad;
  --muted-2: #6e7480;
  --brand: #ff5b2e;
  --brand-2: #ff2e88;
  --brand-3: #ffb03a;
  --gold: #ffc555;
  --radius: 16px;
  --shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}

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

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(900px 420px at 15% -8%, rgba(255, 86, 46, 0.16), transparent 65%),
    radial-gradient(760px 480px at 92% 8%, rgba(124, 74, 255, 0.16), transparent 62%),
    radial-gradient(600px 500px at 50% 108%, rgba(255, 46, 136, 0.08), transparent 65%);
  pointer-events: none;
  z-index: 0;
}

.app {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 660px;
  margin: 0 auto;
  padding: 0 16px 40px;
}

/* ---------------- 顶部导航 ---------------- */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 2px 6px;
}

.brand { display: flex; align-items: center; gap: 10px; }

.logo-mark {
  width: 36px; height: 36px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  display: grid; place-items: center;
  font-size: 18px;
  box-shadow: 0 6px 18px rgba(255, 70, 60, 0.35);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-size: 15px; font-weight: 700; letter-spacing: 0.5px; }
.brand-sub { font-size: 10px; color: var(--muted-2); letter-spacing: 2.2px; text-transform: uppercase; }

.nav-link {
  display: flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-size: 12px;
  text-decoration: none;
  transition: 0.2s;
}
.nav-link:hover { color: #fff; border-color: rgba(255, 255, 255, 0.22); }

/* ---------------- 主视觉 ---------------- */
.hero-title {
  margin: 16px 0 2px;
  font-size: 30px;
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.hero-title .grad {
  background: linear-gradient(100deg, var(--brand-3), var(--brand) 48%, var(--brand-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-desc { color: var(--muted); font-size: 13px; margin: 0 0 16px; }

/* 推荐大卡 */
.feature {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  min-height: 210px;
  display: flex;
  align-items: flex-end;
  background: var(--panel);
  box-shadow: var(--shadow);
  cursor: pointer;
  isolation: isolate;
}
.feature-img {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center 30%;
  transform: scale(1.02);
  transition: transform 0.6s ease;
  z-index: -2;
}
.feature:hover .feature-img { transform: scale(1.08); }
.feature::after {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(to top, rgba(6, 6, 10, 0.96) 8%, rgba(6, 6, 10, 0.55) 45%, rgba(6, 6, 10, 0.06) 78%);
}
.feature-body { padding: 18px 18px 18px; width: 100%; }
.badge-hot {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; margin-bottom: 10px;
  border-radius: 6px;
  font-size: 11px; font-weight: 700; letter-spacing: 1px;
  color: #ffd9c9;
  background: rgba(255, 91, 46, 0.18);
  border: 1px solid rgba(255, 120, 80, 0.35);
}
.feature-title { font-size: 22px; font-weight: 800; margin: 0 0 4px; letter-spacing: 0.3px; }
.feature-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12px; color: #c8ccd6; margin-bottom: 12px; }
.feature-meta .dot { color: var(--muted-2); }
.feature-score { color: var(--gold); font-weight: 700; }

.btn-play {
  display: inline-flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 20px;
  border: 0; border-radius: 999px;
  background: linear-gradient(100deg, var(--brand), var(--brand-2));
  color: #fff; font-size: 14px; font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(255, 62, 90, 0.4);
  transition: transform 0.15s, box-shadow 0.2s;
}
.btn-play:active { transform: scale(0.96); }
.btn-ghost {
  display: inline-flex; align-items: center; gap: 6px;
  height: 40px; padding: 0 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: #fff; font-size: 13px; font-weight: 600;
  cursor: pointer; font-family: inherit;
  backdrop-filter: blur(6px);
}

/* ---------------- 搜索 ---------------- */
.search-wrap {
  position: relative;
  margin: 16px 0 14px;
}
.search-wrap .icon {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  font-size: 15px; color: var(--muted-2);
}
.search {
  width: 100%;
  height: 46px;
  padding: 0 44px 0 42px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: 0.2s;
}
.search::placeholder { color: var(--muted-2); }
.search:focus { border-color: rgba(255, 110, 70, 0.55); background: rgba(255, 255, 255, 0.08); }
.search-clear {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px; border: 0; border-radius: 50%;
  background: transparent; color: var(--muted); font-size: 16px; cursor: pointer;
  display: none;
}

/* ---------------- 筛选 ---------------- */
.filter-bar {
  display: flex; align-items: center; gap: 8px;
  overflow-x: auto;
  padding: 2px 0 10px;
  scrollbar-width: none;
}
.filter-bar::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  height: 32px; padding: 0 15px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
  font-size: 13px; font-family: inherit;
  cursor: pointer;
  transition: 0.18s;
}
.chip.active {
  color: #fff; font-weight: 600;
  border-color: transparent;
  background: linear-gradient(100deg, rgba(255, 91, 46, 0.95), rgba(255, 46, 136, 0.95));
  box-shadow: 0 6px 16px rgba(255, 70, 90, 0.28);
}

.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 14px 2px 12px;
}
.section-title { font-size: 17px; font-weight: 700; letter-spacing: 0.3px; }
.section-title em { font-style: normal; color: var(--muted-2); font-size: 12px; font-weight: 500; margin-left: 6px; }
.sort-btn {
  border: 0; background: transparent;
  color: var(--muted); font-size: 12px; cursor: pointer;
  font-family: inherit;
}
.sort-btn:hover { color: #fff; }

/* ---------------- 影片网格 ---------------- */
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 12px;
}
@media (min-width: 560px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.card {
  cursor: pointer;
  border: 0; padding: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  font-family: inherit;
  animation: rise 0.5s ease both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

.poster {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius);
  overflow: hidden;
  background: linear-gradient(150deg, #24262f, #14151b);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
}
.poster img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform 0.5s ease;
}
.card:hover .poster img { transform: scale(1.06); }
.poster::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.55), transparent 45%);
  pointer-events: none;
}
.poster-fallback {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 12px;
  font-weight: 800; font-size: 15px; line-height: 1.3;
  background: linear-gradient(160deg, #2a2d38, #12131a);
}
.score {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  display: flex; align-items: center; gap: 3px;
  padding: 3px 7px;
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(4px);
  color: var(--gold); font-size: 11.5px; font-weight: 700;
}
.state-tag {
  position: absolute; left: 8px; top: 8px; z-index: 2;
  padding: 2px 7px; border-radius: 6px;
  background: rgba(255, 91, 46, 0.9);
  font-size: 10px; font-weight: 700; letter-spacing: 1px;
}
.card-title {
  margin: 9px 2px 2px;
  font-size: 14px; font-weight: 700; letter-spacing: 0.2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-sub {
  margin: 0 2px;
  font-size: 11.5px; color: var(--muted-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ---------------- 空状态 ---------------- */
.empty {
  grid-column: 1 / -1;
  padding: 52px 20px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
}
.empty .big { font-size: 34px; margin-bottom: 8px; }
.empty p { margin: 4px 0; font-size: 13px; }

/* ---------------- 底部 ---------------- */
.site-foot {
  margin-top: 34px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  text-align: center;
  color: var(--muted-2);
  font-size: 11.5px;
}
.site-foot a { color: var(--muted); text-decoration: none; }
.site-foot a:hover { color: #fff; }

/* ---------------- 详情弹层 ---------------- */
.sheet-mask {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none;
  transition: opacity 0.28s;
}
.sheet-mask.on { opacity: 1; pointer-events: auto; }

.sheet {
  position: fixed; z-index: 61;
  left: 50%; bottom: 0;
  width: min(660px, 100%);
  max-height: 94vh;
  transform: translate(-50%, 102%);
  background: var(--bg-soft);
  border-radius: 24px 24px 0 0;
  overflow: hidden auto;
  transition: transform 0.34s cubic-bezier(0.22, 0.8, 0.3, 1);
  box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.65);
  padding-bottom: calc(20px + env(safe-area-inset-bottom));
}
.sheet.on { transform: translate(-50%, 0); }

.sheet-hero {
  position: relative;
  height: 300px;
  background: #111;
}
.sheet-hero img { width: 100%; height: 100%; object-fit: cover; object-position: center 28%; }
.sheet-hero::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to top, var(--bg-soft) 2%, rgba(16, 17, 23, 0.45) 45%, rgba(0, 0, 0, 0.25));
}
.sheet-close {
  position: absolute; top: 14px; right: 14px; z-index: 3;
  width: 34px; height: 34px;
  border: 0; border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff; font-size: 17px; cursor: pointer;
  backdrop-filter: blur(6px);
}
.sheet-head {
  position: relative;
  z-index: 2;
  margin-top: -58px;
  padding: 0 20px;
}
.sheet-title { font-size: 24px; font-weight: 800; margin: 0 0 2px; letter-spacing: 0.4px; line-height: 1.3; }
.sheet-en { color: var(--muted-2); font-size: 12px; letter-spacing: 0.6px; margin-bottom: 12px; }

.score-row { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.score-big { font-size: 27px; font-weight: 800; color: var(--gold); line-height: 1; }
.score-stars { color: var(--gold); font-size: 13px; letter-spacing: 1px; }
.score-label { font-size: 11px; color: var(--muted-2); }

.meta-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.pill {
  padding: 4px 10px; border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: #cfd3dc; font-size: 11.5px;
}

.block { padding: 0 20px; margin-bottom: 18px; }
.block h3 {
  font-size: 13px; font-weight: 700; color: var(--muted);
  letter-spacing: 1px; margin: 0 0 8px;
}
.intro-text { color: #c3c8d2; font-size: 13.5px; line-height: 1.85; margin: 0; }

.kv-list { display: grid; gap: 8px; font-size: 12.5px; }
.kv { display: flex; gap: 10px; }
.kv b { flex: 0 0 56px; color: var(--muted-2); font-weight: 500; }
.kv span { color: #d7dbe3; }

.sheet-actions {
  position: sticky; bottom: 0;
  display: flex; gap: 10px;
  padding: 14px 20px calc(16px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg-soft) 55%, rgba(16, 17, 23, 0.7));
  border-top: 1px solid var(--line);
}
.sheet-actions .btn-play { flex: 1; justify-content: center; height: 46px; font-size: 15px; }
.sheet-actions .btn-ghost { height: 46px; }

/* ---------------- Toast ---------------- */
.toast {
  position: fixed; left: 50%; bottom: 42px; z-index: 200;
  transform: translate(-50%, 20px);
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(28, 30, 38, 0.96);
  border: 1px solid var(--line);
  color: #fff; font-size: 13px;
  box-shadow: var(--shadow);
  opacity: 0; pointer-events: none;
  transition: 0.28s;
  white-space: nowrap;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 380px) {
  .hero-title { font-size: 26px; }
  .feature { min-height: 190px; }
}

/* ---------------- 置顶区 ---------------- */
.pinned-section { margin-bottom: 4px; }
.pinned-row {
  display: flex; gap: 11px;
  overflow-x: auto;
  padding: 2px 2px 10px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.pinned-row::-webkit-scrollbar { display: none; }
.pin-card {
  flex: 0 0 118px;
  scroll-snap-align: start;
  cursor: pointer;
}
.pin-poster {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: 13px;
  background: #1a1c24 center/cover no-repeat;
  overflow: hidden;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 200, 120, 0.25);
}
.pin-no {
  position: absolute; left: 0; top: 0;
  padding: 3px 8px 3px 7px;
  border-radius: 0 0 9px 0;
  background: linear-gradient(100deg, rgba(255, 150, 40, 0.95), rgba(255, 60, 120, 0.92));
  font-size: 9.5px; font-weight: 800; letter-spacing: 1px; color: #fff;
}
.pin-title {
  margin: 7px 2px 1px;
  font-size: 12.5px; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pin-sub {
  margin: 0 2px;
  font-size: 10.5px; color: var(--muted-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* 卡片角标 */
.pin-badge {
  position: absolute; left: 8px; top: 8px; z-index: 2;
  padding: 3px 7px;
  border-radius: 6px;
  background: linear-gradient(100deg, rgba(255, 150, 40, 0.95), rgba(255, 60, 120, 0.9));
  font-size: 10px; font-weight: 800; letter-spacing: 1px;
  box-shadow: 0 3px 10px rgba(255, 80, 60, 0.4);
}
.pin-badge ~ .score { top: 8px; }
.ep-badge {
  position: absolute; left: 8px; bottom: 8px; z-index: 2;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(4px);
  font-size: 10px; color: #e7ebf3;
}

/* 加载更多 */
.btn-more {
  display: block;
  width: 100%;
  margin: 24px 0 0;
  height: 46px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-size: 13.5px; font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: 0.2s;
}
.btn-more:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.22); }

/* 详情弹层补充 */
.sheet-pin {
  position: absolute; left: 16px; bottom: 78px; z-index: 3;
  padding: 4px 10px;
  border-radius: 8px;
  background: linear-gradient(100deg, rgba(255, 150, 40, 0.95), rgba(255, 60, 120, 0.9));
  font-size: 11px; font-weight: 700; letter-spacing: 1px;
}
.ep-list { display: flex; flex-wrap: wrap; gap: 8px; }
.ep-chip {
  min-width: 56px;
  height: 34px; padding: 0 13px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: #d7dbe4;
  font-size: 12.5px; font-family: inherit;
  cursor: pointer;
}
.ep-chip:hover {
  border-color: transparent;
  background: linear-gradient(100deg, var(--brand), var(--brand-2));
  color: #fff;
}

