:root {
  --tx-primary: #c8102e;
  --tx-primary-dark: #a00d24;
  --tx-primary-light: #e63950;
  --tx-secondary: #6a1b9a;
  --tx-accent: #ffb300;
  --tx-bg: #f7f5f8;
  --tx-bg-alt: #ffffff;
  --tx-surface: rgba(255, 255, 255, 0.72);
  --tx-surface-solid: #ffffff;
  --tx-text: #1c1a1f;
  --tx-text-soft: #5b5560;
  --tx-text-muted: #8a8390;
  --tx-border: rgba(28, 26, 31, 0.1);
  --tx-shadow: 0 8px 30px rgba(28, 26, 31, 0.09);
  --tx-shadow-hover: 0 16px 44px rgba(200, 16, 46, 0.18);
  --tx-radius: 18px;
  --tx-radius-sm: 12px;
  --tx-radius-lg: 26px;
  --tx-blur: saturate(160%) blur(16px);
  --tx-grad: linear-gradient(135deg, #c8102e 0%, #6a1b9a 55%, #2b1055 100%);
  --tx-grad-soft: linear-gradient(135deg, rgba(200, 16, 46, 0.12) 0%, rgba(106, 27, 154, 0.12) 100%);
  --tx-max: 1180px;
  --tx-font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --tx-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --tx-primary: #ff4d67;
    --tx-primary-dark: #e63950;
    --tx-primary-light: #ff7386;
    --tx-secondary: #b57bff;
    --tx-accent: #ffc94d;
    --tx-bg: #0e0c12;
    --tx-bg-alt: #16131c;
    --tx-surface: rgba(30, 26, 38, 0.66);
    --tx-surface-solid: #1b1722;
    --tx-text: #f2eef6;
    --tx-text-soft: #c3bccb;
    --tx-text-muted: #8f8798;
    --tx-border: rgba(255, 255, 255, 0.12);
    --tx-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
    --tx-shadow-hover: 0 16px 44px rgba(255, 77, 103, 0.28);
    --tx-grad: linear-gradient(135deg, #8c0a1f 0%, #4a1366 55%, #1a0a33 100%);
    --tx-grad-soft: linear-gradient(135deg, rgba(255, 77, 103, 0.14) 0%, rgba(181, 123, 255, 0.14) 100%);
  }
}

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

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

body {
  margin: 0;
  font-family: var(--tx-font);
  font-size: 16px;
  line-height: 1.75;
  color: var(--tx-text);
  background-color: var(--tx-bg);
  background-image:
    radial-gradient(circle at 12% 8%, rgba(200, 16, 46, 0.08), transparent 42%),
    radial-gradient(circle at 88% 18%, rgba(106, 27, 154, 0.08), transparent 46%),
    radial-gradient(circle at 50% 100%, rgba(255, 179, 0, 0.06), transparent 50%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

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

a:hover,
a:focus-visible {
  color: var(--tx-primary-light);
}

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

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

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

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

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

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

::-webkit-scrollbar-track {
  background: transparent;
}

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

/* ============ Header / Nav ============ */
header[role="banner"] {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--tx-surface);
  -webkit-backdrop-filter: var(--tx-blur);
  backdrop-filter: var(--tx-blur);
  border-bottom: 1px solid var(--tx-border);
  box-shadow: 0 4px 24px rgba(28, 26, 31, 0.06);
  animation: tx-slide-down 0.6s var(--tx-ease) both;
}

header[role="banner"] nav {
  max-width: var(--tx-max);
  margin: 0 auto;
  padding: 0.7rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

header[role="banner"] nav > a[aria-label] {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  background: var(--tx-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  padding: 0.3rem 0.4rem;
  white-space: nowrap;
  transition: transform 0.3s var(--tx-ease), filter 0.3s var(--tx-ease);
}

header[role="banner"] nav > a[aria-label]:hover {
  transform: scale(1.04);
  filter: brightness(1.1);
}

header[role="banner"] nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.35rem;
  justify-content: flex-end;
}

header[role="banner"] nav ul li a {
  display: inline-block;
  padding: 0.42rem 0.78rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--tx-text-soft);
  position: relative;
  transition: color 0.25s var(--tx-ease), background 0.25s var(--tx-ease), transform 0.25s var(--tx-ease);
}

header[role="banner"] nav ul li a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 4px;
  width: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--tx-grad);
  transform: translateX(-50%);
  transition: width 0.3s var(--tx-ease);
}

header[role="banner"] nav ul li a:hover,
header[role="banner"] nav ul li a:focus-visible {
  color: var(--tx-primary);
  background: var(--tx-grad-soft);
  transform: translateY(-1px);
}

