:root {
  --brand: #c62828;
  --brand-dark: #8e1f1f;
  --brand-light: #e57373;
  --brand-pale: #fdf3f2;
  --accent: #ff8a65;
  --accent-2: #ffb74d;
  --text: #2b1f1e;
  --text-soft: #5c4a48;
  --text-muted: #8a7472;
  --bg: #fffaf9;
  --bg-alt: #fdf3f2;
  --card: #ffffff;
  --card-glass: rgba(255, 255, 255, 0.72);
  --border: rgba(198, 40, 40, 0.12);
  --border-strong: rgba(198, 40, 40, 0.22);
  --shadow-sm: 0 2px 8px rgba(142, 31, 31, 0.06);
  --shadow-md: 0 8px 24px rgba(142, 31, 31, 0.10);
  --shadow-lg: 0 18px 48px rgba(142, 31, 31, 0.16);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;
  --header-h: 64px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --grad-hero: linear-gradient(135deg, #c62828 0%, #e53935 38%, #ff7043 72%, #ffb74d 100%);
  --grad-soft: linear-gradient(135deg, #fdf3f2 0%, #fff5f2 50%, #fff8ec 100%);
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand: #ff6b6b;
    --brand-dark: #ff8a80;
    --brand-light: #e57373;
    --brand-pale: #2a1413;
    --accent: #ffab91;
    --accent-2: #ffcc80;
    --text: #f5eceb;
    --text-soft: #d4c4c2;
    --text-muted: #a08e8c;
    --bg: #140d0d;
    --bg-alt: #1c1211;
    --card: #211615;
    --card-glass: rgba(33, 22, 21, 0.72);
    --border: rgba(255, 107, 107, 0.16);
    --border-strong: rgba(255, 107, 107, 0.3);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.6);
    --grad-hero: linear-gradient(135deg, #7a1c1c 0%, #a32424 40%, #c2410c 75%, #b45309 100%);
    --grad-soft: linear-gradient(135deg, #1c1211 0%, #241615 50%, #2a1a12 100%);
  }
}

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

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.85;
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(1200px 600px at 100% -10%, rgba(255, 138, 101, 0.10), transparent 60%),
    radial-gradient(900px 500px at -10% 20%, rgba(198, 40, 40, 0.08), transparent 55%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img,
svg {
  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 {
  color: var(--brand-dark);
}

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

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

h1 {
  font-size: clamp(1.7rem, 1.2rem + 2.4vw, 2.8rem);
}

h2 {
  font-size: clamp(1.35rem, 1.1rem + 1.2vw, 1.9rem);
  position: relative;
  padding-left: 18px;
}

h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.18em;
  bottom: 0.18em;
  width: 5px;
  border-radius: var(--radius-pill);
  background: linear-gradient(180deg, var(--brand), var(--accent));
}

h3 {
  font-size: clamp(1.1rem, 1rem + 0.5vw, 1.35rem);
  color: var(--brand-dark);
}

h4 {
  font-size: clamp(1rem, 0.95rem + 0.3vw, 1.15rem);
}

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

ul, ol {
  margin: 0 0 1.2em;
  padding-left: 1.4em;
  color: var(--text-soft);
}

li {
  margin-bottom: 0.4em;
}

li::marker {
  color: var(--brand);
}

blockquote {
  margin: 0 0 1.2em;
  padding: 18px 22px;
  border-radius: var(--radius);
  background: var(--card-glass);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  backdrop-filter: blur(14px) saturate(160%);
  border: 1px solid var(--border);
  border-left: 4px solid var(--brand);
  box-shadow: var(--shadow-sm);
  position: relative;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

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

blockquote p {
  margin: 0;
  color: var(--text);
  font-style: normal;
}

blockquote p::before {
  content: "\201C";
  color: var(--brand-light);
  font-size: 1.6em;
  line-height: 0;
  vertical-align: -0.25em;
  margin-right: 4px;
}

figure {
  margin: 1.6em 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  transition: transform 0.45s var(--ease), box-shadow 0.45s var(--ease);
}

figure:hover {
  transform: translateY(-4px) scale(1.005);
  box-shadow: var(--shadow-lg);
}

figcaption {
  padding: 12px 18px;
  font-size: 0.9rem;
  color: var(--text-muted);
  background: var(--card);
  border-top: 1px solid var(--border);
  text-align: center;
}

header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--card-glass);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  backdrop-filter: blur(18px) saturate(180%);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4) inset, var(--shadow-sm);
}

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

header nav > a[aria-label="红果看剧首页"] {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--brand);
  padding: 8px 0;
  position: relative;
  white-space: nowrap;
}

