/* ============================================================
   LibreTV 落地页样式
   纯静态、零外部依赖；所有设计变量集中在 :root
   ============================================================ */

:root {
  --bg: #08090c;
  --bg-elev: #14161c;
  --bg-deep: #0e1015;
  --text: #f2f4f8;
  --text-dim: #8b919c;
  --text-soft: #b9c8ff;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --blue: #4e7bff;
  --violet: #9b5cff;
  --blue-soft: rgba(78, 123, 255, 0.16);
  --grad: linear-gradient(120deg, #4e7bff 0%, #9b5cff 62%, #5e7cff 100%);
  --card: rgba(255, 255, 255, 0.045);
  --card-strong: rgba(20, 22, 28, 0.72);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --max-width: 1120px;
  --shadow-card: 0 24px 60px -28px rgba(0, 0, 0, 0.85);
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", -apple-system,
    BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img {
  display: block;
  max-width: 100%;
}

img.is-broken {
  visibility: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
}

::selection {
  background: rgba(155, 92, 255, 0.35);
  color: #fff;
}

/* ---------------- 背景氛围 ---------------- */

.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
}

.glow-a {
  width: 620px;
  height: 620px;
  top: -220px;
  left: -160px;
  background: radial-gradient(circle, rgba(78, 123, 255, 0.55), transparent 68%);
  animation: drift 22s ease-in-out infinite alternate;
}

.glow-b {
  width: 680px;
  height: 680px;
  top: -140px;
  right: -220px;
  background: radial-gradient(circle, rgba(155, 92, 255, 0.45), transparent 68%);
  animation: drift 26s ease-in-out infinite alternate-reverse;
}

.glow-c {
  width: 520px;
  height: 520px;
  bottom: -260px;
  left: 40%;
  background: radial-gradient(circle, rgba(94, 124, 255, 0.28), transparent 70%);
  animation: drift 30s ease-in-out infinite alternate;
}

.grid-lines {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse 78% 55% at 50% 0%, #000 20%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 78% 55% at 50% 0%, #000 20%, transparent 78%);
  opacity: 0.7;
}

@keyframes drift {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(40px, 30px, 0) scale(1.08);
  }
}

/* ---------------- 通用容器 / 导航 ---------------- */

#home-view,
#share-view {
  position: relative;
  z-index: 1;
}

.nav {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 20px;
  max-width: calc(var(--max-width) + 48px);
  margin: 0 auto;
  padding: 18px 24px;
  transition: background 0.3s ease, border-color 0.3s ease, padding 0.3s ease;
  border-bottom: 1px solid transparent;
}

.nav.is-scrolled {
  background: rgba(8, 9, 12, 0.72);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom-color: var(--line);
  padding-top: 12px;
  padding-bottom: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  box-shadow: 0 6px 18px -6px rgba(78, 123, 255, 0.8);
}

.brand-name {
  font-size: 17px;
  font-weight: 700;
}

.brand-name span {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.nav-links {
  display: flex;
  gap: 6px;
  margin-left: auto;
}

.nav-links a {
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--text-dim);
  font-size: 14px;
  transition: color 0.2s ease, background 0.2s ease;
}

.nav-links a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.nav-cta {
  flex: none;
  margin-left: auto;
}

.nav-links + .nav-cta {
  margin-left: 0;
}

.nav-mini {
  position: relative;
  padding-top: 18px;
}

.nav-mini .btn {
  margin-left: auto;
}

/* ---------------- 按钮 ---------------- */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 50px;
  padding: 0 24px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.25s ease,
    background 0.25s ease, border-color 0.25s ease, opacity 0.25s ease;
}

.btn-sm {
  height: 40px;
  padding: 0 18px;
  font-size: 14px;
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background: var(--grad);
  background-size: 160% 160%;
  color: #fff;
  box-shadow: 0 16px 34px -14px rgba(94, 124, 255, 0.9);
}

.btn-primary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    100deg,
    transparent 20%,
    rgba(255, 255, 255, 0.28) 45%,
    transparent 65%
  );
  transform: translateX(-120%);
  transition: transform 0.6s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  background-position: 100% 0;
  box-shadow: 0 22px 44px -14px rgba(155, 92, 255, 0.85);
}

.btn-primary:hover::after {
  transform: translateX(120%);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--line-strong);
  color: var(--text);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.28);
  transform: translateY(-2px);
}

.btn[disabled],
.btn.is-busy {
  opacity: 0.7;
  pointer-events: none;
}