header[role="banner"] nav ul li a:hover::after {
  width: 60%;
}

/* ============ Breadcrumb ============ */
nav[aria-label="面包屑导航"] {
  max-width: var(--tx-max);
  margin: 0 auto;
  padding: 1rem 1.25rem 0.25rem;
}

nav[aria-label="面包屑导航"] ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.86rem;
  color: var(--tx-text-muted);
}

nav[aria-label="面包屑导航"] ol li {
  display: inline-flex;
  align-items: center;
}

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

nav[aria-label="面包屑导航"] ol li a {
  color: var(--tx-text-soft);
  padding: 0.15rem 0.3rem;
  border-radius: 6px;
}

nav[aria-label="面包屑导航"] ol li a:hover {
  color: var(--tx-primary);
  background: var(--tx-grad-soft);
}

nav[aria-label="面包屑导航"] ol li[aria-current="page"] {
  color: var(--tx-primary);
  font-weight: 600;
}

/* ============ Main layout ============ */
main {
  max-width: var(--tx-max);
  margin: 0 auto;
  padding: 1rem 1.25rem 3rem;
}

main > section {
  position: relative;
  margin: 1.5rem 0;
  padding: 2rem 1.75rem;
  background: var(--tx-surface);
  -webkit-backdrop-filter: var(--tx-blur);
  backdrop-filter: var(--tx-blur);
  border: 1px solid var(--tx-border);
  border-radius: var(--tx-radius);
  box-shadow: var(--tx-shadow);
  transition: transform 0.4s var(--tx-ease), box-shadow 0.4s var(--tx-ease), border-color 0.4s var(--tx-ease);
  animation: tx-fade-up 0.7s var(--tx-ease) both;
}

main > section:hover {
  transform: translateY(-3px);
  box-shadow: var(--tx-shadow-hover);
  border-color: rgba(200, 16, 46, 0.25);
}

main > section > h2 {
  position: relative;
  font-size: clamp(1.4rem, 2.6vw, 1.85rem);
  padding-left: 1rem;
  margin-bottom: 1.2rem;
  background: var(--tx-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

main > section > h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.18em;
  bottom: 0.18em;
  width: 5px;
  border-radius: 5px;
  background: var(--tx-grad);
  box-shadow: 0 0 12px rgba(200, 16, 46, 0.5);
}

main > section h3 {
  font-size: 1.12rem;
  margin-top: 1.4rem;
  color: var(--tx-text);
  transition: color 0.25s var(--tx-ease);
}

main > section h3:hover {
  color: var(--tx-primary);
}

main > section h3::before {
  content: "▸";
  color: var(--tx-primary);
  margin-right: 0.45rem;
  font-size: 0.85em;
  opacity: 0.85;
}

/* ============ Hero / Home ============ */
#home {
  margin-top: 1rem;
  padding: 3.2rem 2rem;
  border-radius: var(--tx-radius-lg);
  background: var(--tx-grad);
  background-size: 220% 220%;
  animation: tx-grad-move 14s ease infinite, tx-fade-up 0.7s var(--tx-ease) both;
  color: #fff;
  border: none;
  overflow: hidden;
  isolation: isolate;
}

#home::before {
  content: "";
  position: absolute;
  inset: -40%;
  background:
    radial-gradient(circle at 20% 25%, rgba(255, 255, 255, 0.22), transparent 38%),
    radial-gradient(circle at 80% 70%, rgba(255, 179, 0, 0.18), transparent 42%);
  z-index: -1;
  animation: tx-float 12s ease-in-out infinite alternate;
}

#home::after {
  content: "";
  position: absolute;
  right: -60px;
  bottom: -60px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.18);
  z-index: -1;
}

#home:hover {
  transform: translateY(-3px) scale(1.002);
  box-shadow: 0 24px 60px rgba(106, 27, 154, 0.35);
}

#home h1 {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  line-height: 1.3;
  color: #fff;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.25);
  margin-bottom: 1rem;
  letter-spacing: 0.02em;
}

#home p {
  color: rgba(255, 255, 255, 0.92);
  font-size: clamp(0.95rem, 1.6vw, 1.08rem);
  max-width: 62ch;
  margin-bottom: 0;
}

/* ============ Cards: articles, cases, faq ============ */
#news article,
#articles article {
  position: relative;
  margin: 1rem 0;
  padding: 1.35rem 1.4rem;
  background: var(--tx-surface-solid);
  border: 1px solid var(--tx-border);
  border-radius: var(--tx-radius-sm);
  box-shadow: 0 4px 16px rgba(28, 26, 31, 0.05);
  transition: transform 0.35s var(--tx-ease), box-shadow 0.35s var(--tx-ease), border-color 0.35s var(--tx-ease);
  overflow: hidden;
}

