:root {
  --brand: #FF5C39;
  --brand-2: #FF8A3D;
  --brand-3: #FFD23F;
  --accent: #3EC1A0;
  --ink: #2D2A4A;
  --ink-soft: #56527A;
  --bg: #FFF7F3;
  --bg-2: #FFFFFF;
  --card: rgba(255, 255, 255, 0.72);
  --card-solid: #FFFFFF;
  --glass: rgba(255, 255, 255, 0.55);
  --glass-border: rgba(255, 255, 255, 0.7);
  --line: rgba(45, 42, 74, 0.1);
  --shadow: 0 10px 30px rgba(255, 92, 57, 0.12), 0 2px 8px rgba(45, 42, 74, 0.06);
  --shadow-hover: 0 18px 44px rgba(255, 92, 57, 0.22), 0 6px 14px rgba(45, 42, 74, 0.1);
  --radius: 18px;
  --radius-sm: 12px;
  --radius-lg: 28px;
  --maxw: 1180px;
  --t: 0.32s 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", Roboto, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand: #FF6E4E;
    --brand-2: #FF9A55;
    --brand-3: #FFD84D;
    --accent: #45D4B1;
    --ink: #F2F0FF;
    --ink-soft: #B6B2D6;
    --bg: #14121F;
    --bg-2: #1B1830;
    --card: rgba(38, 34, 62, 0.66);
    --card-solid: #221E38;
    --glass: rgba(38, 34, 62, 0.5);
    --glass-border: rgba(255, 255, 255, 0.12);
    --line: rgba(255, 255, 255, 0.1);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.45), 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 18px 44px rgba(255, 110, 78, 0.28), 0 6px 14px rgba(0, 0, 0, 0.4);
  }
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink);
  background: var(--bg);
  background-image:
    radial-gradient(circle at 12% 8%, rgba(255, 92, 57, 0.14), transparent 42%),
    radial-gradient(circle at 88% 12%, rgba(62, 193, 160, 0.14), transparent 40%),
    radial-gradient(circle at 50% 100%, rgba(255, 210, 63, 0.12), transparent 46%);
  background-attachment: fixed;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

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

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

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

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

h1 { font-size: clamp(1.65rem, 4vw, 2.7rem); }
h2 { font-size: clamp(1.35rem, 2.8vw, 2rem); }
h3 { font-size: clamp(1.08rem, 2vw, 1.35rem); }
h4 { font-size: 1.05rem; }

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

ul, ol {
  margin: 0 0 1em;
  padding-left: 1.3em;
  color: var(--ink-soft);
}

li { margin-bottom: 0.45em; }

blockquote {
  margin: 0;
}

address {
  font-style: normal;
}

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

/* ============ HEADER / NAV ============ */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--glass);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: 0 4px 24px rgba(45, 42, 74, 0.06);
}

header > nav {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0.7rem clamp(1rem, 4vw, 2rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

header > nav > a[aria-label="抖漫首页"] {
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  padding: 0.3rem 0.9rem;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(120deg, var(--brand), var(--brand-2) 60%, var(--brand-3));
  box-shadow: 0 6px 18px rgba(255, 92, 57, 0.35);
  transition: transform var(--t), box-shadow var(--t);
  flex: 0 0 auto;
}

header > nav > a[aria-label="抖漫首页"]:hover {
  color: #fff;
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 10px 26px rgba(255, 92, 57, 0.5);
}

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

header nav ul li {
  margin: 0;
}

header nav ul a {
  display: inline-block;
  padding: 0.4rem 0.72rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink-soft);
  border-radius: 999px;
  position: relative;
  transition: color var(--t), background var(--t), transform var(--t);
}

header nav ul a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 4px;
  width: 0;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--brand), var(--brand-3));
  transform: translateX(-50%);
  transition: width var(--t);
}

header nav ul a:hover,
header nav ul a:focus-visible {
  color: var(--brand);
  background: rgba(255, 92, 57, 0.09);
  transform: translateY(-1px);
}

header nav ul a:hover::after {
  width: 55%;
}

