:root {
  --bg: #0f0f1a;
  --bg-alt: #16162a;
  --surface: rgba(255, 255, 255, 0.06);
  --surface-solid: #1c1c32;
  --border: rgba(255, 255, 255, 0.12);
  --text: #eef0f7;
  --text-muted: #a8adc4;
  --primary: #e94560;
  --primary-soft: rgba(233, 69, 96, 0.16);
  --accent: #f5b971;
  --accent-2: #6ee7b7;
  --gradient-hero: linear-gradient(135deg, #1a1a2e 0%, #2d1b3d 45%, #4a1d3a 100%);
  --gradient-cta: linear-gradient(135deg, #e94560 0%, #f5b971 100%);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 8px 28px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.45);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;
  --container: 1180px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f7f5f0;
    --bg-alt: #efece4;
    --surface: rgba(255, 255, 255, 0.65);
    --surface-solid: #ffffff;
    --border: rgba(26, 26, 46, 0.1);
    --text: #1a1a2e;
    --text-muted: #5a5f75;
    --primary: #d63a55;
    --primary-soft: rgba(214, 58, 85, 0.1);
    --accent: #d99a4e;
    --accent-2: #2d6a4f;
    --gradient-hero: linear-gradient(135deg, #fff4ec 0%, #ffe3e8 50%, #f3e8ff 100%);
    --shadow-sm: 0 2px 8px rgba(26, 26, 46, 0.06);
    --shadow-md: 0 8px 28px rgba(26, 26, 46, 0.1);
    --shadow-lg: 0 20px 48px rgba(26, 26, 46, 0.14);
  }
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 60% 40% at 12% 0%, rgba(233, 69, 96, 0.12), transparent 70%),
    radial-gradient(ellipse 50% 40% at 88% 12%, rgba(245, 185, 113, 0.1), transparent 70%);
  background-attachment: fixed;
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease);
  overflow-x: hidden;
}

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

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

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

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

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

h1 { font-size: clamp(1.7rem, 4.2vw, 2.9rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: clamp(1.1rem, 2.2vw, 1.35rem); }
h4 { font-size: 1.05rem; }

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

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

li {
  margin-bottom: 0.4em;
}

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

header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 15, 26, 0.72);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

@media (prefers-color-scheme: light) {
  header {
    background: rgba(255, 255, 255, 0.7);
  }
}

header > div {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0.65rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

header a[aria-label="AI漫改短剧首页"] {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
}

header a[aria-label="AI漫改短剧首页"] svg {
  flex: 0 0 auto;
  transition: transform 0.5s var(--ease);
}

header a[aria-label="AI漫改短剧首页"]:hover svg {
  transform: rotate(-8deg) scale(1.06);
}

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

header nav a {
  display: inline-block;
  padding: 0.4rem 0.7rem;
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  font-size: 0.88rem;
  white-space: nowrap;
  transition: background 0.25s var(--ease), color 0.25s var(--ease), transform 0.25s var(--ease);
}

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

main {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.25rem 3rem;
}

section {
  position: relative;
  margin-top: 2.5rem;
  padding: 2rem 1.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  box-shadow: var(--shadow-sm);
  animation: riseIn 0.7s var(--ease) both;
  transition: box-shadow 0.4s var(--ease), transform 0.4s var(--ease), border-color 0.4s var(--ease);
}

section:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(233, 69, 96, 0.28);
}

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  section { animation: none; }
  * { transition-duration: 0.01ms !important; }
}

section#hero {
  margin-top: 1.5rem;
  padding: clamp(2rem, 5vw, 3.5rem) clamp(1.5rem, 4vw, 3rem);
  background: var(--gradient-hero);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

section#hero::before {
  content: "";
  position: absolute;
  inset: -40% -20% auto auto;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(233, 69, 96, 0.35), transparent 65%);
  filter: blur(30px);
  pointer-events: none;
  animation: floatGlow 12s ease-in-out infinite;
}

section#hero::after {
  content: "";
  position: absolute;
  inset: auto auto -30% -15%;
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, rgba(245, 185, 113, 0.28), transparent 65%);
  filter: blur(30px);
  pointer-events: none;
  animation: floatGlow 14s ease-in-out infinite reverse;
}

@keyframes floatGlow {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-24px, 18px) scale(1.08); }
}

section#hero > * {
  position: relative;
  z-index: 1;
}

section#hero h1 {
  background: linear-gradient(120deg, var(--text) 30%, var(--primary) 70%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--text);
  margin-bottom: 1rem;
}

section#hero > p {
  max-width: 68ch;
  font-size: 1.02rem;
}

section#hero > div {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin: 1.6rem 0 2rem;
}

