:root {
  --brand: #2b6cb0;
  --brand-light: #4a90d9;
  --brand-dark: #1e4e8c;
  --accent: #f6ad55;
  --accent-soft: #fbd38d;
  --bg: #f4f8fd;
  --bg-alt: #e8f1fb;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-solid: #ffffff;
  --text: #1a2b3c;
  --text-soft: #4a5d70;
  --text-muted: #7a8a9a;
  --border: rgba(43, 108, 176, 0.14);
  --shadow-sm: 0 2px 8px rgba(30, 78, 140, 0.06);
  --shadow-md: 0 8px 28px rgba(30, 78, 140, 0.1);
  --shadow-lg: 0 18px 48px rgba(30, 78, 140, 0.16);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --blur: 16px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --maxw: 1180px;
  --header-h: 68px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand: #63a4e8;
    --brand-light: #8cc0f5;
    --brand-dark: #3d7fc4;
    --accent: #f6ad55;
    --accent-soft: #c98a3d;
    --bg: #0d1520;
    --bg-alt: #131f2e;
    --surface: rgba(23, 36, 52, 0.66);
    --surface-solid: #172434;
    --text: #e8eef5;
    --text-soft: #b3c2d1;
    --text-muted: #7f92a5;
    --border: rgba(99, 164, 232, 0.2);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 28px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.55);
  }
}

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

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

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(43, 108, 176, 0.16), transparent 60%),
    radial-gradient(900px 500px at -10% 25%, rgba(246, 173, 85, 0.12), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  overflow-x: hidden;
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease);
}

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,
a:focus-visible {
  color: var(--brand-dark);
  text-decoration: underline;
  text-underline-offset: 4px;
}

a:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: 6px;
}

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

h1 {
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  font-weight: 800;
}

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

h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 56px;
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--brand), var(--accent));
}

h3 {
  font-size: clamp(1.1rem, 2.2vw, 1.35rem);
  color: var(--brand-dark);
  margin-top: 1.4em;
}

@media (prefers-color-scheme: dark) {
  h3 { color: var(--brand-light); }
}

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

ul, ol {
  margin: 0 0 1.2em;
  padding-left: 1.4em;
  color: var(--text-soft);
}

li {
  margin-bottom: 0.5em;
}

li::marker {
  color: var(--brand);
}

blockquote {
  margin: 1.2em 0;
  padding: 1em 1.4em;
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--surface);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  color: var(--text-soft);
  font-style: italic;
  box-shadow: var(--shadow-sm);
}

/* ============ Header ============ */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 12px clamp(16px, 4vw, 40px);
  min-height: var(--header-h);
  background: var(--surface);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--brand-dark);
}

@media (prefers-color-scheme: dark) {
  .brand { color: var(--brand-light); }
}

.brand svg {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 50%;
  box-shadow: 0 4px 14px rgba(43, 108, 176, 0.35);
  transition: transform 0.5s var(--ease);
}

.brand:hover svg {
  transform: rotate(-12deg) scale(1.06);
}

nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

nav li {
  margin: 0;
}

nav a {
  display: inline-block;
  padding: 8px 14px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-soft);
  border-radius: 999px;
  text-decoration: none;
  transition: background 0.25s var(--ease), color 0.25s var(--ease),
    transform 0.25s var(--ease);
}

nav a:hover,
nav a:focus-visible {
  color: var(--brand-dark);
  background: rgba(43, 108, 176, 0.1);
  text-decoration: none;
  transform: translateY(-2px);
}

@media (prefers-color-scheme: dark) {
  nav a:hover,
  nav a:focus-visible {
    color: var(--brand-light);
    background: rgba(99, 164, 232, 0.16);
  }
}

/* ============ Main layout ============ */
main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(16px, 3vw, 32px) clamp(14px, 4vw, 32px) 48px;
}

section {
  position: relative;
  margin-bottom: clamp(20px, 3.5vw, 36px);
  padding: clamp(20px, 3.5vw, 40px);
  background: var(--surface);
  backdrop-filter: blur(var(--blur)) saturate(140%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(140%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  animation: rise 0.7s var(--ease) both;
  transition: box-shadow 0.35s var(--ease), transform 0.35s var(--ease),
    border-color 0.35s var(--ease);
}

section:hover {
  box-shadow: var(--shadow-lg);
  border-color: rgba(43, 108, 176, 0.28);
}

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

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

/* ============ Hero ============ */
#hero {
  padding: clamp(28px, 5vw, 60px) clamp(20px, 4vw, 48px);
  background:
    linear-gradient(135deg, rgba(43, 108, 176, 0.92) 0%, rgba(74, 144, 217, 0.85) 45%, rgba(246, 173, 85, 0.82) 100%),
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.25), transparent 55%);
  border: none;
  color: #fff;
  overflow: hidden;
  isolation: isolate;
}

#hero::before {
  content: "";
  position: absolute;
  inset: -40%;
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.22), transparent 45%),
    radial-gradient(circle at 75% 65%, rgba(255, 255, 255, 0.16), transparent 50%);
  animation: floatGlow 14s ease-in-out infinite alternate;
  z-index: -1;
}

@keyframes floatGlow {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(4%, -3%, 0) scale(1.08); }
}

#hero h1 {
  color: #fff;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.18);
  margin-bottom: 0.6em;
}

#hero p {
  color: rgba(255, 255, 255, 0.94);
  font-size: clamp(0.95rem, 1.6vw, 1.08rem);
  max-width: 62ch;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.12);
}

