/* ============================================================
 * 云播（yunbo）搜索预览页样式
 * 暗色主题，颜色用 CSS 变量收口；不用 oklch / dvh / inset 等新语法，
 * 保证 iOS 12、Android 老 WebView（OPPO/vivo 等）也能正常显示
 * ============================================================ */

:root {
  --primitive-ink: #0d0c09;
  --primitive-ink-raised: #181714;
  --primitive-paper: #f8f7f3;
  --primitive-orange: #f49633;
  --primitive-orange-dark: #d4771a;
  --bg: var(--primitive-ink);
  --surface: var(--primitive-ink-raised);
  --text: var(--primitive-paper);
  --accent: var(--primitive-orange);
  --muted: #a7a49c;
  --line: #3a3832;
  --player-bg: #060603;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", sans-serif;
  color: var(--text);
  background: var(--bg);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--bg); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; min-width: 320px; min-height: 100vh; min-height: 100dvh; background: var(--bg); color: var(--text); font-size: 16px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
button { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .58; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
img { display: block; max-width: 100%; }
::selection { color: var(--primitive-ink); background: var(--accent); }

#root { min-height: 100vh; min-height: 100dvh; }
.app-root {
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  overflow: clip;
  background:
    radial-gradient(circle at 90% 0%, rgba(40, 29, 19, 0.18), transparent 30rem),
    var(--bg);
}

.page-shell { width: 90%; max-width: 1400px; width: min(1400px, calc(100% - 10vw)); margin-left: auto; margin-right: auto; }

/* ---------- 顶部导航 ---------- */
.site-header {
  width: min(1400px, calc(100% - 10vw));
  height: 76px;
  margin-left: auto; margin-right: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(58, 56, 50, 0.48);
  position: relative;
  z-index: 20;
}
.brand { display: inline-flex; align-items: center; gap: 10px; border: 0; background: none; padding: 8px 0; font-size: 17px; font-weight: 750; letter-spacing: .04em; }
.brand-mark { width: 29px; height: 29px; display: grid; place-items: center; color: var(--primitive-ink); background: var(--accent); border-radius: 50%; }
.brand-mark svg { margin-left: 2px; }
.brand-cn { margin-left: 7px; color: var(--muted); font-weight: 500; letter-spacing: .08em; }
.header-actions { display: flex; align-items: center; }
.header-actions > * + * { margin-left: 10px; }
.account-state { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; border: 0; padding: 0 8px 0 0; background: transparent; color: var(--muted); font-size: 12px; transition: color 180ms ease; }
.account-state:hover { color: var(--text); }
.account-state.is-logged { color: var(--accent); }
.account-state svg { flex: 0 0 auto; }
.status-dot { display: inline-block; flex: 0 0 auto; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.header-button, .icon-button { min-height: 44px; border: 0; background: transparent; display: inline-flex; align-items: center; justify-content: center; gap: 8px; color: var(--muted); transition: color 180ms ease, background 180ms ease, transform 180ms ease; }
.header-button { padding: 0 12px; font-size: 13px; }
.icon-button { width: 44px; border-radius: 50%; }
.header-button:hover, .icon-button:hover { color: var(--text); background: rgba(43, 41, 35, 0.55); }
.header-button:active, .icon-button:active { transform: scale(.96); }

/* ---------- 按钮 ---------- */
.primary-button, .secondary-button {
  min-height: 48px;
  border-radius: 8px;
  padding: 0 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-weight: 650;
  font-size: 14px;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease, opacity 180ms ease;
}
.primary-button { border: 1px solid var(--accent); background: var(--accent); color: var(--primitive-ink); }
.primary-button:hover { background: var(--primitive-orange-dark); border-color: var(--primitive-orange-dark); transform: translateY(-2px); }
.primary-button:active, .secondary-button:active { transform: scale(.98); }
.secondary-button { border: 1px solid var(--line); background: rgba(28, 27, 22, 0.6); color: var(--text); }
.secondary-button:hover { border-color: var(--muted); background: #282621; }
.full-width { width: 100%; }

/* ---------- 首屏搜索 ---------- */
.search-hero {
  min-height: 600px;
  min-height: calc(100vh - 76px);
  min-height: min(680px, calc(100dvh - 76px));
  padding-top: 60px;
  padding-bottom: 60px;
  padding-top: clamp(48px, 8vh, 90px);
  padding-bottom: clamp(48px, 8vh, 90px);
  display: grid;
  grid-template-columns: minmax(0, .88fr) minmax(0, 1.12fr);
  align-items: center;
  gap: 64px;
  gap: clamp(40px, 6vw, 90px);
}
.hero-copy { position: relative; z-index: 2; }
.overline, .section-index { margin: 0 0 20px; color: var(--accent); font-size: 11px; letter-spacing: .19em; text-transform: uppercase; font-weight: 650; }
.hero-copy h1 { margin: 0; font-size: 60px; font-size: clamp(46px, 5.4vw, 78px); line-height: 1.08; letter-spacing: -.055em; font-weight: 720; }
.hero-copy h1 span { color: var(--accent); }
.hero-description { max-width: 31rem; margin: 26px 0 30px; color: var(--muted); font-size: 16px; line-height: 1.75; }
/* 搜索框用 margin 代替 flex gap，老内核（无 flex gap）也不会挤在一起 */
.search-box { min-height: 62px; display: flex; align-items: center; background: var(--primitive-paper); color: var(--primitive-ink); padding: 7px 7px 7px 18px; border-radius: 9px; box-shadow: 0 22px 60px rgba(0, 0, 0, 0.25); }
.search-box > svg { flex: 0 0 auto; margin-right: 12px; color: #615d54; }
.search-box input { width: 100%; min-width: 0; border: 0; outline: 0; padding: 0 20px 0 0; color: var(--primitive-ink); background: transparent; font-size: 15px; -webkit-appearance: none; appearance: none;
  /* 浏览器记录下拉：预览或回填历史词时，内核会给输入框铺一层浅蓝底，且优先级高于作者样式。
     这里用与搜索框同色的内阴影把底色盖死，并把文字/光标颜色锁住，深色模式下也不会变白字 */
  -webkit-box-shadow: inset 0 0 0 40px var(--primitive-paper);
  box-shadow: inset 0 0 0 40px var(--primitive-paper);
  -webkit-text-fill-color: var(--primitive-ink);
  caret-color: var(--primitive-ink);
}
.search-box input::placeholder { color: #6c695f; -webkit-text-fill-color: #6c695f; }
/* 已回填的状态再补一遍（Safari / 旧版 Chrome 不走内阴影那条路） */
.search-box input:-webkit-autofill,
.search-box input:-webkit-autofill:hover,
.search-box input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--primitive-ink);
  caret-color: var(--primitive-ink);
  -webkit-box-shadow: inset 0 0 0 40px var(--primitive-paper);
  box-shadow: inset 0 0 0 40px var(--primitive-paper);
  transition: background-color 999999s ease-in-out 0s;
}
.search-box input:focus-visible { outline: 0; }
.search-box:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }
.search-box button { align-self: stretch; flex: 0 0 auto; margin-left: 12px; border: 0; border-radius: 6px; padding-left: 23px; padding-right: 23px; background: var(--accent); color: var(--primitive-ink); font-weight: 700; white-space: nowrap; transition: background 180ms ease, transform 180ms ease; }
.search-box button:hover { background: var(--primitive-orange-dark); }
.search-box button:active { transform: scale(.97); }
/* 取消按钮：绝对定位在输入框右端，默认只有一枚浅灰 × ，不铺底色；hover 才轻微加深 */
.search-box .search-field { position: relative; flex: 1 1 auto; display: flex; align-items: center; min-width: 0; }
.search-box .search-clear { position: absolute; top: 50%; right: 0; transform: translateY(-50%) scale(.8); display: grid; place-items: center; width: 18px; height: 18px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #88867f; opacity: 0; visibility: hidden; transition: opacity 160ms ease, transform 160ms ease, background 160ms ease, color 160ms ease; }
.search-box .search-clear.is-visible { opacity: 1; visibility: visible; transform: translateY(-50%) scale(1); }
.search-box .search-clear:hover { background: rgba(1, 1, 1, 0.07); color: var(--primitive-ink); }
.search-box .search-clear svg { display: block; }
/* 图标只有 18px，热区向外扩 8px，手指更容易点中 */
.search-box .search-clear::after { content: ''; position: absolute; top: -8px; right: -8px; bottom: -8px; left: -8px; }
.quick-searches { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 17px; font-size: 12px; color: var(--muted); }
.quick-searches button { min-height: 32px; border: 0; border-bottom: 1px solid transparent; padding: 0; background: transparent; color: var(--muted); }
.quick-searches button:hover { color: var(--text); border-color: var(--accent); }

/* 首屏右侧推荐海报（搜索接口未就绪，用渐变占位） */
.hero-media { position: relative; min-height: 510px; border-radius: 20px; border-radius: clamp(14px, 2vw, 26px); overflow: hidden; isolation: isolate; box-shadow: 0 36px 70px rgba(0, 0, 0, 0.42), inset 0 0 0 1px rgba(255, 255, 255, 0.08); }
.hero-media-bg { position: absolute; top: 0; right: 0; bottom: 0; left: 0; background-size: cover; background-position: center; transition: opacity 400ms ease; }
.hero-media-shade { position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: linear-gradient(180deg, rgba(3, 3, 3, 0.22), transparent 38%, rgba(2, 2, 2, 0.88)); }
.hero-media-top { position: absolute; top: 24px; left: 24px; display: flex; align-items: center; gap: 8px; font-size: 11px; letter-spacing: .08em; color: var(--text); }
.live-dot { width: 6px; height: 6px; display: inline-block; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(244, 150, 51, 0.16); }
.hero-media-content { position: absolute; left: 28px; right: 28px; bottom: 48px; display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.hero-media-content > div { min-width: 0; }
.hero-media-content p { margin: 0 0 6px; font-size: 12px; color: #e0ded7; }
/* 片名可能很长（种子名），限两行，超出省略，避免撑破海报 */
.hero-media-content h2 { margin: 0; font-size: 44px; font-size: clamp(32px, 4vw, 56px); line-height: 1.1; letter-spacing: -.045em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: break-word; word-break: break-word; }
.round-play { width: 58px; height: 58px; flex: 0 0 auto; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--accent); color: var(--primitive-ink); transition: transform 200ms ease, background 200ms ease; }
.round-play svg { margin-left: 3px; }
.round-play:hover { transform: scale(1.07); background: var(--primitive-orange-dark); }
.hero-pagination { position: absolute; left: 28px; bottom: 22px; display: flex; gap: 7px; }
.hero-pagination button { width: 24px; height: 20px; padding: 0; border: 0; background: transparent; position: relative; }
.hero-pagination button::after { content: ''; position: absolute; left: 0; right: 0; top: 9px; height: 2px; background: rgba(238, 238, 238, 0.36); transition: background 180ms ease; }
.hero-pagination button.active::after { background: var(--accent); }

/* ---------- 结果区 ---------- */
.results-section { padding-top: 58px; padding-bottom: 110px; border-top: 1px solid var(--line); }
.results-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.results-heading > div { min-width: 0; }
.results-heading .section-index { margin-bottom: 9px; }
.results-heading h2 { margin: 0; font-size: 36px; font-size: clamp(28px, 3vw, 42px); letter-spacing: -.035em; overflow-wrap: break-word; word-break: break-word; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.results-heading > span { flex: 0 0 auto; color: var(--muted); font-size: 13px; }
.filter-row { display: flex; gap: 6px; margin-bottom: 18px; }
.filter-row button { min-height: 44px; padding: 0 17px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--muted); font-size: 13px; transition: color 180ms ease, background 180ms ease, border-color 180ms ease; }
.filter-row button:hover { color: var(--text); }
.filter-row button.active { color: var(--text); background: var(--surface); border-color: var(--line); }
.resource-list { border-top: 1px solid var(--line); }
.resource-row { display: grid; grid-template-columns: 210px minmax(0, 1fr) auto; align-items: center; gap: 28px; padding: 25px 0; border-bottom: 1px solid var(--line); }
.resource-poster { position: relative; width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 9px; overflow: hidden; padding: 0; background: var(--surface); }
.resource-poster img { width: 100%; height: 100%; object-fit: cover; transition: transform 260ms ease, opacity 200ms ease; }
.resource-poster:hover img { transform: scale(1.045); opacity: .82; }
.poster-play { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: grid; place-items: center; color: var(--text); opacity: 0; transform: scale(.95); transition: opacity 180ms ease, transform 180ms ease; }
.poster-play svg { filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.6)); }
.resource-poster:hover .poster-play, .resource-poster:focus-visible .poster-play { opacity: 1; transform: scale(1); }
.poster-duration { position: absolute; right: 8px; bottom: 8px; padding: 2px 6px; border-radius: 3px; background: rgba(3, 3, 3, 0.78); font-size: 10px; }
.resource-info { min-width: 0; }
.resource-number { color: var(--accent); font-size: 10px; letter-spacing: .12em; margin-bottom: 6px; }
.resource-title-line { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
/* 长片名限两行，避免一条结果被撑得很高；标签固定在标题右侧不参与截断 */
.resource-title-line h3 { flex: 0 1 auto; margin: 0; min-width: 0; max-width: 100%; max-height: 3.2em; font-size: 23px; letter-spacing: -.025em; overflow-wrap: break-word; word-break: break-word; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.quality-tag { flex: 0 0 auto; border: 1px solid rgba(244, 150, 51, 0.55); border-radius: 3px; color: var(--accent); padding: 0 5px; font-size: 9px; line-height: 18px; }
/* 手机上清晰度挪到信息行，避免长片名把标签挤到下一行；副标题为空时不占高度 */
.quality-tag.meta-tag { display: none; }
.resource-info > p:empty { display: none; }
.resource-info > p { margin: 8px 0 12px; max-width: 48rem; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.resource-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; color: var(--muted); font-size: 11px; }
.health { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); }
.preview-link { min-height: 44px; display: flex; align-items: center; gap: 6px; border: 0; padding: 0; background: transparent; color: var(--text); font-size: 13px; transition: color 180ms ease, transform 180ms ease; }
.preview-link:hover { color: var(--accent); transform: translateX(4px); }
.empty-results { padding: 70px 24px; text-align: center; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--muted); }
.empty-results h3 { color: var(--text); margin: 16px 0 4px; }
.empty-results p { margin: 0 0 24px; }

/* ---------- 搜索结果分页 ---------- */
.pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; margin-top: 36px; }
.pagination:empty { display: none; }
.page-btn { min-width: 40px; min-height: 40px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; gap: 4px; border: 1px solid var(--line); border-radius: 6px; background: transparent; color: var(--muted); font-size: 13px; transition: color 180ms ease, border-color 180ms ease, background 180ms ease; }
.page-btn:hover:not(:disabled):not(.active) { color: var(--text); border-color: var(--muted); }
.page-btn.active { color: var(--primitive-ink); background: var(--accent); border-color: var(--accent); font-weight: 600; }
.page-ellipsis { padding: 0 4px; color: var(--muted); font-size: 13px; }

/* ---------- 页脚 / 免责声明 ---------- */
.site-footer { padding-top: 44px; padding-bottom: 54px; border-top: 1px solid var(--line); }
.footer-inner { display: flex; flex-direction: column; gap: 16px; }
.footer-title { margin: 0 0 10px; font-size: 18px; letter-spacing: -.02em; }
.footer-disclaimer { margin: 0; max-width: 60rem; color: var(--muted); font-size: 13px; line-height: 1.85; }
.footer-disclaimer a { color: var(--accent); }
.footer-disclaimer a:hover { text-decoration: underline; }
.footer-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 13px; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--accent); }
.footer-links .divider { color: var(--line); }
.footer-copyright { color: var(--muted); font-size: 12px; letter-spacing: .02em; }

