:root {
  --primary: #1a73e8;
  --primary-dark: #0d47a1;
  --primary-light: #4c9aff;
  --accent: #ff6b6b;
  --accent-2: #ffa94d;
  --bg: #f5f8fc;
  --bg-card: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.7);
  --text: #1c2430;
  --text-soft: #4a5568;
  --text-muted: #718096;
  --border: #e2e8f0;
  --shadow-sm: 0 2px 8px rgba(26, 115, 232, 0.08);
  --shadow-md: 0 8px 24px rgba(26, 115, 232, 0.12);
  --shadow-lg: 0 16px 48px rgba(26, 115, 232, 0.18);
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --max-width: 1200px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary: #4c9aff;
    --primary-dark: #1a73e8;
    --primary-light: #82b6ff;
    --accent: #ff8787;
    --accent-2: #ffc078;
    --bg: #0d1117;
    --bg-card: #161b22;
    --bg-glass: rgba(22, 27, 34, 0.7);
    --text: #e6edf3;
    --text-soft: #b1bac4;
    --text-muted: #8b949e;
    --border: #30363d;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.6);
  }
}

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

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  font-size: 16px;
  overflow-x: hidden;
  transition: background var(--transition), color var(--transition);
}

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

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

a:hover {
  color: var(--primary-dark);
}

ul,
ol {
  list-style: none;
}

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

h1 { font-size: 2.25rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.25rem; }

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

strong {
  color: var(--text);
  font-weight: 600;
}

time {
  color: var(--text-muted);
  font-size: 0.875rem;
}

blockquote {
  border-left: 4px solid var(--primary);
  background: var(--bg-card);
  padding: 1rem 1.5rem;
  border-radius: var(--radius-sm);
  margin: 1rem 0;
}

blockquote p {
  margin-bottom: 0.5rem;
  font-style: italic;
}

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

/* ===== HEADER ===== */
header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

nav[aria-label="主导航"] {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

nav[aria-label="主导航"] > a {
  font-size: 1.375rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  white-space: nowrap;
  letter-spacing: 0.5px;
}

nav[aria-label="主导航"] ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  flex: 1;
}

nav[aria-label="主导航"] ul li a {
  display: inline-block;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-pill);
  color: var(--text-soft);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition);
}

nav[aria-label="主导航"] ul li a:hover {
  background: var(--primary);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

nav[role="search"] {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
}

nav[role="search"] label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

nav[role="search"] input[type="search"] {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--bg-card);
  color: var(--text);
  font-size: 0.875rem;
  width: 200px;
  transition: all var(--transition);
  outline: none;
}

nav[role="search"] input[type="search"]:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.15);
  width: 240px;
}

nav[role="search"] button {
  padding: 0.5rem 1.25rem;
  border: none;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

nav[role="search"] button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

nav[aria-label="面包屑"] {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem 0.75rem;
}

nav[aria-label="面包屑"] ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.8rem;
}

nav[aria-label="面包屑"] ol li {
  color: var(--text-muted);
}

nav[aria-label="面包屑"] ol li:not(:last-child)::after {
  content: "/";
  margin-left: 0.5rem;
  color: var(--text-muted);
}

nav[aria-label="面包屑"] ol li a {
  color: var(--primary);
}

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

/* ===== MAIN ===== */
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

section {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  animation: fadeUp 0.6s ease both;
  transition: box-shadow var(--transition), transform var(--transition);
}

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

section h2 {
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  position: relative;
  display: inline-block;
}

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

section h3 {
  margin: 1.5rem 0 0.75rem;
  color: var(--primary);
}

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

section ul,
section ol {
  padding-left: 0;
  margin-bottom: 1rem;
}

section ul li,
section ol li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--text-soft);
}

section ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
}

section ol {
  counter-reset: item;
}

section ol li {
  counter-increment: item;
}

section ol li::before {
  content: counter(item);
  position: absolute;
  left: 0;
  top: 0.1em;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== HERO ===== */
#hero {
  background: linear-gradient(135deg, #1a73e8 0%, #4c9aff 40%, #ff6b6b 100%);
  color: #fff;
  position: relative;
  overflow: hidden;
  border: none;
  padding: 3rem 2rem;
}

#hero::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -20%;
  width: 500px;
  height: 500px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  filter: blur(40px);
  pointer-events: none;
}

#hero::after {
  content: "";
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 400px;
  height: 400px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  filter: blur(40px);
  pointer-events: none;
}

#hero h1 {
  color: #fff;
  font-size: 2.5rem;
  margin-bottom: 1.25rem;
  position: relative;
  z-index: 1;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

#hero p {
  color: rgba(255, 255, 255, 0.95);
  position: relative;
  z-index: 1;
  max-width: 900px;
}

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

