:root {
  --bg: #0c0c0f;
  --bg-soft: #15151c;
  --bg-card: #1a1a24;
  --line: rgba(255, 255, 255, 0.08);
  --text: #f2f2f5;
  --muted: #a0a0b0;
  --accent: #e11d48;
  --accent-soft: #fb7185;
  --gold: #f5c542;
  --max: 1120px;
  --radius: 14px;
  --font: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --display: "ZCOOL XiaoWei", "Noto Serif SC", "Songti SC", serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(225, 29, 72, 0.18), transparent),
    radial-gradient(ellipse 60% 40% at 100% 50%, rgba(245, 197, 66, 0.05), transparent),
    var(--bg);
  color: var(--text);
  line-height: 1.75;
  font-size: 16px;
  min-height: 100vh;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent-soft);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #fff;
}

h1, h2, h3, h4 {
  font-family: var(--display);
  line-height: 1.35;
  font-weight: 700;
  margin: 0 0 0.75em;
}

h1 { font-size: clamp(1.75rem, 4vw, 2.6rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
h3 { font-size: clamp(1.15rem, 2.5vw, 1.35rem); }

p { margin: 0 0 1.1em; color: var(--muted); }
p strong, li strong { color: var(--text); }

.container {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  background: rgba(12, 12, 15, 0.88);
  border-bottom: 1px solid var(--line);
}

/* Ads bar injected by /ads.js sits sticky under header */

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text);
  font-weight: 700;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.brand img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
}

.brand span {
  font-family: var(--display);
  letter-spacing: 0.02em;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.1rem;
  align-items: center;
  justify-content: flex-end;
}

.nav a {
  color: var(--muted);
  font-size: 0.92rem;
}

.nav a:hover,
.nav a.active {
  color: var(--accent-soft);
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  background: var(--bg-card);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 10px;
  cursor: pointer;
  position: relative;
}

.nav-toggle:hover {
  border-color: rgba(225, 29, 72, 0.45);
  color: var(--accent-soft);
}

.nav-toggle-bars {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  position: relative;
  transition: background 0.2s ease;
}

.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform 0.2s ease, top 0.2s ease;
}

.nav-toggle-bars::before { top: -6px; }
.nav-toggle-bars::after { top: 6px; }

