:root {
  --primary: #1a237e;
  --primary-light: #3949ab;
  --primary-lighter: #5c6bc0;
  --accent: #ffd54f;
  --accent-deep: #ffb300;
  --coral: #ff7043;
  --bg: #f4f6fb;
  --bg-elevated: #ffffff;
  --bg-soft: #eef1f8;
  --text: #1c2233;
  --text-soft: #4a5468;
  --text-muted: #7b8499;
  --border: rgba(26, 35, 126, 0.1);
  --border-strong: rgba(26, 35, 126, 0.18);
  --shadow-sm: 0 2px 8px rgba(26, 35, 126, 0.06);
  --shadow-md: 0 8px 28px rgba(26, 35, 126, 0.1);
  --shadow-lg: 0 18px 48px rgba(26, 35, 126, 0.16);
  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(255, 255, 255, 0.55);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --max-width: 1180px;
  --transition: 0.35s cubic-bezier(0.22, 0.61, 0.36, 1);
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary: #7986cb;
    --primary-light: #9fa8da;
    --primary-lighter: #c5cae9;
    --accent: #ffd54f;
    --accent-deep: #ffca28;
    --coral: #ff8a65;
    --bg: #0d1220;
    --bg-elevated: #161d2f;
    --bg-soft: #1c2438;
    --text: #e8ecf5;
    --text-soft: #b6bfd2;
    --text-muted: #8a93a8;
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.16);
    --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);
    --glass-bg: rgba(22, 29, 47, 0.72);
    --glass-border: rgba(255, 255, 255, 0.1);
  }
}

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

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.8;
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(circle at 12% 8%, rgba(57, 73, 171, 0.08), transparent 42%),
    radial-gradient(circle at 88% 4%, rgba(255, 213, 79, 0.1), transparent 38%),
    radial-gradient(circle at 50% 100%, rgba(255, 112, 67, 0.06), transparent 46%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

a {
  color: var(--primary-light);
  text-decoration: none;
  transition: color var(--transition), opacity var(--transition);
}

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

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

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

h1 {
  font-size: clamp(1.75rem, 4.2vw, 2.9rem);
  margin: 0 0 1rem;
  background: linear-gradient(120deg, var(--primary-light) 0%, var(--coral) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

h2 {
  font-size: clamp(1.4rem, 3vw, 2rem);
  margin: 0 0 1.1rem;
  position: relative;
  padding-left: 1.1rem;
}

h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.18em;
  bottom: 0.18em;
  width: 5px;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--accent) 0%, var(--coral) 100%);
}

h3 {
  font-size: clamp(1.15rem, 2.2vw, 1.4rem);
  margin: 1.6rem 0 0.7rem;
  color: var(--primary-light);
}

h4 {
  font-size: 1.05rem;
  margin: 1.2rem 0 0.5rem;
  color: var(--text);
}

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

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

li {
  margin-bottom: 0.5rem;
}

strong {
  color: var(--text);
}

blockquote {
  margin: 1.4rem 0;
  padding: 1rem 1.4rem;
  border-left: 4px solid var(--accent);
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  color: var(--text-soft);
  font-style: italic;
}

blockquote p {
  margin: 0 0 0.6rem;
}

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

time {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

address {
  font-style: normal;
}

/* ---------- Header ---------- */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.site-header {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.7rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  letter-spacing: 0.01em;
}

.brand svg {
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(26, 35, 126, 0.28);
  transition: transform var(--transition), box-shadow var(--transition);
}

.brand:hover svg {
  transform: rotate(-6deg) scale(1.06);
  box-shadow: 0 8px 22px rgba(26, 35, 126, 0.4);
}

.site-header nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-header nav a {
  display: inline-block;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  font-size: 0.92rem;
  color: var(--text-soft);
  font-weight: 500;
  transition: background var(--transition), color var(--transition), transform var(--transition);
}

.site-header nav a:hover,
.site-header nav a:focus-visible {
  background: var(--primary);
  color: #fff;
  transform: translateY(-2px);
}

@media (prefers-color-scheme: dark) {
  .site-header nav a:hover,
  .site-header nav a:focus-visible {
    background: var(--primary-lighter);
    color: #0d1220;
  }
}

/* ---------- Main layout ---------- */
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

section {
  margin-bottom: 2rem;
  padding: 1.75rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}

section:hover {
  box-shadow: var(--shadow-md);
}

/* ---------- Breadcrumb ---------- */
main > nav[aria-label="面包屑导航"] {
  margin-bottom: 1.2rem;
}

main > nav[aria-label="面包屑导航"] ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  margin: 0;
  padding: 0.55rem 1rem;
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.85rem;
  width: fit-content;
  max-width: 100%;
}

main > nav[aria-label="面包屑导航"] li {
  margin: 0;
  color: var(--text-muted);
}

