:root {
  --orange: #FF6B35;
  --orange-light: #FF8C5A;
  --orange-dark: #E55A2B;
  --green: #2E8B57;
  --bg: #FFF9F5;
  --bg-card: #FFFFFF;
  --bg-elevated: #FFFFFF;
  --text: #1A1A2E;
  --text-secondary: #5A5A6E;
  --text-muted: #8E8E9E;
  --border: rgba(255, 107, 53, 0.12);
  --shadow-sm: 0 2px 8px rgba(255, 107, 53, 0.06);
  --shadow-md: 0 4px 20px rgba(255, 107, 53, 0.1);
  --shadow-lg: 0 8px 40px rgba(255, 107, 53, 0.15);
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(255, 255, 255, 0.5);
  --glass-blur: 16px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121218;
    --bg-card: #1C1C26;
    --bg-elevated: #24242F;
    --text: #F0F0F5;
    --text-secondary: #B0B0C0;
    --text-muted: #7A7A8E;
    --border: rgba(255, 107, 53, 0.18);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --glass-bg: rgba(28, 28, 38, 0.78);
    --glass-border: rgba(255, 255, 255, 0.08);
  }
}

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

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

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

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse 80% 50% at 20% 0%, rgba(255, 107, 53, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 90% 100%, rgba(46, 139, 87, 0.04) 0%, transparent 60%);
  pointer-events: none;
  z-index: -1;
}

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

a {
  color: var(--orange);
  text-decoration: none;
  transition: color var(--transition), opacity var(--transition);
}

a:hover {
  color: var(--orange-dark);
  opacity: 0.85;
}

a:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 3px;
  border-radius: 4px;
}

ul, ol {
  list-style: none;
}

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

h1 { font-size: clamp(1.6rem, 4vw, 2.6rem); }
h2 { font-size: clamp(1.35rem, 3vw, 1.9rem); }
h3 { font-size: clamp(1.1rem, 2.2vw, 1.35rem); }

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

strong {
  color: var(--text);
  font-weight: 600;
}

blockquote {
  border-left: 4px solid var(--orange);
  background: var(--bg-card);
  padding: 1rem 1.25rem;
  margin: 1rem 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  box-shadow: var(--shadow-sm);
}

blockquote p {
  margin-bottom: 0;
  font-style: italic;
  color: var(--text-secondary);
}

/* ============ HEADER ============ */

header[role="banner"] {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem clamp(1rem, 4vw, 3rem);
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-bottom: 1px solid var(--glass-border);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), background var(--transition);
}

header[role="banner"]:hover {
  box-shadow: var(--shadow-md);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.brand svg {
  width: 40px;
  height: 40px;
  transition: transform var(--transition);
}

.brand:hover svg {
  transform: rotate(-8deg) scale(1.06);
}

.brand span {
  font-size: 1.25rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--orange), var(--orange-light));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

header nav[aria-label="主导航"] {
  flex: 1;
  display: flex;
  justify-content: flex-end;
}

header nav[aria-label="主导航"] ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.25rem;
  justify-content: flex-end;
}

header nav[aria-label="主导航"] a {
  display: inline-block;
  padding: 0.4rem 0.7rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  position: relative;
  transition: color var(--transition), background var(--transition);
}

header nav[aria-label="主导航"] a::after {
  content: "";
  position: absolute;
  bottom: 2px;
  left: 50%;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--orange), var(--orange-light));
  border-radius: 2px;
  transform: translateX(-50%);
  transition: width var(--transition);
}

header nav[aria-label="主导航"] a:hover {
  color: var(--orange);
  background: rgba(255, 107, 53, 0.06);
  opacity: 1;
}

header nav[aria-label="主导航"] a:hover::after {
  width: 60%;
}

/* ============ BREADCRUMB ============ */

nav[aria-label="面包屑导航"] {
  padding: 0.75rem clamp(1rem, 4vw, 3rem);
  max-width: 1200px;
  margin: 0 auto;
}

nav[aria-label="面包屑导航"] ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
}

nav[aria-label="面包屑导航"] li {
  color: var(--text-muted);
}

