:root {
  --brand: #c0392b;
  --brand-dark: #96281b;
  --brand-light: #e74c3c;
  --brand-gradient: linear-gradient(135deg, #c0392b 0%, #e74c3c 48%, #f39c12 100%);
  --brand-gradient-soft: linear-gradient(135deg, rgba(192, 57, 43, 0.12), rgba(243, 156, 18, 0.12));
  --bg: #f7f4f2;
  --bg-alt: #ffffff;
  --bg-soft: rgba(255, 255, 255, 0.72);
  --surface: #ffffff;
  --surface-glass: rgba(255, 255, 255, 0.6);
  --text: #2b2320;
  --text-soft: #5c524d;
  --text-muted: #8a7f79;
  --border: rgba(192, 57, 43, 0.14);
  --border-strong: rgba(192, 57, 43, 0.28);
  --shadow-sm: 0 2px 8px rgba(60, 30, 20, 0.06);
  --shadow-md: 0 8px 28px rgba(60, 30, 20, 0.1);
  --shadow-lg: 0 18px 48px rgba(60, 30, 20, 0.16);
  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 26px;
  --radius-pill: 999px;
  --header-h: 68px;
  --maxw: 1180px;
  --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", Roboto, sans-serif;
}

[data-theme="dark"] {
  --bg: #14100f;
  --bg-alt: #1c1715;
  --bg-soft: rgba(28, 23, 21, 0.72);
  --surface: #221b19;
  --surface-glass: rgba(34, 27, 25, 0.62);
  --text: #f3ebe7;
  --text-soft: #c9bdb7;
  --text-muted: #9a8d86;
  --border: rgba(231, 76, 60, 0.22);
  --border-strong: rgba(231, 76, 60, 0.4);
  --brand: #e74c3c;
  --brand-dark: #c0392b;
  --brand-gradient: linear-gradient(135deg, #8e2a20 0%, #c0392b 46%, #e67e22 100%);
  --brand-gradient-soft: linear-gradient(135deg, rgba(231, 76, 60, 0.18), rgba(230, 126, 34, 0.14));
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 20px 52px rgba(0, 0, 0, 0.62);
}

*,
*::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.78;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(1100px 520px at 8% -6%, rgba(192, 57, 43, 0.1), transparent 62%),
    radial-gradient(900px 460px at 96% 4%, rgba(243, 156, 18, 0.1), transparent 60%);
  background-attachment: fixed;
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease);
  overflow-x: hidden;
}

[data-theme="dark"] body {
  background-image:
    radial-gradient(1100px 520px at 8% -6%, rgba(231, 76, 60, 0.16), transparent 62%),
    radial-gradient(900px 460px at 96% 4%, rgba(230, 126, 34, 0.12), transparent 60%);
}

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,
a:focus-visible {
  color: var(--brand-light);
  text-decoration: underline;
  text-underline-offset: 3px;
}

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

::selection {
  background: rgba(192, 57, 43, 0.22);
  color: var(--text);
}

button,
input {
  font-family: inherit;
  font-size: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

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

h1 {
  font-size: clamp(1.6rem, 3.4vw, 2.6rem);
}

h2 {
  font-size: clamp(1.35rem, 2.5vw, 1.95rem);
  position: relative;
  padding-bottom: 0.5em;
}

h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 56px;
  height: 4px;
  border-radius: var(--radius-pill);
  background: var(--brand-gradient);
}

h3 {
  font-size: clamp(1.08rem, 1.6vw, 1.3rem);
  color: var(--brand);
}

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

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

li {
  margin-bottom: 0.35em;
  color: var(--text-soft);
}

/* ============ HEADER ============ */
#site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--surface-glass);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: background 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  flex-shrink: 0;
}

.brand svg {
  border-radius: 12px;
  box-shadow: 0 6px 16px rgba(192, 57, 43, 0.32);
  transition: transform 0.4s var(--ease);
}

