:root {
  --primary: #c0392b;
  --primary-light: #e74c3c;
  --primary-dark: #922b21;
  --accent: #f39c12;
  --accent-light: #f1c40f;
  --bg: #f7f4f0;
  --bg-alt: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.72);
  --bg-card-hover: rgba(255, 255, 255, 0.92);
  --text: #2c2622;
  --text-soft: #5a5048;
  --text-muted: #8a7f75;
  --border: rgba(192, 57, 43, 0.12);
  --border-soft: rgba(0, 0, 0, 0.07);
  --shadow-sm: 0 2px 8px rgba(44, 38, 34, 0.06);
  --shadow-md: 0 8px 28px rgba(44, 38, 34, 0.1);
  --shadow-lg: 0 18px 50px rgba(44, 38, 34, 0.14);
  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 26px;
  --glass-blur: 16px;
  --grad-hero: linear-gradient(135deg, #c0392b 0%, #e05a3a 38%, #f39c12 72%, #f7b733 100%);
  --grad-accent: linear-gradient(120deg, #c0392b, #f39c12);
  --grad-soft: linear-gradient(160deg, rgba(192, 57, 43, 0.08), rgba(243, 156, 18, 0.06));
  --transition: 0.35s cubic-bezier(0.22, 0.61, 0.36, 1);
  --maxw: 1180px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary: #ff6b5a;
    --primary-light: #ff8a7a;
    --primary-dark: #d94a3a;
    --accent: #f7b733;
    --accent-light: #ffd166;
    --bg: #14100e;
    --bg-alt: #1c1714;
    --bg-card: rgba(38, 31, 27, 0.66);
    --bg-card-hover: rgba(48, 39, 34, 0.86);
    --text: #f2ece6;
    --text-soft: #cdc3ba;
    --text-muted: #9a8d82;
    --border: rgba(255, 107, 90, 0.18);
    --border-soft: rgba(255, 255, 255, 0.08);
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 10px 32px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 22px 60px rgba(0, 0, 0, 0.6);
    --grad-hero: linear-gradient(135deg, #7a1f14 0%, #b03a26 40%, #c96a1c 72%, #a86a10 100%);
    --grad-soft: linear-gradient(160deg, rgba(255, 107, 90, 0.1), rgba(247, 183, 51, 0.06));
  }
}

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

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

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.8;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 12% 8%, rgba(192, 57, 43, 0.07), transparent 42%),
    radial-gradient(circle at 88% 22%, rgba(243, 156, 18, 0.07), transparent 40%),
    radial-gradient(circle at 50% 100%, rgba(192, 57, 43, 0.05), transparent 55%);
  background-attachment: fixed;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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(--accent);
}

ul,
ol {
  list-style: none;
}

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

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

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--primary), var(--accent));
  border-radius: 10px;
  border: 2px solid var(--bg);
}

/* ============ Header ============ */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 28px;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 16px clamp(16px, 4vw, 40px);
  background: var(--bg-card);
  backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  border-bottom: 1px solid var(--border-soft);
  box-shadow: var(--shadow-sm);
  border-radius: 0 0 var(--radius) var(--radius);
}

header::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(192, 57, 43, 0.05), transparent 30%, transparent 70%, rgba(243, 156, 18, 0.05));
}

.brand {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand a {
  font-size: clamp(1.35rem, 2.6vw, 1.7rem);
  font-weight: 800;
  letter-spacing: 0.5px;
  background: var(--grad-accent);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  line-height: 1.2;
  transition: filter var(--transition), transform var(--transition);
}

.brand a:hover {
  filter: brightness(1.15) saturate(1.2);
  transform: translateY(-1px);
}

.brand p {
  font-size: 0.72rem;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  font-weight: 500;
}

header nav {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  display: flex;
  justify-content: flex-end;
}

header nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: flex-end;
}

header nav a {
  display: inline-block;
  padding: 8px 14px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-soft);
  border-radius: 999px;
  position: relative;
  transition: color var(--transition), background var(--transition), transform var(--transition);
}

header nav a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 4px;
  width: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--grad-accent);
  transform: translateX(-50%);
  transition: width var(--transition);
}

header nav a:hover {
  color: var(--primary);
  background: rgba(192, 57, 43, 0.07);
  transform: translateY(-1px);
}

header nav a:hover::after {
  width: 40%;
}

/* ============ Main ============ */
main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(20px, 4vw, 44px) clamp(16px, 4vw, 40px) 60px;
  display: flex;
  flex-direction: column;
  gap: clamp(28px, 5vw, 56px);
}

