:root {
  --bg: #f4f6fb;
  --bg-soft: #ffffff;
  --bg-elev: rgba(255, 255, 255, 0.72);
  --text: #1a1a2e;
  --text-soft: #4a4a63;
  --text-mute: #7a7a92;
  --brand: #ffb703;
  --brand-2: #fb8500;
  --accent: #1a1a2e;
  --accent-2: #16213e;
  --line: rgba(26, 26, 46, 0.1);
  --shadow: 0 10px 30px rgba(26, 26, 46, 0.08);
  --shadow-lg: 0 20px 50px rgba(26, 26, 46, 0.14);
  --radius: 18px;
  --radius-sm: 12px;
  --radius-lg: 26px;
  --glass: blur(14px) saturate(160%);
  --header-h: 68px;
  --maxw: 1160px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="dark"] {
  --bg: #0e0f1a;
  --bg-soft: #161826;
  --bg-elev: rgba(30, 32, 48, 0.66);
  --text: #eef0f8;
  --text-soft: #c2c6d8;
  --text-mute: #8b90a8;
  --line: rgba(255, 255, 255, 0.1);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.55);
}

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

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

body {
  margin: 0;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(1200px 600px at 100% -10%, rgba(255, 183, 3, 0.12), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, rgba(22, 33, 62, 0.1), transparent 60%);
  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-2);
  text-decoration: none;
  transition: color 0.25s var(--ease), opacity 0.25s var(--ease);
}

a:hover,
a:focus-visible {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 4px;
}

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

h1,
h2,
h3,
h4 {
  line-height: 1.35;
  color: var(--text);
  letter-spacing: 0.2px;
}

h1 {
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  margin: 0 0 18px;
  font-weight: 800;
}

h2 {
  font-size: clamp(1.3rem, 2.6vw, 1.9rem);
  margin: 0 0 22px;
  font-weight: 800;
  position: relative;
  padding-left: 16px;
}

h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.18em;
  bottom: 0.18em;
  width: 6px;
  border-radius: 6px;
  background: linear-gradient(180deg, var(--brand), var(--brand-2));
}

h3 {
  font-size: clamp(1.05rem, 1.8vw, 1.25rem);
  margin: 26px 0 10px;
  font-weight: 700;
}

p {
  margin: 0 0 14px;
  color: var(--text-soft);
}

strong {
  color: var(--text);
}

ul,
ol {
  padding-left: 1.3em;
  margin: 0 0 16px;
  color: var(--text-soft);
}

li {
  margin: 6px 0;
}

blockquote {
  margin: 18px 0;
  padding: 16px 20px;
  border-left: 4px solid var(--brand);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--bg-elev);
  -webkit-backdrop-filter: var(--glass);
  backdrop-filter: var(--glass);
  box-shadow: var(--shadow);
}

blockquote p {
  margin: 6px 0;
  font-style: italic;
}

address {
  font-style: normal;
}

/* ============ Header ============ */
#site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-elev);
  -webkit-backdrop-filter: var(--glass);
  backdrop-filter: var(--glass);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 4px 24px rgba(26, 26, 46, 0.06);
  transition: background-color 0.4s var(--ease), box-shadow 0.3s var(--ease);
}

.header-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  min-height: var(--header-h);
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.logo svg {
  border-radius: 10px;
  box-shadow: 0 6px 16px rgba(255, 183, 3, 0.28);
  transition: transform 0.4s var(--ease);
}

.logo:hover svg {
  transform: rotate(-6deg) scale(1.06);
}

.logo-text {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 1px;
  background: linear-gradient(120deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

#main-nav {
  flex: 1;
  min-width: 0;
}

#main-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
  justify-content: flex-end;
}

#main-nav a {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-soft);
  text-decoration: none;
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease), transform 0.25s var(--ease);
}

#main-nav a:hover,
#main-nav a:focus-visible {
  color: var(--text);
  background: linear-gradient(120deg, rgba(255, 183, 3, 0.18), rgba(251, 133, 0, 0.14));
  transform: translateY(-2px);
  text-decoration: none;
}

#menu-toggle,
#dark-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-soft);
  color: var(--text);
  font-size: 1.15rem;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s var(--ease), background-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

#menu-toggle:hover,
#dark-toggle:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

#menu-toggle {
  display: none;
}

