:root {
  --primary: #8b3a3a;
  --primary-light: #a84e4e;
  --primary-dark: #6b2a2a;
  --accent: #c9a86c;
  --accent-light: #dbc08a;
  --bg: #faf6f2;
  --bg-alt: #f3ebe4;
  --card-bg: rgba(255, 255, 255, 0.75);
  --card-border: rgba(255, 255, 255, 0.6);
  --text: #2c2420;
  --text-secondary: #6b5e56;
  --text-muted: #9a8d84;
  --shadow: 0 8px 32px rgba(139, 58, 58, 0.08);
  --shadow-hover: 0 16px 48px rgba(139, 58, 58, 0.16);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --transition: 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --max-width: 1200px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary: #c26a6a;
    --primary-light: #d48888;
    --primary-dark: #a04e4e;
    --accent: #d4b87a;
    --accent-light: #e8d4a4;
    --bg: #1a1412;
    --bg-alt: #211a17;
    --card-bg: rgba(40, 32, 28, 0.7);
    --card-border: rgba(80, 60, 52, 0.5);
    --text: #ede5de;
    --text-secondary: #b8a89e;
    --text-muted: #8a7a70;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 16px 48px rgba(0, 0, 0, 0.45);
  }
}

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

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

body {
  font-family: var(--font);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.8;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.4s ease, color 0.4s ease;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(139, 58, 58, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 100%, rgba(201, 168, 108, 0.06) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

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-light);
  opacity: 0.9;
}

ul, ol {
  list-style: none;
}

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

h1 {
  font-size: clamp(1.5rem, 4vw, 2.4rem);
  letter-spacing: 0.02em;
}

h2 {
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  position: relative;
  padding-bottom: 0.6em;
  margin-bottom: 1.2em;
}

h2::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 2px;
}

h3 {
  font-size: clamp(1.05rem, 2.2vw, 1.25rem);
  margin-bottom: 0.6em;
}

p {
  margin-bottom: 1em;
  color: var(--text-secondary);
}

header {
  position: relative;
  z-index: 1;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 40%, var(--primary-light) 70%, var(--accent) 100%);
  color: #fff;
  padding: 3.5rem 1.5rem 3rem;
  text-align: center;
  overflow: hidden;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  box-shadow: 0 8px 40px rgba(139, 58, 58, 0.25);
}

header::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background:
    radial-gradient(circle at 30% 40%, rgba(255, 255, 255, 0.12) 0%, transparent 50%),
    radial-gradient(circle at 70% 60%, rgba(255, 255, 255, 0.08) 0%, transparent 50%);
  animation: headerGlow 12s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes headerGlow {
  0% { transform: translate(0, 0) rotate(0deg); }
  100% { transform: translate(3%, 3%) rotate(3deg); }
}

header h1 {
  color: #fff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
  margin-bottom: 0.8rem;
  position: relative;
  z-index: 1;
}

header > p {
  color: rgba(255, 255, 255, 0.9);
  max-width: 720px;
  margin: 0 auto 2rem;
  font-size: clamp(0.9rem, 2vw, 1.05rem);
  line-height: 1.9;
  position: relative;
  z-index: 1;
}

header nav {
  position: relative;
  z-index: 1;
}

header nav ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

header nav ul li a {
  display: inline-block;
  padding: 0.5rem 1.1rem;
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.9rem;
  border-radius: 50px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  transition: all var(--transition);
  white-space: nowrap;
}

header nav ul li a:hover {
  background: rgba(255, 255, 255, 0.28);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
  opacity: 1;
}

main {
  position: relative;
  z-index: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

section {
  margin-bottom: 2.5rem;
  padding: 2rem 1.5rem;
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: box-shadow var(--transition), transform var(--transition);
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 0.7s ease forwards;
}

section:nth-child(1) { animation-delay: 0.05s; }
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; }
section:nth-child(12) { animation-delay: 0.6s; }
section:nth-child(13) { animation-delay: 0.65s; }

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

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

section p {
  text-align: justify;
}

section ul {
  margin: 0.5rem 0 1rem;
}

section ul li {
  position: relative;
  padding-left: 1.4em;
  margin-bottom: 0.5em;
  color: var(--text-secondary);
}

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

#news ul li,
#articles article {
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

@media (prefers-color-scheme: dark) {
  #news ul li,
  #articles article {
    background: rgba(50, 40, 36, 0.4);
  }
}

#news ul li {
  padding-left: 1.5rem;
}

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

#news ul li:hover,
#articles article:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(139, 58, 58, 0.1);
  border-color: rgba(139, 58, 58, 0.2);
}

#news ul li h3,
#articles article h3 {
  margin-top: 0;
  margin-bottom: 0.4em;
  color: var(--text);
  transition: color var(--transition);
}

#news ul li:hover h3,
#articles article:hover h3 {
  color: var(--primary);
}

