:root {
  --brand: #ff6b35;
  --brand-dark: #e8541f;
  --brand-light: #ff8f66;
  --accent: #7c3aed;
  --accent-2: #06b6d4;
  --bg: #f7f8fc;
  --bg-soft: #eef1f8;
  --surface: #ffffff;
  --surface-2: rgba(255, 255, 255, 0.72);
  --text: #1c2230;
  --text-soft: #4b5568;
  --text-muted: #7a8398;
  --border: rgba(28, 34, 48, 0.08);
  --border-strong: rgba(28, 34, 48, 0.16);
  --shadow-sm: 0 2px 8px rgba(28, 34, 48, 0.06);
  --shadow-md: 0 10px 30px rgba(28, 34, 48, 0.1);
  --shadow-lg: 0 24px 60px rgba(28, 34, 48, 0.16);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --header-h: 72px;
  --max-w: 1180px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Source Han Sans SC", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f131c;
    --bg-soft: #151b27;
    --surface: #1a2130;
    --surface-2: rgba(26, 33, 48, 0.72);
    --text: #eef2f9;
    --text-soft: #b8c1d4;
    --text-muted: #8b95aa;
    --border: rgba(238, 242, 249, 0.09);
    --border-strong: rgba(238, 242, 249, 0.18);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.6);
    --brand-light: #ff9d78;
  }
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(900px 500px at 8% -8%, rgba(255, 107, 53, 0.1), transparent 60%),
    radial-gradient(800px 480px at 96% 4%, rgba(124, 58, 237, 0.09), transparent 62%),
    radial-gradient(700px 420px at 50% 100%, rgba(6, 182, 212, 0.06), transparent 65%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

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

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

a:focus-visible,
summary:focus-visible,
button:focus-visible {
  outline: 3px solid rgba(255, 107, 53, 0.45);
  outline-offset: 3px;
  border-radius: 6px;
}

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

h1 {
  font-size: clamp(1.75rem, 4.2vw, 3rem);
}

h2 {
  font-size: clamp(1.4rem, 2.8vw, 2rem);
}

h3 {
  font-size: clamp(1.1rem, 1.9vw, 1.3rem);
}

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

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

::selection {
  background: rgba(255, 107, 53, 0.25);
  color: var(--text);
}

/* ---------- Header ---------- */
#site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface-2);
  -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: box-shadow 0.3s var(--ease), background 0.3s var(--ease);
}

.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: 0.02em;
  padding: 6px 4px;
  border-radius: var(--radius-sm);
}

.logo svg {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(255, 107, 53, 0.35);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}

.logo:hover svg {
  transform: rotate(-6deg) scale(1.06);
  box-shadow: 0 10px 26px rgba(255, 107, 53, 0.5);
}

.logo:hover {
  color: var(--brand);
}

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

#site-header nav a {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--text-soft);
  position: relative;
  transition: color 0.25s var(--ease), background 0.25s var(--ease), transform 0.25s var(--ease);
}

#site-header nav a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 3px;
  width: 0;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--brand), var(--accent));
  transform: translateX(-50%);
  transition: width 0.3s var(--ease);
}

#site-header nav a:hover {
  color: var(--brand);
  background: rgba(255, 107, 53, 0.08);
  transform: translateY(-1px);
}

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

/* ---------- Main layout ---------- */
main {
  display: block;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px 40px;
}

main > section {
  margin: 40px 0;
  padding: 40px clamp(20px, 4vw, 48px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  animation: rise-in 0.7s var(--ease) both;
}

main > section::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand), var(--accent), var(--accent-2));
  opacity: 0.85;
}

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

main > section {
  transition: box-shadow 0.4s var(--ease), border-color 0.4s var(--ease), transform 0.4s var(--ease);
}

/* ---------- Hero ---------- */
#hero {
  margin-top: 32px;
  padding: clamp(40px, 6vw, 80px) clamp(24px, 5vw, 64px);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(135deg, rgba(255, 107, 53, 0.92) 0%, rgba(255, 143, 102, 0.86) 32%, rgba(124, 58, 237, 0.82) 72%, rgba(6, 182, 212, 0.78) 100%),
    var(--surface);
  background-blend-mode: normal;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 30px 70px rgba(255, 107, 53, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  isolation: isolate;
}

#hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(600px 300px at 88% 12%, rgba(255, 255, 255, 0.35), transparent 62%),
    radial-gradient(500px 280px at 6% 90%, rgba(255, 255, 255, 0.2), transparent 60%);
  pointer-events: none;
  z-index: -1;
}

#hero::after {
  content: "";
  position: absolute;
  top: -60px;
  right: -60px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  pointer-events: none;
  z-index: -1;
  animation: float-slow 9s ease-in-out infinite;
}

#hero h1 {
  color: #fff;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.18);
  max-width: 22ch;
}

#hero p {
  color: rgba(255, 255, 255, 0.94);
  font-size: clamp(1rem, 1.35vw, 1.1rem);
  max-width: 72ch;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.12);
}

#hero p:last-child {
  margin-bottom: 0;
}

/* ---------- Page nav (TOC) ---------- */
main > nav[aria-label="页面目录"] {
  margin: 32px 0;
  padding: 28px clamp(20px, 4vw, 40px);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

main > nav[aria-label="页面目录"] h2 {
  font-size: 1.05rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 16px;
}

main > nav[aria-label="页面目录"] ul {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

main > nav[aria-label="页面目录"] a {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-soft);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: all 0.28s var(--ease);
}

main > nav[aria-label="页面目录"] a:hover {
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(255, 107, 53, 0.32);
}

/* ---------- Section headings ---------- */
main > section > h2 {
  display: inline-block;
  position: relative;
  padding-bottom: 14px;
  margin-bottom: 24px;
}

main > section > h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 64px;
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--brand), var(--accent));
  transition: width 0.5s var(--ease);
}

main > section:hover > h2::after {
  width: 96px;
}

main > section > h3 {
  margin-top: 28px;
  padding-left: 14px;
  border-left: 4px solid var(--brand);
  color: var(--text);
}

/* ---------- Article cards ---------- */
#articles {
  display: block;
}

#articles > p {
  margin-bottom: 28px;
}

#articles article {
  position: relative;
  margin: 0 0 20px;
  padding: 26px clamp(20px, 3vw, 32px);
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s var(--ease);
}

#articles article::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--brand), var(--accent));
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.4s var(--ease);
}

#articles article:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: rgba(255, 107, 53, 0.35);
}

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

#articles article h3 {
  margin: 0 0 8px;
  padding-left: 0;
  border-left: none;
  font-size: 1.15rem;
  color: var(--text);
  transition: color 0.25s var(--ease);
}

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

#articles article p {
  margin-bottom: 10px;
}

#articles article p:first-of-type {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-soft);
  padding: 3px 12px;
  border-radius: 999px;
  margin-bottom: 12px;
}

#articles article a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--brand);
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(255, 107, 53, 0.1);
  transition: all 0.28s var(--ease);
}

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

#articles article a:hover {
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  box-shadow: 0 8px 20px rgba(255, 107, 53, 0.3);
}

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

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

#faq details[open] {
  border-color: rgba(255, 107, 53, 0.4);
  box-shadow: var(--shadow-md);
  background: linear-gradient(180deg, rgba(255, 107, 53, 0.05), transparent 60%), var(--surface);
}

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

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

#faq summary::after {
  content: "+";
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  transition: transform 0.35s var(--ease), background 0.35s var(--ease);
}

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

#faq summary:hover {
  color: var(--brand);
  background: rgba(255, 107, 53, 0.05);
}

#faq details p {
  margin: 0;
  padding: 0 22px 20px;
  color: var(--text-soft);
  animation: fade-in 0.4s var(--ease);
}

/* ---------- Contact ---------- */
#contact {
  background:
    linear-gradient(160deg, rgba(255, 107, 53, 0.06), rgba(124, 58, 237, 0.06)),
    var(--surface);
}

#contact p {
  padding: 10px 16px;
  margin: 0 0 8px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  transition: transform 0.28s var(--ease), border-color 0.28s var(--ease);
}

#contact p:hover {
  transform: translateX(4px);
  border-color: rgba(255, 107, 53, 0.35);
}

#contact h3 {
  margin-top: 28px;
}

/* ---------- Sitemap / Links ---------- */
#sitemap ul,
#links ul {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

#sitemap a,
#links a {
  display: inline-block;
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-soft);
  background: var(--bg-soft);
  border: 1px solid transparent;
  transition: all 0.28s var(--ease);
}

