:root {
  --bg: #0b0d17;
  --bg-soft: #12152a;
  --surface: rgba(255, 255, 255, 0.06);
  --surface-strong: rgba(255, 255, 255, 0.1);
  --border: rgba(255, 255, 255, 0.12);
  --text: #e8eaf6;
  --text-muted: #a5acc9;
  --accent: #7c5cff;
  --accent-2: #ff5c8a;
  --accent-3: #38d9c0;
  --gold: #ffc857;
  --gradient: linear-gradient(135deg, #7c5cff 0%, #ff5c8a 55%, #ffc857 100%);
  --gradient-soft: linear-gradient(135deg, rgba(124, 92, 255, 0.18), rgba(255, 92, 138, 0.14));
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.3);
  --radius: 20px;
  --radius-sm: 12px;
  --radius-pill: 999px;
  --maxw: 1180px;
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f4f5fb;
    --bg-soft: #ffffff;
    --surface: rgba(255, 255, 255, 0.72);
    --surface-strong: rgba(255, 255, 255, 0.9);
    --border: rgba(20, 24, 50, 0.1);
    --text: #171a2e;
    --text-muted: #5a6080;
    --shadow: 0 18px 50px rgba(60, 70, 120, 0.16);
    --shadow-sm: 0 8px 24px rgba(60, 70, 120, 0.12);
    --gradient-soft: linear-gradient(135deg, rgba(124, 92, 255, 0.12), rgba(255, 92, 138, 0.1));
  }
}

*,
*::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(--text);
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(124, 92, 255, 0.22), transparent 60%),
    radial-gradient(900px 500px at 0% 10%, rgba(255, 92, 138, 0.14), transparent 55%),
    radial-gradient(700px 500px at 50% 100%, rgba(56, 217, 192, 0.1), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--accent-3);
  text-decoration: none;
  transition: color 0.25s var(--ease);
}

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

h1, h2, h3, h4 {
  line-height: 1.35;
  margin: 0 0 0.7em;
  letter-spacing: 0.01em;
  font-weight: 700;
}

h1 {
  font-size: clamp(1.7rem, 4vw, 2.7rem);
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

h2 {
  font-size: clamp(1.4rem, 3vw, 2rem);
  position: relative;
  padding-bottom: 0.5em;
}

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

h3 {
  font-size: clamp(1.1rem, 2.2vw, 1.3rem);
  color: var(--text);
}

h4 {
  font-size: 1.02rem;
  color: var(--accent-3);
}

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

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

li {
  margin-bottom: 0.4em;
}

blockquote {
  margin: 0;
  padding: 1.1em 1.4em;
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--surface);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-left-width: 4px;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

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

blockquote p {
  margin: 0;
  color: var(--text);
}

/* ============ Header ============ */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1.2rem;
  padding: 0.9rem clamp(1rem, 3vw, 2.4rem);
  background: rgba(11, 13, 23, 0.6);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-bottom: 1px solid var(--border);
}

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

.brand {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.brand a {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  transition: filter 0.3s var(--ease);
}

.brand a:hover {
  filter: brightness(1.2);
}

.brand p {
  margin: 0;
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

header nav {
  min-width: 0;
}

header nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.3rem;
  margin: 0;
  padding: 0;
  list-style: none;
  justify-content: center;
}

header nav li {
  margin: 0;
}

header nav a {
  display: inline-block;
  padding: 0.32rem 0.62rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  border-radius: var(--radius-pill);
  transition: color 0.25s var(--ease), background 0.25s var(--ease), transform 0.25s var(--ease);
}

header nav a:hover,
header nav a:focus-visible {
  color: #fff;
  background: var(--gradient);
  transform: translateY(-2px);
}

header form {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}

header form label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

header form input[type="search"] {
  width: clamp(120px, 16vw, 210px);
  padding: 0.5rem 0.9rem;
  font-size: 0.85rem;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  outline: none;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s var(--ease);
}

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

header form input[type="search"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.25);
  background: var(--surface-strong);
}