#news ul li p:first-of-type,
#articles article p:first-of-type {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.5em;
}

#news ul li a,
#articles article a {
  display: inline-block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--primary);
  position: relative;
  padding-bottom: 2px;
  transition: all var(--transition);
}

#news ul li a::after,
#articles article a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1.5px;
  background: var(--primary);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--transition);
}

#news ul li a:hover::after,
#articles article a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

#news ul li a:hover,
#articles article a:hover {
  opacity: 1;
}

#faq h3 {
  background: linear-gradient(135deg, rgba(139, 58, 58, 0.06), rgba(201, 168, 108, 0.06));
  padding: 0.8rem 1.2rem;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--primary);
  margin-top: 1.2rem;
  cursor: default;
  transition: all var(--transition);
}

#faq h3:hover {
  background: linear-gradient(135deg, rgba(139, 58, 58, 0.1), rgba(201, 168, 108, 0.1));
  transform: translateX(4px);
}

#faq h3 + p {
  padding: 0.5rem 1.2rem 0.8rem;
  margin-bottom: 0;
}

#howto h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

#howto h3::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  flex-shrink: 0;
}

#contact ul {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
}

#contact ul li {
  padding: 0.85rem 1.2rem;
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  transition: all var(--transition);
}

@media (prefers-color-scheme: dark) {
  #contact ul li {
    background: rgba(50, 40, 36, 0.45);
  }
}

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

#contact ul li:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(139, 58, 58, 0.1);
  border-color: rgba(139, 58, 58, 0.25);
}

#sitemap ul,
#links ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

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

#sitemap ul li a,
#links ul li a {
  display: inline-block;
  padding: 0.45rem 1.1rem;
  background: rgba(139, 58, 58, 0.07);
  border: 1px solid rgba(139, 58, 58, 0.12);
  border-radius: 50px;
  font-size: 0.88rem;
  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: 0 6px 18px rgba(139, 58, 58, 0.25);
  opacity: 1;
}

#legal h2 {
  margin-top: 1.5rem;
}

#legal h2:first-child {
  margin-top: 0;
}

footer {
  position: relative;
  z-index: 1;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
  color: rgba(255, 255, 255, 0.85);
  text-align: center;
  padding: 2.5rem 1.5rem;
  margin-top: 2rem;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: 0 -8px 40px rgba(139, 58, 58, 0.15);
}

footer p {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.88rem;
  margin-bottom: 0.5rem;
}

footer a {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.88rem;
  transition: all var(--transition);
}

footer a:hover {
  color: #fff;
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.4);
  opacity: 1;
}

footer p:last-child {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

::selection {
  background: rgba(139, 58, 58, 0.2);
  color: var(--text);
}

::-webkit-scrollbar {
  width: 8px;
}

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

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--primary), var(--accent));
  border-radius: 4px;
}

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

@media (max-width: 768px) {
  header {
    padding: 2.5rem 1rem 2rem;
    border-radius: 0 0 var(--radius) var(--radius);
  }

  header nav ul {
    gap: 0.4rem;
  }

  header nav ul li a {
    padding: 0.4rem 0.85rem;
    font-size: 0.82rem;
  }

  main {
    padding: 1.25rem 0.85rem 2rem;
  }

  section {
    padding: 1.5rem 1.1rem;
    margin-bottom: 1.5rem;
    border-radius: var(--radius-sm);
  }

  h2 {
    font-size: 1.25rem;
  }

  h2::after {
    width: 45px;
    height: 2.5px;
  }

  h3 {
    font-size: 1.02rem;
  }

  p {
    font-size: 0.92rem;
  }

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

  #contact ul {
    grid-template-columns: 1fr;
  }

  footer {
    padding: 2rem 1rem;
    border-radius: var(--radius) var(--radius) 0 0;
  }
}

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

  header h1 {
    font-size: 1.25rem;
  }

  header > p {
    font-size: 0.85rem;
  }

  header nav ul li a {
    padding: 0.35rem 0.7rem;
    font-size: 0.78rem;
  }

  section {
    padding: 1.25rem 0.9rem;
  }

  #sitemap ul li a,
  #links ul li a {
    padding: 0.35rem 0.85rem;
    font-size: 0.82rem;
  }
}

@media (min-width: 1024px) {
  main {
    padding: 2.5rem 2rem 4rem;
  }

  section {
    padding: 2.5rem 2.2rem;
  }
}

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

  section {
    opacity: 1;
    transform: none;
  }
}

@media print {
  header {
    background: none;
    color: #000;
    box-shadow: none;
  }

  header h1,
  header > p {
    color: #000;
    text-shadow: none;
  }

  section {
    box-shadow: none;
    border: 1px solid #ddd;
    opacity: 1;
    transform: none;
    animation: none;
    break-inside: avoid;
  }

  footer {
    background: none;
    color: #000;
    box-shadow: none;
  }

  footer p,
  footer a {
    color: #000;
  }
}