.nav-toggle[aria-expanded="true"] .nav-toggle-bars {
  background: transparent;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before {
  top: 0;
  transform: rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after {
  top: 0;
  transform: rotate(-45deg);
}

/* Hero */
.hero {
  padding: 3.5rem 0 2.5rem;
  position: relative;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 2.5rem;
  align-items: center;
}

.hero-badge {
  display: inline-block;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  color: var(--gold);
  margin-bottom: 0.85rem;
  text-transform: uppercase;
}

.hero h1 {
  margin-bottom: 0.85rem;
  background: linear-gradient(135deg, #fff 30%, var(--accent-soft));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-lead {
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 36em;
  margin-bottom: 1.5rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.35rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #be123c);
  color: #fff;
}

.btn-primary:hover { color: #fff; }

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--accent-soft);
  color: var(--accent-soft);
}

.hero-keywords {
  font-size: 0.85rem;
  color: var(--muted);
}

.hero-keywords a { margin-right: 0.5rem; }

.phone-stack {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  perspective: 800px;
}

.phone {
  background: #000;
  border-radius: 22px;
  padding: 8px;
  border: 1px solid var(--line);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  animation: floatUp 0.8s ease both;
}

.phone:nth-child(2) { animation-delay: 0.12s; }
.phone:nth-child(3) { animation-delay: 0.2s; grid-column: 1 / -1; max-width: 70%; margin: 0 auto; }
.phone:nth-child(4) { display: none; }

.phone img {
  width: 100%;
  border-radius: 16px;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  object-position: top;
}

@keyframes floatUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Sections */
.section {
  padding: 3rem 0;
  border-top: 1px solid var(--line);
}

.section-head {
  margin-bottom: 1.75rem;
  max-width: 42em;
}

.section-head p {
  margin-bottom: 0;
}

.section-label {
  display: block;
  color: var(--accent-soft);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  margin-bottom: 0.4rem;
}

/* Feature grid */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.15rem;
}

.feature {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.35rem;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.feature:hover {
  border-color: rgba(225, 29, 72, 0.4);
  transform: translateY(-3px);
}

.feature h3 {
  margin-bottom: 0.5rem;
  font-size: 1.15rem;
}

.feature p {
  margin: 0;
  font-size: 0.95rem;
}

/* Showcase rows */
.showcase {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 1.75rem;
  align-items: start;
  margin-bottom: 2.5rem;
  padding: 1.5rem;
  background: var(--bg-soft);
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

.showcase:nth-child(even) {
  grid-template-columns: 1fr 180px;
}

.showcase:nth-child(even) .showcase-media {
  order: 2;
}

.showcase-media {
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #000;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.showcase-media img {
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  object-position: top;
}

.showcase-body h3 {
  color: var(--text);
  margin-bottom: 0.6rem;
}

.showcase-body p {
  margin-bottom: 0.85rem;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.75rem;
}

.tag {
  font-size: 0.78rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: rgba(225, 29, 72, 0.12);
  color: var(--accent-soft);
  border: 1px solid rgba(225, 29, 72, 0.25);
}

/* Gallery */
.gallery {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.85rem;
}

.gallery-item {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #000;
  transition: transform 0.25s ease;
}

.gallery-item:hover {
  transform: scale(1.03);
}

.gallery-item img {
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  object-position: top;
}

.gallery-item figcaption {
  padding: 0.55rem 0.65rem;
  font-size: 0.78rem;
  color: var(--muted);
  background: var(--bg-card);
  text-align: center;
}

/* Content prose for SEO */
.prose {
  max-width: 48em;
}

.prose h2 {
  margin-top: 2rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--line);
}

.prose h2:first-child {
  margin-top: 0;
  border-top: 0;
  padding-top: 0;
}

.prose ul, .prose ol {
  color: var(--muted);
  padding-left: 1.25rem;
  margin: 0 0 1.2em;
}

.prose li { margin-bottom: 0.45rem; }

.toc {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
  margin-bottom: 2rem;
}

.toc h2 {
  font-size: 1.1rem;
  margin-bottom: 0.65rem;
}

.toc ol {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--muted);
}

.toc a { color: var(--accent-soft); }

.related {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
  margin-top: 1.5rem;
}

.related a {
  display: block;
  padding: 1rem 1.15rem;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
}

.related a:hover {
  border-color: var(--accent);
}

.related span {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

/* Page hero small */
.page-hero {
  padding: 2.5rem 0 1.5rem;
}

.page-hero h1 {
  margin-bottom: 0.5rem;
}

.breadcrumb {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--accent-soft); }

/* Error pages */
.error-page {
  min-height: 70vh;
  display: flex;
  align-items: center;
  text-align: center;
  padding: 3rem 0;
}

.error-code {
  font-family: var(--display);
  font-size: clamp(4rem, 12vw, 7rem);
  line-height: 1;
  background: linear-gradient(135deg, var(--accent), var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 0.5rem;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  background: #08080b;
  padding: 2.5rem 0 1.5rem;
  margin-top: 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
  color: var(--text);
  font-weight: 700;
}

.footer-brand img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.footer-col h3 {
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-col li { margin-bottom: 0.45rem; }

.footer-col a {
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-col a:hover { color: var(--accent-soft); }

.footer-bottom {
  border-top: 1px solid var(--line);
  padding-top: 1.15rem;
  font-size: 0.82rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
}

.gallery-4 {
  grid-template-columns: repeat(4, 1fr);
}

/* Mobile image layout */
@media (max-width: 900px) {
  .about-layout {
    grid-template-columns: 1fr !important;
  }

  .about-layout aside {
    display: none;
  }

  .nav-toggle { display: inline-flex; }

  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(12, 12, 15, 0.98);
    border-bottom: 1px solid var(--line);
    padding: 1rem 1.25rem 1.25rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.85rem;
  }

  .nav.open { display: flex; }

  .hero {
    padding: 2rem 0 1.25rem;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 1.35rem;
  }

  /* Hero phones: horizontal snap scroll, capped height */
  .phone-stack {
    display: flex;
    grid-template-columns: none;
    gap: 0.7rem;
    max-width: none;
    margin: 0 -1rem;
    padding: 0.15rem 1rem 0.65rem;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .phone-stack::-webkit-scrollbar {
    display: none;
  }

  .phone {
    flex: 0 0 58vw;
    max-width: 220px;
    scroll-snap-align: start;
    padding: 6px;
    border-radius: 18px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
  }

  .phone:nth-child(3) {
    grid-column: auto;
    max-width: 220px;
    margin: 0;
  }

  .phone img {
    border-radius: 14px;
    aspect-ratio: 9 / 14;
    max-height: 360px;
    object-fit: cover;
    object-position: top center;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }

  .section {
    padding: 2.1rem 0;
  }

  /* Showcase: keep side-by-side, smaller preview */
  .showcase,
  .showcase:nth-child(even) {
    grid-template-columns: 132px 1fr;
    gap: 1rem;
    padding: 1rem;
    margin-bottom: 1.1rem;
  }

  .showcase:nth-child(even) .showcase-media {
    order: 0;
  }

  .showcase-media {
    max-width: 132px;
    margin: 0;
    border-radius: 14px;
  }

  .showcase-media img {
    aspect-ratio: 9 / 14;
    max-height: 230px;
    object-fit: cover;
    object-position: top center;
  }

  .showcase-body p {
    font-size: 0.92rem;
    margin-bottom: 0.55rem;
  }

  /* Galleries: horizontal scroll instead of tall 9:16 grid */
  .gallery,
  .gallery-4 {
    display: flex !important;
    grid-template-columns: none !important;
    gap: 0.7rem;
    margin: 0 -1rem;
    padding: 0.1rem 1rem 0.4rem;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  .gallery-item {
    flex: 0 0 46vw;
    max-width: 180px;
    scroll-snap-align: start;
    border-radius: 14px;
  }

  .gallery-item:hover {
    transform: none;
  }

  .gallery-item img {
    aspect-ratio: 9 / 14;
    max-height: 300px;
    object-fit: cover;
    object-position: top center;
  }

  .gallery-item figcaption {
    padding: 0.4rem 0.35rem;
    font-size: 0.72rem;
  }

  .related {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

@media (max-width: 560px) {
  .phone {
    flex: 0 0 62vw;
    max-width: 240px;
  }

  .phone img {
    max-height: 380px;
  }

  .showcase,
  .showcase:nth-child(even) {
    grid-template-columns: 120px 1fr;
    gap: 0.85rem;
    padding: 0.9rem;
  }

  .showcase-media {
    max-width: 120px;
  }

  .showcase-media img {
    max-height: 210px;
  }

  .gallery-item {
    flex: 0 0 48vw;
    max-width: 190px;
  }

  .gallery-item img {
    max-height: 310px;
  }

  .tag {
    font-size: 0.72rem;
    padding: 0.2rem 0.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