.brand:hover svg {
  transform: rotate(-8deg) scale(1.06);
}

.brand-name {
  font-size: 1.16rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  white-space: nowrap;
}

#main-nav {
  flex: 1 1 auto;
}

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

#main-nav li {
  margin: 0;
}

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

#main-nav a:hover,
#main-nav a:focus-visible {
  color: #fff;
  background: var(--brand-gradient);
  text-decoration: none;
  transform: translateY(-1px);
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

#site-search {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  overflow: hidden;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

#site-search:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(192, 57, 43, 0.14);
}

#site-search input {
  border: none;
  background: transparent;
  color: var(--text);
  padding: 8px 14px;
  width: 190px;
  font-size: 0.88rem;
  outline: none;
}

#site-search input::placeholder {
  color: var(--text-muted);
}

#site-search button {
  padding: 8px 16px;
  font-size: 0.86rem;
  font-weight: 700;
  color: #fff;
  background: var(--brand-gradient);
  transition: filter 0.25s var(--ease);
}

#site-search button:hover {
  filter: brightness(1.08);
}

#theme-toggle,
#mobile-menu-btn {
  padding: 8px 15px;
  font-size: 0.86rem;
  font-weight: 700;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  color: var(--text-soft);
  background: var(--bg-soft);
  transition: color 0.25s var(--ease), background 0.25s var(--ease), border-color 0.25s var(--ease), transform 0.25s var(--ease);
}

#theme-toggle:hover,
#mobile-menu-btn:hover {
  color: var(--brand);
  border-color: var(--brand);
  background: var(--brand-gradient-soft);
  transform: translateY(-1px);
}

#mobile-menu-btn {
  display: none;
}

/* ============ MAIN / SECTIONS ============ */
main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 26px 22px 60px;
}

section {
  margin: 0 0 34px;
  padding: clamp(20px, 3.4vw, 38px);
  background: var(--surface);
  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), border-color 0.4s var(--ease);
}

section:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

section > h2:first-child {
  margin-top: 0;
}

/* ============ BANNER ============ */
#banner {
  position: relative;
  overflow: hidden;
  padding: clamp(30px, 5vw, 62px) clamp(22px, 4vw, 52px);
  border: none;
  border-radius: var(--radius-lg);
  background: var(--brand-gradient);
  box-shadow: var(--shadow-lg);
  color: #fff;
  isolation: isolate;
}

#banner::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.32), transparent 68%);
  z-index: -1;
  animation: floatBlob 14s ease-in-out infinite alternate;
}

#banner::after {
  content: "";
  position: absolute;
  inset: auto auto -46% -12%;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.2), transparent 70%);
  z-index: -1;
  animation: floatBlob 18s ease-in-out infinite alternate-reverse;
}

@keyframes floatBlob {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(-28px, 26px, 0) scale(1.12); }
}

.banner-slide {
  max-width: 880px;
  animation: fadeUp 0.9s var(--ease) both;
}

.banner-slide h1 {
  color: #fff;
  text-shadow: 0 3px 22px rgba(0, 0, 0, 0.22);
}

.banner-slide p {
  color: rgba(255, 255, 255, 0.94);
  font-size: clamp(0.95rem, 1.4vw, 1.06rem);
  margin-bottom: 1.4em;
}

#banner .cta {
  display: inline-block;
  padding: 13px 30px;
  font-weight: 800;
  font-size: 0.98rem;
  color: var(--brand-dark);
  background: #fff;
  border-radius: var(--radius-pill);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), background 0.3s var(--ease);
}

#banner .cta:hover,
#banner .cta:focus-visible {
  text-decoration: none;
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.28);
  background: #fff8f4;
}

.banner-controls {
  margin-top: 26px;
  display: flex;
  gap: 12px;
}

.banner-controls button {
  padding: 9px 20px;
  font-size: 0.86rem;
  font-weight: 700;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.14);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: background 0.25s var(--ease), transform 0.25s var(--ease), border-color 0.25s var(--ease);
}

