:root {
  --brand: #ff4d4f;
  --brand-2: #ff7a45;
  --brand-3: #ff4d94;
  --brand-soft: rgba(255, 77, 79, 0.12);
  --bg: #f7f8fc;
  --bg-2: #eef1f8;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-solid: #ffffff;
  --surface-border: rgba(255, 255, 255, 0.6);
  --text: #1b1f2a;
  --text-2: #4a5266;
  --text-3: #7a8299;
  --line: rgba(27, 31, 42, 0.08);
  --shadow-sm: 0 4px 16px rgba(24, 30, 48, 0.06);
  --shadow: 0 12px 32px rgba(24, 30, 48, 0.10);
  --shadow-lg: 0 24px 60px rgba(24, 30, 48, 0.16);
  --radius-sm: 12px;
  --radius: 18px;
  --radius-lg: 26px;
  --radius-pill: 999px;
  --blur: 18px;
  --maxw: 1180px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --header-h: 68px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1017;
    --bg-2: #12161f;
    --surface: rgba(26, 31, 43, 0.66);
    --surface-solid: #171c27;
    --surface-border: rgba(255, 255, 255, 0.08);
    --text: #eef1f7;
    --text-2: #b9c0d0;
    --text-3: #8b93a7;
    --line: rgba(255, 255, 255, 0.10);
    --brand-soft: rgba(255, 77, 79, 0.18);
    --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.35);
    --shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.55);
  }
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial,
    sans-serif;
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 12% -8%, rgba(255, 77, 79, 0.16), transparent 60%),
    radial-gradient(1000px 560px at 92% 4%, rgba(255, 122, 69, 0.14), transparent 62%),
    radial-gradient(900px 520px at 50% 110%, rgba(255, 77, 148, 0.10), transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img,
video {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--brand);
  text-decoration: none;
  transition: color 0.25s var(--ease), opacity 0.25s var(--ease);
}

a:hover,
a:focus-visible {
  color: var(--brand-2);
  text-decoration: underline;
  text-underline-offset: 3px;
}

a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- Header ---------- */

header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  -webkit-backdrop-filter: saturate(180%) blur(var(--blur));
  backdrop-filter: saturate(180%) blur(var(--blur));
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

header nav {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

header nav > a[title="51视频首页"] {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  background: linear-gradient(92deg, var(--brand) 0%, var(--brand-2) 55%, var(--brand-3) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  white-space: nowrap;
  padding: 6px 2px;
  transition: transform 0.3s var(--ease);
}

header nav > a[title="51视频首页"]:hover {
  transform: translateY(-1px) scale(1.02);
  text-decoration: none;
}

header nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

header nav ul li a {
  display: inline-block;
  padding: 8px 13px;
  border-radius: var(--radius-pill);
  color: var(--text-2);
  font-size: 0.93rem;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.25s var(--ease), color 0.25s var(--ease),
    transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

header nav ul li a:hover,
header nav ul li a:focus-visible {
  color: var(--brand);
  background: var(--brand-soft);
  transform: translateY(-2px);
  text-decoration: none;
  box-shadow: 0 6px 16px rgba(255, 77, 79, 0.18);
}

/* ---------- Layout ---------- */

main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 28px 20px 80px;
}

main > nav[aria-label="面包屑"] {
  margin-bottom: 20px;
}

main > nav[aria-label="面包屑"] ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 10px 16px;
  font-size: 0.86rem;
  color: var(--text-3);
  background: var(--surface);
  -webkit-backdrop-filter: blur(var(--blur));
  backdrop-filter: blur(var(--blur));
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm);
  width: fit-content;
  max-width: 100%;
}

main > nav[aria-label="面包屑"] ol li {
  display: flex;
  align-items: center;
  gap: 8px;
}

main > nav[aria-label="面包屑"] ol li + li::before {
  content: "/";
  color: var(--text-3);
  opacity: 0.6;
}

main > nav[aria-label="面包屑"] ol li:last-child {
  color: var(--brand);
  font-weight: 600;
}

