:root {
  --brand: #f5a623;
  --brand-dark: #e8871e;
  --brand-soft: rgba(245, 166, 35, 0.12);
  --bg: #fffaf2;
  --bg-alt: #ffffff;
  --surface: #ffffff;
  --surface-glass: rgba(255, 255, 255, 0.72);
  --text: #2b2118;
  --text-soft: #6b5c4d;
  --text-mute: #93836f;
  --border: rgba(43, 33, 24, 0.08);
  --shadow-sm: 0 2px 8px rgba(120, 80, 20, 0.06);
  --shadow-md: 0 10px 30px rgba(120, 80, 20, 0.1);
  --shadow-lg: 0 24px 60px rgba(120, 80, 20, 0.16);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --header-h: 68px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --grad-brand: linear-gradient(135deg, #f5a623 0%, #e8871e 100%);
  --grad-hero: linear-gradient(135deg, #f5a623 0%, #ef8f1f 45%, #d96f14 100%);
  --grad-soft: linear-gradient(160deg, #fff7ea 0%, #fdeed6 60%, #fbe4c2 100%);
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand: #ffb43a;
    --brand-dark: #f5a623;
    --brand-soft: rgba(255, 180, 58, 0.14);
    --bg: #14100b;
    --bg-alt: #1a1510;
    --surface: #1f1913;
    --surface-glass: rgba(31, 25, 19, 0.72);
    --text: #f4ece1;
    --text-soft: #c9bba9;
    --text-mute: #93836f;
    --border: rgba(244, 236, 225, 0.1);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.6);
    --grad-soft: linear-gradient(160deg, #241c14 0%, #1c1610 60%, #17120c 100%);
  }
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  background-color: var(--bg);
  background-image: radial-gradient(
      circle at 12% 0%,
      var(--brand-soft) 0%,
      transparent 42%
    ),
    radial-gradient(circle at 88% 12%, rgba(245, 166, 35, 0.08) 0%, transparent 45%);
  background-attachment: fixed;
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease);
  overflow-x: hidden;
}

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

a {
  color: var(--brand-dark);
  text-decoration: none;
  transition: color 0.25s var(--ease), opacity 0.25s var(--ease);
}

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

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

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

h1 {
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  letter-spacing: 0.015em;
}

h2 {
  font-size: clamp(1.35rem, 2.8vw, 1.9rem);
  position: relative;
  padding-left: 16px;
}

h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.18em;
  bottom: 0.18em;
  width: 5px;
  border-radius: 4px;
  background: var(--grad-brand);
}

h3 {
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  color: var(--text);
}

h4 {
  font-size: 1rem;
  color: var(--brand-dark);
}

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

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

li {
  margin-bottom: 0.4em;
}

li::marker {
  color: var(--brand);
}

blockquote {
  margin: 1em 0;
  padding: 16px 20px;
  border-left: 4px solid var(--brand);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  background: var(--surface-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
  color: var(--text-soft);
  font-style: normal;
}

blockquote p {
  margin: 0;
}

/* ============ Header ============ */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  min-height: var(--header-h);
  padding: 10px clamp(16px, 4vw, 48px);
  background: var(--surface-glass);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: background 0.4s var(--ease), box-shadow 0.4s var(--ease);
}

header > div {
  display: flex;
  align-items: center;
  gap: 12px;
}

header > div > a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
}

header > div > a svg {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  box-shadow: 0 6px 16px rgba(245, 166, 35, 0.35);
  transition: transform 0.4s var(--ease);
}

header > div > a:hover svg {
  transform: rotate(-6deg) scale(1.06);
}

header nav ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

header nav li {
  margin: 0;
}

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

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

header nav a:hover,
header nav a:focus-visible {
  color: var(--brand-dark);
  background: var(--brand-soft);
  transform: translateY(-1px);
}

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

/* ============ Main ============ */
main {
  display: block;
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(20px, 4vw, 48px) clamp(16px, 4vw, 40px) 64px;
}

