:root {
  --primary: #c0392b;
  --primary-dark: #962d22;
  --primary-light: #e74c3c;
  --accent: #f39c12;
  --accent-2: #e67e22;
  --bg: #fdf8f4;
  --bg-alt: #ffffff;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-solid: #ffffff;
  --border: rgba(192, 57, 43, 0.12);
  --text: #2b2320;
  --text-soft: #5f524c;
  --text-mute: #8a7c75;
  --shadow-sm: 0 2px 8px rgba(120, 60, 40, 0.08);
  --shadow-md: 0 8px 28px rgba(120, 60, 40, 0.12);
  --shadow-lg: 0 18px 50px rgba(120, 60, 40, 0.18);
  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 26px;
  --gradient-banner: linear-gradient(135deg, #c0392b 0%, #e74c3c 42%, #f39c12 100%);
  --gradient-soft: linear-gradient(135deg, rgba(192, 57, 43, 0.1), rgba(243, 156, 18, 0.12));
  --glass-blur: blur(16px);
  --max-width: 1180px;
  --transition: 0.35s 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: dark) {
  :root {
    --primary: #ff6b52;
    --primary-dark: #e74c3c;
    --primary-light: #ff8a75;
    --accent: #ffb347;
    --accent-2: #ff9f43;
    --bg: #16110f;
    --bg-alt: #1d1714;
    --surface: rgba(38, 30, 27, 0.66);
    --surface-solid: #241d1a;
    --border: rgba(255, 138, 117, 0.16);
    --text: #f4ece8;
    --text-soft: #cbbab2;
    --text-mute: #9c8b83;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 8px 28px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 18px 50px rgba(0, 0, 0, 0.55);
    --gradient-banner: linear-gradient(135deg, #8e2b21 0%, #c0392b 45%, #b26a12 100%);
    --gradient-soft: linear-gradient(135deg, rgba(255, 107, 82, 0.12), rgba(255, 179, 71, 0.1));
  }
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  font-size: 16px;
  overflow-x: hidden;
  background-image:
    radial-gradient(circle at 8% 4%, rgba(243, 156, 18, 0.08), transparent 38%),
    radial-gradient(circle at 92% 12%, rgba(192, 57, 43, 0.08), transparent 42%);
  background-attachment: fixed;
  transition: background-color var(--transition), color var(--transition);
}

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

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--accent-2);
}

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

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

/* ============ Header ============ */
#site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px clamp(16px, 4vw, 48px);
  background: var(--surface);
  -webkit-backdrop-filter: var(--glass-blur) saturate(160%);
  backdrop-filter: var(--glass-blur) saturate(160%);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  animation: headerDrop 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes headerDrop {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

#site-header .brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: 1.18rem;
  letter-spacing: 0.5px;
  color: var(--text);
}

#site-header .brand svg {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  box-shadow: 0 4px 14px rgba(192, 57, 43, 0.4);
  transition: transform var(--transition), box-shadow var(--transition);
}

#site-header .brand:hover svg {
  transform: rotate(-12deg) scale(1.08);
  box-shadow: 0 6px 20px rgba(243, 156, 18, 0.5);
}

#site-header .brand span {
  background: var(--gradient-banner);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

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

#site-header nav a {
  display: inline-block;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-soft);
  position: relative;
  transition: color var(--transition), background var(--transition), transform var(--transition);
}

#site-header nav a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 3px;
  width: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--gradient-banner);
  transform: translateX(-50%);
  transition: width var(--transition);
}

#site-header nav a:hover {
  color: var(--primary);
  background: var(--gradient-soft);
  transform: translateY(-2px);
}

#site-header nav a:hover::after {
  width: 40%;
}

/* ============ Main layout ============ */
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: clamp(20px, 4vw, 48px) clamp(16px, 4vw, 40px) 60px;
}

main > section {
  margin-bottom: clamp(32px, 5vw, 64px);
  animation: fadeUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-timeline: view();
  animation-range: entry 0% cover 26%;
}

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