/* ---------- 详情页 ---------- */
.detail-page { padding-top: 24px; padding-bottom: 90px; }
.detail-breadcrumb { min-height: 44px; display: flex; align-items: center; gap: 10px; margin-bottom: 20px; color: var(--muted); font-size: 12px; }
.detail-breadcrumb button { min-height: 44px; display: flex; align-items: center; gap: 7px; border: 0; padding: 0 10px 0 0; background: transparent; color: var(--text); }
.detail-breadcrumb button:hover { color: var(--accent); }
.detail-breadcrumb strong { min-width: 0; max-width: 26em; color: var(--text); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1.62fr) minmax(320px, .8fr); gap: 48px; gap: clamp(34px, 4.5vw, 68px); align-items: start; }
.media-column { min-width: 0; }
.player-shell { position: relative; min-height: 260px; aspect-ratio: 16 / 10; overflow: hidden; border-radius: 14px; border-radius: clamp(10px, 1.5vw, 18px); background: var(--player-bg); isolation: isolate; box-shadow: 0 32px 70px rgba(0, 0, 0, 0.35), inset 0 0 0 1px rgba(255, 255, 255, 0.08); }
.player-poster { position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }
.player-video { position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.player-vignette { position: absolute; top: 0; right: 0; bottom: 0; left: 0; pointer-events: none; background: linear-gradient(180deg, rgba(2, 2, 2, 0.5), transparent 35%, transparent 60%, rgba(2, 2, 2, 0.7)); }
.player-topline { position: absolute; top: 18px; left: 18px; right: 18px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.web-preview, .trial-chip, .saved-chip { min-height: 28px; display: inline-flex; align-items: center; gap: 7px; padding: 0 10px; border-radius: 5px; background: rgba(6, 6, 6, 0.65); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); font-size: 10px; }
.trial-chip { margin-left: auto; }
.saved-chip { margin-left: auto; color: var(--accent); }
.preview-center { position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--text); }
.preview-center-icon { width: 72px; height: 72px; display: grid; place-items: center; margin-bottom: 18px; border-radius: 50%; background: var(--accent); color: var(--primitive-ink); box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4); transition: transform 220ms ease; }
.preview-center-icon svg { margin-left: 4px; }
.preview-center:hover .preview-center-icon { transform: scale(1.08); }
.preview-center strong { font-size: 18px; }
.preview-center > span:last-child { margin-top: 4px; color: #e0ded7; font-size: 12px; }
.player-controls { position: absolute; left: 18px; right: 18px; bottom: 15px; display: flex; align-items: center; gap: 14px; }
.player-controls button { width: 40px; height: 40px; flex: 0 0 auto; border: 0; border-radius: 50%; display: grid; place-items: center; padding: 0; background: rgba(3, 3, 3, 0.42); color: var(--text); }
.player-controls button:hover { background: rgba(3, 3, 3, 0.75); }
.fake-timeline { position: relative; flex: 1; height: 3px; background: rgba(238, 238, 238, 0.28); overflow: hidden; }
.fake-timeline span { display: block; width: 8%; height: 100%; background: var(--accent); transition: width 300ms linear; }
.fake-timeline span.moving { width: 70%; transition: width 28s linear; }
.trial-end-panel, .parsing-panel { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 60px 24px; background: rgba(4, 3, 2, 0.86); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.trial-end-panel p { margin: 0 0 4px; color: var(--accent); font-size: 12px; letter-spacing: .1em; }
.trial-end-panel h2, .parsing-panel h2 { margin: 0 0 24px; font-size: 28px; font-size: clamp(23px, 3vw, 34px); letter-spacing: -.03em; }
.trial-end-panel > span { margin-top: 12px; color: var(--muted); font-size: 11px; }

.progress-ring { --progress: 0deg; width: 104px; height: 104px; display: grid; place-items: center; margin-bottom: 22px; border-radius: 50%; background: var(--line); background: conic-gradient(var(--accent) var(--progress), var(--line) 0); transition: background 120ms linear; }
.progress-ring::before { content: ''; grid-area: 1 / 1; width: 92px; height: 92px; border-radius: 50%; background: var(--primitive-ink); }
.progress-ring > div { grid-area: 1 / 1; z-index: 1; display: flex; flex-direction: column; }
.progress-ring strong { font-size: 23px; line-height: 1.2; }
.progress-ring span { color: var(--muted); font-size: 10px; }
.parse-steps { display: flex; gap: 18px; color: var(--muted); font-size: 11px; }
.parse-steps span { display: flex; align-items: center; gap: 4px; }
.parse-steps span svg { opacity: .25; }
.parse-steps span.done { color: var(--text); }
.parse-steps span.done svg { opacity: 1; color: var(--accent); }
.parsing-panel > p { margin: 18px 0 0; color: var(--muted); font-size: 11px; }
.continuity-note { display: flex; align-items: center; gap: 9px; margin-top: 18px; color: var(--muted); font-size: 12px; }
.continuity-note svg { color: var(--accent); flex: 0 0 auto; }
.continuity-note strong { color: var(--text); font-weight: 550; }
.app-continuation { width: 100%; min-height: 76px; margin-top: 22px; display: flex; align-items: center; gap: 13px; border: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 12px 0; background: transparent; text-align: left; }
.app-continuation > span:nth-child(2) { display: flex; flex: 1; flex-direction: column; }
.app-continuation strong { font-size: 13px; font-weight: 550; }
.app-continuation small { color: var(--muted); font-size: 11px; }
.app-continuation > svg { color: var(--muted); transition: transform 180ms ease, color 180ms ease; }
.app-continuation:hover > svg { color: var(--accent); transform: translateY(2px); }
.app-icon { color: var(--accent); }
.resource-detail { padding-top: 8px; }
.detail-kicker { display: flex; flex-wrap: wrap; gap: 13px; color: var(--muted); font-size: 11px; }
.resource-detail h1 { margin: 12px 0 12px; font-size: 44px; font-size: clamp(38px, 4vw, 56px); line-height: 1.1; letter-spacing: -.05em; overflow-wrap: break-word; word-break: break-word; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.detail-subtitle { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.75; }
.spec-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 26px 0; padding-top: 18px; padding-bottom: 18px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.spec-grid > div { display: flex; flex-direction: column; gap: 3px; }
.spec-grid span { color: var(--muted); font-size: 10px; }
.spec-grid strong { font-size: 12px; font-weight: 550; }
.detail-actions { display: grid; gap: 10px; }
.detail-actions .primary-button, .detail-actions .secondary-button { width: 100%; }
.action-assurance { display: flex; align-items: center; justify-content: center; gap: 5px; margin: 10px 0 0; color: var(--muted); font-size: 10px; }
.secondary-links { display: flex; gap: 20px; margin-top: 20px; }
.secondary-links button { min-height: 40px; display: inline-flex; align-items: center; gap: 6px; border: 0; padding: 0; background: transparent; color: var(--muted); font-size: 11px; }
.secondary-links button:hover { color: var(--text); }
.file-section { margin-top: 22px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.file-section-toggle { width: 100%; min-height: 58px; display: flex; align-items: center; justify-content: space-between; border: 0; padding: 0; background: transparent; }
.file-section-toggle > span { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.file-section-toggle small { color: var(--muted); font-size: 10px; }
.file-section-toggle > svg { color: var(--muted); transition: transform 200ms ease; }
.file-section-toggle > svg.rotated { transform: rotate(180deg); }
.file-list { padding: 0 0 14px; }
.file-list > div { display: flex; align-items: center; gap: 9px; padding: 10px 0; color: var(--muted); }
.file-list > div > span { min-width: 0; flex: 1; display: flex; justify-content: space-between; gap: 8px; color: var(--text); font-size: 11px; }
.file-list small { color: var(--muted); }
.file-list > div > svg:last-child { color: var(--accent); }
.detail-description { padding-top: 22px; }
.detail-description h2 { margin: 0 0 8px; font-size: 14px; }
.detail-description p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.8; }
.mobile-action-bar { display: none; }

/* ---------- 弹窗 ---------- */
.modal-backdrop { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(1, 1, 1, 0.76); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); animation: fade-in 180ms ease-out; }
.modal-sheet { position: relative; width: 100%; max-width: 470px; max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px); overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 34px; border: 1px solid var(--line); border-radius: 16px; background: var(--primitive-ink-raised); box-shadow: 0 36px 80px rgba(0, 0, 0, 0.55); animation: sheet-in 220ms ease-out; }
.modal-close { position: absolute; top: 13px; right: 13px; }
.sheet-eyebrow { display: flex; align-items: center; gap: 7px; margin-bottom: 13px; color: var(--accent); font-size: 11px; letter-spacing: .06em; }
.modal-sheet h2 { margin: 0; font-size: 29px; letter-spacing: -.035em; }
.sheet-intro { margin: 10px 0 22px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.context-resource { display: flex; align-items: center; gap: 11px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: rgba(14, 13, 10, 0.6); }
.context-resource img { width: 65px; height: 48px; border-radius: 4px; object-fit: cover; }
.context-resource > div { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.context-resource strong { font-size: 12px; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.context-resource > div span { color: var(--muted); font-size: 10px; }
.context-status { color: var(--accent); font-size: 10px; }
.auth-form { margin-top: 22px; }
.auth-form > label:not(.agreement) { display: block; margin: 14px 0 6px; color: var(--muted); font-size: 11px; }
.phone-input, .code-input { min-height: 48px; display: flex; align-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: var(--primitive-ink); }
.phone-input:focus-within, .code-input:focus-within { border-color: var(--accent); }
.phone-input > span { padding: 0 12px; border-right: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.phone-input input, .code-input input { width: 100%; min-width: 0; height: 46px; border: 0; outline: 0; padding: 0 13px; background: transparent; color: var(--text); font-size: 14px; }
.phone-input input:focus-visible, .code-input input:focus-visible { outline: 0; }
/* 浏览器给「历史输入过的手机号 / 短信验证码」自动填充时会自己铺一层浅蓝底，
   深色表单里会露出一块突兀的亮色。用内阴影把底色盖回输入框本来的颜色，
   文字色也一并指定，否则自动填充的黑字在深底上看不清。
   两条规则分开写：老内核不认识 :autofill，混在同一个选择器列表里会让整条失效。 */
.phone-input input:-webkit-autofill,
.phone-input input:-webkit-autofill:hover,
.phone-input input:-webkit-autofill:focus,
.code-input input:-webkit-autofill,
.code-input input:-webkit-autofill:hover,
.code-input input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
  -webkit-box-shadow: inset 0 0 0 40px var(--primitive-ink);
  box-shadow: inset 0 0 0 40px var(--primitive-ink);
  transition: background-color 999999s ease-in-out 0s;
}
.phone-input input:autofill,
.code-input input:autofill {
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
  -webkit-box-shadow: inset 0 0 0 40px var(--primitive-ink);
  box-shadow: inset 0 0 0 40px var(--primitive-ink);
  transition: background-color 999999s ease-in-out 0s;
}
.code-input button { align-self: stretch; flex: 0 0 auto; border: 0; border-left: 1px solid var(--line); padding: 0 13px; background: transparent; color: var(--accent); font-size: 11px; }
.form-error { margin: 9px 0 0; color: #ff8273; font-size: 11px; }
.agreement { display: flex; align-items: flex-start; gap: 8px; margin: 18px 0; color: var(--muted); font-size: 10px; cursor: pointer; }
.agreement input { width: 16px; height: 16px; margin: 1px 0 0; accent-color: var(--accent); }
.auth-submit { width: 100%; }
.privacy-note { display: flex; align-items: center; justify-content: center; gap: 5px; margin: 13px 0 0; color: var(--muted); font-size: 10px; }
.handoff-card { margin-bottom: 18px; padding: 12px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.handoff-card > img { width: 100%; aspect-ratio: 16 / 7; object-fit: cover; border-radius: 7px; margin-bottom: 14px; }
.handoff-line { display: flex; justify-content: space-between; gap: 18px; padding: 6px 0; font-size: 11px; }
.handoff-line span { color: var(--muted); }
.handoff-line strong { min-width: 0; font-weight: 550; text-align: right; overflow-wrap: anywhere; }
.app-sheet .secondary-button { margin-top: 10px; }
.sheet-footnote { margin: 12px 0 0; text-align: center; color: var(--muted); font-size: 10px; }
.saved-resource { margin-bottom: 20px; }
.saved-resource > img { width: 100%; aspect-ratio: 16 / 8; object-fit: cover; border-radius: 7px; }
.saved-resource > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0 16px; }
.saved-resource > div > div { min-width: 0; }
.saved-resource > div strong { overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.saved-resource > div > span { display: flex; align-items: center; gap: 4px; color: var(--accent); font-size: 11px; }
.saved-resource .primary-button { width: 100%; }
.library-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 34px; margin-bottom: 20px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; }
/* 账号面板：每行左侧字段名、右侧值，值可能很长（uid），允许折行 */
.account-row { display: flex; align-items: baseline; justify-content: space-between; padding: 11px 0; border-top: 1px solid var(--line); font-size: 12px; }
.account-row span { flex: 0 0 auto; color: var(--muted); }
.account-row strong { margin-left: 16px; min-width: 0; font-weight: 600; overflow-wrap: anywhere; text-align: right; }
.account-sheet .secondary-button { margin-top: 22px; }
.toast { position: fixed; z-index: 80; left: 50%; bottom: 28px; transform: translateX(-50%); max-width: calc(100% - 32px); display: flex; align-items: center; gap: 8px; padding: 12px 17px; border: 1px solid var(--line); border-radius: 8px; background: var(--primitive-paper); color: var(--primitive-ink); box-shadow: 0 15px 45px rgba(0, 0, 0, 0.4); font-size: 12px; white-space: normal; line-height: 1.5; animation: toast-in 200ms ease-out; }
.toast svg { color: var(--primitive-orange-dark); }
.button-spinner { width: 16px; height: 16px; border: 2px solid rgba(11, 11, 11, 0.25); border-top-color: var(--primitive-ink); border-radius: 50%; animation: spin 700ms linear infinite; }

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheet-in { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px) scale(.97); } to { opacity: 1; transform: translate(-50%, 0) scale(1); } }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1023px) {
  .page-shell, .site-header { width: calc(100% - 48px); max-width: 900px; width: min(900px, calc(100% - 48px)); }
  .search-hero { grid-template-columns: 1fr 1fr; gap: 32px; }
  .hero-media { min-height: 440px; }
  .detail-layout { grid-template-columns: minmax(0, 1.35fr) minmax(280px, .8fr); gap: 28px; }
  .player-shell { aspect-ratio: 16 / 11; }
  .resource-detail h1 { font-size: 38px; }
  .spec-grid { gap: 6px; }
  .resource-row { grid-template-columns: 180px minmax(0, 1fr) auto; gap: 20px; }
}

@media (max-width: 767px) {
  .app-root { background: var(--bg); }
  .page-shell, .site-header { width: calc(100% - 32px); }
  .site-header { height: 64px; }
  .brand { font-size: 15px; }
  .brand-cn { display: none; }
  .brand-mark { width: 27px; height: 27px; }
  /* 手机端账号只留图标：游客也能点开登录，登录后点它看账号、退出 */
  .account-state { min-width: 44px; min-height: 44px; padding: 0; justify-content: center; }
  .account-phone { display: none; }
  .header-button { width: 44px; padding: 0; }
  .header-button span { display: none; }
  .reset-button { display: none; }
  .search-hero { min-height: 0; grid-template-columns: 1fr; gap: 28px; padding-top: 34px; padding-bottom: 36px; }
  .overline { margin-bottom: 15px; }
  .hero-copy h1 { font-size: 46px; font-size: clamp(40px, 12vw, 56px); }
  .hero-description { margin: 20px 0 24px; font-size: 14px; }
  .search-box { min-height: 56px; padding-left: 14px; }
  .search-box > svg { margin-right: 9px; }
  .search-box button { margin-left: 9px; }
  .search-box input { font-size: 16px; padding-right: 18px; }
  .search-box .search-clear { width: 16px; height: 16px; }
  .search-box button { padding-left: 16px; padding-right: 16px; }
  .quick-searches { margin-top: 12px; }
  .hero-media { min-height: 260px; max-height: 58vh; aspect-ratio: 4 / 4; border-radius: 13px; }
  .hero-media-content { left: 20px; right: 20px; bottom: 44px; }
  .hero-media-content h2 { font-size: 37px; }
  .hero-media-top { top: 18px; left: 20px; }
  .hero-pagination { left: 20px; }
  .round-play { width: 52px; height: 52px; }
  .results-section { padding-top: 40px; padding-bottom: 80px; }
  .results-heading { align-items: start; margin-bottom: 18px; }
  .results-heading > span { padding-top: 26px; font-size: 10px; }
  .results-heading h2 { font-size: 28px; }
  .filter-row { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; margin-right: -16px; padding-right: 16px; }
  .filter-row::-webkit-scrollbar { display: none; }
  .filter-row button { flex: 0 0 auto; }
  .resource-row { grid-template-columns: 124px minmax(0, 1fr); gap: 14px; padding: 18px 0; }
  .resource-poster { aspect-ratio: 4 / 3; align-self: start; }
  .poster-play { opacity: 1; transform: scale(.8); }
  .poster-duration { display: none; }
  .resource-info { align-self: center; }
  .resource-number { display: none; }
  .resource-title-line { gap: 6px; }
  .resource-title-line h3 { font-size: 18px; line-height: 1.4; max-height: 2.8em; }
  .resource-title-line .quality-tag { display: none; }
  .resource-meta .meta-tag { display: inline-block; line-height: 16px; }
  .resource-info > p { margin: 5px 0 8px; font-size: 11px; display: -webkit-box; white-space: normal; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.55; }
  .resource-meta { gap: 9px; font-size: 9px; }
  .resource-meta .health { display: none; }
  .preview-link { grid-column: 2; min-height: 30px; margin-top: -14px; font-size: 11px; color: var(--accent); justify-self: start; }
  .pagination { gap: 4px; margin-top: 26px; }
  .page-btn { min-width: 34px; min-height: 34px; padding: 0 9px; font-size: 12px; }
  .site-footer { padding-top: 30px; padding-bottom: 40px; }
  .footer-disclaimer { font-size: 12px; }
  .footer-links { gap: 6px 10px; font-size: 12px; }

  .detail-page { width: 100%; padding: 0 0 118px; }
  .detail-breadcrumb { width: calc(100% - 32px); margin: 0 auto 12px; }
  .detail-breadcrumb > span, .detail-breadcrumb > strong { display: none; }
  .detail-layout { display: flex; flex-direction: column; gap: 0; }
  .media-column { width: 100%; }
  .player-shell { width: 100%; aspect-ratio: 16 / 10; border-radius: 0; box-shadow: none; }
  .player-topline { top: 13px; left: 13px; right: 13px; }
  .preview-center-icon { width: 60px; height: 60px; margin-bottom: 12px; }
  .preview-center strong { font-size: 16px; }
  .preview-center > span:last-child { font-size: 10px; }
  .continuity-note { margin: 14px 16px 0; font-size: 11px; }
  .app-continuation { width: calc(100% - 32px); margin: 18px 16px 0; }
  .resource-detail { width: calc(100% - 32px); margin: 0 auto; padding-top: 25px; }
  .resource-detail h1 { font-size: 38px; margin-top: 9px; }
  .detail-subtitle { font-size: 13px; }
  .spec-grid { margin: 20px 0; }
  .detail-actions { display: none; }
  .action-assurance { display: none; }
  .secondary-links { margin-top: 4px; }
  .file-section { margin-top: 14px; }
  .file-list > div > span { flex-direction: column; gap: 0; }
  .detail-description { padding-bottom: 12px; }
  .mobile-action-bar { position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: 1.15fr 1fr; gap: 8px; padding: 10px 12px; padding-bottom: calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgba(14, 13, 10, 0.92); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); }
  .mobile-action-bar .primary-button, .mobile-action-bar .secondary-button { min-height: 48px; padding: 0 10px; font-size: 12px; }
  .trial-end-panel, .parsing-panel { padding: 48px 18px 30px; }
  .trial-end-panel h2, .parsing-panel h2 { font-size: 21px; margin-bottom: 16px; }
  .trial-end-panel > span { display: none; }
  .progress-ring { width: 82px; height: 82px; margin-bottom: 14px; }
  .progress-ring::before { width: 72px; height: 72px; }
  .progress-ring strong { font-size: 19px; }
  .parse-steps { gap: 9px; font-size: 9px; }
  .parsing-panel > p { margin-top: 10px; }
  .player-controls { left: 10px; right: 10px; bottom: 7px; gap: 6px; }
  .player-controls button { width: 38px; height: 38px; }

  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal-sheet { width: 100%; max-height: 91vh; max-height: 91dvh; padding: 28px 22px 24px; padding-bottom: calc(24px + env(safe-area-inset-bottom)); border-radius: 18px 18px 0 0; border-bottom: 0; animation-name: mobile-sheet-in; }
  .modal-sheet h2 { font-size: 27px; }
  .phone-input input, .code-input input { font-size: 16px; }
  .toast { bottom: 82px; bottom: calc(82px + env(safe-area-inset-bottom)); font-size: 11px; white-space: normal; width: max-content; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .hero-media-bg { transition: none; }
}

/* 横屏刘海屏：左右安全区留白，避免内容压到刘海里 */
@media (orientation: landscape) {
  .app-root { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
  .mobile-action-bar { padding-left: calc(12px + env(safe-area-inset-left)); padding-right: calc(12px + env(safe-area-inset-right)); }
}

@keyframes mobile-sheet-in { from { opacity: 0; transform: translateY(28px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }

[hidden] { display: none !important; }
.file-chevron { display: inline-flex; color: var(--muted); }
.file-chevron svg { transition: transform 200ms ease; }
.file-chevron.rotated svg { transform: rotate(180deg); }
.trial-chip b { font-weight: 500; }

/* ---------- 老内核兜底（X5 / UC / 旧 Chromium 没有 flex gap） ----------
   JS 检测到不支持时给 <html> 加 .no-flex-gap，这里用 margin 补间距 */
.no-flex-gap .filter-row button + button,
.no-flex-gap .pagination > * + *,
.no-flex-gap .footer-links > * + * { margin-left: 8px; }
.no-flex-gap .quick-searches > * + *,
.no-flex-gap .hero-media-top > * + * { margin-left: 10px; }
.no-flex-gap .resource-meta > * + *,
.no-flex-gap .detail-kicker > * + * { margin-left: 12px; }
.no-flex-gap .secondary-links button + button { margin-left: 18px; }
.no-flex-gap .player-controls > * + * { margin-left: 12px; }
.no-flex-gap .hero-pagination button + button { margin-left: 7px; }
.no-flex-gap .health .status-dot { margin-right: 6px; }
.no-flex-gap .resource-title-line .quality-tag { margin-left: 8px; }
.no-flex-gap .results-heading > * + * { margin-left: 18px; }

/* ---------- 老内核兜底（iOS 12 / 老 Android WebView 无 aspect-ratio） ---------- */
@supports not (aspect-ratio: 1 / 1) {
  .resource-poster { height: 0; padding-top: 56.25%; }
  .resource-poster img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
  .hero-media { height: 510px; }
  .player-shell { height: 0; min-height: 0; padding-top: 62.5%; }
  .handoff-card > img { height: 190px; }
  .saved-resource > img { height: 180px; }
  @media (max-width: 767px) {
    .resource-poster { padding-top: 75%; }
    .hero-media { height: 340px; }
    .player-shell { padding-top: 62.5%; }
  }
}