main > section {
  margin-bottom: clamp(28px, 5vw, 56px);
  padding: clamp(20px, 3.5vw, 40px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.45s var(--ease), transform 0.45s var(--ease),
    border-color 0.45s var(--ease), background 0.4s var(--ease);
  animation: fadeUp 0.7s var(--ease) both;
}

main > section:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(245, 166, 35, 0.28);
}

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

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

/* ============ Hero ============ */
#hero {
  position: relative;
  overflow: hidden;
  padding: clamp(28px, 5vw, 64px);
  background: var(--grad-hero);
  border: none;
  border-radius: var(--radius-xl);
  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: -100px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.35), transparent 70%);
  animation: floaty 9s ease-in-out infinite;
}

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

@keyframes floaty {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-18px, 22px); }
}

#hero h1 {
  position: relative;
  z-index: 1;
  color: #fff;
  text-shadow: 0 2px 18px rgba(120, 60, 0, 0.25);
  max-width: 20em;
}

#hero > p {
  position: relative;
  z-index: 1;
  max-width: 62em;
  color: rgba(255, 255, 255, 0.94);
  font-size: clamp(0.95rem, 1.6vw, 1.05rem);
  line-height: 1.85;
}

#hero figure {
  position: relative;
  z-index: 1;
  margin: 24px 0 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(120, 60, 0, 0.35);
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
}

#hero figure:hover {
  transform: translateY(-4px) scale(1.008);
  box-shadow: 0 28px 64px rgba(120, 60, 0, 0.42);
}

#hero figure svg {
  width: 100%;
  height: auto;
  display: block;
}

#hero figcaption {
  padding: 12px 18px;
  font-size: 0.86rem;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(0, 0, 0, 0.16);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  text-align: center;
}

/* ============ Article cards (news) ============ */
#news article {
  position: relative;
  padding: 20px 22px;
  margin-bottom: 16px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease),
    border-color 0.35s var(--ease);
}

#news article::before {
  content: "";
  position: absolute;
  left: 0;
  top: 18px;
  bottom: 18px;
  width: 3px;
  border-radius: 3px;
  background: var(--grad-brand);
  opacity: 0;
  transform: scaleY(0.4);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}

#news article:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: rgba(245, 166, 35, 0.35);
}

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

#news article h3 {
  margin-bottom: 0.35em;
  transition: color 0.3s var(--ease);
}

#news article:hover h3 {
  color: var(--brand-dark);
}

#news article p {
  margin-bottom: 0.5em;
  font-size: 0.95rem;
}

#news article > p:first-of-type {
  font-size: 0.82rem;
  color: var(--text-mute);
  letter-spacing: 0.02em;
}

#news article a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  transition: background 0.3s var(--ease), color 0.3s var(--ease),
    transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

#news article a::after {
  content: "→";
  transition: transform 0.3s var(--ease);
}

#news article a:hover {
  background: var(--grad-brand);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(245, 166, 35, 0.35);
}

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

/* ============ FAQ ============ */
#faq details {
  margin-bottom: 12px;
  padding: 4px 20px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color 0.35s var(--ease), box-shadow 0.35s var(--ease),
    background 0.35s var(--ease);
}

#faq details[open] {
  border-color: rgba(245, 166, 35, 0.4);
  box-shadow: var(--shadow-md);
  background: var(--surface-glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

#faq details:hover {
  border-color: rgba(245, 166, 35, 0.32);
}

#faq summary {
  position: relative;
  list-style: none;
  cursor: pointer;
  padding: 14px 34px 14px 0;
  font-weight: 600;
  color: var(--text);
  transition: color 0.3s var(--ease);
  user-select: none;
}

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

#faq summary::after {
  content: "";
  position: absolute;
  right: 4px;
  top: 50%;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--brand);
  border-bottom: 2px solid var(--brand);
  transform: translateY(-70%) rotate(45deg);
  transition: transform 0.35s var(--ease);
}

