:root {
  --bg: #f5f6fa;
  --bg-soft: #ffffff;
  --bg-elev: rgba(255, 255, 255, 0.72);
  --text: #1c1c28;
  --text-soft: #55556b;
  --text-mute: #8a8aa0;
  --line: rgba(28, 28, 40, 0.09);
  --brand: #5b4bff;
  --brand-2: #8f6bff;
  --brand-3: #ff6b9d;
  --accent: #00d4b8;
  --grad-hero: linear-gradient(135deg, #1a1a2e 0%, #2d1b4e 42%, #4a2b7a 72%, #6b3fa0 100%);
  --grad-line: linear-gradient(90deg, #5b4bff, #ff6b9d, #00d4b8);
  --shadow-sm: 0 2px 8px rgba(28, 28, 40, 0.06);
  --shadow-md: 0 8px 28px rgba(28, 28, 40, 0.10);
  --shadow-lg: 0 18px 48px rgba(28, 28, 40, 0.14);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --blur: saturate(180%) blur(18px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --maxw: 1180px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0e17;
    --bg-soft: #16161f;
    --bg-elev: rgba(30, 30, 44, 0.62);
    --text: #ececf4;
    --text-soft: #b6b6c8;
    --text-mute: #85859c;
    --line: rgba(236, 236, 244, 0.10);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 8px 28px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.55);
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -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-color: var(--bg);
  background-image:
    radial-gradient(1200px 600px at 12% -8%, rgba(91, 75, 255, 0.16), transparent 60%),
    radial-gradient(1000px 520px at 92% 4%, rgba(255, 107, 157, 0.13), transparent 62%),
    radial-gradient(900px 500px at 50% 108%, rgba(0, 212, 184, 0.10), transparent 60%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  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-3);
}

::selection {
  background: rgba(91, 75, 255, 0.28);
  color: var(--text);
}

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

h1 { font-size: clamp(1.65rem, 4.2vw, 2.6rem); }
h2 { font-size: clamp(1.3rem, 3vw, 1.9rem); }
h3 { font-size: clamp(1.08rem, 2.2vw, 1.32rem); }
h4 { font-size: 1rem; color: var(--brand); }

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

ul {
  margin: 0 0 1em;
  padding-left: 1.2em;
}

li {
  color: var(--text-soft);
  margin-bottom: 0.35em;
}

/* ---------- Header ---------- */

header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-elev);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  animation: slideDown 0.6s var(--ease) both;
}

@keyframes slideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.brand-bar {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px 20px 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 14px;
}

.brand-bar a {
  font-size: clamp(1.15rem, 2.6vw, 1.45rem);
  font-weight: 800;
  letter-spacing: 0.02em;
  background: var(--grad-line);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  position: relative;
}

.brand-bar a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: var(--grad-line);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease);
}

.brand-bar a:hover::after {
  transform: scaleX(1);
}

.brand-bar span {
  font-size: 0.86rem;
  color: var(--text-mute);
  letter-spacing: 0.02em;
}

nav {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px 12px;
}

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

nav li {
  margin: 0;
}

nav a {
  display: inline-block;
  padding: 6px 14px;
  font-size: 0.88rem;
  color: var(--text-soft);
  border-radius: 999px;
  border: 1px solid transparent;
  transition: all 0.3s var(--ease);
}

nav a:hover,
nav a:focus-visible {
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border-color: transparent;
  box-shadow: 0 6px 18px rgba(91, 75, 255, 0.35);
  transform: translateY(-2px);
  outline: none;
}

/* ---------- Main & Sections ---------- */

main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px 40px;
}

section {
  margin: 34px 0;
  padding: clamp(20px, 3.4vw, 38px);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
  animation: riseIn 0.7s var(--ease) both;
}

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

section:nth-of-type(2) { animation-delay: 0.04s; }
section:nth-of-type(3) { animation-delay: 0.08s; }
section:nth-of-type(4) { animation-delay: 0.12s; }
section:nth-of-type(5) { animation-delay: 0.16s; }
section:nth-of-type(6) { animation-delay: 0.2s; }

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

section h2 {
  position: relative;
  padding-bottom: 14px;
  margin-bottom: 22px;
}

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

section h3 {
  margin-top: 1.6em;
  padding-left: 14px;
  border-left: 4px solid;
  border-image: var(--grad-line) 1;
}

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

/* ---------- Hero ---------- */

#hero {
  margin-top: 30px;
  padding: clamp(30px, 5.5vw, 64px) clamp(22px, 4vw, 54px);
  background: var(--grad-hero);
  color: #fff;
  border: none;
  box-shadow: var(--shadow-lg);
  isolation: isolate;
}

#hero::before {
  height: 100%;
  background:
    radial-gradient(600px 300px at 15% 10%, rgba(143, 107, 255, 0.55), transparent 65%),
    radial-gradient(520px 280px at 88% 88%, rgba(255, 107, 157, 0.42), transparent 65%),
    radial-gradient(480px 260px at 70% 8%, rgba(0, 212, 184, 0.28), transparent 62%);
  opacity: 1;
  z-index: -1;
  animation: auroraShift 14s ease-in-out infinite alternate;
}

@keyframes auroraShift {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(-3%, 2%, 0) scale(1.06); }
}

#hero h1 {
  color: #fff;
  text-shadow: 0 4px 26px rgba(0, 0, 0, 0.35);
  max-width: 900px;
}

#hero p {
  color: rgba(255, 255, 255, 0.84);
  max-width: 860px;
  font-size: clamp(0.95rem, 1.6vw, 1.05rem);
  margin-bottom: 0;
}