/* Fallback for browsers without scroll-timeline */
@supports not (animation-timeline: view()) {
  main > section {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

/* ============ Hero banner ============ */
#hero {
  position: relative;
  overflow: hidden;
  padding: clamp(36px, 6vw, 72px) clamp(22px, 5vw, 64px);
  border-radius: var(--radius-lg);
  background: var(--gradient-banner);
  color: #fff;
  box-shadow: var(--shadow-lg);
  isolation: isolate;
}

#hero::before {
  content: "";
  position: absolute;
  inset: -50% -20% auto auto;
  width: 60%;
  height: 160%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.28), transparent 62%);
  transform: rotate(18deg);
  z-index: -1;
  animation: heroGlow 9s ease-in-out infinite alternate;
}

#hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 15% 85%, rgba(255, 255, 255, 0.16), transparent 45%),
    radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.12), transparent 40%);
  z-index: -1;
  pointer-events: none;
}

@keyframes heroGlow {
  from { transform: rotate(18deg) translateX(-4%); opacity: 0.7; }
  to { transform: rotate(18deg) translateX(4%); opacity: 1; }
}

#hero h1 {
  font-size: clamp(1.5rem, 3.6vw, 2.5rem);
  line-height: 1.35;
  font-weight: 800;
  letter-spacing: 0.5px;
  margin-bottom: 20px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.18);
  animation: heroTitle 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes heroTitle {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

#hero p {
  max-width: 860px;
  font-size: clamp(0.95rem, 1.4vw, 1.05rem);
  color: rgba(255, 255, 255, 0.94);
  margin-bottom: 14px;
  animation: heroTitle 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.12s both;
}

#hero p:last-child {
  margin-bottom: 0;
  animation-delay: 0.24s;
}

/* ============ Content sections ============ */
main > section:not(#hero) {
  position: relative;
  padding: clamp(22px, 3.5vw, 40px);
  border-radius: var(--radius-lg);
  background: var(--surface);
  -webkit-backdrop-filter: var(--glass-blur) saturate(150%);
  backdrop-filter: var(--glass-blur) saturate(150%);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

main > section:not(#hero):hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(192, 57, 43, 0.26);
}

main > section h2 {
  position: relative;
  font-size: clamp(1.25rem, 2.4vw, 1.65rem);
  font-weight: 800;
  color: var(--text);
  margin-bottom: 18px;
  padding-left: 18px;
  line-height: 1.4;
}

main > section h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.18em;
  bottom: 0.18em;
  width: 6px;
  border-radius: 6px;
  background: var(--gradient-banner);
  box-shadow: 0 0 12px rgba(192, 57, 43, 0.5);
}

main > section h3 {
  font-size: clamp(1.05rem, 1.8vw, 1.2rem);
  font-weight: 700;
  color: var(--primary);
  margin: 22px 0 10px;
  line-height: 1.45;
}

main > section h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent-2);
  margin: 16px 0 6px;
}

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

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

/* ============ Lists ============ */
main > section ul {
  list-style: none;
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

main > section ul li {
  position: relative;
  padding: 12px 16px 12px 42px;
  border-radius: var(--radius-sm);
  background: var(--gradient-soft);
  border: 1px solid var(--border);
  color: var(--text-soft);
  font-size: 0.95rem;
  transition: transform var(--transition), background var(--transition), box-shadow var(--transition);
}

main > section ul li::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gradient-banner);
  transform: translateY(-50%);
  box-shadow: 0 0 0 4px rgba(192, 57, 43, 0.12);
}

main > section ul li:hover {
  transform: translateX(6px);
  background: var(--gradient-soft);
  box-shadow: var(--shadow-sm);
}

main > section ul li a {
  font-weight: 600;
}

/* ============ Articles ============ */
#articles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

#articles > h2,
#articles > p {
  grid-column: 1 / -1;
}

#articles article {
  display: flex;
  flex-direction: column;
  padding: 22px;
  border-radius: var(--radius);
  background: var(--surface-solid);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

#articles article::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: var(--gradient-banner);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition);
}

#articles article:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(243, 156, 18, 0.35);
}

#articles article:hover::before {
  transform: scaleX(1);
}

#articles article h3 {
  margin-top: 0;
  color: var(--text);
  font-size: 1.08rem;
  transition: color var(--transition);
}

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

#articles article p {
  font-size: 0.9rem;
}

