:root {
  --c-primary: #ff5a3c;
  --c-primary-2: #ff8a3c;
  --c-accent: #7c5cff;
  --c-accent-2: #3cc8ff;
  --c-bg: #f7f8fc;
  --c-bg-2: #ffffff;
  --c-card: rgba(255, 255, 255, 0.72);
  --c-card-solid: #ffffff;
  --c-text: #1c2130;
  --c-text-2: #4a5268;
  --c-text-3: #7a8299;
  --c-border: rgba(28, 33, 48, 0.08);
  --c-shadow: rgba(28, 33, 48, 0.08);
  --c-shadow-strong: rgba(28, 33, 48, 0.16);
  --grad-hero: linear-gradient(135deg, #ff5a3c 0%, #ff8a3c 42%, #7c5cff 100%);
  --grad-soft: linear-gradient(135deg, rgba(255, 90, 60, 0.12), rgba(124, 92, 255, 0.12));
  --radius-s: 10px;
  --radius-m: 16px;
  --radius-l: 24px;
  --radius-xl: 32px;
  --maxw: 1180px;
  --space: clamp(16px, 4vw, 40px);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --c-bg: #0e1017;
    --c-bg-2: #151824;
    --c-card: rgba(28, 32, 46, 0.66);
    --c-card-solid: #1a1e2c;
    --c-text: #eef1f8;
    --c-text-2: #b8c0d4;
    --c-text-3: #8a93ab;
    --c-border: rgba(255, 255, 255, 0.09);
    --c-shadow: rgba(0, 0, 0, 0.4);
    --c-shadow-strong: rgba(0, 0, 0, 0.6);
    --grad-soft: linear-gradient(135deg, rgba(255, 90, 60, 0.16), rgba(124, 92, 255, 0.16));
  }
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.75;
  color: var(--c-text);
  background-color: var(--c-bg);
  background-image:
    radial-gradient(circle at 12% 0%, rgba(255, 90, 60, 0.10), transparent 42%),
    radial-gradient(circle at 88% 8%, rgba(124, 92, 255, 0.12), transparent 46%),
    radial-gradient(circle at 50% 100%, rgba(60, 200, 255, 0.08), transparent 50%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

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

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

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

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

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

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

::selection {
  background: rgba(255, 90, 60, 0.24);
  color: var(--c-text);
}

/* ============ HEADER / NAV ============ */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.62);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  backdrop-filter: blur(18px) saturate(180%);
  border-bottom: 1px solid var(--c-border);
  box-shadow: 0 4px 24px -12px var(--c-shadow-strong);
  transition: background 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

@media (prefers-color-scheme: dark) {
  header {
    background: rgba(14, 16, 23, 0.66);
  }
}

header nav {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px var(--space);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

header nav > a:first-child {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--c-text);
  background: var(--grad-hero);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  position: relative;
  padding-left: 34px;
  line-height: 1.2;
}

header nav > a:first-child::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  border-radius: 9px;
  background: var(--grad-hero);
  box-shadow: 0 6px 16px -6px var(--c-primary);
}

header nav > a:first-child::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  opacity: 0.92;
}

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

header nav > ul li a {
  display: inline-block;
  padding: 7px 13px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--c-text-2);
  border-radius: 999px;
  white-space: nowrap;
  transition: color 0.25s var(--ease), background 0.25s var(--ease), transform 0.25s var(--ease);
}

header nav > ul li a:hover,
header nav > ul li a:focus-visible {
  color: var(--c-primary);
  background: rgba(255, 90, 60, 0.10);
  transform: translateY(-1px);
}

/* ============ MAIN LAYOUT ============ */
main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--space) 80px;
}

section {
  margin: 0 0 clamp(28px, 5vw, 56px);
  padding: clamp(22px, 4vw, 44px);
  background: var(--c-card);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  backdrop-filter: blur(14px) saturate(160%);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-l);
  box-shadow: 0 18px 48px -28px var(--c-shadow-strong), 0 2px 8px -4px var(--c-shadow);
  scroll-margin-top: 96px;
  position: relative;
  overflow: hidden;
  animation: sectionIn 0.7s var(--ease) both;
  animation-timeline: view();
  animation-range: entry 0% entry 60%;
}

@supports not (animation-timeline: view()) {
  section {
    animation: none;
  }
}

section::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--grad-hero);
  opacity: 0.85;
  border-radius: var(--radius-l) var(--radius-l) 0 0;
}

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