#news article::before,
#articles article::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--tx-grad);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.4s var(--tx-ease);
}

#news article:hover,
#articles article:hover {
  transform: translateY(-4px);
  box-shadow: var(--tx-shadow-hover);
  border-color: rgba(200, 16, 46, 0.3);
}

#news article:hover::before,
#articles article:hover::before {
  transform: scaleY(1);
}

#news article h3,
#articles article h3 {
  margin-top: 0;
  font-size: 1.08rem;
}

#news article h3::before,
#articles article h3::before {
  content: none;
}

#news article h3 a,
#articles article h3 a {
  color: var(--tx-text);
  background-image: linear-gradient(var(--tx-primary), var(--tx-primary));
  background-size: 0% 2px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size 0.35s var(--tx-ease), color 0.25s var(--tx-ease);
}

#news article h3 a:hover,
#articles article h3 a:hover {
  color: var(--tx-primary);
  background-size: 100% 2px;
}

#news article p,
#articles article p {
  margin-bottom: 0.55rem;
  font-size: 0.94rem;
}

#news article p:first-of-type,
#articles article p:first-of-type {
  font-size: 0.8rem;
  color: var(--tx-text-muted);
  letter-spacing: 0.02em;
}

#articles article p a {
  display: inline-block;
  margin-top: 0.35rem;
  padding: 0.35rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--tx-primary);
  border: 1px solid rgba(200, 16, 46, 0.35);
  border-radius: 999px;
  transition: all 0.3s var(--tx-ease);
}

#articles article p a:hover {
  color: #fff;
  background: var(--tx-grad);
  border-color: transparent;
  transform: translateX(3px);
  box-shadow: 0 6px 18px rgba(200, 16, 46, 0.3);
}

/* ============ Testimonials ============ */
#testimonials p {
  position: relative;
  padding: 1rem 1.2rem 1rem 2.8rem;
  margin: 0.8rem 0;
  background: var(--tx-grad-soft);
  border-radius: var(--tx-radius-sm);
  border-left: 3px solid var(--tx-primary);
  font-style: italic;
  color: var(--tx-text-soft);
  transition: transform 0.3s var(--tx-ease), background 0.3s var(--tx-ease);
}

#testimonials p::before {
  content: "\201C";
  position: absolute;
  left: 0.9rem;
  top: 0.2rem;
  font-size: 2.2rem;
  line-height: 1;
  font-style: normal;
  color: var(--tx-primary);
  opacity: 0.55;
}

#testimonials p:hover {
  transform: translateX(5px);
  background: rgba(200, 16, 46, 0.1);
}

/* ============ FAQ ============ */
#faq h3 {
  margin-top: 1.6rem;
  padding: 0.85rem 1rem;
  background: var(--tx-surface-solid);
  border: 1px solid var(--tx-border);
  border-radius: var(--tx-radius-sm) var(--tx-radius-sm) 0 0;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.3s var(--tx-ease), color 0.3s var(--tx-ease);
}

#faq h3::before {
  content: "?";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-right: 0.6rem;
  font-size: 0.78rem;
  color: #fff;
  background: var(--tx-grad);
  border-radius: 50%;
  vertical-align: middle;
}

#faq h3:hover {
  background: var(--tx-grad-soft);
  color: var(--tx-primary);
}

#faq h3 + p {
  margin: -1px 0 0;
  padding: 1rem 1.1rem;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--tx-border);
  border-top: none;
  border-radius: 0 0 var(--tx-radius-sm) var(--tx-radius-sm);
  font-size: 0.94rem;
  transition: background 0.3s var(--tx-ease);
}

@media (prefers-color-scheme: dark) {
  #faq h3 + p {
    background: rgba(255, 255, 255, 0.03);
  }
}

#faq h3 + p:hover {
  background: var(--tx-grad-soft);
}

/* ============ HowTo ============ */
#howto {
  background: var(--tx-grad-soft), var(--tx-surface);
}

#howto h3 {
  display: inline-block;
  padding: 0.15rem 0.8rem;
  background: var(--tx-grad);
  color: #fff;
  -webkit-text-fill-color: #fff;
  border-radius: 999px;
  font-size: 0.92rem;
  margin-top: 1.3rem;
}

#howto h3::before {
  content: none;
}

#howto h3:hover {
  color: #fff;
  filter: brightness(1.08);
}

#howto p {
  margin-top: 0.6rem;
}