/* ============ MAIN LAYOUT ============ */
main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(1rem, 3vw, 2rem) clamp(1rem, 4vw, 2rem) 3rem;
}

section {
  margin-bottom: clamp(1.6rem, 4vw, 3rem);
  padding: clamp(1.2rem, 3.2vw, 2.4rem);
  background: var(--card);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  backdrop-filter: blur(14px) saturate(150%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  animation: rise 0.7s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

section::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(255, 92, 57, 0.35), transparent 40%, rgba(62, 193, 160, 0.3));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0.7;
}

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

section > h2 {
  position: relative;
  padding-left: 1rem;
  margin-bottom: 1rem;
}

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

section > h2::after {
  content: "";
  display: block;
  width: 64px;
  height: 3px;
  margin-top: 0.5rem;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--brand), var(--accent));
  opacity: 0.8;
}

/* ============ BREADCRUMB ============ */
main > nav[aria-label="面包屑导航"] {
  margin-bottom: 1rem;
}

main > nav[aria-label="面包屑导航"] ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  margin: 0;
  font-size: 0.86rem;
  background: var(--glass);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  width: fit-content;
  box-shadow: 0 4px 16px rgba(45, 42, 74, 0.05);
}

main > nav[aria-label="面包屑导航"] li {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--ink-soft);
}

main > nav[aria-label="面包屑导航"] li + li::before {
  content: "›";
  color: var(--brand);
  font-weight: 800;
}

main > nav[aria-label="面包屑导航"] li[aria-current="page"] {
  color: var(--brand);
  font-weight: 700;
}

/* ============ HERO ============ */
#hero {
  padding: clamp(1.6rem, 4.5vw, 3.4rem);
  background:
    linear-gradient(135deg, rgba(255, 92, 57, 0.92), rgba(255, 138, 61, 0.85) 45%, rgba(62, 193, 160, 0.85)),
    var(--card);
  color: #fff;
  border: none;
  isolation: isolate;
}

#hero::before {
  background: radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.35), transparent 55%);
  opacity: 1;
  mix-blend-mode: soft-light;
}

#hero::after {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  right: -140px;
  top: -160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 210, 63, 0.55), transparent 68%);
  filter: blur(10px);
  z-index: -1;
  animation: floaty 9s ease-in-out infinite;
}

@keyframes floaty {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(22px) scale(1.06); }
}

#hero h1 {
  color: #fff;
  text-shadow: 0 4px 22px rgba(45, 42, 74, 0.28);
  max-width: 22ch;
}

#hero > p {
  color: rgba(255, 255, 255, 0.94);
  font-size: clamp(0.96rem, 1.6vw, 1.08rem);
  max-width: 68ch;
  text-shadow: 0 2px 12px rgba(45, 42, 74, 0.2);
}

#hero figure {
  margin: 1.4rem 0 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.14);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 20px 50px rgba(45, 42, 74, 0.28);
  transition: transform var(--t), box-shadow var(--t);
}

#hero figure:hover {
  transform: translateY(-6px) scale(1.008);
  box-shadow: 0 28px 64px rgba(45, 42, 74, 0.34);
}

#hero figure svg {
  width: 100%;
  height: auto;
  display: block;
}

#hero figcaption {
  padding: 0.7rem 1rem;
  font-size: 0.85rem;
  color: #fff;
  text-align: center;
  background: rgba(45, 42, 74, 0.28);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

/* ============ CARDS: NEWS / ARTICLES / CASES ============ */
#news,
#articles,
#cases,
#testimonials {
  display: block;
}

#news article,
#articles article {
  position: relative;
  padding: clamp(1rem, 2.4vw, 1.5rem);
  margin-bottom: 1rem;
  background: var(--card-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 6px 20px rgba(45, 42, 74, 0.06);
  transition: transform var(--t), box-shadow var(--t), border-color var(--t);
  overflow: hidden;
}

#news article::before,
#articles article::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: linear-gradient(180deg, var(--brand), var(--brand-3));
  opacity: 0;
  transition: opacity var(--t);
}