section#hero > div a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.6rem;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), background 0.3s var(--ease), color 0.3s var(--ease);
}

section#hero > div a:first-child {
  background: var(--gradient-cta);
  color: #fff;
  box-shadow: 0 8px 24px rgba(233, 69, 96, 0.35);
}

section#hero > div a:first-child:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 14px 32px rgba(233, 69, 96, 0.5);
  color: #fff;
}

section#hero > div a:last-child {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

section#hero > div a:last-child:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
  color: var(--primary);
}

section#hero figure {
  margin: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
}

section#hero figure:hover {
  transform: translateY(-6px) scale(1.01);
  box-shadow: var(--shadow-lg);
}

section#hero figcaption {
  padding: 0.7rem 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  background: var(--surface-solid);
  border-top: 1px solid var(--border);
  text-align: center;
}

nav[aria-label="面包屑导航"] {
  margin-top: 1.5rem;
}

nav[aria-label="面包屑导航"] ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  list-style: none;
  margin: 0;
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  width: fit-content;
  max-width: 100%;
}

nav[aria-label="面包屑导航"] li {
  margin: 0;
  color: var(--text-muted);
}

nav[aria-label="面包屑导航"] li + li::before {
  content: "/";
  margin-right: 0.4rem;
  color: var(--text-muted);
  opacity: 0.6;
}

section h2 {
  position: relative;
  padding-bottom: 0.6rem;
  margin-bottom: 1.2rem;
}

section h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 56px;
  height: 4px;
  border-radius: var(--radius-pill);
  background: var(--gradient-cta);
  transition: width 0.45s var(--ease);
}

section:hover h2::after {
  width: 96px;
}

section h3 {
  margin-top: 1.6rem;
  color: var(--text);
}

section h3::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 0.55rem;
  border-radius: 2px;
  background: var(--primary);
  transform: rotate(45deg) translateY(-1px);
}

section h4 {
  margin-top: 1.2rem;
  color: var(--accent);
}

blockquote {
  margin: 1.2rem 0;
  padding: 1.2rem 1.4rem;
  background: var(--surface-solid);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s var(--ease);
}

blockquote:hover {
  transform: translateX(6px);
  box-shadow: var(--shadow-md);
  border-left-color: var(--accent);
}

blockquote p {
  font-style: italic;
  color: var(--text);
  margin-bottom: 0.6rem;
}

blockquote footer {
  font-size: 0.88rem;
  color: var(--text-muted);
  text-align: right;
}

article {
  margin: 1rem 0;
  padding: 1.2rem 1.3rem;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s var(--ease);
}

article:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: rgba(233, 69, 96, 0.35);
}

article h3 {
  margin-top: 0;
}

article h3::before {
  display: none;
}

article time {
  display: inline-block;
  font-size: 0.8rem;
  color: var(--accent);
  background: var(--primary-soft);
  padding: 0.15rem 0.65rem;
  border-radius: var(--radius-pill);
  margin-bottom: 0.6rem;
}

article a {
  display: inline-block;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  transition: background 0.3s var(--ease), color 0.3s var(--ease), transform 0.3s var(--ease);
}

article a:hover {
  background: var(--gradient-cta);
  color: #fff;
  border-color: transparent;
  transform: translateX(4px);
}

details {
  margin: 0.6rem 0;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

details:hover {
  border-color: rgba(233, 69, 96, 0.35);
  box-shadow: var(--shadow-sm);
}

details[open] {
  border-color: rgba(233, 69, 96, 0.45);
  box-shadow: var(--shadow-md);
}

details summary {
  cursor: pointer;
  padding: 0.9rem 1.2rem;
  font-weight: 600;
  color: var(--text);
  list-style: none;
  position: relative;
  padding-right: 2.6rem;
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
}

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

details summary::after {
  content: "+";
  position: absolute;
  right: 1.1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--primary);
  transition: transform 0.35s var(--ease), color 0.3s var(--ease);
}

details[open] summary::after {
  content: "−";
  transform: translateY(-50%) rotate(180deg);
  color: var(--accent);
}

details summary:hover {
  background: var(--primary-soft);
  color: var(--primary);
}

details p {
  padding: 0 1.2rem 1rem;
  margin: 0;
  animation: fadeSlide 0.4s var(--ease);
}

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

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

section#howto ol li {
  counter-increment: step;
  position: relative;
  padding: 0.6rem 0.9rem 0.6rem 3rem;
  margin-bottom: 0.5rem;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease);
}

section#howto ol li::before {
  content: counter(step);
  position: absolute;
  left: 0.8rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.6rem;
  height: 1.6rem;
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  background: var(--gradient-cta);
  border-radius: 50%;
}

