:root {
  --bg-primary: #0f0f1a;
  --bg-secondary: #1a1a2e;
  --bg-card: rgba(30, 30, 50, 0.72);
  --bg-glass: rgba(255, 255, 255, 0.06);
  --border-glass: rgba(255, 255, 255, 0.12);
  --text-primary: #eef0f6;
  --text-secondary: #a8adc4;
  --text-muted: #6b7089;
  --accent: #e94560;
  --accent-2: #7b5cff;
  --accent-3: #00d4ff;
  --gradient-hero: linear-gradient(135deg, #1a1a2e 0%, #16213e 35%, #0f3460 65%, #533483 100%);
  --gradient-accent: linear-gradient(135deg, #e94560 0%, #7b5cff 100%);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-xl: 32px;
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.35);
  --shadow-glow: 0 0 40px rgba(233, 69, 96, 0.25);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
  --max-width: 1200px;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg-primary: #f5f6fb;
    --bg-secondary: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.78);
    --bg-glass: rgba(255, 255, 255, 0.65);
    --border-glass: rgba(20, 20, 45, 0.1);
    --text-primary: #1a1a2e;
    --text-secondary: #4a4f6a;
    --text-muted: #8288a3;
    --gradient-hero: linear-gradient(135deg, #e8ecff 0%, #dce4ff 35%, #c9d8ff 65%, #e2d4ff 100%);
    --shadow-sm: 0 2px 10px rgba(30, 30, 60, 0.08);
    --shadow-md: 0 8px 30px rgba(30, 30, 60, 0.12);
    --shadow-glow: 0 0 40px rgba(123, 92, 255, 0.18);
  }
}

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

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.75;
  font-size: 16px;
  min-height: 100vh;
  overflow-x: hidden;
  background-image:
    radial-gradient(circle at 15% 10%, rgba(123, 92, 255, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 85% 20%, rgba(233, 69, 96, 0.1) 0%, transparent 45%),
    radial-gradient(circle at 50% 90%, rgba(0, 212, 255, 0.08) 0%, transparent 50%);
  background-attachment: fixed;
}

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

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

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

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

ul,
ol {
  list-style: none;
}

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

h1 {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1rem;
}

h2 {
  font-size: clamp(1.4rem, 2.8vw, 2rem);
  margin-bottom: 1rem;
  position: relative;
  padding-left: 1rem;
}

h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.2em;
  bottom: 0.2em;
  width: 5px;
  border-radius: 4px;
  background: var(--gradient-accent);
}

h3 {
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  margin: 1.25rem 0 0.5rem;
  color: var(--text-primary);
}

h4 {
  font-size: 1.05rem;
  margin: 1rem 0 0.4rem;
  color: var(--accent-3);
}

p {
  margin-bottom: 0.9rem;
  color: var(--text-secondary);
}

strong {
  color: var(--text-primary);
  font-weight: 700;
}

/* ============ HEADER ============ */
header[role="banner"] {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  padding: 0.9rem clamp(1rem, 4vw, 3rem);
  background: var(--bg-glass);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--border-glass);
  box-shadow: var(--shadow-sm);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.brand svg {
  width: 40px;
  height: 40px;
  transition: transform var(--transition);
  filter: drop-shadow(0 0 8px rgba(233, 69, 96, 0.4));
}

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

.brand strong {
  font-size: 1.25rem;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  white-space: nowrap;
  letter-spacing: 0.04em;
}

header nav[aria-label="主导航"] {
  flex: 1 1 auto;
  min-width: 0;
}

header nav[aria-label="主导航"] ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.35rem;
}

header nav[aria-label="主导航"] a {
  display: inline-block;
  padding: 0.4rem 0.75rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition), transform var(--transition);
}

header nav[aria-label="主导航"] a:hover,
header nav[aria-label="主导航"] a:focus-visible {
  color: var(--text-primary);
  background: var(--bg-glass);
  transform: translateY(-2px);
}

header form[role="search"] {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  padding: 0.25rem 0.3rem 0.25rem 0.9rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}

header form[role="search"]:focus-within {
  border-color: var(--accent-3);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.18);
}

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

header form[role="search"] input {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 0.875rem;
  font-family: inherit;
  padding: 0.4rem 0;
  width: 160px;
  outline: none;
}

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

header form[role="search"] button {
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  background: var(--gradient-accent);
  border: none;
  border-radius: var(--radius-xl);
  padding: 0.45rem 1rem;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), filter var(--transition);
}