nav[aria-label="面包屑导航"] li + li::before {
  content: "›";
  margin-right: 0.4rem;
  color: var(--text-muted);
  font-weight: 600;
}

nav[aria-label="面包屑导航"] a {
  color: var(--text-secondary);
}

nav[aria-label="面包屑导航"] a:hover {
  color: var(--orange);
}

/* ============ MAIN LAYOUT ============ */

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 3rem) 3rem;
}

main > section {
  margin-bottom: 2.5rem;
  animation: fadeInUp 0.6s ease both;
}

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

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

main > section:not(#hero) {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(1.25rem, 3vw, 2.5rem);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}

main > section:not(#hero):hover {
  box-shadow: var(--shadow-md);
}

main > section h2 {
  position: relative;
  padding-bottom: 0.6rem;
  margin-bottom: 1.25rem;
}

main > section h2::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 48px;
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--orange), var(--orange-light));
}

main > section h3 {
  margin-top: 1.5rem;
  margin-bottom: 0.6rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

main > section h3::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--orange);
  flex-shrink: 0;
}

main > section ul,
main > section ol {
  padding-left: 0;
  margin-bottom: 1rem;
}

main > section ul li,
main > section ol li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

main > section ul li::before {
  content: "";
  position: absolute;
  left: 0.25rem;
  top: 0.65em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--orange), var(--orange-light));
}

main > section ol {
  counter-reset: item;
}

main > section ol li {
  counter-increment: item;
}

main > section ol li::before {
  content: counter(item);
  position: absolute;
  left: 0;
  top: 0.15em;
  width: 1.2rem;
  height: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--orange), var(--orange-light));
  border-radius: 50%;
}

/* ============ HERO ============ */

#hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  padding: clamp(2rem, 5vw, 4rem) clamp(1.5rem, 4vw, 3rem);
  background: linear-gradient(135deg, #FF6B35 0%, #FF8C5A 40%, #FFA07A 70%, #FFB88C 100%);
  color: #fff;
  margin-top: 0.5rem;
  box-shadow: var(--shadow-lg);
}

#hero::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -20%;
  width: 60%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

#hero::after {
  content: "";
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 50%;
  height: 100%;
  background: radial-gradient(circle, rgba(46, 139, 87, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

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

#hero p {
  position: relative;
  z-index: 1;
  color: rgba(255, 255, 255, 0.92);
  max-width: 800px;
  font-size: 1rem;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

#hero p:last-of-type {
  margin-bottom: 1.5rem;
}

/* ============ CAROUSEL ============ */

.banner-carousel {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  padding: 0.5rem 0 0.75rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.banner-carousel::-webkit-scrollbar {
  display: none;
}

.banner-carousel .slide {
  flex: 0 0 auto;
  scroll-snap-align: start;
  padding: 0.75rem 1.25rem;
  background: rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  transition: transform var(--transition), background var(--transition), box-shadow var(--transition);
  cursor: default;
}

.banner-carousel .slide:hover {
  transform: translateY(-3px) scale(1.02);
  background: rgba(255, 255, 255, 0.35);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* ============ ARTICLES ============ */

#articles article {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.35rem;
  margin-bottom: 1rem;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

#articles article:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: rgba(255, 107, 53, 0.3);
}

#articles article h3 {
  margin-top: 0;
  font-size: 1.05rem;
}

#articles article h3::before {
  display: none;
}

#articles article p {
  font-size: 0.9rem;
  margin-bottom: 0.6rem;
}

#articles article a {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  background: rgba(255, 107, 53, 0.08);
  transition: background var(--transition), color var(--transition), transform var(--transition);
}

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

#articles article a:hover {
  background: var(--orange);
  color: #fff;
  opacity: 1;
}

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

/* ============ FAQ ============ */

#faq h3 {
  margin-top: 1.25rem;
  padding: 0.6rem 0.9rem;
  background: rgba(255, 107, 53, 0.05);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--orange);
  transition: background var(--transition);
}

#faq h3::before {
  display: none;
}

#faq h3:hover {
  background: rgba(255, 107, 53, 0.1);
}

#faq p {
  padding-left: 0.9rem;
  font-size: 0.925rem;
}