#hero h1::after {
  content: "";
  display: block;
  width: 90px;
  height: 5px;
  margin-top: 18px;
  border-radius: 5px;
  background: linear-gradient(90deg, #fff, rgba(255, 255, 255, 0.15));
}

/* ---------- Glass cards: articles / faq / cases / etc ---------- */

article {
  margin: 0 0 16px;
  padding: 20px 22px;
  background: var(--bg-elev);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease),
    border-color 0.35s var(--ease);
}

article:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(91, 75, 255, 0.35);
}

article h3 {
  margin: 0 0 8px;
  padding-left: 0;
  border-left: none;
  font-size: 1.05rem;
}

article h3 a {
  color: var(--text);
}

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

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

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

article a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 6px 16px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 6px 16px rgba(91, 75, 255, 0.3);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease),
    filter 0.3s var(--ease);
}

article a:hover {
  color: #fff;
  transform: translateY(-2px);
  filter: brightness(1.08);
  box-shadow: 0 10px 24px rgba(91, 75, 255, 0.42);
}

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

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

/* ---------- FAQ ---------- */

#faq h3 {
  margin-top: 1.2em;
  padding: 14px 18px;
  background: var(--bg-elev);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  transition: background 0.3s var(--ease), transform 0.3s var(--ease),
    box-shadow 0.3s var(--ease);
}

#faq h3:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-md);
}

#faq h3 + p {
  padding: 0 6px 4px 20px;
  font-size: 0.94rem;
}

/* ---------- News ---------- */

#news h3 {
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(91, 75, 255, 0.08), rgba(255, 107, 157, 0.08));
  border-left: 4px solid var(--brand-3);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

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

#news p {
  font-size: 0.92rem;
  padding-left: 4px;
}

/* ---------- Cases ---------- */

#cases h3 {
  border-left-color: var(--accent);
}

#cases h3 + p {
  padding: 14px 18px;
  background: var(--bg-elev);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 0.94rem;
}

/* ---------- Sitemap & Links lists ---------- */

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

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

#sitemap a,
#links a {
  display: inline-block;
  padding: 8px 18px;
  font-size: 0.9rem;
  color: var(--text-soft);
  background: var(--bg-elev);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: all 0.3s var(--ease);
}

#sitemap a:hover,
#links a:hover {
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border-color: transparent;
  transform: translateY(-3px);
  box-shadow: 0 8px 22px rgba(91, 75, 255, 0.35);
}

/* ---------- Contact / Legal / Team blocks ---------- */

#contact h3,
#team h3,
#legal h3,
#howto h3 {
  color: var(--text);
}

#contact p,
#legal p,
#team p {
  font-size: 0.94rem;
}

/* ---------- Footer ---------- */

footer {
  margin-top: 40px;
  padding: 40px 20px 48px;
  text-align: center;
  background: linear-gradient(180deg, transparent, rgba(91, 75, 255, 0.08));
  border-top: 1px solid var(--line);
}

footer p {
  margin: 0 auto 10px;
  max-width: 860px;
  font-size: 0.85rem;
  color: var(--text-mute);
  line-height: 1.7;
}

footer p:first-child {
  font-size: 1rem;
  font-weight: 700;
  background: var(--grad-line);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 16px;
}

footer p:last-child {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px dashed var(--line);
  font-size: 0.8rem;
}

/* ---------- Scrollbar ---------- */

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

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

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--brand), var(--brand-2));
  border-radius: 999px;
  border: 2px solid var(--bg);
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--brand-2), var(--brand-3));
}

/* ---------- Focus / Accessibility ---------- */

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

/* ---------- Responsive: Tablet ---------- */

@media (max-width: 900px) {
  main {
    padding: 0 16px 32px;
  }

  section {
    margin: 24px 0;
    border-radius: var(--radius);
  }

  .brand-bar {
    padding: 12px 16px 8px;
  }

  nav {
    padding: 0 16px 10px;
  }

  nav ul {
    gap: 6px;
  }

  nav a {
    padding: 5px 12px;
    font-size: 0.83rem;
  }
}

/* ---------- Responsive: Mobile ---------- */

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

  .brand-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }

  .brand-bar span {
    font-size: 0.78rem;
  }

  nav ul {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

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

  nav a {
    white-space: nowrap;
    padding: 6px 13px;
    font-size: 0.82rem;
    background: var(--bg-elev);
    border: 1px solid var(--line);
  }

  nav a:hover {
    transform: none;
  }

  section {
    padding: 20px 16px;
    margin: 18px 0;
    border-radius: 18px;
  }

  section h2 {
    padding-bottom: 12px;
    margin-bottom: 18px;
  }

  section h3 {
    padding-left: 10px;
    border-left-width: 3px;
  }

  #hero {
    padding: 30px 20px;
  }

  #hero h1::after {
    width: 60px;
    height: 4px;
    margin-top: 14px;
  }

  article {
    padding: 16px;
  }

  article a {
    padding: 6px 14px;
  }

  #faq h3 {
    padding: 12px 14px;
    font-size: 0.95rem;
  }

  #faq h3 + p {
    padding-left: 10px;
  }

  #sitemap a,
  #links a {
    padding: 7px 14px;
    font-size: 0.85rem;
  }

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

/* ---------- Reduced motion ---------- */

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

/* ---------- High contrast / forced colors ---------- */

@media (forced-colors: active) {
  section,
  article,
  nav a {
    border: 1px solid CanvasText;
  }
}

/* ---------- Print ---------- */

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

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

  section {
    box-shadow: none;
    border: 1px solid #ccc;
    page-break-inside: avoid;
  }
}