/* 短剧 App 式首页（站点配置 [home] style = "shorts"）。独立页面，不依赖 styles.css；主色跟 [brand] accent 走。 */
:root { --sx-bg: var(--bg, #0c0a12); --sx-panel: var(--surface, #18141f); --sx-chip: var(--surface-2, #1c1725);
  --sx-line: var(--surface-3, #2a2436); --sx-ink: var(--ink, #f5f2fa); --sx-mute: var(--faint, #9b93ab);
  --sx-accent: var(--accent, #ff3b6b); --sx-accent-2: #ff8a3d; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: #050408; }
body { margin: 0; color: var(--sx-ink); -webkit-font-smoothing: antialiased;
  font: 15px/1.5 "Plus Jakarta Sans", "Sukhumvit Set", "Noto Sans Thai", "Leelawadee UI", "PingFang SC", system-ui, sans-serif; }
a { color: inherit; text-decoration: none; }
img { display: block; width: 100%; height: 100%; object-fit: cover; }
.sx { max-width: 520px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; background: var(--sx-bg); padding-bottom: calc(74px + env(safe-area-inset-bottom)); }
.sx-h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

.sx-top { position: sticky; top: 0; z-index: 6; display: flex; align-items: center; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 14px 8px; background: rgba(12, 10, 18, .92); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
/* 站名标记和其他页面（styles.css 的 .logo）一致：图标 + 小写站名 + 主色圆点或域名后缀 */
.sx-top .logo { flex: none; display: inline-flex; align-items: baseline; gap: 2px; font-size: 25px; font-weight: 800; letter-spacing: -.05em; line-height: 1; }
.sx-top .logo img { width: auto; height: 28px; }
.sx-top .logo .logo-icon { align-self: center; width: 26px; height: 26px; margin-right: 7px; border-radius: 7px; }
.sx-top .logo span { width: 7px; height: 7px; border-radius: 50%; background: var(--sx-accent); box-shadow: 0 0 12px var(--sx-accent); }
.sx-top .logo span.logo-tld { width: auto; height: auto; margin-left: -2px; border-radius: 0; background: none; box-shadow: none; color: var(--sx-accent); }
.sx-search { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 99px;
  background: var(--sx-chip); color: var(--sx-mute); font-size: 13.5px; }
.sx-search span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sx-chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 4px 14px 12px; }
.sx-chips::-webkit-scrollbar, .sx-rail::-webkit-scrollbar, .sx-slides::-webkit-scrollbar { display: none; }
.sx-chips a { flex: none; padding: 6px 15px; border-radius: 99px; font-size: 13.5px; font-weight: 600; color: #cfc8dc; background: var(--sx-chip); }
.sx-chips a.on { color: #fff; background: linear-gradient(92deg, var(--sx-accent), var(--sx-accent-2)); }

/* 顶部轮播：左右滑动，露出下一张的边 */
.sx-hero { position: relative; }
.sx-slides { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding: 0 14px; scroll-padding: 0 14px; }
.sx-slide { position: relative; flex: 0 0 calc(100% - 26px); aspect-ratio: 5 / 6; border-radius: 18px; overflow: hidden; scroll-snap-align: start; background: var(--sx-panel); }
.sx-slide:only-child { flex-basis: 100%; }
/* 竖版封面常把片名印在下半张：图靠上对齐（下半张被裁掉），文字区下面的遮罩压到几乎不透，免得封面上的字和这里的片名叠在一起 */
.sx-slide > img { object-position: center top; }
.sx-slide::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: linear-gradient(180deg, rgba(12,10,18,0) 34%, rgba(12,10,18,.8) 52%, rgba(12,10,18,.97) 61%, #0c0a12 72%); }
.sx-slide-copy { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; padding: 16px; display: flex; flex-direction: column; align-items: flex-start; gap: 7px; }
.sx-slide-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.sx-slide-tags i { font-style: normal; font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 99px; background: rgba(255,255,255,.16); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.sx-slide-tags i:last-child { background: var(--sx-accent); }
.sx-slide strong { font-size: 25px; line-height: 1.22; font-weight: 800; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sx-slide-syn { font-size: 13px; color: #d6d0e2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sx-cta { display: inline-flex; align-items: center; gap: 6px; margin-top: 3px; padding: 10px 22px; border-radius: 99px; font-weight: 800; font-size: 15px; color: #fff;
  background: linear-gradient(92deg, var(--sx-accent), var(--sx-accent-2)); box-shadow: 0 8px 22px rgba(255, 59, 107, .38); }
.sx-dots { display: flex; justify-content: center; gap: 5px; padding: 10px 0 0; }
.sx-dots i { width: 6px; height: 6px; border-radius: 6px; background: #3a3348; transition: width .2s, background .2s; }
.sx-dots i.on { width: 18px; background: var(--sx-accent); }

.sx-sec { padding: 20px 0 0; }
.sx-head { display: flex; align-items: baseline; justify-content: space-between; padding: 0 14px 11px; }
.sx-head h2 { margin: 0; font-size: 18px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.sx-head h2::before { content: ""; width: 4px; height: 17px; border-radius: 4px; background: linear-gradient(var(--sx-accent), var(--sx-accent-2)); }
.sx-more { font-size: 12.5px; color: var(--sx-mute); }
.sx-rail { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; padding: 0 14px; scroll-snap-type: x proximity; scroll-padding: 0 14px; }
.sx-rail .sx-card { flex: 0 0 30.5%; scroll-snap-align: start; }
.sx-wall { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 10px; padding: 0 14px; }

.sx-card { position: relative; display: block; min-width: 0; }
.sx-art { position: relative; display: block; aspect-ratio: var(--poster-ar, 2 / 3); border-radius: 11px; overflow: hidden; background: var(--sx-panel); }
.sx-art::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 38%; background: linear-gradient(rgba(0,0,0,0), rgba(0,0,0,.7)); }
.sx-noart { display: flex; align-items: center; justify-content: center; height: 100%; padding: 8px; text-align: center; font-size: 13px; font-weight: 700;
  background: linear-gradient(160deg, #3a2148, #1b1626); }
.sx-badge { position: absolute; left: 6px; top: 6px; z-index: 1; font-size: 10.5px; font-weight: 800; line-height: 1; padding: 4px 7px; border-radius: 6px; color: #fff; background: var(--sx-accent); }
.sx-count { position: absolute; right: 7px; bottom: 6px; z-index: 1; font-style: normal; font-size: 11px; font-weight: 700; text-shadow: 0 1px 3px rgba(0,0,0,.8); }
.sx-name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 7px; font-size: 13px; font-weight: 600; line-height: 1.38; }
.sx-sub { display: block; margin-top: 1px; font-size: 11.5px; color: var(--sx-mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 热门榜：封面左下角压一个大号名次 */
.sx-hot .sx-rail .sx-card { flex-basis: 33%; }
.sx-rank { position: absolute; left: 4px; top: 0; z-index: 2; font-style: italic; font-weight: 900; font-size: 34px; line-height: 1; letter-spacing: -2px;
  color: #fff; text-shadow: 0 2px 10px rgba(0,0,0,.75); padding: 5px 4px 0 2px; }
.sx-ranked:nth-child(-n+3) .sx-rank { background: linear-gradient(180deg, #ffe08a, #ff9f43); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none; filter: drop-shadow(0 2px 6px rgba(0,0,0,.7)); }
.sx-ranked .sx-art::before { content: ""; position: absolute; top: 0; right: 0; bottom: auto; left: 0; height: 40%; z-index: 1; background: linear-gradient(rgba(0,0,0,.55), rgba(0,0,0,0)); }

.sx-resume-bar { position: absolute; left: 0; bottom: 0; z-index: 2; height: 3px; background: var(--sx-accent); }
.sx-pager { display: flex; gap: 10px; margin: 18px 14px 0; }
.sx-next { flex: 1; display: block; padding: 12px; text-align: center; border-radius: 12px; background: var(--sx-chip); font-weight: 700; font-size: 14px; }
.sx-empty { margin: 80px 24px; text-align: center; color: var(--sx-mute); }
.sx-foot { margin-top: 30px; padding: 20px 14px 8px; border-top: 1px solid var(--sx-line); text-align: center; color: var(--sx-mute); font-size: 12px; }
.sx-foot nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; }
.sx-foot a { color: #bdb5cc; }
.sx-tabs { position: fixed; left: 50%; bottom: 0; z-index: 8; transform: translateX(-50%); width: 100%; max-width: 520px; display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 7px 6px calc(7px + env(safe-area-inset-bottom)); background: rgba(14, 11, 20, .94); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border-top: 1px solid var(--sx-line); }
.sx-tabs a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10.5px; font-weight: 600; color: #8a8299; }
.sx-tabs a.on { color: var(--sx-accent); }

/* 剧场页（[home] style = "feed" 的 /theater）：热播榜 / 新剧榜 */
.sx-rtabs { display: flex; gap: 8px; padding: 0 14px 12px; }
.sx-rtabs button { padding: 4px 12px; border: 0; border-radius: 6px; background: var(--sx-chip); color: var(--sx-mute); font: inherit; font-size: 13px; cursor: pointer; }
.sx-rtabs button.on { background: var(--sx-ink); color: #000; font-weight: 700; }
.sx-rlist { display: grid; gap: 12px; padding: 0 14px; }
.sx-rlist[hidden] { display: none; }
.sx-ritem { display: flex; align-items: center; gap: 12px; }
.sx-ritem > b { flex: none; width: 20px; text-align: center; font-size: 19px; font-weight: 900; color: var(--sx-mute); }
.sx-ritem:nth-child(-n+3) > b { color: var(--sx-accent); }
.sx-rcover { flex: none; width: 56px; height: 76px; border-radius: 6px; overflow: hidden; background: var(--sx-panel); }
.sx-rtext { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sx-rtext strong { font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sx-rtext small { font-size: 12px; color: var(--sx-mute); }
.sx-ritem em { flex: none; display: flex; flex-direction: column; align-items: flex-end; font-style: normal; font-weight: 700; font-size: 14px; }
.sx-ritem em small { font-size: 12px; font-weight: 400; color: var(--sx-mute); }
html[data-home="feed"] .sx { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
.sx-badge.is-done { background: rgba(0,0,0,.62); }

/* 语言切换（右上角）：<details> 展开一列语言，链接到这一页的其他语言版本 */
.ap-lang { position: relative; z-index: 15; flex: none; }
.ap-lang summary { list-style: none; display: flex; align-items: center; gap: 4px; height: 30px; padding: 0 10px; border-radius: 99px;
  background: rgba(255,255,255,.12); color: #fff; font-size: 12.5px; font-weight: 700; cursor: pointer; user-select: none; }
.ap-lang summary::-webkit-details-marker { display: none; }
.ap-lang > div { position: absolute; top: calc(100% + 6px); right: 0; display: grid; min-width: 160px; padding: 6px; border-radius: 10px;
  background: #1c1c1c; box-shadow: 0 8px 28px rgba(0,0,0,.5); }
.ap-lang a { padding: 10px 12px; border-radius: 6px; color: #fff; font-size: 14px; text-decoration: none; white-space: nowrap; }
.ap-lang a:hover { background: rgba(255,255,255,.07); }
.ap-lang a[aria-current] { color: var(--accent, #ff3b6b); font-weight: 700; }

/* 老浏览器（Chrome 88、iOS 15 以前，例如 UC 国际版）不认 aspect-ratio：用上内边距撑出封面比例，图片铺满 */
@supports not (aspect-ratio: 1 / 1) {
  .sx-slide { height: 0; padding-top: calc((100% - 26px) * 1.2); }
  .sx-slide:only-child { padding-top: 120%; }
  .sx-art { height: 0; padding-top: calc(var(--poster-h, 1.5) * 100%); }
  .sx-slide > img, .sx-art > img { position: absolute; top: 0; left: 0; }
}
