/* Reset & Base */
*, *::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', Roboto, 'Helvetica Neue', Arial, sans-serif; line-height: 1.6; color: #1a1a2e; background: #f0f2f5; min-height: 100vh; transition: background 0.3s, color 0.3s; }
a { color: #e63946; text-decoration: none; transition: color 0.3s; }
a:hover { color: #c1121f; }
ul, ol { list-style: none; }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4, h5, h6 { line-height: 1.3; color: #1a1a2e; }
h1 { font-size: clamp(1.8rem, 5vw, 3rem); margin-bottom: 0.5em; }
h2 { font-size: clamp(1.4rem, 4vw, 2.2rem); margin: 1.5em 0 0.75em; position: relative; }
h3 { font-size: clamp(1.1rem, 3vw, 1.5rem); margin: 1.2em 0 0.5em; }
p { margin-bottom: 1em; }
section { max-width: 1200px; margin: 2rem auto; padding: 2rem 1.5rem; background: rgba(255,255,255,0.85); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-radius: 24px; box-shadow: 0 8px 32px rgba(0,0,0,0.08); transition: transform 0.3s, box-shadow 0.3s, background 0.3s; border: 1px solid rgba(255,255,255,0.3); }
section:hover { box-shadow: 0 12px 40px rgba(230,57,70,0.12); transform: translateY(-4px); }

/* Skip link */
.skip-link { position: absolute; top: -100%; left: 0; background: #e63946; color: #fff; padding: 0.5rem 1rem; z-index: 1000; transition: top 0.2s; }
.skip-link:focus { top: 0; }

/* Header & Nav */
header { background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%); padding: 1rem 0; position: sticky; top: 0; z-index: 100; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid rgba(255,255,255,0.08); }
nav { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; display: flex; justify-content: center; flex-wrap: wrap; gap: 0.5rem 1rem; }
nav a { color: rgba(255,255,255,0.85); font-weight: 500; padding: 0.4rem 0.8rem; border-radius: 30px; transition: all 0.3s; font-size: 0.95rem; position: relative; }
nav a:hover, nav a:focus { color: #fff; background: rgba(230,57,70,0.3); transform: scale(1.05); }

/* Main hero section */
main > section:first-of-type { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: #fff; border: none; padding: 4rem 2rem; margin-top: 0; border-radius: 0 0 40px 40px; text-align: center; }
main > section:first-of-type h1 { color: #fff; font-size: clamp(2rem, 6vw, 3.5rem); text-shadow: 0 2px 20px rgba(0,0,0,0.2); }
main > section:first-of-type p { color: rgba(255,255,255,0.9); max-width: 800px; margin: 1rem auto; font-size: 1.1rem; }

/* Card-like elements inside sections */
details { background: rgba(255,255,255,0.6); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-radius: 16px; padding: 1rem 1.5rem; margin-bottom: 0.75rem; border: 1px solid rgba(255,255,255,0.4); transition: all 0.3s; cursor: pointer; }
details:hover { background: rgba(255,255,255,0.8); box-shadow: 0 4px 16px rgba(0,0,0,0.06); }
details summary { font-weight: 600; font-size: 1.05rem; padding: 0.25rem 0; outline: none; }
details[open] summary { margin-bottom: 0.5rem; color: #e63946; }
details p { padding: 0.5rem 0 0; }

/* Article cards in news */
article { background: rgba(255,255,255,0.5); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); border-radius: 20px; padding: 1.5rem; margin-bottom: 1.5rem; border: 1px solid rgba(255,255,255,0.3); transition: all 0.3s; }
article:hover { background: rgba(255,255,255,0.8); transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,0.08); }
article h3 { margin-top: 0; }
article a { display: inline-block; margin-top: 0.5rem; font-weight: 600; }

/* Footer */
footer { background: #1a1a2e; color: rgba(255,255,255,0.7); padding: 2.5rem 1.5rem; margin-top: 3rem; border-radius: 40px 40px 0 0; text-align: center; font-size: 0.9rem; }
footer p { margin-bottom: 0.5rem; }

/* Sitemap & Friendlinks */
section:has(h2:contains("网站地图")), section:has(h2:contains("友情链接")) { background: rgba(255,255,255,0.4); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
section ul li { margin-bottom: 0.5rem; }
section ul li a { display: inline-block; padding: 0.3rem 0.8rem; border-radius: 20px; background: rgba(230,57,70,0.08); transition: all 0.3s; }
section ul li a:hover { background: #e63946; color: #fff; transform: translateX(4px); }

/* Scroll animation base */
section, article, details { opacity: 0; transform: translateY(30px); animation: fadeUp 0.6s ease-out forwards; }
@keyframes fadeUp { to { opacity: 1; transform: translateY(0); } }
section:nth-child(2) { animation-delay: 0.1s; }
section:nth-child(3) { animation-delay: 0.15s; }
section:nth-child(4) { animation-delay: 0.2s; }
section:nth-child(5) { animation-delay: 0.25s; }
section:nth-child(6) { animation-delay: 0.3s; }
section:nth-child(7) { animation-delay: 0.35s; }
section:nth-child(8) { animation-delay: 0.4s; }
section:nth-child(9) { animation-delay: 0.45s; }
section:nth-child(10) { animation-delay: 0.5s; }
section:nth-child(11) { animation-delay: 0.55s; }
article { animation-delay: 0.1s; }

/* Responsive */
@media (max-width: 768px) {
  header { padding: 0.8rem 0; }
  nav { gap: 0.3rem 0.6rem; padding: 0 1rem; }
  nav a { font-size: 0.85rem; padding: 0.3rem 0.6rem; }
  section { margin: 1.2rem 0.8rem; padding: 1.5rem 1rem; border-radius: 20px; }
  main > section:first-of-type { padding: 2.5rem 1rem; border-radius: 0 0 30px 30px; }
  h1 { font-size: 1.8rem; }
  h2 { font-size: 1.3rem; }
  details { padding: 0.8rem 1rem; }
  article { padding: 1rem; }
  footer { padding: 1.8rem 1rem; }
}

@media (max-width: 480px) {
  nav { flex-direction: column; align-items: center; gap: 0.2rem; }
  nav a { width: 100%; text-align: center; }
  section { padding: 1.2rem 0.8rem; }
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
  body { background: #0f0f1a; color: #e0e0e0; }
  h1, h2, h3, h4, h5, h6 { color: #f0f0f0; }
  section { background: rgba(30,30,50,0.85); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-color: rgba(255,255,255,0.08); }
  section:hover { box-shadow: 0 12px 40px rgba(230,57,70,0.2); }
  main > section:first-of-type { background: linear-gradient(135deg, #2c1a4d 0%, #1a1a3e 100%); }
  details { background: rgba(40,40,60,0.6); border-color: rgba(255,255,255,0.1); }
  details:hover { background: rgba(50,50,70,0.8); }
  article { background: rgba(40,40,60,0.5); border-color: rgba(255,255,255,0.08); }
  article:hover { background: rgba(50,50,70,0.7); }
  footer { background: #0a0a14; }
  a { color: #ff6b6b; }
  a:hover { color: #ff8e8e; }
  section ul li a { background: rgba(255,107,107,0.1); }
  section ul li a:hover { background: #e63946; color: #fff; }
  nav a { color: rgba(255,255,255,0.7); }
  nav a:hover { background: rgba(230,57,70,0.4); }
  .skip-link { background: #ff6b6b; }
  details[open] summary { color: #ff6b6b; }
}

/* Additional polish */
::selection { background: #e63946; color: #fff; }
:focus-visible { outline: 2px solid #e63946; outline-offset: 2px; }
html { scroll-padding-top: 80px; }