main > nav[aria-label="面包屑导航"] li + li::before {
  content: "/";
  margin-right: 0.4rem;
  color: var(--text-muted);
  opacity: 0.6;
}

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

/* ---------- Hero ---------- */
#hero {
  position: relative;
  overflow: hidden;
  padding: 2.5rem 2rem;
  border: none;
  background:
    linear-gradient(135deg, rgba(26, 35, 126, 0.96) 0%, rgba(57, 73, 171, 0.92) 45%, rgba(255, 112, 67, 0.85) 100%);
  color: #fff;
  box-shadow: var(--shadow-lg);
}

#hero::before,
#hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(2px);
}

#hero::before {
  width: 340px;
  height: 340px;
  top: -140px;
  right: -90px;
  background: radial-gradient(circle, rgba(255, 213, 79, 0.55), transparent 68%);
  animation: floatOrb 12s ease-in-out infinite;
}

#hero::after {
  width: 260px;
  height: 260px;
  bottom: -120px;
  left: -70px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.22), transparent 70%);
  animation: floatOrb 16s ease-in-out infinite reverse;
}

@keyframes floatOrb {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-18px, 22px) scale(1.08); }
}

#hero h1 {
  background: none;
  -webkit-text-fill-color: #fff;
  color: #fff;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.22);
  position: relative;
  z-index: 1;
}

#hero p {
  color: rgba(255, 255, 255, 0.9);
  position: relative;
  z-index: 1;
  max-width: 62ch;
}

#hero figure {
  margin: 1.5rem 0;
  position: relative;
  z-index: 1;
}

#hero figure svg {
  border-radius: var(--radius-md);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
  transition: transform var(--transition);
}

#hero figure:hover svg {
  transform: scale(1.015);
}

#hero figcaption {
  margin-top: 0.7rem;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.78);
  text-align: center;
}

#hero a {
  color: var(--accent);
}

/* ---------- Article cards ---------- */
#articles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.2rem;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}

#articles > h2,
#articles > p {
  grid-column: 1 / -1;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.75rem 1rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 0;
}

#articles > p {
  padding-top: 0;
  border-top: none;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  margin-top: -1.2rem;
  padding-bottom: 1.5rem;
}

#articles > h2 {
  padding-bottom: 0.4rem;
}

#articles article {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 1.4rem 1.4rem 1.2rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

#articles article::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-light), var(--accent), var(--coral));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition);
}

#articles article:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-strong);
}

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

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

#articles article:hover h3 {
  color: var(--primary-light);
}

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

#articles article a {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--primary-light);
  align-self: flex-start;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  background: var(--bg-soft);
  transition: background var(--transition), color var(--transition), gap var(--transition);
}

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

#articles article a:hover {
  background: var(--primary);
  color: #fff;
}

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

@media (prefers-color-scheme: dark) {
  #articles article a:hover {
    background: var(--primary-lighter);
    color: #0d1220;
  }
}

/* ---------- FAQ ---------- */
#faq details {
  margin-bottom: 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

#faq details[open] {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
  background: linear-gradient(180deg, var(--bg-elevated), var(--bg-soft));
}

#faq summary {
  cursor: pointer;
  padding: 1rem 3rem 1rem 1.2rem;
  font-weight: 600;
  color: var(--text);
  list-style: none;
  position: relative;
  transition: color var(--transition);
  user-select: none;
}

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

#faq summary::after {
  content: "+";
  position: absolute;
  right: 1.1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  line-height: 24px;
  text-align: center;
  border-radius: 50%;
  background: var(--bg-soft);
  color: var(--primary-light);
  font-size: 1.2rem;
  font-weight: 400;
  transition: transform var(--transition), background var(--transition), color var(--transition);
}

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

#faq summary:hover {
  color: var(--primary-light);
}

#faq details p {
  padding: 0 1.2rem 1.1rem;
  margin: 0;
  font-size: 0.95rem;
  animation: fadeSlide 0.4s ease both;
}

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

/* ---------- HowTo ---------- */
#howto ul {
  padding-left: 0;
  list-style: none;
}

#howto ul li {
  position: relative;
  padding-left: 1.7rem;
}

#howto ul li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--coral);
  font-weight: 700;
}

#howto h4 {
  display: inline-block;
  padding: 0.15rem 0.7rem;
  background: var(--bg-soft);
  border-radius: 999px;
  border-left: 3px solid var(--accent);
}

/* ---------- News ---------- */
#news h3 {
  padding-bottom: 0.4rem;
  border-bottom: 1px dashed var(--border-strong);
}

#news h3 + p time {
  display: inline-block;
  padding: 0.1rem 0.6rem;
  background: var(--bg-soft);
  border-radius: 999px;
  margin-bottom: 0.6rem;
}