/* ============ Sections (glass cards) ============ */
section {
  position: relative;
  padding: clamp(22px, 4vw, 44px);
  background: var(--bg-card);
  backdrop-filter: blur(var(--glass-blur)) saturate(150%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(150%);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  animation: fadeUp 0.7s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

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

section::before {
  content: "";
  position: absolute;
  top: 0;
  left: clamp(22px, 4vw, 44px);
  right: clamp(22px, 4vw, 44px);
  height: 3px;
  border-radius: 0 0 4px 4px;
  background: var(--grad-accent);
  opacity: 0.85;
}

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

section:nth-of-type(2) { animation-delay: 0.05s; }
section:nth-of-type(3) { animation-delay: 0.1s; }
section:nth-of-type(4) { animation-delay: 0.15s; }
section:nth-of-type(5) { animation-delay: 0.2s; }
section:nth-of-type(6) { animation-delay: 0.25s; }

/* ============ Hero ============ */
#hero {
  padding: clamp(32px, 6vw, 72px) clamp(22px, 5vw, 60px);
  background: var(--grad-hero);
  border: none;
  color: #fff;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(192, 57, 43, 0.28);
}

#hero::before {
  content: "";
  position: absolute;
  inset: 0;
  height: auto;
  border-radius: inherit;
  background:
    radial-gradient(circle at 85% 15%, rgba(255, 255, 255, 0.22), transparent 45%),
    radial-gradient(circle at 10% 90%, rgba(255, 255, 255, 0.12), transparent 40%);
  pointer-events: none;
  opacity: 1;
}

#hero::after {
  content: "";
  position: absolute;
  top: -60%;
  right: -20%;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.14), transparent 70%);
  animation: floatBlob 14s ease-in-out infinite;
  pointer-events: none;
}

@keyframes floatBlob {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-40px, 30px) scale(1.08); }
}

#hero h1 {
  position: relative;
  z-index: 1;
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  line-height: 1.35;
  font-weight: 800;
  letter-spacing: 0.5px;
  margin-bottom: 22px;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.18);
}

#hero > p {
  position: relative;
  z-index: 1;
  font-size: clamp(0.95rem, 1.6vw, 1.05rem);
  color: rgba(255, 255, 255, 0.94);
  margin-bottom: 16px;
  max-width: 900px;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.12);
}

#hero nav {
  position: relative;
  z-index: 1;
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.25);
}

#hero nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

#hero nav a {
  display: inline-block;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
}

#hero nav a:hover {
  background: rgba(255, 255, 255, 0.32);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
}

/* ============ Typography ============ */
h2 {
  position: relative;
  font-size: clamp(1.3rem, 2.8vw, 1.85rem);
  font-weight: 800;
  line-height: 1.4;
  color: var(--text);
  margin-bottom: 22px;
  padding-left: 18px;
  letter-spacing: 0.3px;
}

h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.18em;
  bottom: 0.18em;
  width: 6px;
  border-radius: 6px;
  background: var(--grad-accent);
  box-shadow: 0 0 14px rgba(192, 57, 43, 0.35);
}

h3 {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  font-weight: 700;
  line-height: 1.5;
  color: var(--primary);
  margin: 26px 0 12px;
  transition: color var(--transition);
}

h3:hover {
  color: var(--accent);
}

p {
  color: var(--text-soft);
  margin-bottom: 14px;
  font-size: clamp(0.94rem, 1.5vw, 1rem);
  text-align: justify;
  word-break: break-word;
}

section > p:last-child,
article p:last-child {
  margin-bottom: 0;
}

ul li,
ol li {
  color: var(--text-soft);
}

/* ============ Articles ============ */
#articles {
  display: flex;
  flex-direction: column;
}

#articles > p {
  margin-bottom: 8px;
}

article {
  position: relative;
  margin-top: 20px;
  padding: 20px 22px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition), background var(--transition);
  animation: fadeUp 0.6s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

article::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--grad-accent);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform var(--transition);
}

article:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
  background: var(--bg-card-hover);
}

article:hover::before {
  transform: scaleY(1);
}

article h3 {
  margin-top: 0;
  color: var(--text);
  font-size: clamp(1rem, 1.9vw, 1.15rem);
}

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

article p:first-of-type {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--primary);
  background: rgba(192, 57, 43, 0.09);
  padding: 2px 12px;
  border-radius: 999px;
  margin-bottom: 10px;
  letter-spacing: 0.3px;
}

article p a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--primary);
  padding: 6px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(192, 57, 43, 0.05);
  transition: all var(--transition);
}

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

article p a:hover {
  color: #fff;
  background: var(--grad-accent);
  border-color: transparent;
  box-shadow: 0 6px 18px rgba(192, 57, 43, 0.3);
}

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

/* ============ FAQ ============ */
#faq h3 {
  position: relative;
  padding: 14px 18px 14px 48px;
  margin: 14px 0 0;
  font-size: clamp(0.98rem, 1.8vw, 1.1rem);
  color: var(--text);
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  cursor: default;
  transition: all var(--transition);
}

#faq h3::before {
  content: "Q";
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 800;
  color: #fff;
  background: var(--grad-accent);
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(192, 57, 43, 0.25);
}

#faq h3:hover {
  color: var(--primary);
  border-color: var(--primary);
  transform: translateX(4px);
  box-shadow: var(--shadow-sm);
}

#faq h3 + p {
  margin: 0 0 6px;
  padding: 14px 18px 16px 48px;
  background: var(--grad-soft);
  border: 1px solid var(--border-soft);
  border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  font-size: 0.94rem;
}