.banner-controls button:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: #fff;
  transform: translateY(-2px);
}

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

/* ============ BREADCRUMB ============ */
#breadcrumb {
  margin: 0 0 20px;
  padding: 0 4px;
}

#breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.86rem;
  color: var(--text-muted);
}

#breadcrumb li {
  margin: 0;
  color: var(--text-muted);
}

#breadcrumb li + li::before {
  content: "/";
  margin-right: 8px;
  color: var(--border-strong);
}

#breadcrumb a {
  color: var(--text-soft);
  font-weight: 600;
}

#breadcrumb a:hover {
  color: var(--brand);
}

/* ============ ANCHOR NAV ============ */
#anchor-nav {
  position: sticky;
  top: calc(var(--header-h) + 8px);
  z-index: 900;
  margin: 0 0 26px;
  padding: 10px 12px;
  background: var(--surface-glass);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
  scrollbar-width: thin;
}

#anchor-nav ul {
  display: flex;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
  white-space: nowrap;
}

#anchor-nav li {
  margin: 0;
}

#anchor-nav a {
  display: inline-block;
  padding: 6px 14px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-soft);
  border-radius: var(--radius-pill);
  transition: color 0.25s var(--ease), background 0.25s var(--ease);
}

#anchor-nav a:hover,
#anchor-nav a:focus-visible {
  color: #fff;
  background: var(--brand-gradient);
  text-decoration: none;
}

#anchor-nav::-webkit-scrollbar {
  height: 6px;
}

#anchor-nav::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: var(--radius-pill);
}

/* ============ ARTICLE CARDS ============ */
#news article,
#articles article {
  position: relative;
  margin: 0 0 18px;
  padding: 22px 24px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s var(--ease);
}

#news article:last-child,
#articles article:last-child {
  margin-bottom: 0;
}

#news article::before,
#articles article::before {
  content: "";
  position: absolute;
  left: 0;
  top: 18px;
  bottom: 18px;
  width: 4px;
  border-radius: var(--radius-pill);
  background: var(--brand-gradient);
  opacity: 0.85;
}

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

#news article h3,
#articles article h3 {
  margin-bottom: 0.45em;
}

#news article p,
#articles article p {
  margin-bottom: 0.7em;
}

#articles article p:nth-of-type(1) {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.02em;
}

#articles article a {
  display: inline-block;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  background: var(--brand-gradient-soft);
  border: 1px solid var(--border-strong);
  transition: background 0.25s var(--ease), color 0.25s var(--ease), transform 0.25s var(--ease);
}

#articles article a:hover,
#articles article a:focus-visible {
  text-decoration: none;
  color: #fff;
  background: var(--brand-gradient);
  transform: translateX(3px);
}

/* ============ FAQ ============ */
#faq details {
  margin: 0 0 12px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

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

#faq summary {
  position: relative;
  padding: 16px 52px 16px 22px;
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  transition: color 0.25s var(--ease), background 0.25s var(--ease);
}

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

#faq summary::after {
  content: "+";
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  line-height: 24px;
  text-align: center;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--brand);
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  transition: transform 0.3s var(--ease), background 0.3s var(--ease), color 0.3s var(--ease);
}

#faq details[open] summary::after {
  content: "−";
  transform: translateY(-50%) rotate(180deg);
  background: var(--brand-gradient);
  color: #fff;
  border-color: transparent;
}

#faq summary:hover {
  color: var(--brand);
  background: var(--brand-gradient-soft);
}

#faq details > p {
  margin: 0;
  padding: 0 22px 18px;
  animation: fadeUp 0.35s var(--ease) both;
}

/* ============ CONTACT ============ */
#contact ul {
  list-style: none;
  padding: 0;
  margin: 0 0 1.4em;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