/* ---------- Sitemap / Footer nav ---------- */
main > nav[aria-label="网站地图"],
main > nav[aria-label="友情链接"] {
  padding: 1.5rem 1.75rem;
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  backdrop-filter: blur(16px) saturate(150%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 2rem;
}

main > nav[aria-label="网站地图"] ul,
main > nav[aria-label="友情链接"] ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

main > nav[aria-label="网站地图"] li,
main > nav[aria-label="友情链接"] li {
  margin: 0;
}

main > nav[aria-label="网站地图"] a,
main > nav[aria-label="友情链接"] a {
  display: inline-block;
  padding: 0.4rem 1rem;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  font-size: 0.88rem;
  color: var(--text-soft);
  transition: transform var(--transition), background var(--transition), color var(--transition), border-color var(--transition), box-shadow var(--transition);
}

main > nav[aria-label="网站地图"] a:hover,
main > nav[aria-label="友情链接"] a:hover {
  background: var(--primary);
  color: #fff;
  border-color: transparent;
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

@media (prefers-color-scheme: dark) {
  main > nav[aria-label="网站地图"] a:hover,
  main > nav[aria-label="友情链接"] a:hover {
    background: var(--primary-lighter);
    color: #0d1220;
  }
}

/* ---------- Footer ---------- */
footer {
  background:
    linear-gradient(160deg, rgba(26, 35, 126, 0.97) 0%, rgba(20, 27, 56, 0.98) 100%);
  color: rgba(255, 255, 255, 0.82);
  padding: 2.5rem 1.25rem 2rem;
  margin-top: 1rem;
  border-top: 3px solid var(--accent);
}

footer > section {
  max-width: var(--max-width);
  margin: 0 auto 1.6rem;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}

footer > section:hover {
  box-shadow: none;
}

footer h2 {
  font-size: 1.1rem;
  color: var(--accent);
  padding-left: 0;
  margin-bottom: 0.6rem;
}

footer h2::before {
  display: none;
}

footer p {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.9rem;
  margin-bottom: 0.6rem;
}

footer a {
  color: var(--accent);
}

footer a:hover {
  color: #fff;
  text-decoration: underline;
}

footer > p {
  max-width: var(--max-width);
  margin: 1.4rem auto 0;
  text-align: center;
  padding-top: 1.2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

footer > p time {
  color: rgba(255, 255, 255, 0.55);
}

/* ---------- Scroll reveal animation ---------- */
@media (prefers-reduced-motion: no-preference) {
  section,
  #articles article,
  #faq details {
    animation: revealUp 0.7s cubic-bezier(0.22, 0.61, 0.36, 1) both;
  }

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

  section:nth-of-type(2),
  #articles article:nth-child(2) { animation-delay: 0.05s; }
  section:nth-of-type(3),
  #articles article:nth-child(3) { animation-delay: 0.1s; }
  section:nth-of-type(4),
  #articles article:nth-child(4) { animation-delay: 0.15s; }
  section:nth-of-type(5),
  #articles article:nth-child(5) { animation-delay: 0.2s; }
  section:nth-of-type(6),
  #articles article:nth-child(6) { animation-delay: 0.25s; }
  section:nth-of-type(7),
  #articles article:nth-child(7) { animation-delay: 0.3s; }
  section:nth-of-type(8),
  #articles article:nth-child(8) { animation-delay: 0.35s; }
  section:nth-of-type(9),
  #articles article:nth-child(9) { animation-delay: 0.4s; }
  section:nth-of-type(10),
  #articles article:nth-child(10) { animation-delay: 0.45s; }
}

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

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
  }

  .site-header nav {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 0.2rem;
  }

  .site-header nav::-webkit-scrollbar {
    display: none;
  }

  .site-header nav ul {
    flex-wrap: nowrap;
    width: max-content;
  }

  section {
    padding: 1.4rem 1.2rem;
    border-radius: var(--radius-md);
  }

  #hero {
    padding: 2rem 1.25rem;
  }

  #articles {
    grid-template-columns: 1fr;
  }
}

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

  main {
    padding: 1rem 0.9rem 2rem;
  }

  .brand {
    font-size: 1rem;
  }

  .brand svg {
    width: 34px;
    height: 34px;
  }

  #hero {
    padding: 1.6rem 1rem;
    border-radius: var(--radius-md);
  }

  #hero figure svg {
    height: 180px;
  }

  h2 {
    padding-left: 0.9rem;
  }

  #faq summary {
    padding: 0.9rem 2.6rem 0.9rem 1rem;
    font-size: 0.95rem;
  }

  #articles > h2,
  #articles > p {
    padding-left: 1.1rem;
    padding-right: 1.1rem;
  }

  main > nav[aria-label="网站地图"],
  main > nav[aria-label="友情链接"] {
    padding: 1.2rem 1rem;
  }

  footer {
    padding: 2rem 1rem 1.6rem;
  }
}

/* ---------- Print ---------- */
@media print {
  header,
  footer,
  #hero::before,
  #hero::after {
    display: none;
  }

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

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