h1 {
  position: relative;
  margin: 0 0 34px;
  padding: 40px 34px;
  font-size: clamp(1.5rem, 1.1rem + 2.4vw, 2.5rem);
  line-height: 1.3;
  font-weight: 800;
  letter-spacing: 0.2px;
  color: #fff;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(120deg, rgba(255, 77, 79, 0.96) 0%, rgba(255, 122, 69, 0.94) 48%, rgba(255, 77, 148, 0.94) 100%),
    radial-gradient(600px 300px at 90% 0%, rgba(255, 255, 255, 0.35), transparent 60%);
  background-blend-mode: normal, overlay;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  isolation: isolate;
  text-shadow: 0 2px 12px rgba(120, 20, 20, 0.28);
}

h1::before {
  content: "";
  position: absolute;
  inset: -40% -10% auto auto;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.34), transparent 68%);
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
  animation: floatGlow 9s ease-in-out infinite alternate;
}

h1::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.15));
  opacity: 0.5;
}

@keyframes floatGlow {
  from {
    transform: translate3d(0, 0, 0) scale(1);
    opacity: 0.85;
  }
  to {
    transform: translate3d(-30px, 26px, 0) scale(1.12);
    opacity: 1;
  }
}

/* ---------- Sections as glass cards ---------- */

main > section {
  position: relative;
  margin: 0 0 26px;
  padding: 30px 28px;
  background: var(--surface);
  -webkit-backdrop-filter: saturate(180%) blur(var(--blur));
  backdrop-filter: saturate(180%) blur(var(--blur));
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease),
    border-color 0.4s var(--ease), background 0.4s var(--ease);
  will-change: transform;
}

main > section::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0) 42%, rgba(255, 77, 79, 0.28));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0.9;
}

main > section:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(255, 77, 79, 0.28);
}

main > section h2 {
  position: relative;
  margin: 0 0 20px;
  padding-left: 18px;
  font-size: clamp(1.2rem, 1.02rem + 0.9vw, 1.6rem);
  font-weight: 800;
  line-height: 1.4;
  letter-spacing: 0.2px;
  color: var(--text);
}

main > section h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.18em;
  bottom: 0.18em;
  width: 6px;
  border-radius: var(--radius-pill);
  background: linear-gradient(180deg, var(--brand), var(--brand-3));
  box-shadow: 0 0 14px rgba(255, 77, 79, 0.5);
}

main > section h3 {
  margin: 24px 0 10px;
  font-size: 1.06rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.2px;
}

main > section h3:first-of-type {
  margin-top: 6px;
}

main > section p {
  margin: 0 0 12px;
  color: var(--text-2);
  font-size: 0.98rem;
}

main > section p:last-child {
  margin-bottom: 0;
}

/* ---------- Lists ---------- */

main > section ul,
main > section ol {
  margin: 0 0 12px;
  padding-left: 1.35em;
  color: var(--text-2);
}

main > section li {
  margin: 6px 0;
  padding-left: 2px;
}

main > section li::marker {
  color: var(--brand);
  font-weight: 700;
}

/* ---------- Articles & News ---------- */

main > section article {
  position: relative;
  margin: 0 0 16px;
  padding: 22px 22px 20px;
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease),
    border-color 0.35s var(--ease);
  overflow: hidden;
}

main > section article::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--brand), var(--brand-3));
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.4s var(--ease);
}

main > section article:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: rgba(255, 77, 79, 0.3);
}

main > section article:hover::after {
  transform: scaleY(1);
}

main > section article h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
  line-height: 1.5;
}

main > section article time {
  display: inline-block;
  margin-bottom: 10px;
  padding: 3px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.4px;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: var(--radius-pill);
}

main > section article p {
  margin: 0 0 12px;
  font-size: 0.94rem;
}

main > section article a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: var(--brand-soft);
  color: var(--brand);
  transition: background 0.3s var(--ease), color 0.3s var(--ease),
    transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

main > section article a::after {
  content: "→";
  transition: transform 0.3s var(--ease);
}

main > section article a:hover,
main > section article a:focus-visible {
  background: linear-gradient(92deg, var(--brand), var(--brand-3));
  color: #fff;
  transform: translateY(-2px);
  text-decoration: none;
  box-shadow: 0 8px 20px rgba(255, 77, 79, 0.35);
}

main > section article a:hover::after {
  transform: translateX(4px);
}

/* ---------- Blockquote ---------- */