header form button {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-family: inherit;
  font-weight: 600;
  color: #fff;
  background: var(--gradient);
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), filter 0.25s var(--ease);
}

header form button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(124, 92, 255, 0.45);
  filter: brightness(1.08);
}

header form button:active {
  transform: translateY(0);
}

/* ============ Main layout ============ */
main {
  width: min(var(--maxw), 100% - clamp(1.2rem, 5vw, 3rem));
  margin: 0 auto;
  padding: clamp(1.2rem, 3vw, 2.4rem) 0 3rem;
}

main > nav[aria-label="面包屑导航"] ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 1.6rem;
  padding: 0.5rem 1rem;
  list-style: none;
  font-size: 0.82rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  width: fit-content;
}

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

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

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

/* ============ Sections as cards ============ */
main > section {
  position: relative;
  margin-bottom: clamp(1.4rem, 3vw, 2.2rem);
  padding: clamp(1.3rem, 3vw, 2.4rem);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: var(--shadow-sm);
  transition: transform 0.45s var(--ease), box-shadow 0.45s var(--ease), border-color 0.45s var(--ease);
  animation: rise 0.8s var(--ease) both;
}

main > section:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: rgba(124, 92, 255, 0.35);
}

/* Hero banner */
#hero {
  overflow: hidden;
  padding: clamp(1.8rem, 5vw, 3.6rem);
  background:
    linear-gradient(135deg, rgba(124, 92, 255, 0.28), rgba(255, 92, 138, 0.22) 50%, rgba(255, 200, 87, 0.16)),
    var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

#hero::before {
  content: "";
  position: absolute;
  inset: -40% -10% auto auto;
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, rgba(255, 92, 138, 0.35), transparent 65%);
  filter: blur(20px);
  pointer-events: none;
  animation: float 12s ease-in-out infinite alternate;
}

#hero::after {
  content: "";
  position: absolute;
  inset: auto auto -50% -12%;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(56, 217, 192, 0.28), transparent 65%);
  filter: blur(24px);
  pointer-events: none;
  animation: float 15s ease-in-out infinite alternate-reverse;
}

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

#hero p {
  max-width: 78ch;
  font-size: 1rem;
}

/* ============ Articles & cards ============ */
#news,
#articles {
  display: grid;
  gap: 1rem;
}

#news article,
#articles article {
  position: relative;
  padding: 1.2rem 1.3rem;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s var(--ease), background 0.35s var(--ease);
}

#news article:hover,
#articles article:hover {
  transform: translateY(-4px) scale(1.005);
  border-color: rgba(124, 92, 255, 0.45);
  box-shadow: var(--shadow);
}

#news article h3,
#articles article h3 {
  margin-bottom: 0.35em;
  transition: color 0.3s var(--ease);
}

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

#news article p:first-of-type,
#articles article p:first-of-type {
  display: inline-block;
  margin-bottom: 0.6em;
  padding: 0.15rem 0.7rem;
  font-size: 0.75rem;
  color: var(--gold);
  background: rgba(255, 200, 87, 0.12);
  border: 1px solid rgba(255, 200, 87, 0.3);
  border-radius: var(--radius-pill);
}

#articles article a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--accent-3);
}

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

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

/* ============ Reviews ============ */
#reviews {
  display: grid;
  gap: 1rem;
}

/* ============ FAQ / HowTo spacing ============ */
#faq h3,
#howto h3,
#howto h4 {
  margin-top: 1.4em;
}

#faq h3:first-of-type,
#howto h3:first-of-type {
  margin-top: 0;
}

#howto {
  background:
    linear-gradient(135deg, rgba(56, 217, 192, 0.1), rgba(124, 92, 255, 0.08)),
    var(--surface);
}

