:root {
  --bg: #0f0f1a;
  --bg-soft: #16162a;
  --bg-card: rgba(28, 28, 50, 0.55);
  --bg-card-solid: #1c1c32;
  --border: rgba(140, 140, 200, 0.16);
  --text: #e8e8f4;
  --text-soft: #b4b4cc;
  --text-dim: #8a8aa8;
  --primary: #7c5cff;
  --primary-2: #ff4d9d;
  --accent: #38e0c8;
  --gradient: linear-gradient(135deg, #6a4dff 0%, #b23bff 45%, #ff4d9d 100%);
  --gradient-soft: linear-gradient(135deg, rgba(106, 77, 255, 0.18), rgba(255, 77, 157, 0.14));
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
  --shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.3);
  --radius: 20px;
  --radius-sm: 12px;
  --maxw: 1180px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f5f4fb;
    --bg-soft: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.62);
    --bg-card-solid: #ffffff;
    --border: rgba(90, 70, 160, 0.14);
    --text: #1d1b2e;
    --text-soft: #4a4763;
    --text-dim: #7b7894;
    --shadow: 0 18px 44px rgba(80, 60, 160, 0.14);
    --shadow-sm: 0 8px 22px rgba(80, 60, 160, 0.1);
    --gradient-soft: linear-gradient(135deg, rgba(106, 77, 255, 0.12), rgba(255, 77, 157, 0.1));
  }
}

*,
*::before,
*::after {
  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", "Noto Sans SC", sans-serif;
  font-size: 16px;
  line-height: 1.85;
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(1000px 500px at 12% -8%, rgba(124, 92, 255, 0.22), transparent 60%),
    radial-gradient(900px 480px at 92% 4%, rgba(255, 77, 157, 0.16), transparent 62%),
    radial-gradient(800px 600px at 50% 100%, rgba(56, 224, 200, 0.08), transparent 70%);
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: rgba(124, 92, 255, 0.4);
  color: #fff;
}

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

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

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

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

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

h1 {
  font-size: clamp(1.7rem, 4.2vw, 2.9rem);
  margin: 0 0 0.7em;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  letter-spacing: -0.01em;
}

h2 {
  font-size: clamp(1.35rem, 2.8vw, 1.95rem);
  margin: 0 0 0.75em;
  padding-left: 0.6em;
  position: relative;
}

h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.18em;
  bottom: 0.18em;
  width: 5px;
  border-radius: 4px;
  background: var(--gradient);
  box-shadow: 0 0 16px rgba(124, 92, 255, 0.6);
}

h3 {
  font-size: clamp(1.08rem, 2vw, 1.28rem);
  margin: 1.4em 0 0.5em;
  color: var(--text);
}

h4 {
  font-size: 1.02rem;
  margin: 1.2em 0 0.4em;
  color: var(--accent);
}

ul {
  margin: 0 0 1.1em;
  padding-left: 1.3em;
  color: var(--text-soft);
}

li {
  margin-bottom: 0.4em;
}

li::marker {
  color: var(--primary-2);
}

/* ---------- Header ---------- */
header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(16px, 4vw, 40px);
  background: rgba(15, 15, 26, 0.55);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--border);
}

@media (prefers-color-scheme: light) {
  header {
    background: rgba(255, 255, 255, 0.62);
  }
}

.brand a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.22rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--text);
  padding: 6px 4px;
}

.brand a::before {
  content: "";
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: var(--gradient);
  box-shadow: 0 6px 18px rgba(124, 92, 255, 0.5);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}

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

.brand a:hover::before {
  transform: rotate(-12deg) scale(1.08);
  box-shadow: 0 8px 26px rgba(255, 77, 157, 0.55);
}

/* ---------- Main layout ---------- */
main {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(20px, 4vw, 44px) clamp(16px, 4vw, 32px) 60px;
}

main > h1 {
  margin-top: 0.2em;
  animation: fadeUp 0.7s var(--ease) both;
}

main > p:first-of-type {
  font-size: 1.06rem;
  color: var(--text-soft);
  padding: 22px 24px;
  border-radius: var(--radius);
  background: var(--gradient-soft);
  border: 1px solid var(--border);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-sm);
  animation: fadeUp 0.7s 0.08s var(--ease) both;
}