header form[role="search"] button:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-glow);
  filter: brightness(1.08);
}

header form[role="search"] button:active {
  transform: translateY(0) scale(0.97);
}

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

main > section {
  margin-bottom: clamp(1.75rem, 4vw, 3rem);
  padding: clamp(1.25rem, 3vw, 2rem);
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
  animation: fadeUp 0.7s cubic-bezier(0.4, 0, 0.2, 1) both;
}

main > section:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(123, 92, 255, 0.35);
}

main > section:nth-of-type(1) { animation-delay: 0.05s; }
main > section:nth-of-type(2) { animation-delay: 0.1s; }
main > section:nth-of-type(3) { animation-delay: 0.15s; }
main > section:nth-of-type(4) { animation-delay: 0.2s; }
main > section:nth-of-type(5) { animation-delay: 0.25s; }
main > section:nth-of-type(6) { animation-delay: 0.3s; }

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

/* ============ HERO ============ */
#home {
  position: relative;
  overflow: hidden;
  background: var(--gradient-hero);
  border-radius: var(--radius-xl);
  padding: clamp(1.75rem, 5vw, 3.5rem);
  border: 1px solid var(--border-glass);
  box-shadow: var(--shadow-md);
}

#home::before {
  content: "";
  position: absolute;
  inset: -40%;
  background:
    radial-gradient(circle at 20% 30%, rgba(233, 69, 96, 0.35), transparent 45%),
    radial-gradient(circle at 80% 70%, rgba(0, 212, 255, 0.28), transparent 45%);
  filter: blur(60px);
  animation: heroGlow 12s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes heroGlow {
  0% { transform: translate(0, 0) scale(1); opacity: 0.8; }
  100% { transform: translate(4%, -4%) scale(1.15); opacity: 1; }
}

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

#home p {
  color: var(--text-secondary);
  max-width: 80ch;
}

/* ============ BREADCRUMB ============ */
nav[aria-label="面包屑导航"] {
  margin: 1.25rem 0;
}

nav[aria-label="面包屑导航"] ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
}

nav[aria-label="面包屑导航"] li {
  display: inline-flex;
  align-items: center;
  color: var(--text-muted);
}

nav[aria-label="面包屑导航"] li + li::before {
  content: "›";
  margin-right: 0.35rem;
  color: var(--text-muted);
}

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

nav[aria-label="面包屑导航"] a:hover {
  color: var(--accent-3);
  background: var(--bg-glass);
}

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

/* ============ PAGE ANCHOR NAV ============ */
nav[aria-label="页面内锚点导航"] {
  margin: 1rem 0 1.75rem;
  padding: 0.85rem 1rem;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

nav[aria-label="页面内锚点导航"] ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

nav[aria-label="页面内锚点导航"] a {
  display: inline-block;
  padding: 0.3rem 0.7rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  transition: all var(--transition);
}

nav[aria-label="页面内锚点导航"] a:hover {
  color: #fff;
  background: var(--gradient-accent);
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

/* ============ BLOCKQUOTE / REVIEWS ============ */
blockquote {
  position: relative;
  margin: 1rem 0;
  padding: 1rem 1.25rem 1rem 1.5rem;
  background: var(--bg-glass);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-md);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

blockquote:hover {
  transform: translateX(6px);
  box-shadow: var(--shadow-sm);
  border-left-color: var(--accent-3);
}

blockquote p {
  color: var(--text-primary);
  font-style: italic;
  margin-bottom: 0.4rem;
}

blockquote footer {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: right;
}

/* ============ ARTICLES / CARDS ============ */
article {
  margin: 1rem 0;
  padding: 1.1rem 1.25rem;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition), background var(--transition);
}

article:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: rgba(233, 69, 96, 0.4);
  background: var(--bg-card);
}

article h3 {
  margin-top: 0;
}

article p {
  font-size: 0.94rem;
}

article a {
  display: inline-block;
  margin-top: 0.4rem;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.3rem 0.85rem;
  border-radius: var(--radius-xl);
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  transition: all var(--transition);
}

article a:hover {
  color: #fff;
  background: var(--gradient-accent);
  border-color: transparent;
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}

/* ============ DETAILS / FAQ ============ */
details {
  margin: 0.7rem 0;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
}

details[open] {
  border-color: rgba(123, 92, 255, 0.45);
  box-shadow: var(--shadow-sm);
}