/* ============ HOWTO ============ */

#howto ol {
  counter-reset: step;
}

#howto ol li {
  counter-increment: step;
  padding-left: 2rem;
  margin-bottom: 0.65rem;
}

#howto ol li::before {
  content: counter(step);
  width: 1.4rem;
  height: 1.4rem;
  font-size: 0.75rem;
}

/* ============ CONTACT ============ */

#contact ul li {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

#contact ul li::before {
  content: "▸";
  background: none;
  width: auto;
  height: auto;
  border-radius: 0;
  color: var(--orange);
  font-size: 0.8rem;
  top: 0;
  left: 0.15rem;
}

/* ============ SITEMAP & LINKS ============ */

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

#sitemap ul li,
#links ul li {
  padding-left: 0;
  margin-bottom: 0;
}

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

#sitemap ul a,
#links ul a {
  display: inline-block;
  padding: 0.4rem 1rem;
  font-size: 0.875rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-secondary);
  transition: all var(--transition);
}

#sitemap ul a:hover,
#links ul a:hover {
  background: var(--orange);
  color: #fff;
  border-color: var(--orange);
  opacity: 1;
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

/* ============ FOOTER ============ */

footer[role="contentinfo"] {
  background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg) 100%);
  border-top: 1px solid var(--border);
  padding: clamp(1.5rem, 4vw, 3rem) clamp(1rem, 4vw, 3rem);
  margin-top: 1rem;
}

footer[role="contentinfo"] section {
  max-width: 1200px;
  margin: 0 auto 1.5rem;
}

footer[role="contentinfo"] h2 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  color: var(--text);
}

footer[role="contentinfo"] p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

footer[role="contentinfo"] > p:last-child {
  max-width: 1200px;
  margin: 1.5rem auto 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

/* ============ SCROLL ANIMATIONS ============ */

@supports (animation-timeline: view()) {
  main > section {
    animation: fadeInUp 0.6s ease both;
    animation-timeline: view();
    animation-range: entry 0% entry 40%;
  }
}

/* ============ RESPONSIVE ============ */

@media (max-width: 900px) {
  header[role="banner"] {
    flex-wrap: wrap;
    padding: 0.6rem 1rem;
  }

  header nav[aria-label="主导航"] {
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  header nav[aria-label="主导航"]::-webkit-scrollbar {
    display: none;
  }

  header nav[aria-label="主导航"] ul {
    flex-wrap: nowrap;
    gap: 0;
    padding-bottom: 0.25rem;
  }

  header nav[aria-label="主导航"] a {
    white-space: nowrap;
    font-size: 0.8rem;
    padding: 0.35rem 0.55rem;
  }
}

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

  main > section:not(#hero) {
    border-radius: var(--radius-md);
    padding: 1.1rem;
    margin-bottom: 1.5rem;
  }

  #hero {
    border-radius: var(--radius-lg);
    padding: 1.75rem 1.25rem;
  }

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

  #hero p {
    font-size: 0.9rem;
  }

  .banner-carousel .slide {
    font-size: 0.8rem;
    padding: 0.6rem 1rem;
  }

  #articles article {
    padding: 1rem;
  }

  #faq h3 {
    font-size: 0.95rem;
  }

  blockquote {
    padding: 0.85rem 1rem;
  }

  footer[role="contentinfo"] {
    padding: 1.5rem 1rem;
  }
}

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

  .brand svg {
    width: 32px;
    height: 32px;
  }
}

/* ============ REDUCED MOTION ============ */

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

/* ============ PRINT ============ */

@media print {
  header[role="banner"],
  nav[aria-label="面包屑导航"],
  footer[role="contentinfo"] {
    display: none;
  }

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

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

  #hero {
    background: #f5f5f5;
    color: #000;
  }

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

/* ============ SELECTION ============ */

::selection {
  background: rgba(255, 107, 53, 0.25);
  color: var(--text);
}

/* ============ SCROLLBAR ============ */

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

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

::-webkit-scrollbar-thumb {
  background: rgba(255, 107, 53, 0.3);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 107, 53, 0.5);
}