#howto h4 {
  display: inline-block;
  padding: 0.15rem 0.7rem;
  border-radius: var(--radius-pill);
  background: rgba(56, 217, 192, 0.12);
  border: 1px solid rgba(56, 217, 192, 0.3);
}

/* ============ Sitemap & links ============ */
#sitemap ul,
#links ul {
  columns: 2;
  column-gap: 1.6rem;
  list-style: none;
  padding: 0;
}

#sitemap li,
#links li {
  break-inside: avoid;
  margin-bottom: 0.5rem;
}

#sitemap a,
#links a {
  display: inline-block;
  padding: 0.18rem 0;
  color: var(--text-muted);
  transition: color 0.25s var(--ease), transform 0.25s var(--ease);
}

#sitemap a:hover,
#links a:hover {
  color: var(--accent-3);
  transform: translateX(4px);
}

/* ============ Legal ============ */
#legal h2 {
  margin-top: 1.4em;
}

#legal h2:first-child {
  margin-top: 0;
}

/* ============ Footer ============ */
footer {
  position: relative;
  margin-top: 2rem;
  padding: clamp(1.6rem, 4vw, 2.6rem) clamp(1rem, 3vw, 2.4rem);
  text-align: center;
  background: linear-gradient(180deg, transparent, rgba(124, 92, 255, 0.08));
  border-top: 1px solid var(--border);
}

footer p {
  margin: 0.35em 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

footer p:first-child {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

footer a {
  color: var(--accent-3);
  margin: 0 0.2rem;
}

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

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

@keyframes float {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(-30px, 30px, 0) scale(1.12);
  }
}

@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;
  }
}

/* Staggered section reveal */
main > section:nth-of-type(1) { animation-delay: 0.02s; }
main > section:nth-of-type(2) { animation-delay: 0.06s; }
main > section:nth-of-type(3) { animation-delay: 0.1s; }
main > section:nth-of-type(4) { animation-delay: 0.14s; }
main > section:nth-of-type(5) { animation-delay: 0.18s; }
main > section:nth-of-type(6) { animation-delay: 0.22s; }
main > section:nth-of-type(7) { animation-delay: 0.26s; }
main > section:nth-of-type(8) { animation-delay: 0.3s; }
main > section:nth-of-type(9) { animation-delay: 0.34s; }
main > section:nth-of-type(10) { animation-delay: 0.38s; }

/* ============ Responsive ============ */
@media (max-width: 1024px) {
  header {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "brand search"
      "nav nav";
    row-gap: 0.6rem;
  }
  .brand { grid-area: brand; }
  header nav { grid-area: nav; }
  header form { grid-area: search; }
  header nav ul { justify-content: flex-start; }
}

@media (max-width: 720px) {
  html {
    scroll-padding-top: 150px;
  }
  header {
    grid-template-columns: 1fr;
    grid-template-areas:
      "brand"
      "search"
      "nav";
    padding: 0.8rem 1rem;
  }
  header form input[type="search"] {
    width: 100%;
    flex: 1;
  }
  header form {
    width: 100%;
  }
  header nav ul {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 0.3rem;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }
  header nav a {
    white-space: nowrap;
  }
  .brand p {
    white-space: normal;
  }
  main {
    width: calc(100% - 1.6rem);
  }
  main > section {
    padding: 1.15rem;
    border-radius: 16px;
  }
  #hero {
    padding: 1.4rem;
  }
  #sitemap ul,
  #links ul {
    columns: 1;
  }
  blockquote {
    padding: 0.9rem 1rem;
  }
}

@media (max-width: 380px) {
  body {
    font-size: 15px;
  }
  header form button {
    padding: 0.5rem 0.75rem;
  }
}

/* High contrast / accessibility */
:focus-visible {
  outline: 2px solid var(--accent-3);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection {
  background: rgba(124, 92, 255, 0.4);
  color: #fff;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  border-radius: var(--radius-pill);
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
  filter: brightness(1.15);
}