/* ===== NEWS & ARTICLES ===== */
#news article,
#articles article {
  background: var(--bg);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
  transition: all var(--transition);
}

#news article:hover,
#articles article:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-light);
}

#news article h3,
#articles article h3 {
  margin: 0 0 0.25rem;
  color: var(--text);
  font-size: 1.1rem;
}

#news article time,
#articles article time {
  display: block;
  margin-bottom: 0.5rem;
}

#news article p,
#articles article p {
  margin-bottom: 0.5rem;
}

#articles article a {
  display: inline-block;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.25rem 0;
  position: relative;
}

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

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

/* ===== FAQ ===== */
#faq details {
  background: var(--bg);
  border-radius: var(--radius-md);
  margin-bottom: 0.75rem;
  border: 1px solid var(--border);
  overflow: hidden;
  transition: all var(--transition);
}

#faq details[open] {
  border-color: var(--primary-light);
  box-shadow: var(--shadow-sm);
}

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

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

#faq summary::after {
  content: "+";
  position: absolute;
  right: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--primary);
  transition: transform var(--transition);
}

#faq details[open] summary::after {
  transform: translateY(-50%) rotate(45deg);
}

#faq summary:hover {
  background: rgba(26, 115, 232, 0.06);
}

#faq details p {
  padding: 0 1.25rem 1rem;
  margin: 0;
  font-size: 0.95rem;
}

/* ===== CONTACT ===== */
#contact ul li {
  padding-left: 0;
}

#contact ul li::before {
  display: none;
}

#contact ul li {
  padding: 0.5rem 0;
  border-bottom: 1px dashed var(--border);
}

#contact ul li:last-child {
  border-bottom: none;
}

/* ===== SITEMAP & LINKS ===== */
#sitemap ul,
#links ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

#sitemap ul li,
#links ul li {
  padding-left: 0;
  margin-bottom: 0;
}

#sitemap ul li::before,
#links ul li::before {
  display: none;
}

#sitemap ul li a,
#links ul li a {
  display: inline-block;
  padding: 0.4rem 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 0.875rem;
  color: var(--text-soft);
  transition: all var(--transition);
}

#sitemap ul li a:hover,
#links ul li a:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

/* ===== LEGAL ===== */
#legal h3 {
  margin-top: 1.5rem;
}

#legal p {
  font-size: 0.95rem;
  line-height: 1.85;
}

/* ===== FOOTER ===== */
footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  margin-top: 2rem;
  padding: 2rem 1.5rem;
  text-align: center;
}

footer p {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

footer nav[aria-label="页脚导航"] ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.5rem;
  margin-top: 1rem;
}

footer nav[aria-label="页脚导航"] ul li a {
  font-size: 0.875rem;
  color: var(--text-soft);
  transition: color var(--transition);
}

footer nav[aria-label="页脚导航"] ul li a:hover {
  color: var(--primary);
}

/* ===== ANIMATIONS ===== */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  nav[aria-label="主导航"] {
    gap: 1rem;
  }

  nav[aria-label="主导航"] ul {
    order: 3;
    flex-basis: 100%;
    justify-content: center;
  }

  nav[role="search"] {
    margin-left: auto;
  }
}

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

  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.4rem; }
  h3 { font-size: 1.1rem; }

  nav[aria-label="主导航"] {
    padding: 0.75rem 1rem;
  }

  nav[aria-label="主导航"] > a {
    font-size: 1.2rem;
  }

  nav[aria-label="主导航"] ul {
    gap: 0.15rem;
  }

  nav[aria-label="主导航"] ul li a {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
  }

  nav[role="search"] {
    width: 100%;
    order: 4;
  }

  nav[role="search"] input[type="search"] {
    flex: 1;
    width: auto;
  }

  nav[role="search"] input[type="search"]:focus {
    width: auto;
  }

  nav[aria-label="面包屑"] {
    padding: 0 1rem 0.5rem;
  }

  main {
    padding: 1rem;
    gap: 1.25rem;
  }

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

  #hero {
    padding: 2rem 1.25rem;
  }

  #hero h1 {
    font-size: 1.6rem;
  }

  #news article,
  #articles article {
    padding: 1rem;
  }

  footer {
    padding: 1.5rem 1rem;
  }
}

@media (max-width: 480px) {
  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.25rem; }

  #hero h1 {
    font-size: 1.35rem;
  }

  nav[aria-label="主导航"] > a {
    font-size: 1.1rem;
  }

  section {
    padding: 1rem;
  }

  #sitemap ul li a,
  #links ul li a {
    padding: 0.3rem 0.75rem;
    font-size: 0.8rem;
  }
}

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

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

::selection {
  background: var(--primary);
  color: #fff;
}

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

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: var(--radius-pill);
  border: 2px solid var(--bg);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-light);
}