#articles article p:first-of-type {
  color: var(--text-mute);
  font-size: 0.82rem;
  letter-spacing: 0.3px;
}

#articles article a {
  margin-top: auto;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 600;
  color: #fff;
  background: var(--gradient-banner);
  box-shadow: 0 4px 14px rgba(192, 57, 43, 0.3);
  transition: transform var(--transition), box-shadow var(--transition), filter var(--transition);
}

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

#articles article a:hover {
  color: #fff;
  transform: translateY(-2px);
  filter: brightness(1.08);
  box-shadow: 0 8px 22px rgba(243, 156, 18, 0.4);
}

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

/* ============ FAQ ============ */
#faq h3 {
  position: relative;
  padding: 14px 18px 14px 46px;
  margin: 14px 0 0;
  border-radius: var(--radius-sm);
  background: var(--gradient-soft);
  border: 1px solid var(--border);
  font-size: 0.98rem;
  color: var(--text);
  cursor: default;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
}

#faq h3::before {
  content: "?";
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 0.78rem;
  font-weight: 800;
  color: #fff;
  background: var(--gradient-banner);
  box-shadow: 0 2px 8px rgba(192, 57, 43, 0.35);
}

#faq h3:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-sm);
}

#faq h3 + p {
  padding: 10px 18px 16px 46px;
  margin: 0 0 6px;
  font-size: 0.94rem;
  border-bottom: 1px dashed var(--border);
}

/* ============ Contact ============ */
#contact p {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  margin-bottom: 10px;
  border-radius: var(--radius-sm);
  background: var(--surface-solid);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), border-color var(--transition);
}

#contact p:hover {
  transform: translateX(6px);
  border-color: rgba(243, 156, 18, 0.4);
}

#contact p::before {
  content: "◆";
  color: var(--accent-2);
  font-size: 0.75rem;
  line-height: 1.9;
}

/* ============ Sitemap & Links ============ */
#sitemap ul,
#links ul {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

/* ============ Footer ============ */
footer {
  position: relative;
  margin-top: 20px;
  padding: clamp(36px, 5vw, 60px) clamp(16px, 4vw, 40px) 28px;
  background: linear-gradient(180deg, rgba(192, 57, 43, 0.06), rgba(243, 156, 18, 0.05));
  border-top: 1px solid var(--border);
}

footer::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: var(--gradient-banner);
}

footer > section {
  max-width: var(--max-width);
  margin: 0 auto 22px;
  padding: 18px 22px;
  border-radius: var(--radius);
  background: var(--surface);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}

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

footer > section h2 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

footer > section p {
  font-size: 0.88rem;
  color: var(--text-mute);
  margin: 0;
}

/* ============ Responsive ============ */
@media (max-width: 960px) {
  #site-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  #site-header nav {
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

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

  #site-header nav ul {
    flex-wrap: nowrap;
    gap: 2px;
    padding-bottom: 4px;
  }

  #site-header nav a {
    white-space: nowrap;
    font-size: 0.86rem;
    padding: 6px 12px;
  }
}

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

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

  main > section {
    margin-bottom: 26px;
  }

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

  main > section:not(#hero) {
    padding: 20px 16px;
    border-radius: var(--radius);
  }

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

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

  main > section ul li {
    padding: 10px 12px 10px 36px;
  }

  main > section ul li::before {
    left: 13px;
    width: 8px;
    height: 8px;
  }

  #articles {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  #articles article {
    padding: 18px;
  }

  #faq h3 {
    padding: 12px 14px 12px 40px;
    font-size: 0.92rem;
  }

  #faq h3::before {
    left: 11px;
    width: 20px;
    height: 20px;
  }

  #faq h3 + p {
    padding: 8px 14px 14px 40px;
    font-size: 0.9rem;
  }

  footer {
    padding: 28px 14px 20px;
  }

  footer > section {
    padding: 14px 16px;
  }
}

@media (max-width: 380px) {
  #site-header .brand {
    font-size: 1.02rem;
  }

  #site-header .brand svg {
    width: 34px;
    height: 34px;
  }
}

/* ============ Accessibility & motion ============ */
@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 print {
  #site-header,
  footer,
  #hero::before,
  #hero::after {
    display: none;
  }

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

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