/* ---------------- 首页 Hero ---------------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(0, 0.96fr);
  align-items: center;
  gap: 48px;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 48px 24px 32px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-dim);
  font-size: 13px;
  letter-spacing: 0.02em;
}

.pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.16);
}

.hero h1 {
  margin: 20px 0 16px;
  font-size: clamp(38px, 5.4vw, 62px);
  line-height: 1.12;
  font-weight: 700;
  letter-spacing: -0.035em;
}

.grad-text {
  background: linear-gradient(100deg, #7ea2ff 0%, #b98cff 48%, #6f8bff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lead {
  max-width: 30em;
  margin: 0 0 28px;
  color: var(--text-dim);
  font-size: 16px;
  line-height: 1.8;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.cta-row.center {
  justify-content: center;
}

.platform-note,
.download-hint {
  margin: 16px 0 0;
  color: var(--text-dim);
  font-size: 13px;
}

.ios-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding: 10px 16px;
  border: 1px dashed rgba(255, 255, 255, 0.22);
  border-radius: var(--radius-sm);
  background: rgba(245, 165, 36, 0.07);
  color: #f5c26b;
  font-size: 13px;
}

.ios-note--center {
  display: flex;
  justify-content: center;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}

[hidden] {
  display: none !important;
}

/* ---------------- 海报堆叠 ---------------- */

.hero-visual {
  position: relative;
}

.poster-stack {
  position: relative;
  height: 500px;
}

.poster {
  position: absolute;
  width: clamp(140px, 12.5vw, 172px);
  aspect-ratio: 2 / 3;
  margin: 0;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(160deg, #1a1d26, #0d0f14);
  box-shadow: 0 30px 60px -22px rgba(0, 0, 0, 0.95);
  animation: float 7s ease-in-out infinite;
}

.poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.poster::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(0, 0, 0, 0.55));
}

.poster.p1 {
  left: 0;
  top: 22%;
  transform: rotate(-9deg);
  animation-delay: -1.4s;
}

.poster.p2 {
  left: 24%;
  top: 4%;
  z-index: 3;
  transform: rotate(-2.5deg);
}

.poster.p3 {
  left: 47%;
  top: 18%;
  z-index: 2;
  transform: rotate(6deg);
  animation-delay: -3.1s;
}

.poster.p4 {
  left: 64%;
  top: 36%;
  transform: rotate(11deg);
  animation-delay: -4.6s;
}

.poster-halo {
  position: absolute;
  inset: 12% 0 6%;
  z-index: -1;
  background: radial-gradient(ellipse at 50% 50%, rgba(94, 124, 255, 0.32), transparent 62%);
  filter: blur(40px);
}

@keyframes float {
  0%,
  100% {
    translate: 0 0;
  }
  50% {
    translate: 0 -12px;
  }
}

/* ---------------- 区块 / 功能列表 ---------------- */

.section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 64px 24px;
}

.section-head {
  max-width: 620px;
  margin-bottom: 28px;
}

.eyebrow {
  display: inline-block;
  color: var(--blue);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.34em;
}

.section-head h2,
.download-card h2 {
  margin: 12px 0 0;
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.feature-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.feature-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-card);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.3s ease,
    background 0.3s ease;
}

.feature-row:hover {
  transform: translateY(-3px);
  border-color: rgba(124, 148, 255, 0.4);
  background: rgba(255, 255, 255, 0.065);
}

.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: var(--blue-soft);
  border: 1px solid rgba(124, 148, 255, 0.28);
  color: #a9bcff;
}

.feature-row h3 {
  margin: 2px 0 4px;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.feature-row p {
  margin: 0;
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.7;
}

/* ---------------- 下载 ---------------- */

.download-card {
  position: relative;
  padding: 52px 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: radial-gradient(ellipse at 50% -20%, rgba(94, 124, 255, 0.22), transparent 60%),
    rgba(255, 255, 255, 0.035);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  text-align: center;
  overflow: hidden;
}

.download-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent);
  transform: translateX(-100%);
  animation: sheen 9s ease-in-out infinite;
}

@keyframes sheen {
  0%,
  55% {
    transform: translateX(-100%);
  }
  80%,
  100% {
    transform: translateX(100%);
  }
}

.download-card > * {
  position: relative;
}

.download-lead {
  max-width: 30em;
  margin: 12px auto 26px;
  color: var(--text-dim);
}

.download-hint {
  max-width: 34em;
  margin-left: auto;
  margin-right: auto;
  font-size: 12px;
}

/* ---------------- 页脚 ---------------- */

.footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 36px 24px calc(44px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  color: var(--text-dim);
  font-size: 12.5px;
}

.footer p {
  margin: 0;
  line-height: 1.8;
}

.footer--share {
  text-align: center;
  border-top: 0;
  padding-top: 20px;
}

/* ---------------- 分享态 ---------------- */

.share-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: #05060a;
}

.share-bg img {
  position: absolute;
  inset: -12%;
  width: 124%;
  height: 124%;
  object-fit: cover;
  filter: blur(64px) saturate(130%) brightness(0.55);
  opacity: 0;
  transition: opacity 0.8s ease;
}

.share-bg img.is-loaded {
  opacity: 0.5;
}

.share-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 12%, rgba(78, 123, 255, 0.22), transparent 58%),
    linear-gradient(180deg, rgba(8, 9, 12, 0.55), rgba(8, 9, 12, 0.92) 62%, #08090c);
}

.share-main {
  max-width: 880px;
  margin: 0 auto;
  padding: 12px 24px 24px;
}