/* ---------- Sections ---------- */
section {
  position: relative;
  margin: 26px 0;
  padding: clamp(20px, 3.4vw, 34px);
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  backdrop-filter: blur(16px) saturate(150%);
  box-shadow: var(--shadow-sm);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease),
    border-color 0.4s var(--ease);
  animation: fadeUp 0.6s var(--ease) both;
}

section:hover {
  transform: translateY(-3px);
  border-color: rgba(124, 92, 255, 0.42);
  box-shadow: var(--shadow);
}

section:target {
  border-color: rgba(255, 77, 157, 0.55);
  box-shadow: 0 0 0 1px rgba(255, 77, 157, 0.25), var(--shadow);
}

/* ---------- Nav ---------- */
nav[aria-label] {
  margin: 26px 0;
  padding: clamp(18px, 3vw, 26px);
  border-radius: var(--radius);
  background: var(--gradient-soft);
  border: 1px solid var(--border);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-sm);
  animation: fadeUp 0.6s 0.12s var(--ease) both;
}

nav[aria-label] h2 {
  font-size: 1.2rem;
  margin-bottom: 0.9em;
}

nav[aria-label] ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

nav[aria-label] li {
  margin: 0;
}

nav[aria-label] a {
  display: inline-block;
  padding: 7px 15px;
  border-radius: 999px;
  font-size: 0.9rem;
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  transition: all 0.28s var(--ease);
}

@media (prefers-color-scheme: light) {
  nav[aria-label] a {
    background: rgba(255, 255, 255, 0.7);
  }
}

nav[aria-label] a:hover {
  color: #fff;
  background: var(--gradient);
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(124, 92, 255, 0.4);
}

/* ---------- Articles ---------- */
article {
  position: relative;
  margin: 0 0 16px;
  padding: 20px 22px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--border);
  transition: transform 0.35s var(--ease), border-color 0.35s var(--ease),
    background 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

@media (prefers-color-scheme: light) {
  article {
    background: rgba(255, 255, 255, 0.72);
  }
}

article::before {
  content: "";
  position: absolute;
  left: 0;
  top: 16px;
  bottom: 16px;
  width: 3px;
  border-radius: 3px;
  background: var(--gradient);
  opacity: 0;
  transition: opacity 0.35s var(--ease);
}

article:hover {
  transform: translateX(4px);
  border-color: rgba(124, 92, 255, 0.45);
  background: rgba(124, 92, 255, 0.08);
  box-shadow: var(--shadow-sm);
}

article:hover::before {
  opacity: 1;
}

article h3 {
  margin-top: 0;
}

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

article a {
  display: inline-block;
  font-weight: 600;
  padding: 4px 0;
  border-bottom: 1px dashed currentColor;
  transition: border-color 0.25s var(--ease), letter-spacing 0.25s var(--ease);
}

article a:hover {
  border-bottom-color: transparent;
  letter-spacing: 0.02em;
}

/* ---------- FAQ ---------- */
#faq h3 {
  padding: 14px 18px;
  margin: 14px 0 0;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  background: rgba(124, 92, 255, 0.1);
  border: 1px solid var(--border);
  border-bottom: none;
  cursor: default;
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
}

#faq h3 + p {
  margin: 0 0 6px;
  padding: 0 18px 16px;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  border: 1px solid var(--border);
  border-top: none;
  background: rgba(255, 255, 255, 0.025);
  transition: background 0.3s var(--ease);
}

@media (prefers-color-scheme: light) {
  #faq h3 + p {
    background: rgba(255, 255, 255, 0.6);
  }
}

#faq h3:hover {
  background: rgba(124, 92, 255, 0.2);
  color: var(--accent);
}

#faq h3:hover + p {
  background: rgba(124, 92, 255, 0.06);
}

/* ---------- News / dates ---------- */
#news h3 {
  margin-top: 1.3em;
}

#news p:first-of-type,
#articles p:nth-of-type(1) {
  font-size: 0.85rem;
  color: var(--text-dim);
  letter-spacing: 0.03em;
}

/* ---------- HowTo steps ---------- */
#howto h4 {
  position: relative;
  padding: 10px 16px 10px 44px;
  border-radius: var(--radius-sm);
  background: var(--gradient-soft);
  border: 1px solid var(--border);
  margin-top: 1.1em;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