details summary {
  cursor: pointer;
  padding: 0.9rem 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  list-style: none;
  position: relative;
  padding-right: 2.5rem;
  transition: background var(--transition), color var(--transition);
  user-select: none;
}

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

details summary::after {
  content: "+";
  position: absolute;
  right: 1.15rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--accent-3);
  transition: transform var(--transition), color var(--transition);
}

details[open] summary::after {
  content: "−";
  color: var(--accent);
  transform: translateY(-50%) rotate(180deg);
}

details summary:hover {
  background: var(--bg-card);
  color: var(--accent-3);
}

details > p {
  padding: 0 1.15rem 1rem;
  margin: 0;
  font-size: 0.94rem;
  animation: fadeUp 0.35s ease both;
}

/* ============ ADDRESS / CONTACT ============ */
address {
  font-style: normal;
  padding: 1rem 1.25rem;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
}

address p {
  margin-bottom: 0.5rem;
  font-size: 0.94rem;
}

address a {
  font-weight: 600;
}

/* ============ SITEMAP / LINKS LISTS ============ */
#sitemap ul,
#links ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

#sitemap li,
#links li {
  flex: 0 1 auto;
}

#sitemap a,
#links a {
  display: inline-block;
  padding: 0.45rem 1rem;
  font-size: 0.88rem;
  color: var(--text-secondary);
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  transition: all var(--transition);
}

#sitemap a:hover,
#links a:hover {
  color: #fff;
  background: var(--gradient-accent);
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

/* ============ FOOTER ============ */
footer[role="contentinfo"] {
  margin-top: 2rem;
  padding: clamp(1.75rem, 4vw, 3rem) clamp(1rem, 4vw, 3rem);
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-glass);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  position: relative;
}

footer[role="contentinfo"]::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-accent);
  opacity: 0.7;
}

footer[role="contentinfo"] section {
  padding: 0.5rem 0;
}

footer[role="contentinfo"] h2 {
  font-size: 1rem;
  padding-left: 0.75rem;
  margin-bottom: 0.6rem;
}

footer[role="contentinfo"] h2::before {
  width: 4px;
}

footer[role="contentinfo"] p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.7;
}

footer[role="contentinfo"] > p {
  grid-column: 1 / -1;
  text-align: center;
  padding-top: 1rem;
  border-top: 1px solid var(--border-glass);
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ============ SCROLL ANIMATION (progressive enhancement) ============ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
  header[role="banner"] {
    padding: 0.75rem 1rem;
  }

  header nav[aria-label="主导航"] {
    order: 3;
    flex-basis: 100%;
  }

  header nav[aria-label="主导航"] ul {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 0.25rem;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }

  header nav[aria-label="主导航"] a {
    white-space: nowrap;
  }

  header form[role="search"] {
    margin-left: auto;
  }

  header form[role="search"] input {
    width: 120px;
  }
}

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

  header[role="banner"] {
    gap: 0.6rem;
  }

  .brand strong {
    font-size: 1.1rem;
  }

  header form[role="search"] {
    flex-basis: 100%;
    order: 2;
    margin-left: 0;
  }

  header form[role="search"] input {
    flex: 1;
    width: auto;
  }

  header nav[aria-label="主导航"] {
    order: 3;
  }

  main {
    padding: 1rem 0.85rem;
  }

  main > section {
    padding: 1.1rem 1rem;
    border-radius: var(--radius-md);
  }

  #home {
    padding: 1.5rem 1.1rem;
    border-radius: var(--radius-lg);
  }

  h2 {
    padding-left: 0.85rem;
  }

  nav[aria-label="页面内锚点导航"] {
    padding: 0.7rem 0.8rem;
  }

  nav[aria-label="页面内锚点导航"] a {
    font-size: 0.78rem;
    padding: 0.28rem 0.6rem;
  }

  blockquote {
    padding: 0.85rem 1rem 0.85rem 1.1rem;
  }

  article {
    padding: 0.95rem 1rem;
  }

  footer[role="contentinfo"] {
    padding: 1.5rem 1rem;
    grid-template-columns: 1fr;
  }

  footer[role="contentinfo"] > p {
    text-align: left;
  }
}

/* ============ REDUCED TRANSPARENCY / FALLBACK ============ */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  header[role="banner"],
  main > section,
  nav[aria-label="页面内锚点导航"],
  details,
  article,
  blockquote {
    background: var(--bg-secondary);
  }
}