.share-card {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 30px;
  align-items: start;
  padding: 30px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--card-strong);
  backdrop-filter: blur(28px) saturate(140%);
  -webkit-backdrop-filter: blur(28px) saturate(140%);
  box-shadow: 0 40px 90px -40px rgba(0, 0, 0, 0.95);
  animation: cardIn 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.share-poster {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(160deg, #1b1e27, #0c0e13);
  box-shadow: 0 26px 50px -22px rgba(0, 0, 0, 0.95);
}

.share-poster::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.12) 50%, transparent 65%);
  transform: translateX(-100%);
  animation: shimmer 1.8s ease-in-out infinite;
}

.share-poster.is-loaded::after {
  display: none;
}

@keyframes shimmer {
  to {
    transform: translateX(100%);
  }
}

.share-poster img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.share-poster img.is-loaded {
  opacity: 1;
}

.poster-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 30% 20%, rgba(78, 123, 255, 0.35), transparent 55%),
    radial-gradient(circle at 75% 80%, rgba(155, 92, 255, 0.32), transparent 55%),
    #0d0f15;
  color: rgba(255, 255, 255, 0.82);
  font-size: 54px;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.share-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--text-dim);
  font-size: 12px;
  letter-spacing: 0.02em;
}

.tag-accent {
  border-color: rgba(124, 148, 255, 0.35);
  background: rgba(94, 124, 255, 0.16);
  color: var(--text-soft);
}

.share-title {
  margin: 0 0 22px;
  font-size: clamp(24px, 3.4vw, 34px);
  line-height: 1.28;
  font-weight: 700;
  letter-spacing: -0.03em;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.share-actions {
  display: grid;
  gap: 12px;
}

.share-actions .cta-row {
  justify-content: flex-start;
}

.share-actions .btn {
  height: 52px;
}

.share-actions .cta-row .btn {
  flex: 1 1 0;
}

.status {
  min-height: 20px;
  margin: 12px 0 0;
  color: #f5c26b;
  font-size: 13px;
}

.status.is-ok {
  color: #6ee7a8;
}

.status.is-idle {
  color: var(--text-dim);
}

.share-legal {
  max-width: 40em;
  margin: 18px auto 0;
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.8;
  text-align: center;
  opacity: 0.8;
}

/* ---------------- 入场动效 ---------------- */

.js .reveal:not(.in) {
  opacity: 0;
  transform: translateY(18px);
}

.js .reveal.in {
  opacity: 1;
  transform: none;
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ---------------- 响应式 ---------------- */

@media (max-width: 960px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 20px;
    padding-top: 28px;
  }

  .hero-visual {
    order: -1;
  }

  .poster-stack {
    height: 360px;
    max-width: 520px;
    margin: 0 auto;
  }

  .poster {
    width: clamp(122px, 29vw, 164px);
  }

  .poster.p1 {
    left: 0;
    top: 22%;
  }

  .poster.p2 {
    left: 25%;
    top: 6%;
  }

  .poster.p3 {
    left: 50%;
    top: 18%;
  }

  .poster.p4 {
    left: 72%;
    top: 38%;
  }

  .share-card {
    grid-template-columns: 170px minmax(0, 1fr);
    gap: 24px;
    padding: 24px;
  }
}

@media (max-width: 640px) {
  .nav {
    gap: 12px;
    padding: 14px 18px;
  }

  .nav-links {
    display: none;
  }

  .nav-cta {
    margin-left: auto;
  }

  /* 窄屏海报扇形重排：避免最右一张被裁切 */
  .poster-stack {
    height: 300px;
  }

  .poster {
    width: clamp(100px, 27vw, 132px);
    border-radius: 14px;
  }

  .poster.p1 {
    left: 0;
    top: 22%;
  }

  .poster.p2 {
    left: 22%;
    top: 4%;
  }

  .poster.p3 {
    left: 44%;
    top: 16%;
  }

  .poster.p4 {
    left: 66%;
    top: 38%;
  }

  .hero {
    padding: 20px 18px 28px;
  }

  .hero h1 {
    font-size: clamp(32px, 9.4vw, 42px);
  }

  .lead {
    font-size: 15px;
    margin-bottom: 24px;
  }

  .cta-row {
    gap: 10px;
  }

  .cta-row .btn {
    flex: 1 1 100%;
    height: 50px;
  }

  .section {
    padding: 44px 18px;
  }

  .feature-row {
    padding: 18px;
  }

  .download-card {
    padding: 36px 20px;
  }

  .share-main {
    padding: 4px 16px 20px;
  }

  .share-card {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 22px 20px 24px;
    justify-items: center;
    text-align: center;
  }

  .share-poster {
    width: min(52%, 168px);
  }

  .share-info {
    width: 100%;
  }

  .share-tags,
  .share-actions .cta-row {
    justify-content: center;
  }

  .share-title {
    font-size: clamp(22px, 7vw, 28px);
    margin-bottom: 18px;
  }

  .share-actions {
    width: 100%;
  }

  .share-legal {
    margin-top: 14px;
  }

  .footer {
    padding: 28px 18px calc(36px + env(safe-area-inset-bottom));
    text-align: center;
  }
}

/* 点赞/无障碍：减弱动效 */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
