:root {
  --bg: #0f0f1a;
  --bg-soft: #16162a;
  --bg-card: rgba(30, 30, 52, 0.55);
  --bg-card-solid: #1a1a2e;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #ececf5;
  --text-soft: #b6b6cc;
  --text-dim: #8a8aa3;
  --primary: #e94560;
  --primary-soft: #ff6b81;
  --accent: #6c5ce7;
  --accent-2: #00cec9;
  --gradient: linear-gradient(135deg, #e94560 0%, #6c5ce7 55%, #00cec9 100%);
  --gradient-soft: linear-gradient(135deg, rgba(233, 69, 96, 0.16), rgba(108, 92, 231, 0.16));
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
  --shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.3);
  --radius: 18px;
  --radius-sm: 12px;
  --radius-pill: 999px;
  --maxw: 1180px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f5f6fb;
    --bg-soft: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.72);
    --bg-card-solid: #ffffff;
    --border: rgba(20, 20, 45, 0.08);
    --border-strong: rgba(20, 20, 45, 0.16);
    --text: #1a1a2e;
    --text-soft: #4a4a63;
    --text-dim: #71718c;
    --shadow: 0 18px 48px rgba(30, 30, 70, 0.14);
    --shadow-sm: 0 8px 24px rgba(30, 30, 70, 0.1);
    --gradient-soft: linear-gradient(135deg, rgba(233, 69, 96, 0.1), rgba(108, 92, 231, 0.1));
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 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: var(--bg);
  background-image: radial-gradient(
      circle at 12% -8%,
      rgba(233, 69, 96, 0.18),
      transparent 42%
    ),
    radial-gradient(circle at 88% 4%, rgba(108, 92, 231, 0.2), transparent 46%),
    radial-gradient(circle at 50% 120%, rgba(0, 206, 201, 0.12), transparent 55%);
  background-attachment: fixed;
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease);
  overflow-x: hidden;
}

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

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

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

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

h1,
h2,
h3,
h4 {
  line-height: 1.3;
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0.2px;
}

h1 {
  font-size: clamp(1.7rem, 4vw, 2.75rem);
  margin: 0 0 20px;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  text-wrap: balance;
}

h2 {
  font-size: clamp(1.4rem, 2.6vw, 2rem);
  margin: 0 0 22px;
  position: relative;
  padding-left: 18px;
}

h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.18em;
  bottom: 0.18em;
  width: 6px;
  border-radius: var(--radius-pill);
  background: var(--gradient);
}

h3 {
  font-size: clamp(1.05rem, 1.8vw, 1.25rem);
  margin: 26px 0 10px;
}

p {
  margin: 0 0 14px;
  color: var(--text-soft);
  text-wrap: pretty;
}

ul,
ol {
  margin: 0 0 16px;
  padding-left: 1.3em;
  color: var(--text-soft);
}

li {
  margin-bottom: 8px;
}

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

header[role="banner"] {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  background: rgba(15, 15, 26, 0.62);
  border-bottom: 1px solid var(--border);
  transition: background 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

@media (prefers-color-scheme: light) {
  header[role="banner"] {
    background: rgba(255, 255, 255, 0.7);
  }
}

.brand-bar {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.brand-bar > a {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  flex-shrink: 0;
}

.brand-bar > a svg {
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}

.brand-bar > a:hover svg {
  transform: rotate(-6deg) scale(1.06);
  box-shadow: 0 10px 28px rgba(233, 69, 96, 0.4);
}

.brand-name {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  white-space: nowrap;
}

nav[aria-label="主导航"] {
  flex: 1 1 auto;
  min-width: 0;
}

nav[aria-label="主导航"] ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: flex-end;
}

nav[aria-label="主导航"] a {
  display: inline-block;
  padding: 7px 13px;
  border-radius: var(--radius-pill);
  font-size: 0.9rem;
  color: var(--text-soft);
  border: 1px solid transparent;
  white-space: nowrap;
  transition: all 0.28s var(--ease);
}

nav[aria-label="主导航"] a:hover,
nav[aria-label="主导航"] a:focus-visible {
  color: var(--text);
  background: var(--gradient-soft);
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

section {
  margin: 0 auto 34px;
  padding: 34px clamp(18px, 3vw, 40px);
  background: var(--bg-card);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  animation: fadeUp 0.7s var(--ease) both;
  transition: border-color 0.35s var(--ease), box-shadow 0.35s var(--ease),
    transform 0.35s var(--ease);
}

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

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

#hero {
  margin-top: 34px;
  padding: clamp(30px, 5vw, 64px) clamp(20px, 4vw, 52px);
  background: linear-gradient(
      135deg,
      rgba(233, 69, 96, 0.24) 0%,
      rgba(108, 92, 231, 0.24) 50%,
      rgba(0, 206, 201, 0.18) 100%
    ),
    var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 26px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
}

#hero::after {
  content: "";
  position: absolute;
  inset: -40% -20% auto auto;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(233, 69, 96, 0.35), transparent 68%);
  filter: blur(20px);
  pointer-events: none;
}