/* ============ HERO (home) ============ */
#home {
  margin-top: clamp(20px, 4vw, 40px);
  padding: clamp(30px, 6vw, 68px) clamp(22px, 5vw, 64px);
  background: var(--grad-hero);
  border: none;
  color: #fff;
  box-shadow: 0 30px 70px -30px rgba(255, 90, 60, 0.55), 0 12px 32px -16px rgba(124, 92, 255, 0.45);
  isolation: isolate;
}

#home::before {
  display: none;
}

#home::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 82% 18%, rgba(255, 255, 255, 0.28), transparent 42%),
    radial-gradient(circle at 8% 88%, rgba(255, 255, 255, 0.18), transparent 46%);
  pointer-events: none;
}

#home h1 {
  margin: 0 0 0.6em;
  font-size: clamp(1.5rem, 4.2vw, 2.5rem);
  line-height: 1.3;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #fff;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.18);
}

#home p {
  color: rgba(255, 255, 255, 0.94);
  font-size: clamp(0.95rem, 1.6vw, 1.05rem);
  max-width: 76ch;
}

#home strong {
  color: #fff;
  background: rgba(255, 255, 255, 0.22);
  padding: 1px 6px;
  border-radius: 6px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

/* ============ HEADINGS ============ */
h2 {
  position: relative;
  margin: 0 0 0.9em;
  padding-left: 18px;
  font-size: clamp(1.25rem, 2.8vw, 1.75rem);
  line-height: 1.35;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: var(--c-text);
}

h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.18em;
  bottom: 0.18em;
  width: 5px;
  border-radius: 999px;
  background: var(--grad-hero);
  box-shadow: 0 0 14px -2px var(--c-primary);
}

h3 {
  margin: 1.6em 0 0.55em;
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  font-weight: 700;
  line-height: 1.5;
  color: var(--c-text);
  letter-spacing: -0.2px;
}

h3:first-of-type {
  margin-top: 0;
}

h4 {
  margin: 1.4em 0 0.45em;
  font-size: clamp(0.98rem, 1.8vw, 1.08rem);
  font-weight: 700;
  color: var(--c-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

h4::before {
  content: "";
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: var(--grad-hero);
  box-shadow: 0 0 0 3px rgba(255, 90, 60, 0.16);
}

section > p:last-child,
section > *:last-child {
  margin-bottom: 0;
}

/* ============ BLOCKQUOTE / CASES ============ */
blockquote {
  margin: 1.2em 0;
  padding: 18px 22px 18px 26px;
  background: var(--grad-soft);
  border-left: 4px solid var(--c-primary);
  border-radius: var(--radius-m);
  position: relative;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

blockquote:hover {
  transform: translateX(4px);
  box-shadow: 0 12px 30px -20px var(--c-shadow-strong);
}

blockquote p {
  margin: 0;
  color: var(--c-text);
  font-style: italic;
  font-size: 0.98rem;
}

/* ============ ARTICLES ============ */
#articles article {
  margin: 0 0 16px;
  padding: 20px 22px;
  background: var(--c-card-solid);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-m);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
  position: relative;
  overflow: hidden;
}

#articles article::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 3px;
  background: var(--grad-hero);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--ease);
}

#articles article:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px -24px var(--c-shadow-strong);
  border-color: rgba(255, 90, 60, 0.35);
}

#articles article:hover::after {
  transform: scaleX(1);
}

#articles article h3 {
  margin: 0 0 0.4em;
  font-size: 1.08rem;
  color: var(--c-text);
}

#articles article p:first-of-type {
  font-size: 0.82rem;
  color: var(--c-text-3);
  margin-bottom: 0.7em;
  letter-spacing: 0.3px;
}

#articles article p {
  font-size: 0.94rem;
}

#articles article a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: 999px;
  background: rgba(255, 90, 60, 0.10);
  color: var(--c-primary);
  transition: background 0.25s var(--ease), color 0.25s var(--ease), transform 0.25s var(--ease);
}

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

#articles article a:hover {
  background: var(--grad-hero);
  color: #fff;
  transform: translateY(-1px);
}

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

/* ============ FAQ ============ */
#faq h3 {
  margin: 0 0 8px;
  padding: 16px 20px 0;
  font-size: 1rem;
  color: var(--c-text);
}

#faq h3 + p {
  margin: 0 0 14px;
  padding: 0 20px 16px;
  font-size: 0.94rem;
  color: var(--c-text-2);
  border-bottom: 1px dashed var(--c-border);
}

