:root {
  --primary: #b5653a;
  --primary-dark: #7a4d2c;
  --primary-light: #d99b6c;
  --accent: #e8a54b;
  --accent-soft: #f3e7d8;
  --bg: #faf6f0;
  --bg-alt: #f3ece2;
  --surface: #ffffff;
  --surface-glass: rgba(255, 255, 255, 0.72);
  --border: rgba(122, 77, 44, 0.14);
  --text: #2f241c;
  --text-soft: #6b5a4c;
  --text-muted: #8d7b6b;
  --shadow-sm: 0 2px 8px rgba(122, 77, 44, 0.08);
  --shadow-md: 0 8px 28px rgba(122, 77, 44, 0.12);
  --shadow-lg: 0 18px 48px rgba(122, 77, 44, 0.18);
  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 28px;
  --radius-pill: 999px;
  --header-h: 68px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary: #e09a68;
    --primary-dark: #f0b98c;
    --primary-light: #c47c4e;
    --accent: #f0b96a;
    --accent-soft: #3a2c22;
    --bg: #17120e;
    --bg-alt: #1f1813;
    --surface: #241c16;
    --surface-glass: rgba(36, 28, 22, 0.68);
    --border: rgba(240, 185, 140, 0.16);
    --text: #f3e9df;
    --text-soft: #cbb8a6;
    --text-muted: #a08d7c;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 8px 28px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.6);
  }
}

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

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.8;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(181, 101, 58, 0.14), transparent 60%),
    radial-gradient(900px 500px at -10% 20%, rgba(232, 165, 75, 0.12), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

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

a:hover,
a:focus-visible {
  color: var(--primary);
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

ul,
ol {
  padding-left: 1.35em;
  margin: 0 0 1em;
}

li {
  margin: 0.35em 0;
}

p {
  margin: 0 0 1.1em;
  color: var(--text-soft);
}

h1, h2, h3, h4, h5, h6 {
  color: var(--text);
  line-height: 1.35;
  margin: 0 0 0.6em;
  font-weight: 700;
  letter-spacing: 0.01em;
}

h1 { font-size: clamp(1.75rem, 4.2vw, 2.85rem); }
h2 { font-size: clamp(1.45rem, 3.2vw, 2.1rem); }
h3 { font-size: clamp(1.15rem, 2.2vw, 1.4rem); }
h4 { font-size: clamp(1rem, 1.8vw, 1.15rem); }

h2 {
  position: relative;
  padding-bottom: 0.5em;
}

h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 56px;
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

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

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

header nav > a[aria-label="蘑菇视频首页"] {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--text);
  white-space: nowrap;
  padding: 6px 0;
  background: linear-gradient(120deg, var(--primary-dark), var(--primary), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

header nav > a[aria-label="蘑菇视频首页"]::before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 8px;
  border-radius: 50% 50% 50% 0;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  transform: rotate(-45deg);
  vertical-align: middle;
}

header nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 2px 4px;
  margin: 0;
  padding: 0;
  flex: 1;
  justify-content: flex-end;
}

header nav ul li a {
  display: block;
  padding: 6px 10px;
  font-size: 0.85rem;
  color: var(--text-soft);
  border-radius: var(--radius-pill);
  white-space: nowrap;
  transition: background 0.25s var(--ease), color 0.25s var(--ease), transform 0.25s var(--ease);
}

header nav ul li a:hover,
header nav ul li a:focus-visible {
  color: var(--primary-dark);
  background: var(--accent-soft);
  transform: translateY(-1px);
}

main {
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px 20px 60px;
  display: block;
}

main > nav[aria-label="面包屑导航"] ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 0;
  margin: 0 0 24px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

main > nav[aria-label="面包屑导航"] ol li {
  margin: 0;
  display: inline-flex;
  align-items: center;
}

main > nav[aria-label="面包屑导航"] ol li + li::before {
  content: "›";
  margin-right: 6px;
  color: var(--text-muted);
  opacity: 0.6;
}

section {
  margin: 0 0 32px;
  padding: clamp(22px, 3.4vw, 44px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.35s var(--ease), transform 0.35s var(--ease), border-color 0.35s var(--ease);
  animation: fadeUp 0.7s var(--ease) both;
}

section:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(181, 101, 58, 0.28);
}

section:nth-of-type(2n) {
  background: linear-gradient(180deg, var(--surface), var(--bg-alt));
}

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

#hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: clamp(20px, 4vw, 48px);
  align-items: center;
  padding: clamp(32px, 5vw, 72px) clamp(24px, 4vw, 56px);
  border: none;
  border-radius: var(--radius-lg);
  color: #fff;
  background:
    radial-gradient(900px 420px at 88% 12%, rgba(255, 214, 150, 0.45), transparent 60%),
    radial-gradient(700px 380px at 0% 100%, rgba(255, 255, 255, 0.18), transparent 55%),
    linear-gradient(125deg, #7a4d2c 0%, #b5653a 42%, #d99b6c 72%, #e8a54b 100%);
  box-shadow: var(--shadow-lg);
}

#hero::before {
  content: "";
  position: absolute;
  inset: -40% -10% auto auto;
  width: 460px;
  height: 460px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.22), transparent 65%);
  pointer-events: none;
  animation: floaty 12s ease-in-out infinite;
}