#news article:hover,
#articles article:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(255, 92, 57, 0.35);
}

#news article:hover::before,
#articles article:hover::before {
  opacity: 1;
}

#news article h3,
#articles article h3 {
  margin-bottom: 0.35rem;
  transition: color var(--t);
}

#news article:hover h3,
#articles article:hover h3 {
  color: var(--brand);
}

#news article p:first-of-type,
#articles article p:first-of-type {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--brand);
  background: rgba(255, 92, 57, 0.1);
  padding: 0.15rem 0.7rem;
  border-radius: 999px;
  margin-bottom: 0.6rem;
}

#articles article a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  background: rgba(255, 92, 57, 0.1);
  transition: background var(--t), color var(--t), transform var(--t), box-shadow var(--t);
}

#articles article a::after {
  content: "→";
  transition: transform var(--t);
}

#articles article a:hover {
  background: linear-gradient(120deg, var(--brand), var(--brand-2));
  color: #fff;
  transform: translateX(4px);
  box-shadow: 0 8px 20px rgba(255, 92, 57, 0.35);
}

#articles article a:hover::after {
  transform: translateX(3px);
}

/* ============ TESTIMONIALS ============ */
#testimonials blockquote {
  position: relative;
  padding: clamp(1rem, 2.4vw, 1.6rem) clamp(1.1rem, 2.6vw, 1.8rem);
  margin-bottom: 1rem;
  background: var(--card-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 6px 20px rgba(45, 42, 74, 0.06);
  transition: transform var(--t), box-shadow var(--t);
}

#testimonials blockquote::before {
  content: "“";
  position: absolute;
  top: -0.15em;
  left: 0.4rem;
  font-size: 4rem;
  line-height: 1;
  font-family: Georgia, serif;
  color: var(--brand);
  opacity: 0.22;
}

#testimonials blockquote:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

#testimonials blockquote p {
  font-size: 1rem;
  color: var(--ink);
  margin-bottom: 0.5rem;
}

#testimonials cite {
  display: block;
  font-style: normal;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--brand);
  text-align: right;
}

/* ============ FAQ ============ */
#faq dl {
  margin: 0;
  display: grid;
  gap: 0.75rem;
}

#faq dt {
  position: relative;
  font-weight: 800;
  color: var(--ink);
  padding: 0.85rem 1rem 0.85rem 2.6rem;
  background: var(--card-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: default;
  transition: background var(--t), color var(--t), border-color var(--t), transform var(--t);
}

#faq dt::before {
  content: "Q";
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.35rem;
  height: 1.35rem;
  display: grid;
  place-items: center;
  font-size: 0.78rem;
  font-weight: 900;
  color: #fff;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
}

#faq dt:hover {
  background: rgba(255, 92, 57, 0.08);
  border-color: rgba(255, 92, 57, 0.35);
  color: var(--brand);
  transform: translateX(4px);
}

#faq dd {
  margin: -0.35rem 0 0.35rem;
  padding: 0.85rem 1rem 0.85rem 2.6rem;
  color: var(--ink-soft);
  background: var(--glass);
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  font-size: 0.94rem;
}

/* ============ HOWTO ============ */
#howto ol {
  counter-reset: step;
  list-style: none;
  padding: 0;
  display: grid;
  gap: 0.7rem;
}

#howto ol > li {
  counter-increment: step;
  position: relative;
  padding: 0.85rem 1rem 0.85rem 3.2rem;
  background: var(--card-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  transition: transform var(--t), box-shadow var(--t), border-color var(--t);
}

#howto ol > li::before {
  content: counter(step);
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.6rem;
  height: 1.6rem;
  display: grid;
  place-items: center;
  font-size: 0.82rem;
  font-weight: 900;
  color: #fff;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--brand));
  box-shadow: 0 4px 12px rgba(62, 193, 160, 0.35);
}

#howto ol > li:hover {
  transform: translateX(5px);
  border-color: rgba(62, 193, 160, 0.45);
  box-shadow: 0 8px 22px rgba(62, 193, 160, 0.16);
}