#faq h3 {
  background: var(--c-card-solid);
  border-radius: var(--radius-m) var(--radius-m) 0 0;
  border: 1px solid var(--c-border);
  border-bottom: none;
  transition: background 0.25s var(--ease), color 0.25s var(--ease);
  position: relative;
  padding-left: 46px;
}

#faq h3::before {
  content: "Q";
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 800;
  color: #fff;
  background: var(--grad-hero);
  border-radius: 7px;
  box-shadow: 0 4px 10px -4px var(--c-primary);
}

#faq h3 + p {
  background: var(--c-card-solid);
  border: 1px solid var(--c-border);
  border-top: none;
  border-radius: 0 0 var(--radius-m) var(--radius-m);
  margin-bottom: 16px;
}

#faq h3:hover {
  color: var(--c-primary);
}

/* ============ HOWTO STEPS ============ */
#howto h4 {
  margin-top: 1.5em;
}

#howto h4::before {
  content: "";
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: var(--grad-hero);
  box-shadow: 0 4px 10px -4px var(--c-primary);
  position: relative;
}

#howto h4 {
  counter-increment: step;
  position: relative;
  padding-left: 34px;
}

#howto h4::before {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
}

#howto {
  counter-reset: step;
}

#howto h4::after {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 800;
  color: #fff;
  z-index: 1;
}

/* ============ CONTACT ============ */
#contact p {
  line-height: 2;
}

#contact h3 + p {
  padding: 18px 22px;
  background: var(--grad-soft);
  border-radius: var(--radius-m);
  border: 1px solid var(--c-border);
  color: var(--c-text);
}

#contact a {
  font-weight: 600;
}

/* ============ SITEMAP / LINKS ============ */
#sitemap ul,
#links ul {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

#sitemap ul li a,
#links ul li a {
  display: inline-block;
  padding: 8px 16px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--c-text-2);
  background: var(--c-card-solid);
  border: 1px solid var(--c-border);
  border-radius: 999px;
  transition: transform 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s var(--ease);
}

#sitemap ul li a:hover,
#links ul li a:hover {
  color: #fff;
  background: var(--grad-hero);
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: 0 12px 24px -12px var(--c-primary);
}

/* ============ FOOTER ============ */
footer {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(28px, 5vw, 48px) var(--space) 56px;
  text-align: center;
  border-top: 1px solid var(--c-border);
  background: linear-gradient(180deg, transparent, rgba(124, 92, 255, 0.05));
}

footer p {
  margin: 0 0 8px;
  font-size: 0.85rem;
  color: var(--c-text-3);
  line-height: 1.8;
}

footer p:first-child {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--c-text-2);
  letter-spacing: 0.3px;
}

footer p:last-child {
  margin-bottom: 0;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
  header nav {
    padding: 12px var(--space);
  }

  header nav > ul {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    gap: 2px;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  header nav > ul::-webkit-scrollbar {
    display: none;
  }

  header nav > ul li a {
    font-size: 0.82rem;
    padding: 6px 11px;
  }

  section {
    border-radius: var(--radius-m);
  }

  #home {
    border-radius: var(--radius-l);
  }
}

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

  main {
    padding-bottom: 48px;
  }

  section {
    padding: 20px 16px;
    margin-bottom: 22px;
  }

  #home {
    padding: 28px 20px;
  }

  header nav > a:first-child {
    font-size: 1.15rem;
    padding-left: 30px;
  }

  header nav > a:first-child::before {
    width: 22px;
    height: 22px;
    border-radius: 8px;
  }

  header nav > a:first-child::after {
    left: 6px;
    width: 10px;
    height: 10px;
  }

  #articles article {
    padding: 16px;
  }

  #faq h3 {
    padding: 14px 16px 0 42px;
    font-size: 0.95rem;
  }

  #faq h3 + p {
    padding: 0 16px 14px;
    font-size: 0.9rem;
  }

  #faq h3::before {
    left: 14px;
  }

  #contact h3 + p {
    padding: 14px 16px;
  }

  #sitemap ul li a,
  #links ul li a {
    padding: 7px 13px;
    font-size: 0.82rem;
  }
}

/* ============ MOTION PREFERENCES ============ */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============ PRINT ============ */
@media print {
  header,
  footer,
  #sitemap,
  #links {
    display: none;
  }

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

  section {
    box-shadow: none;
    border: 1px solid #ddd;
    background: #fff;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    animation: none;
  }

  #home {
    background: #f2f2f2;
    color: #000;
  }

  #home h1,
  #home p,
  #home strong {
    color: #000;
    text-shadow: none;
  }
}