#hero figure {
  margin: 1.6em 0 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 10px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.22);
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
}

#hero figure:hover {
  transform: translateY(-6px) scale(1.008);
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.3);
}

#hero figure svg {
  border-radius: var(--radius-sm);
  width: 100%;
  height: auto;
}

#hero figcaption {
  margin-top: 10px;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.88);
  text-align: center;
}

/* ============ Cards: articles / cases ============ */
#articles {
  display: grid;
  gap: 16px;
}

#articles h2 {
  grid-column: 1 / -1;
}

#articles article {
  padding: 20px 22px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease),
    border-color 0.35s var(--ease);
}

#articles article:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(43, 108, 176, 0.35);
}

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

#articles article p {
  font-size: 0.92rem;
  margin-bottom: 0.6em;
}

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

#articles article a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(43, 108, 176, 0.1);
  transition: background 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(--brand);
  color: #fff;
  text-decoration: none;
}

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

/* ============ FAQ ============ */
#faq details {
  margin-bottom: 10px;
  padding: 14px 18px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.3s var(--ease), border-color 0.3s var(--ease),
    background 0.3s var(--ease);
}

#faq details:hover {
  border-color: rgba(43, 108, 176, 0.32);
  box-shadow: var(--shadow-md);
}

#faq details[open] {
  border-color: rgba(43, 108, 176, 0.45);
  box-shadow: var(--shadow-md);
  background: linear-gradient(180deg, rgba(43, 108, 176, 0.06), transparent 60%),
    var(--surface-solid);
}

#faq summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--text);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 0;
  transition: color 0.25s var(--ease);
}

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

#faq summary::after {
  content: "+";
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--brand);
  background: rgba(43, 108, 176, 0.12);
  transition: transform 0.3s var(--ease), background 0.3s var(--ease),
    color 0.3s var(--ease);
}

#faq details[open] summary::after {
  content: "−";
  transform: rotate(180deg);
  background: var(--brand);
  color: #fff;
}

#faq details p {
  margin: 12px 0 2px;
  font-size: 0.93rem;
  color: var(--text-soft);
  animation: fadeIn 0.4s var(--ease);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============ HowTo steps ============ */
#howto ol {
  list-style: none;
  counter-reset: step;
  padding: 0;
}

#howto ol li {
  position: relative;
  counter-increment: step;
  padding: 14px 16px 14px 58px;
  margin-bottom: 12px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

#howto ol li:hover {
  transform: translateX(6px);
  box-shadow: var(--shadow-md);
}

#howto ol li::before {
  content: counter(step);
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-light));
  box-shadow: 0 4px 12px rgba(43, 108, 176, 0.35);
}

/* ============ Contact ============ */
#contact {
  background:
    linear-gradient(135deg, rgba(43, 108, 176, 0.08), rgba(246, 173, 85, 0.08)),
    var(--surface);
}

#contact h3 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

#contact p {
  font-size: 0.98rem;
}

/* ============ Sitemap & links ============ */
#sitemap ul,
#links ul {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
  padding: 0;
}

#sitemap li,
#links li {
  margin: 0;
}

#sitemap a,
#links a {
  display: inline-block;
  padding: 8px 16px;
  font-size: 0.9rem;
  border-radius: 999px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease),
    background 0.25s var(--ease), color 0.25s var(--ease);
}

#sitemap a:hover,
#links a:hover {
  transform: translateY(-3px);
  background: var(--brand);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 8px 20px rgba(43, 108, 176, 0.3);
}

/* ============ Legal & author ============ */
#legal {
  font-size: 0.94rem;
}

#legal h3 {
  margin-top: 1.2em;
}

#author {
  background: linear-gradient(135deg, rgba(246, 173, 85, 0.1), rgba(43, 108, 176, 0.08)),
    var(--surface);
  font-size: 0.94rem;
}

#author p:last-child {
  color: var(--text-muted);
  font-size: 0.86rem;
}

/* ============ Footer ============ */
footer {
  padding: clamp(24px, 4vw, 40px) clamp(16px, 4vw, 40px);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
  border-top: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

footer p {
  margin: 4px 0;
  color: var(--text-muted);
}

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

/* ============ Responsive ============ */
@media (min-width: 720px) {
  #articles {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1040px) {
  #articles {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 860px) {
  header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  nav {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  nav::-webkit-scrollbar {
    display: none;
  }

  nav ul {
    flex-wrap: nowrap;
    gap: 2px;
    padding-bottom: 4px;
  }

  nav a {
    white-space: nowrap;
    font-size: 0.86rem;
    padding: 7px 12px;
  }
}

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

  section {
    border-radius: var(--radius-md);
    padding: 18px 16px;
  }

  #hero {
    border-radius: var(--radius-md);
  }

  #hero figure {
    padding: 8px;
  }

  #howto ol li {
    padding-left: 50px;
  }

  #howto ol li::before {
    left: 10px;
    width: 26px;
    height: 26px;
    font-size: 0.82rem;
  }

  #faq details {
    padding: 12px 14px;
  }

  #faq summary {
    font-size: 0.92rem;
  }

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

/* ============ Motion & accessibility ============ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

::selection {
  background: rgba(43, 108, 176, 0.28);
  color: var(--text);
}

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

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

::-webkit-scrollbar-thumb {
  background: rgba(43, 108, 176, 0.35);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(43, 108, 176, 0.55);
  background-clip: content-box;
}

@media print {
  header,
  footer,
  nav,
  #sitemap,
  #links {
    display: none;
  }

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

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