#hero p {
  font-size: clamp(0.95rem, 1.3vw, 1.05rem);
  color: var(--text-soft);
  max-width: 78ch;
}

nav[aria-label="面包屑导航"] ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  margin: 22px 0 0;
  font-size: 0.85rem;
  color: var(--text-dim);
}

nav[aria-label="面包屑导航"] li + li::before {
  content: "/";
  margin-right: 8px;
  color: var(--text-dim);
  opacity: 0.6;
}

nav[aria-label="面包屑导航"] [aria-current="page"] {
  color: var(--primary-soft);
  font-weight: 600;
}

article {
  padding: 22px clamp(16px, 2.4vw, 28px);
  margin: 0 0 18px;
  background: var(--bg-card-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: transform 0.32s var(--ease), border-color 0.32s var(--ease),
    box-shadow 0.32s var(--ease);
}

article:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

article h3:first-child {
  margin-top: 0;
}

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

article h3 a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  height: 2px;
  width: 0;
  background: var(--gradient);
  border-radius: 2px;
  transition: width 0.35s var(--ease);
}

article h3 a:hover::after,
article h3 a:focus-visible::after {
  width: 100%;
}

article h3 a:hover,
article h3 a:focus-visible {
  color: var(--primary-soft);
}

article p:last-child a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  background: var(--gradient-soft);
  transition: all 0.3s var(--ease);
}

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

article p:last-child a:hover,
article p:last-child a:focus-visible {
  color: #fff;
  background: var(--gradient);
  border-color: transparent;
  box-shadow: 0 8px 22px rgba(233, 69, 96, 0.35);
}

article p:last-child a:hover::after,
article p:last-child a:focus-visible::after {
  transform: translateX(4px);
}

aside[aria-label="作者与编辑信息"] {
  padding: 20px clamp(16px, 2.4vw, 26px);
  border-radius: var(--radius-sm);
  background: var(--gradient-soft);
  border: 1px dashed var(--border-strong);
  margin-top: 8px;
}

aside[aria-label="作者与编辑信息"] h3 {
  margin-top: 0;
}

aside[aria-label="作者与编辑信息"] p {
  margin-bottom: 0;
  font-size: 0.92rem;
  color: var(--text-dim);
}

details {
  background: var(--bg-card-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  overflow: hidden;
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease),
    transform 0.3s var(--ease);
}

details:hover {
  border-color: var(--border-strong);
  transform: translateX(3px);
}

details[open] {
  border-color: var(--primary);
  box-shadow: 0 10px 30px rgba(233, 69, 96, 0.18);
}

summary {
  cursor: pointer;
  padding: 16px 52px 16px 20px;
  font-weight: 600;
  color: var(--text);
  list-style: none;
  position: relative;
  transition: color 0.28s var(--ease), background 0.28s var(--ease);
  user-select: none;
}

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

summary::after {
  content: "+";
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  line-height: 24px;
  text-align: center;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  color: var(--primary-soft);
  font-size: 1.1rem;
  font-weight: 400;
  transition: all 0.32s var(--ease);
}

details[open] summary::after {
  content: "−";
  background: var(--gradient);
  color: #fff;
  border-color: transparent;
  transform: translateY(-50%) rotate(180deg);
}