main > section blockquote {
  position: relative;
  margin: 14px 0;
  padding: 18px 20px 18px 52px;
  font-size: 0.96rem;
  font-style: normal;
  color: var(--text-2);
  background: linear-gradient(135deg, var(--brand-soft), transparent 80%);
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

main > section blockquote::before {
  content: "“";
  position: absolute;
  left: 16px;
  top: 6px;
  font-size: 2.6rem;
  line-height: 1;
  font-weight: 800;
  color: var(--brand);
  opacity: 0.5;
  font-family: Georgia, "Times New Roman", serif;
}

main > section blockquote:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

/* ---------- FAQ details ---------- */

main > section details {
  margin: 0 0 12px;
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow 0.35s var(--ease), border-color 0.35s var(--ease),
    transform 0.35s var(--ease);
}

main > section details:hover {
  border-color: rgba(255, 77, 79, 0.3);
  box-shadow: var(--shadow);
}

main > section details[open] {
  border-color: rgba(255, 77, 79, 0.4);
  box-shadow: var(--shadow);
}

main > section details summary {
  position: relative;
  list-style: none;
  cursor: pointer;
  padding: 16px 52px 16px 20px;
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text);
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
  -webkit-tap-highlight-color: transparent;
}

main > section details summary::-webkit-details-marker {
  display: none;
}

main > section details summary::after {
  content: "";
  position: absolute;
  right: 20px;
  top: 50%;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--brand);
  border-bottom: 2px solid var(--brand);
  transform: translateY(-70%) rotate(45deg);
  transition: transform 0.35s var(--ease);
}

main > section details[open] summary {
  color: var(--brand);
  background: var(--brand-soft);
}

main > section details[open] summary::after {
  transform: translateY(-30%) rotate(-135deg);
}

main > section details summary:hover {
  background: var(--brand-soft);
  color: var(--brand);
}

main > section details p {
  margin: 0;
  padding: 14px 20px 18px;
  font-size: 0.94rem;
  color: var(--text-2);
  border-top: 1px solid var(--line);
  animation: fadeSlide 0.4s var(--ease);
}

@keyframes fadeSlide {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Contact / sitemap / links / legal / editor ---------- */

#contact p {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  padding: 10px 14px;
  margin: 0 0 10px;
  font-size: 0.94rem;
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease),
    box-shadow 0.3s var(--ease);
}

#contact p:hover {
  transform: translateX(4px);
  border-color: rgba(255, 77, 79, 0.3);
  box-shadow: var(--shadow);
}

#sitemap ul,
#links ul {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}

#sitemap ul li,
#links ul li {
  margin: 0;
  padding: 0;
}

#sitemap ul li a,
#links ul li a {
  display: block;
  padding: 12px 16px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-2);
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s var(--ease), color 0.3s var(--ease),
    background 0.3s var(--ease), border-color 0.3s var(--ease),
    box-shadow 0.3s var(--ease);
}

#sitemap ul li a:hover,
#links ul li a:hover,
#sitemap ul li a:focus-visible,
#links ul li a:focus-visible {
  color: #fff;
  background: linear-gradient(92deg, var(--brand), var(--brand-3));
  border-color: transparent;
  transform: translateY(-3px);
  text-decoration: none;
  box-shadow: 0 12px 26px rgba(255, 77, 79, 0.32);
}

#legal h3 {
  display: inline-block;
  padding: 4px 14px;
  margin: 22px 0 10px;
  font-size: 0.95rem;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: var(--radius-pill);
}

#editor p {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  padding: 10px 14px;
  margin: 0 0 10px;
  font-size: 0.92rem;
  color: var(--text-2);
  background: var(--surface-solid);
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
}

/* ---------- Footer ---------- */

footer {
  position: relative;
  margin-top: 20px;
  padding: 34px 20px 40px;
  text-align: center;
  color: var(--text-2);
  background: var(--surface);
  -webkit-backdrop-filter: saturate(180%) blur(var(--blur));
  backdrop-filter: saturate(180%) blur(var(--blur));
  border-top: 1px solid var(--line);
}

footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2), var(--brand-3));
  opacity: 0.85;
}

footer p {
  margin: 6px 0;
  font-size: 0.88rem;
}