#sitemap a:hover,
#links a:hover {
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(255, 107, 53, 0.28);
}

/* ---------- Reviews ---------- */
#reviews h3 + p {
  position: relative;
  padding: 18px 22px 18px 52px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  border: 1px solid var(--border);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

#reviews h3 + p::before {
  content: "“";
  position: absolute;
  left: 18px;
  top: 6px;
  font-size: 2.6rem;
  line-height: 1;
  font-weight: 800;
  color: var(--brand);
  opacity: 0.55;
}

#reviews h3 + p:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

/* ---------- Footer ---------- */
footer {
  margin-top: 40px;
  padding: 56px 24px 32px;
  background:
    linear-gradient(180deg, transparent, rgba(255, 107, 53, 0.05)),
    var(--surface);
  border-top: 1px solid var(--border);
  color: var(--text-soft);
}

footer > section {
  max-width: var(--max-w);
  margin: 0 auto 36px;
  padding-bottom: 28px;
  border-bottom: 1px dashed var(--border-strong);
}

footer > section:last-of-type {
  border-bottom: none;
}

footer h2 {
  font-size: 1.15rem;
  color: var(--text);
  margin-bottom: 14px;
  position: relative;
  padding-left: 16px;
}

footer h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  box-shadow: 0 0 0 4px rgba(255, 107, 53, 0.15);
}

footer h3 {
  font-size: 1rem;
  color: var(--text);
  margin: 18px 0 8px;
  padding-left: 0;
  border-left: none;
}

footer p {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin: 0 0 8px;
}

footer > p {
  max-width: var(--max-w);
  margin: 0 auto;
  padding-top: 24px;
  text-align: center;
  font-size: 0.86rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

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

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float-slow {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(18px) rotate(8deg);
  }
}

main > section:nth-of-type(1) {
  animation-delay: 0.02s;
}
main > section:nth-of-type(2) {
  animation-delay: 0.04s;
}
main > section:nth-of-type(3) {
  animation-delay: 0.06s;
}

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

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .header-inner {
    padding: 0 18px;
  }

  #site-header nav a {
    padding: 7px 11px;
    font-size: 0.88rem;
  }

  main {
    padding: 0 18px 32px;
  }

  main > section {
    padding: 32px 24px;
    border-radius: var(--radius-md);
  }
}

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

  .header-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px 16px;
  }

  .logo {
    justify-content: center;
    font-size: 1.15rem;
  }

  #site-header nav ul {
    justify-content: center;
    gap: 2px;
    padding-bottom: 4px;
  }

  #site-header nav a {
    padding: 6px 10px;
    font-size: 0.82rem;
  }

  #hero {
    padding: 36px 22px;
    border-radius: var(--radius-lg);
    margin-top: 20px;
  }

  #hero::after {
    width: 160px;
    height: 160px;
    top: -40px;
    right: -40px;
  }

  main > section {
    margin: 24px 0;
    padding: 26px 18px;
  }

  main > section > h2 {
    font-size: 1.3rem;
  }

  main > section > h3 {
    margin-top: 22px;
    font-size: 1.05rem;
  }

  #articles article {
    padding: 20px 16px;
  }

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

  #faq summary::after {
    right: 14px;
    width: 24px;
    height: 24px;
    font-size: 1rem;
  }

  #faq details p {
    padding: 0 16px 16px;
    font-size: 0.92rem;
  }

  #sitemap a,
  #links a,
  main > nav[aria-label="页面目录"] a {
    padding: 7px 13px;
    font-size: 0.84rem;
  }

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

  #reviews h3 + p {
    padding: 16px 16px 16px 44px;
  }

  #reviews h3 + p::before {
    left: 12px;
    font-size: 2rem;
  }
}

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

  #hero h1 {
    font-size: 1.55rem;
  }

  main > section {
    padding: 22px 14px;
    border-radius: var(--radius-sm);
  }

  #articles article a {
    width: 100%;
    justify-content: center;
  }

  #contact p {
    font-size: 0.88rem;
    word-break: break-all;
  }
}

/* ---------- Print ---------- */
@media print {
  #site-header,
  main > nav[aria-label="页面目录"],
  #hero::after,
  #hero::before {
    display: none;
  }

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

  main > section,
  #articles article,
  #faq details {
    box-shadow: none;
    border: 1px solid #ccc;
    break-inside: avoid;
  }

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