/* xl-app.rest — 小蓝男同APP 官方平台指南 */
:root {
  --blue-900: #0a3d6b;
  --blue-700: #1565a8;
  --blue-500: #1e88e5;
  --blue-300: #64b5f6;
  --blue-50: #e8f4fc;
  --ink: #1a2332;
  --muted: #5a6a7a;
  --line: #d4e3f0;
  --bg: #f5f9fc;
  --white: #ffffff;
  --accent: #00a8a8;
  --radius: 12px;
  --shadow: 0 8px 28px rgba(21, 101, 168, 0.1);
  --max: 1100px;
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.75;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
}

a {
  color: var(--blue-700);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--blue-500);
}

.container {
  width: min(100% - 32px, var(--max));
  margin-inline: auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--blue-900);
  font-weight: 700;
  font-size: 1.05rem;
  flex-shrink: 0;
}

.brand img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
}

.nav-toggle {
  display: none;
  background: var(--blue-50);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  color: var(--blue-900);
  font-size: 0.9rem;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  align-items: center;
}

.nav a {
  color: var(--ink);
  font-size: 0.92rem;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
}

.nav a:hover,
.nav a.active {
  color: var(--blue-700);
  border-bottom-color: var(--blue-500);
}

/* Hero */
.hero {
  position: relative;
  background:
    linear-gradient(125deg, #0a3d6b 0%, #1565a8 48%, #1e88e5 78%, #00a8a8 100%);
  color: var(--white);
  padding: 72px 0 64px;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 80% 20%, rgba(100, 181, 246, 0.25), transparent 50%);
  pointer-events: none;
}

.hero .container {
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  line-height: 1.35;
  margin-bottom: 14px;
  max-width: 18em;
}

.hero .lead {
  font-size: 1.05rem;
  opacity: 0.95;
  max-width: 36em;
  margin-bottom: 28px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
}

.btn-primary {
  background: var(--white);
  color: var(--blue-900);
}

.btn-primary:hover {
  background: var(--blue-50);
  color: var(--blue-900);
}

.btn-ghost {
  background: transparent;
  color: var(--white);
  border: 1.5px solid rgba(255, 255, 255, 0.65);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
}

/* Breadcrumb */
.breadcrumb {
  padding: 16px 0 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.breadcrumb a {
  color: var(--muted);
}

.breadcrumb span {
  margin: 0 6px;
  opacity: 0.5;
}

/* Sections */
.section {
  padding: 56px 0;
}

.section-alt {
  background: var(--white);
}

.section-head {
  margin-bottom: 28px;
}

.section-head h2 {
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  color: var(--blue-900);
  margin-bottom: 10px;
  position: relative;
  padding-left: 14px;
}

.section-head h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.28em;
  width: 4px;
  height: 1.1em;
  background: linear-gradient(180deg, var(--blue-500), var(--accent));
  border-radius: 2px;
}

.section-head p {
  color: var(--muted);
  max-width: 48em;
}

.prose h2,
.prose h3 {
  color: var(--blue-900);
  margin: 1.6em 0 0.7em;
  line-height: 1.4;
}

.prose h2 {
  font-size: 1.45rem;
}

.prose h3 {
  font-size: 1.15rem;
}

.prose p {
  margin-bottom: 1em;
  color: var(--ink);
}

.prose ul,
.prose ol {
  margin: 0 0 1.2em 1.25em;
}

.prose li {
  margin-bottom: 0.45em;
}

.prose strong {
  color: var(--blue-900);
}

/* Feature grid */
.feature-grid.cols-2 {
  grid-template-columns: repeat(2, 1fr);
}

.feature-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}

.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(21, 101, 168, 0.14);
}

.feature-card img {
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  object-position: top;
  border-radius: 0;
  background: #eee;
}

.feature-card .body {
  padding: 16px 18px 20px;
}

.feature-card h3 {
  font-size: 1.05rem;
  margin-bottom: 8px;
  color: var(--blue-900);
}

.feature-card p {
  font-size: 0.92rem;
  color: var(--muted);
}

/* Split layout */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px;
  align-items: center;
}

.split.reverse .text {
  order: 2;
}

.split.reverse .media {
  order: 1;
}

.split .media img {
  width: 100%;
  max-width: 320px;
  margin-inline: auto;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}

.split .text h3 {
  font-size: 1.25rem;
  color: var(--blue-900);
  margin-bottom: 12px;
}

.split .text p {
  color: var(--muted);
  margin-bottom: 12px;
}

.split .text ul {
  margin-left: 1.2em;
  color: var(--ink);
}

.split + .split {
  margin-top: 48px;
}