/* ============ Breadcrumb ============ */
.breadcrumb {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px 20px 0;
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.86rem;
  color: var(--text-mute);
}

.breadcrumb li + li::before {
  content: "/";
  margin-right: 8px;
  color: var(--text-mute);
  opacity: 0.6;
}

.breadcrumb a {
  color: var(--text-mute);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--brand-2);
}

/* ============ Main / Section ============ */
main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 8px 20px 40px;
}

.section {
  margin-top: 34px;
  padding: 30px clamp(18px, 3vw, 36px);
  background: var(--bg-elev);
  -webkit-backdrop-filter: var(--glass);
  backdrop-filter: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), background-color 0.4s var(--ease);
}

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

/* ============ Hero ============ */
.hero {
  margin-top: 22px;
  padding: clamp(24px, 4vw, 48px);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(26, 26, 46, 0.96), rgba(22, 33, 62, 0.92)),
    radial-gradient(600px 300px at 90% 0%, rgba(255, 183, 3, 0.35), transparent 60%);
  color: #eef0f8;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
  animation: fadeUp 0.8s var(--ease) both;
}

.hero::after {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  right: -140px;
  top: -180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 183, 3, 0.35), transparent 65%);
  pointer-events: none;
  animation: float 9s ease-in-out infinite;
}

.hero h1 {
  color: #ffffff;
  position: relative;
  z-index: 1;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.4);
}

.hero-lead {
  color: rgba(238, 240, 248, 0.88);
  font-size: clamp(0.95rem, 1.6vw, 1.05rem);
  max-width: 900px;
  position: relative;
  z-index: 1;
}

.hero-lead strong {
  color: var(--brand);
}

.hero-banner {
  margin-top: 26px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  position: relative;
  z-index: 1;
  transition: transform 0.5s var(--ease);
}

.hero-banner:hover {
  transform: translateY(-4px) scale(1.006);
}

.hero-banner svg {
  display: block;
  width: 100%;
  height: auto;
}

/* ============ Article Cards ============ */
#article article {
  margin: 0 0 18px;
  padding: 20px 22px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s var(--ease);
  animation: fadeUp 0.7s var(--ease) both;
}

#article article:last-child {
  margin-bottom: 0;
}

#article article:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(255, 183, 3, 0.5);
}

#article article h3 {
  margin-top: 0;
}

#article article .meta {
  font-size: 0.82rem;
  color: var(--text-mute);
  letter-spacing: 0.3px;
}

#article article a {
  display: inline-block;
  margin-top: 4px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 999px;
  background: linear-gradient(120deg, rgba(255, 183, 3, 0.16), rgba(251, 133, 0, 0.16));
  color: var(--brand-2);
  text-decoration: none;
  transition: transform 0.25s var(--ease), background-color 0.25s var(--ease), color 0.25s var(--ease);
}

#article article a:hover {
  transform: translateX(4px);
  color: var(--text);
  background: linear-gradient(120deg, var(--brand), var(--brand-2));
}

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

#howto ol li {
  counter-increment: step;
  position: relative;
  padding: 14px 16px 14px 58px;
  margin: 10px 0;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: transform 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: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
  color: #1a1a2e;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 6px 14px rgba(255, 183, 3, 0.35);
}

#howto ol li:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow);
}

/* ============ FAQ ============ */
#faq details {
  margin: 10px 0;
  padding: 0;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
}

#faq details[open] {
  border-color: rgba(255, 183, 3, 0.55);
  box-shadow: var(--shadow);
}

#faq summary {
  cursor: pointer;
  padding: 15px 46px 15px 18px;
  font-weight: 700;
  color: var(--text);
  position: relative;
  list-style: none;
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease);
}

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

#faq summary::after {
  content: "+";
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 800;
  color: #1a1a2e;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  transition: transform 0.35s var(--ease);
}

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

#faq summary:hover {
  background: linear-gradient(120deg, rgba(255, 183, 3, 0.12), rgba(251, 133, 0, 0.08));
}

#faq details p {
  padding: 0 18px 16px;
  margin: 0;
  animation: fadeIn 0.4s var(--ease) both;
}

/* ============ Contact ============ */
#contact address {
  padding: 18px 20px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(255, 183, 3, 0.1), rgba(251, 133, 0, 0.06));
  border: 1px solid rgba(255, 183, 3, 0.28);
}