section#howto ol li:hover {
  transform: translateX(6px);
  border-color: var(--primary);
}

address {
  font-style: normal;
  padding: 1.2rem 1.4rem;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 1.2rem;
}

address p {
  margin: 0 0 0.5rem;
}

address a {
  font-weight: 600;
}

form[role="search"] {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  margin-top: 0.8rem;
}

form[role="search"] label {
  flex: 0 0 100%;
  font-size: 0.9rem;
  color: var(--text-muted);
}

form[role="search"] input[type="search"] {
  flex: 1 1 220px;
  min-width: 0;
  padding: 0.7rem 1.1rem;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text);
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

form[role="search"] input[type="search"]::placeholder {
  color: var(--text-muted);
  opacity: 0.75;
}

form[role="search"] input[type="search"]:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-soft);
  outline: none;
}

form[role="search"] button {
  padding: 0.7rem 1.6rem;
  font-size: 0.95rem;
  font-family: inherit;
  font-weight: 600;
  color: #fff;
  background: var(--gradient-cta);
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

form[role="search"] button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(233, 69, 96, 0.4);
}

form[role="search"] button:active {
  transform: translateY(0);
}

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

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

section#sitemap a,
section#links a {
  display: block;
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-sm);
  background: var(--surface-solid);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: transform 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease), background 0.3s var(--ease);
}

section#sitemap a:hover,
section#links a:hover {
  transform: translateY(-2px);
  color: var(--primary);
  border-color: var(--primary);
  background: var(--primary-soft);
}

footer {
  max-width: var(--container);
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.2rem;
}

footer section {
  margin-top: 0;
  padding: 1.4rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

footer section:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

footer h2 {
  font-size: 1rem;
  margin-bottom: 0.7rem;
  color: var(--text);
}

footer h2::after {
  display: none;
}

footer p {
  font-size: 0.86rem;
  margin: 0;
  line-height: 1.7;
}

footer > p {
  grid-column: 1 / -1;
  text-align: center;
  margin: 0.5rem 0 0;
}

footer > p a {
  display: inline-block;
  padding: 0.55rem 1.4rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform 0.3s var(--ease), background 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease);
}

footer > p a:hover {
  transform: translateY(-3px);
  background: var(--gradient-cta);
  color: #fff;
  border-color: transparent;
}

::selection {
  background: var(--primary);
  color: #fff;
}

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

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

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

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

@media (max-width: 860px) {
  header > div {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  header nav {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 0.2rem;
  }

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

  header nav ul {
    flex-wrap: nowrap;
  }

  section {
    padding: 1.5rem 1.15rem;
    border-radius: var(--radius-md);
  }

  section#hero {
    padding: 1.8rem 1.2rem;
  }

  section#hero > div {
    gap: 0.6rem;
  }

  section#hero > div a {
    flex: 1 1 100%;
  }

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

  blockquote:hover {
    transform: none;
  }
}

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

  main {
    padding: 0 0.85rem 2rem;
  }

  header > div {
    padding: 0.55rem 0.85rem;
  }

  header a[aria-label="AI漫改短剧首页"] span {
    font-size: 1rem;
  }

  section {
    margin-top: 1.5rem;
    padding: 1.25rem 0.95rem;
  }

  section h2 {
    font-size: 1.25rem;
  }

  section h3 {
    font-size: 1.05rem;
  }

  article {
    padding: 1rem;
  }

  details summary {
    padding: 0.75rem 0.9rem;
    padding-right: 2.4rem;
    font-size: 0.92rem;
  }

  details p {
    padding: 0 0.9rem 0.9rem;
  }

  form[role="search"] button {
    flex: 1 1 100%;
  }

  footer {
    padding: 1.5rem 0.85rem 2.5rem;
    grid-template-columns: 1fr;
  }

  footer section {
    padding: 1.1rem 1rem;
  }
}

@media (prefers-color-scheme: light) {
  header nav a:hover,
  header nav a:focus-visible {
    color: var(--primary);
  }

  section#hero > div a:last-child {
    background: rgba(255, 255, 255, 0.75);
  }

  section#hero > div a:last-child:hover {
    color: var(--primary);
  }

  section#hero figcaption {
    background: rgba(255, 255, 255, 0.8);
  }

  blockquote {
    background: rgba(255, 255, 255, 0.8);
  }

  article,
  details,
  address,
  section#howto ol li,
  section#sitemap a,
  section#links a,
  form[role="search"] input[type="search"] {
    background: rgba(255, 255, 255, 0.85);
  }

  footer > p a {
    background: rgba(255, 255, 255, 0.8);
  }
}

@media print {
  header,
  footer,
  section#hero::before,
  section#hero::after {
    display: none;
  }

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

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