header nav > a[aria-label="红果看剧首页"]::after {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-left: 6px;
  border-radius: 50%;
  background: var(--grad-hero);
  vertical-align: middle;
  box-shadow: 0 0 0 3px var(--brand-pale);
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.25); opacity: 0.75; }
}

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

header nav ul li {
  margin: 0;
}

header nav ul a {
  display: inline-block;
  padding: 7px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-soft);
  transition: background 0.25s var(--ease), color 0.25s var(--ease), transform 0.25s var(--ease);
}

header nav ul a:hover {
  background: var(--brand-pale);
  color: var(--brand);
  transform: translateY(-1px);
}

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px 40px;
}

main > section {
  margin: 32px 0;
  padding: clamp(20px, 4vw, 40px);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.4s var(--ease), transform 0.4s var(--ease);
  animation: rise 0.7s var(--ease) both;
}

main > section:hover {
  box-shadow: var(--shadow-md);
}

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

main > section:first-of-type {
  margin-top: 28px;
  padding: clamp(28px, 5vw, 56px);
  background: var(--grad-hero);
  color: #fff;
  border: none;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

main > section:first-of-type::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.22), transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(255, 255, 255, 0.15), transparent 45%);
  pointer-events: none;
}

main > section:first-of-type::after {
  content: "";
  position: absolute;
  top: -60%;
  right: -20%;
  width: 60%;
  height: 200%;
  background: linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, 0.12) 50%, transparent 60%);
  transform: rotate(8deg);
  pointer-events: none;
  animation: sheen 9s ease-in-out infinite;
}

@keyframes sheen {
  0%, 100% { transform: translateX(-30%) rotate(8deg); opacity: 0.4; }
  50% { transform: translateX(30%) rotate(8deg); opacity: 0.9; }
}

main > section:first-of-type h1 {
  color: #fff;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.18);
  position: relative;
  z-index: 1;
}

main > section:first-of-type p {
  color: rgba(255, 255, 255, 0.94);
  position: relative;
  z-index: 1;
  max-width: 72ch;
  font-size: 1.02rem;
}

main > section:first-of-type figure {
  position: relative;
  z-index: 1;
  margin-top: 28px;
  background: rgba(255, 255, 255, 0.5);
  border-color: rgba(255, 255, 255, 0.4);
}

main > section:first-of-type figcaption {
  background: rgba(255, 255, 255, 0.85);
  color: var(--brand-dark);
  border-top-color: rgba(198, 40, 40, 0.15);
}

main > nav[aria-label="站内锚点导航"] {
  margin: 28px 0;
  padding: clamp(18px, 3vw, 28px);
  background: var(--card-glass);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

main > nav[aria-label="站内锚点导航"] h2 {
  font-size: 1.1rem;
  margin-bottom: 14px;
}

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

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

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

main > nav[aria-label="站内锚点导航"] a:hover {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(198, 40, 40, 0.28);
}

article {
  margin: 0 0 20px;
  padding: clamp(18px, 3vw, 26px);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s var(--ease);
  position: relative;
  overflow: hidden;
}

article::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--brand), var(--accent));
  opacity: 0;
  transition: opacity 0.35s var(--ease);
}

article:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

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

article h3 {
  margin-bottom: 8px;
}

article p {
  margin-bottom: 0.7em;
}

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

article a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  background: var(--brand);
  color: #fff;
  transition: all 0.3s var(--ease);
}

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

article a:hover {
  background: var(--brand-dark);
  color: #fff;
  box-shadow: 0 6px 18px rgba(198, 40, 40, 0.32);
  transform: translateY(-2px);
}

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