summary:hover {
  color: var(--primary-soft);
  background: var(--gradient-soft);
}

details p {
  padding: 0 20px 18px;
  margin: 0;
  font-size: 0.94rem;
  color: var(--text-soft);
  animation: fadeIn 0.4s var(--ease) both;
}

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

#howto {
  counter-reset: howto;
}

#howto h3 {
  counter-increment: howto;
  position: relative;
  padding-left: 44px;
}

#howto h3::before {
  content: counter(howto, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  line-height: 32px;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
  border-radius: 10px;
  background: var(--gradient);
  box-shadow: 0 6px 16px rgba(233, 69, 96, 0.32);
}

#contact p {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  padding: 12px 16px;
  margin: 0 0 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-card-solid);
  border: 1px solid var(--border);
  transition: border-color 0.28s var(--ease), transform 0.28s var(--ease);
}

#contact p:hover {
  border-color: var(--primary);
  transform: translateX(4px);
}

#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;
  border-radius: var(--radius-pill);
  font-size: 0.9rem;
  color: var(--text-soft);
  background: var(--bg-card-solid);
  border: 1px solid var(--border);
  transition: all 0.3s var(--ease);
}

#sitemap a:hover,
#sitemap a:focus-visible,
#links a:hover,
#links a:focus-visible {
  color: #fff;
  background: var(--gradient);
  border-color: transparent;
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(108, 92, 231, 0.35);
}

footer[role="contentinfo"] {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 40px 20px 60px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  border-top: 1px solid var(--border);
}

footer[role="contentinfo"] section {
  margin: 0;
  padding: 22px;
  background: var(--bg-card);
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  animation: fadeUp 0.7s var(--ease) both;
  transition: border-color 0.3s var(--ease), transform 0.3s var(--ease);
}

footer[role="contentinfo"] section:hover {
  border-color: var(--border-strong);
  transform: translateY(-3px);
}

footer[role="contentinfo"] h2 {
  font-size: 1rem;
  margin: 0 0 12px;
  padding-left: 14px;
  color: var(--text);
}

footer[role="contentinfo"] h2::before {
  width: 4px;
}

footer[role="contentinfo"] p {
  font-size: 0.86rem;
  line-height: 1.7;
  color: var(--text-dim);
  margin: 0;
}

footer[role="contentinfo"] > p {
  grid-column: 1 / -1;
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-dim);
  padding-top: 18px;
  border-top: 1px solid var(--border);
  margin: 6px 0 0;
}

@media (max-width: 900px) {
  .brand-bar {
    gap: 12px;
    padding: 10px 16px;
  }

  nav[aria-label="主导航"] ul {
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  nav[aria-label="主导航"] ul::-webkit-scrollbar {
    display: none;
  }

  nav[aria-label="主导航"] a {
    font-size: 0.84rem;
    padding: 6px 11px;
  }

  main {
    padding: 0 14px 40px;
  }

  section {
    padding: 26px 18px;
    border-radius: 16px;
    margin-bottom: 24px;
  }

  #hero {
    margin-top: 22px;
    border-radius: 20px;
  }
}

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

  .brand-name {
    font-size: 1rem;
  }

  h2 {
    padding-left: 14px;
  }

  h2::before {
    width: 4px;
  }

  article {
    padding: 18px 16px;
  }

  summary {
    padding: 14px 46px 14px 16px;
    font-size: 0.94rem;
  }

  summary::after {
    right: 14px;
    width: 22px;
    height: 22px;
    line-height: 20px;
    font-size: 1rem;
  }

  details p {
    padding: 0 16px 16px;
  }

  #howto h3 {
    padding-left: 38px;
  }

  #howto h3::before {
    width: 28px;
    height: 28px;
    line-height: 28px;
    font-size: 0.72rem;
  }

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

  footer[role="contentinfo"] {
    padding: 28px 14px 44px;
    gap: 14px;
  }
}

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

@media print {
  header[role="banner"],
  footer[role="contentinfo"],
  #sitemap,
  #links {
    display: none;
  }

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

  section,
  article {
    box-shadow: none;
    border: 1px solid #ccc;
    background: #fff;
  }
}