#faq details[open] summary {
  color: var(--brand-dark);
}

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

#faq details p {
  margin: 0 0 16px;
  padding-top: 2px;
  border-top: 1px dashed var(--border);
  padding-top: 14px;
  animation: fadeIn 0.35s var(--ease);
}

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

/* ============ HowTo ============ */
#howto ol {
  counter-reset: step;
  list-style: none;
  padding-left: 0;
}

#howto ol > li {
  counter-increment: step;
  position: relative;
  padding: 12px 16px 12px 52px;
  margin-bottom: 10px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease),
    box-shadow 0.3s var(--ease);
}

#howto ol > li::before {
  content: counter(step);
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--grad-brand);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  box-shadow: 0 4px 10px rgba(245, 166, 35, 0.4);
}

#howto ol > li:hover {
  transform: translateX(4px);
  border-color: rgba(245, 166, 35, 0.35);
  box-shadow: var(--shadow-sm);
}

#howto ul li {
  position: relative;
}

/* ============ Contact / map ============ */
#contact p {
  margin-bottom: 0.5em;
}

#contact h3 {
  margin-top: 1.6em;
}

#contact ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  padding-left: 0;
  list-style: none;
}

#contact ul li {
  margin: 0;
}

#contact ul a {
  display: inline-block;
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 0.9rem;
  background: var(--brand-soft);
  color: var(--brand-dark);
  border: 1px solid transparent;
  transition: all 0.3s var(--ease);
}

#contact ul a:hover {
  background: var(--grad-brand);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(245, 166, 35, 0.35);
}

/* ============ Editor ============ */
#editor {
  background: var(--grad-soft);
}

#editor p {
  margin-bottom: 0.35em;
  font-size: 0.94rem;
}

/* ============ Footer ============ */
footer {
  position: relative;
  padding: clamp(28px, 4vw, 48px) clamp(16px, 4vw, 40px);
  background: var(--surface-glass);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-mute);
  font-size: 0.88rem;
}

footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--grad-brand);
  opacity: 0.85;
}

footer p {
  margin: 0 0 8px;
  color: var(--text-mute);
  font-size: 0.86rem;
}

footer nav ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 18px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

footer nav li {
  margin: 0;
}

footer nav a {
  color: var(--text-soft);
  font-size: 0.86rem;
  position: relative;
  transition: color 0.3s var(--ease);
}

footer nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 1.5px;
  background: var(--grad-brand);
  transition: width 0.3s var(--ease);
}

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

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

/* ============ Scroll reveal ============ */
@supports (animation-timeline: view()) {
  main > section {
    animation: none;
    animation-timeline: view();
    animation-range: entry 0% entry 60%;
    animation-name: revealView;
    animation-fill-mode: both;
  }

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

/* ============ Responsive ============ */
@media (max-width: 900px) {
  header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 16px;
  }

  header nav {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

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

  header nav ul {
    flex-wrap: nowrap;
    padding-bottom: 4px;
  }

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

  :root {
    --header-h: 108px;
  }

  #hero {
    text-align: left;
  }
}

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

  main {
    padding: 16px 12px 48px;
  }

  main > section {
    padding: 20px 16px;
    border-radius: var(--radius-md);
  }

  #hero {
    padding: 22px 18px;
    border-radius: var(--radius-lg);
  }

  #hero figure {
    margin-top: 18px;
    border-radius: var(--radius-md);
  }

  h2 {
    padding-left: 13px;
  }

  h2::before {
    width: 4px;
  }

  #news article {
    padding: 16px;
  }

  #faq details {
    padding: 2px 14px;
  }

  #howto ol > li {
    padding-left: 46px;
  }

  blockquote {
    padding: 14px 16px;
  }

  footer nav ul {
    gap: 8px 14px;
  }
}

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

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

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

  main > section {
    box-shadow: none;
    border: 1px solid #ddd;
    animation: none;
  }
}