#hero::after {
  content: "";
  position: absolute;
  inset: auto auto -30% -8%;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.14), transparent 65%);
  pointer-events: none;
  animation: floaty 16s ease-in-out infinite reverse;
}

@keyframes floaty {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(-24px, 18px, 0) scale(1.06); }
}

#hero h1 {
  color: #fff;
  text-shadow: 0 2px 18px rgba(60, 30, 10, 0.28);
  margin-bottom: 0.5em;
}

#hero p {
  color: rgba(255, 255, 255, 0.92);
  font-size: clamp(0.95rem, 1.4vw, 1.05rem);
  max-width: 62ch;
  text-shadow: 0 1px 10px rgba(60, 30, 10, 0.2);
}

#hero figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 22px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: var(--radius-lg);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  backdrop-filter: blur(14px) saturate(150%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), var(--shadow-md);
  transition: transform 0.45s var(--ease), box-shadow 0.45s var(--ease);
}

#hero figure:hover {
  transform: translateY(-6px) rotate(-1deg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), var(--shadow-lg);
}

#hero figure svg {
  width: clamp(120px, 18vw, 170px);
  height: auto;
  filter: drop-shadow(0 10px 22px rgba(60, 30, 10, 0.28));
  transition: transform 0.6s var(--ease);
}

#hero figure:hover svg {
  transform: scale(1.05);
}

#hero figcaption {
  font-size: 0.82rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.6;
}

main > nav[aria-label="页面内锚点导航"] {
  padding: 18px clamp(18px, 3vw, 30px);
  margin-bottom: 32px;
  background: var(--surface-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  backdrop-filter: blur(16px) saturate(150%);
  box-shadow: var(--shadow-sm);
}

main > nav[aria-label="页面内锚点导航"] h2 {
  font-size: 0.95rem;
  margin-bottom: 12px;
  padding-bottom: 0;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.08em;
}

main > nav[aria-label="页面内锚点导航"] h2::after {
  display: none;
}

main > nav[aria-label="页面内锚点导航"] ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  margin: 0;
}

main > nav[aria-label="页面内锚点导航"] ul li {
  margin: 0;
}

main > nav[aria-label="页面内锚点导航"] ul li a {
  display: inline-block;
  padding: 6px 14px;
  font-size: 0.85rem;
  color: var(--text-soft);
  background: var(--bg-alt);
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  transition: all 0.28s var(--ease);
}

main > nav[aria-label="页面内锚点导航"] ul li a:hover,
main > nav[aria-label="页面内锚点导航"] ul li a:focus-visible {
  color: #fff;
  background: linear-gradient(120deg, var(--primary-dark), var(--primary));
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(181, 101, 58, 0.3);
}

article {
  position: relative;
  padding: 22px 24px;
  margin: 0 0 18px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), background 0.3s var(--ease), border-color 0.3s var(--ease);
}

article::before {
  content: "";
  position: absolute;
  left: 0;
  top: 18px;
  bottom: 18px;
  width: 4px;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--primary), var(--accent));
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}

article:hover {
  transform: translateY(-4px);
  background: var(--surface);
  border-color: rgba(181, 101, 58, 0.3);
  box-shadow: var(--shadow-md);
}

article:hover::before {
  opacity: 1;
}

article h3 {
  margin-bottom: 0.35em;
  transition: color 0.25s var(--ease);
}

article:hover h3 {
  color: var(--primary-dark);
}

article p:first-of-type {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.7em;
}

article p:first-of-type::before {
  content: "🕒 ";
  opacity: 0.8;
}

article a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--primary);
  padding: 4px 0;
}

article a::after {
  content: "→";
  transition: transform 0.25s var(--ease);
}

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

#faq h3 {
  margin-top: 1.6em;
  padding: 10px 16px;
  background: var(--bg-alt);
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 1.02rem;
  transition: background 0.25s var(--ease), border-color 0.25s var(--ease);
}

#faq h3:hover {
  background: var(--accent-soft);
  border-left-color: var(--accent);
}