/* Gallery strip */
.shot-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.shot-row.cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

.shot-row figure {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.shot-row img {
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  object-position: top;
  border-radius: 0;
}

.shot-row figcaption {
  padding: 10px 12px 14px;
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
}

/* TOC */
.toc {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 26px;
  margin: 28px 0;
}

.toc h2 {
  font-size: 1.1rem;
  color: var(--blue-900);
  margin-bottom: 12px;
}

.toc ol {
  margin-left: 1.3em;
  columns: 2;
  gap: 24px;
}

.toc li {
  margin-bottom: 6px;
  break-inside: avoid;
}

/* Page content */
.page-hero {
  background: linear-gradient(120deg, var(--blue-900), var(--blue-500));
  color: var(--white);
  padding: 48px 0 40px;
}

.page-hero h1 {
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  margin-bottom: 8px;
}

.page-hero p {
  opacity: 0.9;
  max-width: 40em;
}

.page-body {
  padding: 40px 0 64px;
}

.page-body .prose {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px 28px;
  box-shadow: var(--shadow);
}

/* CTA */
.cta-band {
  background: linear-gradient(105deg, var(--blue-900) 0%, var(--blue-700) 55%, var(--accent) 100%);
  color: var(--white);
  padding: 48px 0;
  text-align: center;
}

.cta-band h2 {
  font-size: 1.5rem;
  margin-bottom: 10px;
}

.cta-band p {
  opacity: 0.92;
  margin-bottom: 20px;
}

.cta-band .btn-primary {
  margin: 0 6px 8px;
}

/* Related links */
.related {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 28px;
}

.related a {
  display: block;
  background: var(--blue-50);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  color: var(--blue-900);
  font-weight: 600;
  font-size: 0.92rem;
  text-align: center;
}

.related a:hover {
  background: var(--white);
  border-color: var(--blue-300);
}

/* Error pages */
.error-wrap {
  min-height: 70vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 48px 16px;
}

.error-wrap .code {
  font-size: clamp(4rem, 12vw, 7rem);
  font-weight: 800;
  color: var(--blue-500);
  line-height: 1;
  margin-bottom: 8px;
}

.error-wrap h1 {
  font-size: 1.5rem;
  color: var(--blue-900);
  margin-bottom: 10px;
}

.error-wrap p {
  color: var(--muted);
  margin-bottom: 24px;
}

/* Footer */
.site-footer {
  background: var(--blue-900);
  color: rgba(255, 255, 255, 0.85);
  padding: 40px 0 24px;
  font-size: 0.9rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 28px;
  margin-bottom: 28px;
}

.site-footer h3 {
  color: var(--white);
  font-size: 1rem;
  margin-bottom: 12px;
}

.site-footer a {
  color: rgba(255, 255, 255, 0.8);
  display: block;
  margin-bottom: 8px;
}

.site-footer a:hover {
  color: var(--white);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.footer-brand img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.copyright {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding-top: 18px;
  text-align: center;
  font-size: 0.82rem;
  opacity: 0.75;
}

/* Utilities */
.tag {
  display: inline-block;
  background: var(--blue-50);
  color: var(--blue-700);
  font-size: 0.8rem;
  padding: 2px 10px;
  border-radius: 999px;
  margin-right: 6px;
  margin-bottom: 6px;
}

.note {
  background: var(--blue-50);
  border-left: 4px solid var(--blue-500);
  padding: 14px 16px;
  border-radius: 0 8px 8px 0;
  margin: 18px 0;
  color: var(--ink);
  font-size: 0.95rem;
}

/* Responsive */
@media (max-width: 960px) {
  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .shot-row,
  .shot-row.cols-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .related {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .toc ol {
    columns: 1;
  }
}

@media (max-width: 720px) {
  .nav-toggle {
    display: inline-flex;
  }

  .nav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding-bottom: 10px;
  }

  .nav.open {
    display: flex;
  }

  .nav a {
    width: 100%;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
  }

  .header-inner {
    flex-wrap: wrap;
  }

  .hero {
    padding: 48px 0 40px;
  }

  .split,
  .split.reverse .text,
  .split.reverse .media {
    grid-template-columns: 1fr;
    order: unset;
  }

  .split.reverse .media {
    order: -1;
  }

  .split .media img {
    max-width: 260px;
  }

  .feature-grid,
  .feature-grid.cols-2 {
    grid-template-columns: 1fr;
  }

  .shot-row,
  .shot-row.cols-3 {
    grid-template-columns: 1fr 1fr;
  }

  .related {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .section {
    padding: 40px 0;
  }

  .page-body .prose {
    padding: 22px 18px;
  }
}