#contact li {
  margin: 0;
  padding: 14px 18px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  color: var(--text-soft);
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

#contact li:hover {
  border-color: var(--brand);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

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

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

#sitemap a,
#links a {
  display: inline-block;
  padding: 7px 16px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-soft);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  transition: color 0.25s var(--ease), background 0.25s var(--ease), border-color 0.25s var(--ease), transform 0.25s var(--ease);
}

#sitemap a:hover,
#links a:hover,
#sitemap a:focus-visible,
#links a:focus-visible {
  color: #fff;
  background: var(--brand-gradient);
  border-color: transparent;
  text-decoration: none;
  transform: translateY(-2px);
}

/* ============ LEGAL ============ */
#legal {
  background: var(--brand-gradient-soft);
}

#legal h2 {
  font-size: 1.15rem;
}

#legal h2::after {
  width: 40px;
  height: 3px;
}

/* ============ FOOTER ============ */
footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding: 40px 22px 30px;
  margin-top: 20px;
}

.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  text-align: center;
}

.footer-inner p {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin: 0 0 0.55em;
}

.footer-inner p:first-child {
  font-weight: 800;
  font-size: 1rem;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.footer-inner a {
  color: var(--brand);
  font-weight: 600;
}

/* ============ BACK TO TOP ============ */
#back-to-top {
  position: fixed;
  right: 22px;
  bottom: 24px;
  z-index: 950;
  padding: 11px 18px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
  background: var(--brand-gradient);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease), visibility 0.35s var(--ease), filter 0.25s var(--ease);
}

#back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

#back-to-top:hover {
  filter: brightness(1.1);
  transform: translateY(-3px);
}

/* ============ SCROLL REVEAL ============ */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  will-change: opacity, transform;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@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;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
  #banner::before,
  #banner::after {
    animation: none;
  }
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1024px) {
  #site-search input {
    width: 150px;
  }
  #main-nav a {
    padding: 6px 9px;
    font-size: 0.85rem;
  }
}

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

  .header-inner {
    padding: 10px 16px;
    gap: 12px;
  }

  #main-nav {
    order: 3;
    flex-basis: 100%;
    display: none;
  }

  #main-nav.is-open {
    display: block;
    animation: fadeUp 0.3s var(--ease) both;
  }

  #main-nav ul {
    flex-direction: column;
    gap: 2px;
    padding: 8px 0 4px;
  }

  #main-nav a {
    display: block;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.94rem;
  }

  #mobile-menu-btn {
    display: inline-block;
  }

  .header-tools {
    margin-left: auto;
  }

  #site-search {
    order: 4;
    flex-basis: 100%;
    margin-top: 4px;
  }

  #site-search input {
    width: 100%;
    flex: 1;
  }

  #anchor-nav {
    top: calc(var(--header-h) + 4px);
  }

  main {
    padding: 18px 16px 48px;
  }

  section {
    border-radius: var(--radius);
    margin-bottom: 24px;
  }

  #banner {
    border-radius: var(--radius);
  }
}

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

  .brand-name {
    font-size: 1.02rem;
  }

  #theme-toggle,
  #mobile-menu-btn {
    padding: 7px 12px;
    font-size: 0.8rem;
  }

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

  section {
    padding: 18px 16px;
  }

  #banner {
    padding: 28px 20px;
  }

  .banner-controls {
    flex-wrap: wrap;
  }

  #news article,
  #articles article {
    padding: 18px 18px 18px 20px;
  }

  #news article::before,
  #articles article::before {
    top: 14px;
    bottom: 14px;
  }

  #faq summary {
    padding: 14px 46px 14px 16px;
    font-size: 0.94rem;
  }

  #faq details > p {
    padding: 0 16px 16px;
  }

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

  #back-to-top {
    right: 14px;
    bottom: 16px;
    padding: 10px 15px;
    font-size: 0.78rem;
  }

  footer {
    padding: 30px 16px 24px;
  }
}