/* ============ CONTACT ============ */
#contact address {
  display: grid;
  gap: 0.5rem;
  padding: clamp(1rem, 2.4vw, 1.5rem);
  background: linear-gradient(135deg, rgba(255, 92, 57, 0.08), rgba(62, 193, 160, 0.08));
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

#contact address p {
  margin: 0;
  padding: 0.45rem 0 0.45rem 1.9rem;
  position: relative;
  font-size: 0.94rem;
  color: var(--ink);
  border-bottom: 1px dashed var(--line);
}

#contact address p:last-child {
  border-bottom: none;
}

#contact address p::before {
  content: "";
  position: absolute;
  left: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-3));
  box-shadow: 0 0 10px rgba(255, 92, 57, 0.5);
}

#contact address a {
  font-weight: 700;
  word-break: break-all;
}

/* ============ SITEMAP / LINKS ============ */
#sitemap ul,
#links ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

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

#sitemap ul a,
#links ul a {
  display: inline-block;
  padding: 0.42rem 0.95rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-soft);
  background: var(--card-solid);
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: all var(--t);
}

#sitemap ul a:hover,
#links ul a:hover {
  color: #fff;
  background: linear-gradient(120deg, var(--brand), var(--brand-2));
  border-color: transparent;
  transform: translateY(-3px);
  box-shadow: 0 10px 22px rgba(255, 92, 57, 0.32);
}

/* ============ LEGAL ============ */
#legal h3 {
  margin-top: 1.2rem;
  padding-bottom: 0.35rem;
  border-bottom: 2px dashed var(--line);
}

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

/* ============ FOOTER ============ */
footer {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2rem clamp(1rem, 4vw, 2rem) 2.6rem;
  text-align: center;
  border-top: 1px solid var(--line);
}

footer p {
  margin: 0.3rem 0;
  font-size: 0.86rem;
  color: var(--ink-soft);
}

footer p:first-child {
  font-weight: 700;
  color: var(--ink);
}

footer p:last-child {
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  background: linear-gradient(90deg, var(--brand), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 700;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
  html { scroll-padding-top: 130px; }

  header > nav {
    justify-content: center;
    text-align: center;
  }

  header nav ul {
    justify-content: center;
    width: 100%;
  }

  header nav ul a {
    font-size: 0.84rem;
    padding: 0.35rem 0.6rem;
  }
}

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

  main {
    padding: 0.85rem 0.85rem 2rem;
  }

  section {
    border-radius: var(--radius);
    padding: 1.1rem 1rem;
    margin-bottom: 1.2rem;
  }

  #hero {
    padding: 1.4rem 1.1rem;
  }

  #hero h1 { max-width: none; }

  header nav ul {
    gap: 0.1rem 0.15rem;
  }

  header nav ul a {
    font-size: 0.78rem;
    padding: 0.3rem 0.5rem;
  }

  main > nav[aria-label="面包屑导航"] ol {
    font-size: 0.78rem;
    padding: 0.45rem 0.8rem;
  }

  #faq dt,
  #faq dd {
    padding-left: 2.3rem;
  }

  #howto ol > li {
    padding-left: 2.9rem;
  }

  #contact address p {
    padding-left: 1.5rem;
    font-size: 0.9rem;
  }

  blockquote p { font-size: 0.95rem; }
}

@media (max-width: 380px) {
  header > nav > a[aria-label="抖漫首页"] {
    font-size: 1.25rem;
  }
  header nav ul a {
    font-size: 0.72rem;
  }
}

/* ============ MOTION & ACCESSIBILITY ============ */
@media (hover: none) {
  #news article:hover,
  #articles article:hover,
  #testimonials blockquote:hover,
  #howto ol > li:hover,
  #faq dt:hover,
  #hero figure:hover,
  #sitemap ul a:hover,
  #links ul a:hover {
    transform: none;
  }
}

@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,
  footer,
  #sitemap,
  #links {
    display: none;
  }
  section {
    box-shadow: none;
    border: 1px solid #ccc;
    background: #fff;
    break-inside: avoid;
  }
  body {
    background: #fff;
    color: #000;
  }
}