#howto h4::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 50%;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  border-radius: 50%;
  background: var(--gradient);
  box-shadow: 0 0 12px rgba(124, 92, 255, 0.6);
}

#howto h4:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-sm);
}

/* ---------- Contact info ---------- */
#contact p {
  padding: 10px 16px;
  margin: 0 0 8px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--border);
  transition: background 0.3s var(--ease), transform 0.3s var(--ease);
}

@media (prefers-color-scheme: light) {
  #contact p {
    background: rgba(255, 255, 255, 0.68);
  }
}

#contact p:hover {
  background: rgba(124, 92, 255, 0.1);
  transform: translateX(3px);
}

/* ---------- Sitemap / links ---------- */
#sitemap ul,
#links ul {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}

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

#sitemap a,
#links a {
  display: block;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  transition: all 0.28s var(--ease);
}

@media (prefers-color-scheme: light) {
  #sitemap a,
  #links a {
    background: rgba(255, 255, 255, 0.7);
  }
}

#sitemap a:hover,
#links a:hover {
  color: #fff;
  background: var(--gradient);
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(124, 92, 255, 0.38);
}

/* ---------- Reviews / cases quotes ---------- */
#reviews p {
  position: relative;
  padding: 18px 20px 18px 46px;
  border-radius: var(--radius-sm);
  background: var(--gradient-soft);
  border: 1px solid var(--border);
  font-style: normal;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

#reviews p::before {
  content: "\201C";
  position: absolute;
  left: 16px;
  top: 6px;
  font-size: 2.6rem;
  line-height: 1;
  color: var(--primary-2);
  opacity: 0.6;
  font-family: Georgia, serif;
}

#reviews p:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

/* ---------- Footer ---------- */
footer {
  margin-top: 40px;
  padding: 36px clamp(16px, 4vw, 40px) 44px;
  text-align: center;
  border-top: 1px solid var(--border);
  background: linear-gradient(180deg, transparent, rgba(124, 92, 255, 0.08));
}

footer p {
  margin: 0 0 6px;
  font-size: 0.88rem;
  color: var(--text-dim);
}

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

/* ---------- Copyright block ---------- */
#copyright {
  text-align: center;
  background: var(--gradient-soft);
}

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

#copyright p:nth-last-child(2) {
  font-size: 0.85rem;
  color: var(--text-dim);
}

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

@keyframes floatGlow {
  0%, 100% {
    box-shadow: 0 6px 18px rgba(124, 92, 255, 0.45);
  }
  50% {
    box-shadow: 0 10px 30px rgba(255, 77, 157, 0.5);
  }
}

@supports (animation-timeline: view()) {
  section {
    animation: fadeUp 0.01s linear both;
    animation-timeline: view();
    animation-range: entry 0% cover 22%;
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  body {
    font-size: 15px;
    line-height: 1.8;
    background-attachment: scroll;
  }

  h2 {
    padding-left: 0.5em;
  }

  h2::before {
    width: 4px;
  }

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

  section:hover {
    transform: none;
  }

  main > p:first-of-type {
    padding: 18px;
    font-size: 1rem;
  }

  nav[aria-label] ul {
    gap: 8px;
  }

  nav[aria-label] a {
    padding: 6px 12px;
    font-size: 0.85rem;
  }

  article {
    padding: 16px;
  }

  article:hover {
    transform: none;
  }

  #sitemap ul,
  #links ul {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 6px;
  }

  #sitemap a,
  #links a {
    padding: 8px 10px;
    font-size: 0.86rem;
  }

  #reviews p {
    padding: 16px 16px 16px 40px;
  }
}

@media (max-width: 420px) {
  header {
    padding: 10px 14px;
  }

  .brand a {
    font-size: 1.05rem;
  }

  .brand a::before {
    width: 26px;
    height: 26px;
  }

  main {
    padding: 16px 12px 40px;
  }

  section {
    padding: 16px;
  }

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

  #faq h3 + p {
    padding: 0 14px 14px;
  }
}

/* ---------- 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;
  }

  section:hover,
  article:hover,
  #contact p:hover,
  #sitemap a:hover,
  #links a:hover,
  nav[aria-label] a:hover {
    transform: none;
  }
}

/* ---------- Print ---------- */
@media print {
  body {
    background: #fff;
    color: #000;
  }

  header,
  nav[aria-label],
  footer {
    display: none;
  }

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