section > section[id^="article-"] {
  margin: 20px 0;
  padding: clamp(18px, 3vw, 28px);
  background: var(--bg-alt);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  border-left: 4px solid var(--brand-light);
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

section > section[id^="article-"]:hover {
  border-left-color: var(--brand);
  box-shadow: var(--shadow-sm);
}

section > section[id^="article-"] h4 {
  color: var(--brand-dark);
}

details {
  margin-bottom: 12px;
  padding: 0;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow 0.3s var(--ease), border-color 0.3s var(--ease), background 0.3s var(--ease);
}

details[open] {
  background: var(--card);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

details:hover {
  border-color: var(--border-strong);
}

summary {
  cursor: pointer;
  padding: 16px 52px 16px 20px;
  font-weight: 600;
  color: var(--text);
  position: relative;
  list-style: none;
  transition: color 0.25s var(--ease), background 0.25s var(--ease);
  user-select: none;
}

summary::-webkit-details-marker {
  display: none;
}

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.3s var(--ease);
}

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

details[open] summary {
  color: var(--brand);
  background: var(--brand-pale);
  border-bottom: 1px solid var(--border);
}

summary:hover {
  color: var(--brand);
}

details > p {
  padding: 16px 20px;
  margin: 0;
  animation: fadeIn 0.35s var(--ease);
}

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

#howto ol {
  counter-reset: step;
  list-style: none;
  padding-left: 0;
}

#howto ol li {
  counter-increment: step;
  position: relative;
  padding: 12px 16px 12px 56px;
  margin-bottom: 10px;
  background: var(--bg-alt);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

#howto ol li::before {
  content: counter(step);
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--grad-hero);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  box-shadow: 0 3px 10px rgba(198, 40, 40, 0.3);
}

#howto ol li:hover {
  transform: translateX(4px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

address {
  font-style: normal;
  padding: clamp(18px, 3vw, 26px);
  background: var(--bg-alt);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  border-left: 4px solid var(--brand);
}

address p {
  margin-bottom: 0.5em;
}

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

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

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

#sitemap a,
#links a {
  display: block;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--text-soft);
  transition: all 0.28s var(--ease);
}

#sitemap a:hover,
#links a:hover {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(198, 40, 40, 0.26);
}

footer {
  margin-top: 48px;
  padding: clamp(32px, 5vw, 56px) 20px 28px;
  background: linear-gradient(180deg, var(--bg-alt) 0%, var(--brand-pale) 100%);
  border-top: 1px solid var(--border);
  position: relative;
}

footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--grad-hero);
}

footer > section {
  max-width: 1200px;
  margin: 0 auto 24px;
  padding: 0;
}

footer h2 {
  font-size: 1.05rem;
  padding-left: 14px;
}

footer h2::before {
  width: 4px;
}

footer p {
  font-size: 0.9rem;
  color: var(--text-muted);
  max-width: 900px;
}

footer > p {
  max-width: 1200px;
  margin: 0 auto 10px;
  text-align: center;
  font-size: 0.85rem;
}

footer > p a {
  display: inline-block;
  padding: 8px 22px;
  border-radius: var(--radius-pill);
  background: var(--brand);
  color: #fff;
  font-weight: 600;
  transition: all 0.3s var(--ease);
}

footer > p a:hover {
  background: var(--brand-dark);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(198, 40, 40, 0.3);
}

@media (max-width: 900px) {
  header nav {
    padding: 8px 16px;
    gap: 8px;
  }

  header nav ul {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  header nav ul::-webkit-scrollbar {
    display: none;
  }

  header nav ul a {
    white-space: nowrap;
    font-size: 0.85rem;
    padding: 6px 10px;
  }

  main {
    padding: 0 14px 32px;
  }

  main > section {
    border-radius: var(--radius);
  }
}

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

  h2 {
    padding-left: 14px;
  }

  h2::before {
    width: 4px;
  }

  main > section {
    margin: 20px 0;
    padding: 18px 16px;
  }

  main > section:first-of-type {
    padding: 24px 18px;
  }

  main > section:first-of-type::after {
    display: none;
  }

  blockquote {
    padding: 14px 16px;
  }

  summary {
    padding: 14px 44px 14px 16px;
    font-size: 0.95rem;
  }

  details > p {
    padding: 14px 16px;
  }

  #howto ol li {
    padding: 12px 14px 12px 50px;
  }

  #howto ol li::before {
    left: 12px;
    width: 26px;
    height: 26px;
    font-size: 0.8rem;
  }

  #sitemap ul,
  #links ul {
    grid-template-columns: repeat(2, 1fr);
  }

  article a {
    padding: 6px 14px;
    font-size: 0.85rem;
  }
}

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

@media print {
  header,
  footer,
  main > nav[aria-label="站内锚点导航"],
  main > section:first-of-type::after {
    display: none;
  }

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

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