#faq h3:first-of-type {
  margin-top: 0.8em;
}

#howto ul li::marker {
  color: var(--primary);
}

#howto h4 {
  margin-top: 1.5em;
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  gap: 8px;
}

#howto h4::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  flex-shrink: 0;
}

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

#contact ul li,
#sitemap ul li,
#links ul li {
  margin: 0;
  padding: 12px 16px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  transition: transform 0.25s var(--ease), background 0.25s var(--ease), border-color 0.25s var(--ease);
}

#contact ul li:hover,
#sitemap ul li:hover,
#links ul li:hover {
  transform: translateY(-2px);
  background: var(--surface);
  border-color: rgba(181, 101, 58, 0.3);
}

#sitemap ul li a,
#links ul li a {
  display: block;
  color: var(--text-soft);
  font-weight: 500;
}

#sitemap ul li a:hover,
#links ul li a:hover {
  color: var(--primary-dark);
}

#sitemap ul li a::before {
  content: "🔗 ";
  opacity: 0.7;
  font-size: 0.85em;
}

#legal h3 {
  margin-top: 1.6em;
  padding-bottom: 0.3em;
  border-bottom: 1px dashed var(--border);
}

#legal h3:first-of-type {
  margin-top: 0;
}

#legal h4 {
  margin-top: 1.4em;
  color: var(--text-muted);
  font-size: 0.95rem;
}

footer {
  max-width: 1240px;
  margin: 0 auto 40px;
  padding: 32px clamp(20px, 3vw, 40px);
  text-align: center;
  background: var(--surface-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  backdrop-filter: blur(16px) saturate(150%);
  box-shadow: var(--shadow-sm);
  font-size: 0.85rem;
  color: var(--text-muted);
}

footer p {
  margin: 0 0 8px;
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.7;
}

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

footer a {
  color: var(--primary-dark);
  font-weight: 500;
  padding: 2px 4px;
  border-radius: 4px;
}

footer a:hover {
  color: var(--primary);
  background: var(--accent-soft);
}

footer p:last-child {
  margin-bottom: 0;
}

::selection {
  background: rgba(181, 101, 58, 0.25);
  color: var(--text);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-alt);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--primary-light), var(--primary));
  border-radius: 10px;
  border: 2px solid var(--bg-alt);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-dark);
}

@media (max-width: 1024px) {
  #hero {
    grid-template-columns: minmax(0, 1fr);
    text-align: left;
  }

  #hero figure {
    max-width: 320px;
    margin: 0 auto;
  }

  header nav ul {
    justify-content: flex-start;
  }
}

@media (max-width: 768px) {
  :root {
    --header-h: 60px;
  }

  body {
    font-size: 15px;
    line-height: 1.75;
  }

  header nav {
    padding: 10px 16px;
    gap: 10px;
  }

  header nav > a[aria-label="蘑菇视频首页"] {
    font-size: 1.1rem;
  }

  header nav ul {
    flex: 1 0 100%;
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 6px;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
    mask-image: linear-gradient(90deg, #000 92%, transparent);
    -webkit-mask-image: linear-gradient(90deg, #000 92%, transparent);
  }

  header nav ul::-webkit-scrollbar {
    height: 4px;
  }

  header nav ul li a {
    padding: 5px 10px;
    font-size: 0.8rem;
  }

  main {
    padding: 16px 14px 40px;
  }

  section {
    padding: 20px 18px;
    border-radius: var(--radius-md);
    margin-bottom: 22px;
  }

  #hero {
    padding: 28px 20px;
    border-radius: var(--radius-md);
  }

  #hero figure {
    padding: 16px;
  }

  main > nav[aria-label="页面内锚点导航"] {
    padding: 14px 16px;
  }

  main > nav[aria-label="页面内锚点导航"] ul {
    gap: 6px;
  }

  main > nav[aria-label="页面内锚点导航"] ul li a {
    padding: 5px 11px;
    font-size: 0.8rem;
  }

  article {
    padding: 18px 16px;
  }

  #contact ul,
  #sitemap ul,
  #links ul {
    grid-template-columns: 1fr;
  }

  footer {
    margin: 0 14px 30px;
    padding: 24px 18px;
    border-radius: var(--radius-md);
  }
}

@media (max-width: 420px) {
  h1 { font-size: 1.55rem; }
  h2 { font-size: 1.3rem; }

  #hero p {
    font-size: 0.92rem;
  }

  article h3 {
    font-size: 1.05rem;
  }
}

@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;
  }
}

@media print {
  header,
  main > nav,
  footer {
    display: none;
  }

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

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

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

  #hero h1,
  #hero p,
  #hero figcaption {
    color: #000;
    text-shadow: none;
  }
}