/* ============ Contact ============ */
#contact p {
  padding: 0.55rem 0.9rem;
  margin: 0.4rem 0;
  background: var(--tx-surface-solid);
  border-radius: var(--tx-radius-sm);
  border: 1px solid var(--tx-border);
  font-size: 0.95rem;
  transition: transform 0.3s var(--tx-ease), border-color 0.3s var(--tx-ease);
}

#contact p:hover {
  transform: translateX(4px);
  border-color: rgba(200, 16, 46, 0.35);
}

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

/* ============ Sitemap / Links ============ */
#sitemap ul,
#links ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

#sitemap ul li a,
#links ul li a {
  display: inline-block;
  padding: 0.45rem 1rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--tx-text-soft);
  background: var(--tx-surface-solid);
  border: 1px solid var(--tx-border);
  border-radius: 999px;
  transition: all 0.3s var(--tx-ease);
}

#sitemap ul li a:hover,
#links ul li a:hover {
  color: #fff;
  background: var(--tx-grad);
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(200, 16, 46, 0.28);
}

/* ============ Footer ============ */
footer[role="contentinfo"] {
  position: relative;
  margin-top: 2rem;
  padding: 2.5rem 1.25rem 2rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.86);
  background: var(--tx-grad);
  background-size: 180% 180%;
  animation: tx-grad-move 16s ease infinite;
  overflow: hidden;
}

footer[role="contentinfo"]::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.14), transparent 60%);
  pointer-events: none;
}

footer[role="contentinfo"] p {
  margin: 0.35rem auto;
  max-width: 720px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.9rem;
  position: relative;
}

footer[role="contentinfo"] p:first-child {
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  letter-spacing: 0.02em;
}

footer[role="contentinfo"] a {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ============ Animations ============ */
@keyframes tx-fade-up {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes tx-grad-move {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@keyframes tx-float {
  from {
    transform: translate(0, 0) scale(1);
  }
  to {
    transform: translate(3%, -3%) scale(1.06);
  }
}

/* Stagger section entrance */
main > section:nth-of-type(2) { animation-delay: 0.04s; }
main > section:nth-of-type(3) { animation-delay: 0.08s; }
main > section:nth-of-type(4) { animation-delay: 0.12s; }
main > section:nth-of-type(5) { animation-delay: 0.16s; }
main > section:nth-of-type(6) { animation-delay: 0.2s; }
main > section:nth-of-type(7) { animation-delay: 0.24s; }
main > section:nth-of-type(8) { animation-delay: 0.28s; }
main > section:nth-of-type(9) { animation-delay: 0.32s; }
main > section:nth-of-type(10) { animation-delay: 0.36s; }
main > section:nth-of-type(n+11) { animation-delay: 0.4s; }

/* ============ Responsive ============ */
@media (max-width: 900px) {
  header[role="banner"] nav {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  header[role="banner"] nav > a[aria-label] {
    text-align: center;
  }

  header[role="banner"] nav ul {
    justify-content: center;
    gap: 0.1rem 0.25rem;
  }

  header[role="banner"] nav ul li a {
    font-size: 0.82rem;
    padding: 0.35rem 0.6rem;
  }
}

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

  main {
    padding: 0.5rem 0.75rem 2rem;
  }

  main > section {
    margin: 1rem 0;
    padding: 1.4rem 1.1rem;
    border-radius: var(--tx-radius-sm);
  }

  main > section > h2 {
    font-size: 1.25rem;
    padding-left: 0.85rem;
  }

  main > section h3 {
    font-size: 1.02rem;
  }

  #home {
    padding: 2.2rem 1.2rem;
    border-radius: var(--tx-radius);
  }

  #home h1 {
    font-size: 1.4rem;
  }

  #news article,
  #articles article {
    padding: 1.05rem 1rem;
  }

  #faq h3 {
    font-size: 0.94rem;
    padding: 0.7rem 0.8rem;
  }

  #faq h3 + p {
    padding: 0.85rem 0.9rem;
  }

  #sitemap ul li a,
  #links ul li a {
    padding: 0.38rem 0.8rem;
    font-size: 0.82rem;
  }

  footer[role="contentinfo"] {
    padding: 2rem 1rem 1.5rem;
  }
}

@media (max-width: 380px) {
  header[role="banner"] nav ul li a {
    font-size: 0.76rem;
    padding: 0.3rem 0.45rem;
  }
}

/* ============ Accessibility / Motion ============ */
@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[role="banner"],
  nav[aria-label="面包屑导航"],
  footer[role="contentinfo"] {
    display: none;
  }

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

  main > section {
    box-shadow: none;
    border: 1px solid #ddd;
    background: #fff;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    page-break-inside: avoid;
  }

  a {
    color: #000;
    text-decoration: underline;
  }
}