/* ============ HowTo / Notice ordered feel ============ */
#howto h3 {
  display: inline-block;
  padding: 4px 16px;
  font-size: 0.95rem;
  color: var(--primary);
  background: rgba(192, 57, 43, 0.08);
  border-radius: 999px;
  margin-top: 22px;
}

#howto h3:hover {
  background: var(--grad-accent);
  color: #fff;
}

#notice h3 {
  padding-left: 16px;
  border-left: 4px solid var(--accent);
  margin-left: 2px;
}

/* ============ Contact ============ */
#contact ul {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  margin-top: 18px;
}

#contact li {
  position: relative;
  padding: 14px 18px 14px 44px;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  line-height: 1.6;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  word-break: break-word;
}

#contact li::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 50%;
  width: 10px;
  height: 10px;
  transform: translateY(-50%) rotate(45deg);
  border-radius: 2px;
  background: var(--grad-accent);
}

#contact li:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-sm);
  border-color: var(--primary);
}

#contact li a {
  font-weight: 600;
}

/* ============ Sitemap ============ */
#sitemap > ul {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

#sitemap > ul li a {
  display: block;
  padding: 10px 16px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-soft);
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

#sitemap > ul li a:hover {
  color: #fff;
  background: var(--grad-accent);
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(192, 57, 43, 0.25);
}

#sitemap h3 {
  margin-top: 24px;
}

#sitemap h3 + ul {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 0;
}

#sitemap h3 + ul li a {
  display: inline-block;
  padding: 8px 18px;
  font-size: 0.85rem;
  color: var(--text-muted);
  background: transparent;
  border: 1px dashed var(--border);
  border-radius: 999px;
}

#sitemap h3 + ul li a:hover {
  color: var(--primary);
  background: rgba(192, 57, 43, 0.07);
  border-style: solid;
  box-shadow: none;
  transform: none;
}

/* ============ Footer ============ */
footer {
  position: relative;
  margin-top: 20px;
  padding: clamp(32px, 5vw, 56px) clamp(16px, 4vw, 40px) 28px;
  background: linear-gradient(180deg, rgba(192, 57, 43, 0.06), rgba(0, 0, 0, 0.03));
  border-top: 1px solid var(--border-soft);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

footer > div {
  max-width: var(--maxw);
  margin: 0 auto 22px;
}

footer p {
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.9;
  margin-bottom: 6px;
  text-align: left;
}

footer > div:first-child p:first-child {
  font-size: clamp(1rem, 2vw, 1.15rem);
  font-weight: 800;
  background: var(--grad-accent);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  margin-bottom: 12px;
}

footer a {
  color: var(--primary);
  font-weight: 600;
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition), color var(--transition);
}

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

footer > div:nth-child(2) {
  padding-top: 20px;
  border-top: 1px dashed var(--border-soft);
}

footer nav {
  max-width: var(--maxw);
  margin: 0 auto;
  padding-top: 20px;
  border-top: 1px solid var(--border-soft);
}

footer nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  justify-content: center;
}

footer nav a {
  font-size: 0.86rem;
  color: var(--text-soft);
  padding: 4px 2px;
  position: relative;
}

footer nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--grad-accent);
  transition: width var(--transition);
}

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

footer nav a:hover::after {
  width: 100%;
}

/* ============ Responsive ============ */
@media (max-width: 900px) {
  html {
    scroll-padding-top: 140px;
  }

  header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    border-radius: 0 0 var(--radius) var(--radius);
  }

  header nav {
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
  }

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

  header nav ul {
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 2px;
  }

  header nav a {
    white-space: nowrap;
    padding: 7px 12px;
    font-size: 0.85rem;
  }
}

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

  main {
    gap: 24px;
    padding: 18px 12px 40px;
  }

  section {
    padding: 20px 16px 24px;
    border-radius: var(--radius);
  }

  section::before {
    left: 16px;
    right: 16px;
  }

  #hero {
    padding: 30px 18px 32px;
    border-radius: var(--radius);
  }

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

  #hero nav ul {
    gap: 8px;
  }

  #hero nav a {
    padding: 7px 13px;
    font-size: 0.8rem;
  }

  h2 {
    font-size: 1.22rem;
    padding-left: 14px;
    margin-bottom: 16px;
  }

  h2::before {
    width: 5px;
  }

  h3 {
    margin-top: 20px;
  }

  p {
    text-align: left;
  }

  article {
    padding: 16px 16px 18px;
  }

  #faq h3 {
    padding: 12px 14px 12px 44px;
  }

  #faq h3 + p {
    padding: 12px 14px 14px 44px;
  }

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

  #sitemap > ul {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }

  footer {
    padding: 28px 16px 22px;
  }

  footer p {
    font-size: 0.82rem;
  }

  footer nav ul {
    gap: 6px 18px;
  }
}

@media (max-width: 380px) {
  header nav a {
    padding: 6px 10px;
    font-size: 0.8rem;
  }

  #hero nav a {
    font-size: 0.76rem;
    padding: 6px 11px;
  }
}

/* ============ Reduced motion ============ */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

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

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

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

  a {
    color: #000;
    text-decoration: underline;
  }
}