footer p:first-child {
  font-weight: 600;
  color: var(--text);
}

footer a {
  color: var(--text-2);
  font-weight: 500;
  transition: color 0.25s var(--ease);
}

footer a:hover,
footer a:focus-visible {
  color: var(--brand);
  text-decoration: none;
}

/* ---------- Scroll reveal animation ---------- */

main > section,
main > section article,
main > section details,
main > section blockquote {
  animation: revealUp 0.7s var(--ease) both;
}

main > section:nth-of-type(1) { animation-delay: 0.02s; }
main > section:nth-of-type(2) { animation-delay: 0.06s; }
main > section:nth-of-type(3) { animation-delay: 0.10s; }
main > section:nth-of-type(4) { animation-delay: 0.14s; }
main > section:nth-of-type(5) { animation-delay: 0.18s; }
main > section:nth-of-type(6) { animation-delay: 0.22s; }
main > section:nth-of-type(7) { animation-delay: 0.26s; }
main > section:nth-of-type(8) { animation-delay: 0.30s; }
main > section:nth-of-type(9) { animation-delay: 0.34s; }
main > section:nth-of-type(10) { animation-delay: 0.38s; }
main > section:nth-of-type(11) { animation-delay: 0.42s; }
main > section:nth-of-type(12) { animation-delay: 0.46s; }

@keyframes revealUp {
  from {
    opacity: 0;
    transform: translateY(26px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@supports (animation-timeline: view()) {
  main > section {
    animation-timeline: view();
    animation-range: entry 0% cover 28%;
  }
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  :root {
    --header-h: 60px;
    --radius-lg: 22px;
  }

  header nav {
    padding: 10px 16px;
    gap: 10px;
    justify-content: center;
  }

  header nav ul {
    justify-content: center;
    gap: 2px;
  }

  header nav ul li a {
    padding: 7px 11px;
    font-size: 0.88rem;
  }

  main {
    padding: 20px 16px 64px;
  }

  h1 {
    padding: 30px 22px;
    border-radius: var(--radius);
  }

  main > section {
    padding: 24px 20px;
  }
}

@media (max-width: 600px) {
  body {
    font-size: 15px;
  }

  header nav > a[title="51视频首页"] {
    font-size: 1.2rem;
  }

  header nav ul li a {
    padding: 6px 9px;
    font-size: 0.82rem;
  }

  main {
    padding: 16px 12px 56px;
  }

  main > nav[aria-label="面包屑"] ol {
    font-size: 0.78rem;
    padding: 8px 12px;
    gap: 6px;
  }

  h1 {
    padding: 24px 18px;
    margin-bottom: 22px;
  }

  main > section {
    padding: 20px 16px;
    margin-bottom: 18px;
    border-radius: var(--radius);
  }

  main > section h2 {
    padding-left: 14px;
    margin-bottom: 16px;
  }

  main > section h2::before {
    width: 5px;
  }

  main > section article {
    padding: 18px 16px;
  }

  main > section blockquote {
    padding: 16px 16px 16px 44px;
  }

  main > section details summary {
    padding: 14px 44px 14px 16px;
    font-size: 0.92rem;
  }

  main > section details summary::after {
    right: 16px;
  }

  main > section details p {
    padding: 12px 16px 16px;
  }

  #sitemap ul,
  #links ul {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 8px;
  }

  #sitemap ul li a,
  #links ul li a {
    padding: 10px 12px;
    font-size: 0.86rem;
  }

  footer {
    padding: 26px 14px 32px;
  }
}

@media (max-width: 380px) {
  header nav ul li a {
    padding: 6px 7px;
    font-size: 0.78rem;
  }

  h1 {
    padding: 20px 14px;
  }
}

/* ---------- Accessibility / motion / print ---------- */

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

@media (prefers-contrast: more) {
  :root {
    --line: rgba(27, 31, 42, 0.3);
    --surface-border: rgba(27, 31, 42, 0.3);
  }
}

@media print {
  header,
  footer,
  main > nav[aria-label="面包屑"] {
    display: none;
  }

  body {
    background: #fff;
    color: #000;
  }

  main > section {
    box-shadow: none;
    border: 1px solid #ccc;
    break-inside: avoid;
  }
}