#contact address p {
  margin: 6px 0;
  color: var(--text-soft);
}

/* ============ Sitemap & Links ============ */
#sitemap ul,
#links ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

#sitemap li,
#links li {
  margin: 0;
}

#sitemap a,
#links a {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-soft);
  text-decoration: none;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease);
}

#sitemap a:hover,
#links a:hover {
  transform: translateY(-3px);
  color: var(--text);
  border-color: rgba(255, 183, 3, 0.6);
  box-shadow: var(--shadow);
  text-decoration: none;
}

/* ============ Footer ============ */
#site-footer {
  margin-top: 40px;
  padding: 40px 20px 30px;
  background: linear-gradient(180deg, rgba(26, 26, 46, 0.04), rgba(26, 26, 46, 0.1));
  border-top: 1px solid var(--line);
}

[data-theme="dark"] #site-footer {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.05));
}

.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  gap: 18px;
}

.footer-inner > p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-mute);
  text-align: center;
}

.footer-inner > p a {
  color: var(--text-soft);
  font-weight: 600;
}

.footer-inner section {
  padding: 16px 18px;
  background: var(--bg-elev);
  -webkit-backdrop-filter: var(--glass);
  backdrop-filter: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.footer-inner section:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.footer-inner section h3 {
  margin: 0 0 8px;
  font-size: 0.98rem;
}

.footer-inner section p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-mute);
}

/* ============ Back to top ============ */
#back-to-top {
  position: fixed;
  right: 20px;
  bottom: 24px;
  width: 46px;
  height: 46px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  color: #1a1a2e;
  font-size: 1.2rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 12px 26px rgba(255, 183, 3, 0.4);
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(0.9);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease), visibility 0.35s var(--ease), box-shadow 0.35s var(--ease);
  z-index: 90;
}

#back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

#back-to-top:hover {
  transform: translateY(-4px) scale(1.06);
  box-shadow: 0 18px 34px rgba(255, 183, 3, 0.55);
}

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

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

/* Scroll-reveal */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  will-change: opacity, transform;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@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;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ============ Responsive ============ */
@media (max-width: 1024px) {
  #main-nav ul {
    gap: 2px;
  }
  #main-nav a {
    padding: 7px 9px;
    font-size: 0.86rem;
  }
}

@media (max-width: 900px) {
  #menu-toggle {
    display: inline-flex;
    order: 3;
  }

  #dark-toggle {
    display: inline-flex;
    order: 4;
  }

  .logo {
    order: 1;
  }

  #main-nav {
    order: 5;
    flex-basis: 100%;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.45s var(--ease), opacity 0.35s var(--ease), margin 0.35s var(--ease);
  }

  #main-nav.is-open {
    max-height: 640px;
    opacity: 1;
    margin-top: 8px;
    padding-bottom: 12px;
  }

  #main-nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
  }

  #main-nav a {
    display: block;
    padding: 11px 14px;
    font-size: 0.95rem;
    border-radius: 10px;
    background: var(--bg-soft);
    border: 1px solid var(--line);
  }

  .header-inner {
    flex-wrap: wrap;
    padding: 10px 16px;
  }
}

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

  main {
    padding: 6px 14px 30px;
  }

  .breadcrumb {
    padding: 12px 14px 0;
  }

  .section {
    margin-top: 22px;
    padding: 22px 16px;
    border-radius: var(--radius);
  }

  .hero {
    padding: 24px 18px;
    border-radius: var(--radius);
  }

  h2 {
    padding-left: 14px;
    margin-bottom: 16px;
  }

  h2::before {
    width: 5px;
  }

  #article article {
    padding: 16px;
  }

  #howto ol li {
    padding: 12px 14px 12px 52px;
  }

  #faq summary {
    padding: 13px 44px 13px 14px;
    font-size: 0.95rem;
  }

  #faq details p {
    padding: 0 14px 14px;
  }

  .footer-inner section {
    padding: 14px;
  }

  #back-to-top {
    right: 14px;
    bottom: 16px;
    width: 42px;
    height: 42px;
  }
}

@media (max-width: 380px) {
  .logo-text {
    font-size: 1.05rem;
  }

  #sitemap a,
  #links a {
    padding: 7px 12px;
    font-size: 0.84rem;
  }
}