:root {
  --primary: #ff6b35;
  --primary-light: #ff8c5a;
  --primary-dark: #e55a2b;
  --secondary: #6c5ce7;
  --secondary-light: #a29bfe;
  --accent: #00cec9;
  --accent-light: #55efc4;
  --bg: #f8f9fc;
  --bg-card: #ffffff;
  --bg-card-hover: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.72);
  --bg-glass-border: rgba(255, 255, 255, 0.5);
  --bg-nav: rgba(255, 255, 255, 0.85);
  --text: #1a1a2e;
  --text-secondary: #4a4a6a;
  --text-muted: #8888a8;
  --border: #e8e8f0;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.12);
  --shadow-glow: 0 8px 32px rgba(255, 107, 53, 0.25);
  --radius-sm: 8px;
  --radius: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --max-width: 1200px;
  --header-height: 64px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0f1a;
    --bg-card: #1a1a2e;
    --bg-card-hover: #22223a;
    --bg-glass: rgba(26, 26, 46, 0.75);
    --bg-glass-border: rgba(255, 255, 255, 0.08);
    --bg-nav: rgba(15, 15, 26, 0.88);
    --text: #eaeaf0;
    --text-secondary: #b0b0c8;
    --text-muted: #70708a;
    --border: #2a2a40;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 8px 32px rgba(255, 107, 53, 0.35);
  }
}

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

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

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 60% at 10% 0%, rgba(255, 107, 53, 0.08), transparent),
    radial-gradient(ellipse 60% 50% at 90% 10%, rgba(108, 92, 231, 0.06), transparent),
    radial-gradient(ellipse 50% 40% at 50% 100%, rgba(0, 206, 201, 0.05), transparent);
  background-attachment: fixed;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--transition), color var(--transition);
}

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

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

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

::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: 4px;
}

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

header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg-nav);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--bg-glass-border);
  box-shadow: var(--shadow-sm);
  transition: background var(--transition), box-shadow var(--transition);
}

header nav {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

header nav ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  list-style: none;
  min-height: var(--header-height);
  padding: 8px 0;
}

header nav ul li {
  flex-shrink: 0;
}

header nav ul li a {
  display: inline-block;
  padding: 6px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 100px;
  white-space: nowrap;
  transition: all var(--transition);
  position: relative;
}

header nav ul li a::after {
  content: "";
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 60%;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
  transition: transform var(--transition);
}

header nav ul li a:hover {
  color: var(--primary);
  background: rgba(255, 107, 53, 0.08);
}

header nav ul li a:hover::after {
  transform: translateX(-50%) scaleX(1);
}

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px 80px;
}

main > article {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

h1 {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-top: 40px;
  padding: 48px 40px;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, #ff6b35 0%, #ff8c5a 25%, #6c5ce7 75%, #a29bfe 100%);
  background-size: 200% 200%;
  animation: gradientShift 8s ease infinite;
  color: #ffffff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-glow);
}

h1::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 40%, rgba(255, 255, 255, 0.15), transparent 60%);
  animation: shimmer 6s ease-in-out infinite;
  pointer-events: none;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

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

section {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 40px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition), background var(--transition);
  position: relative;
  overflow: hidden;
}

section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent));
  opacity: 0;
  transition: opacity var(--transition);
}

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

section:hover::before {
  opacity: 1;
}

section h2 {
  font-size: clamp(1.25rem, 2.5vw, 1.65rem);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--border);
  position: relative;
  letter-spacing: -0.01em;
}

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

section h3 {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  font-weight: 600;
  color: var(--text);
  margin: 28px 0 12px;
  padding-left: 16px;
  position: relative;
  line-height: 1.4;
}

section h3::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 4px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--primary), var(--secondary));
}

section h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 20px 0 8px;
}

section p {
  color: var(--text-secondary);
  margin-bottom: 14px;
  line-height: 1.85;
  font-size: 15px;
}

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

section ul,
section ol {
  padding-left: 0;
  list-style: none;
  margin-bottom: 14px;
}

section ul li {
  position: relative;
  padding: 6px 0 6px 24px;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.75;
}

section ul li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 15px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  box-shadow: 0 0 8px rgba(255, 107, 53, 0.3);
}

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

section a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition);
  position: relative;
}

section a::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--primary);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--transition);
}

section a:hover {
  color: var(--primary-dark);
}

section a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

blockquote {
  margin: 16px 0;
  padding: 20px 24px;
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius) var(--radius) 0;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}

blockquote:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow);
}

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

article article {
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--bg-glass-border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

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

article article h3 {
  margin-top: 0;
  font-size: 1.1rem;
}

article article p {
  font-size: 14px;
}

#faq h3 {
  margin-top: 24px;
  padding: 16px 20px 16px 36px;
  background: var(--bg-glass);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: var(--radius-sm);
  border: 1px solid var(--bg-glass-border);
  transition: background var(--transition), border-color var(--transition);
}

#faq h3:hover {
  background: rgba(255, 107, 53, 0.06);
  border-color: rgba(255, 107, 53, 0.25);
}

#faq h3::before {
  top: 50%;
  transform: translateY(-50%);
  height: 60%;
}

#howto h4 {
  color: var(--primary);
  font-weight: 700;
  display: inline-block;
  padding: 4px 14px;
  background: rgba(255, 107, 53, 0.08);
  border-radius: 100px;
  font-size: 14px;
  margin-top: 24px;
}

#contact ul {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

#contact ul li {
  padding: 14px 18px;
  background: var(--bg-glass);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--bg-glass-border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  word-break: break-all;
}

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

#contact ul li:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: rgba(255, 107, 53, 0.3);
}

#sitemap ul {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}

#sitemap ul li {
  padding: 10px 16px;
  background: var(--bg-glass);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--bg-glass-border);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

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

#sitemap ul li a {
  display: block;
  width: 100%;
  font-size: 14px;
}

#sitemap ul li:hover {
  background: rgba(255, 107, 53, 0.08);
  border-color: rgba(255, 107, 53, 0.3);
  transform: translateX(4px);
}

#links ul {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

#links ul li {
  padding: 0;
}

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

#links ul li a {
  display: inline-block;
  padding: 8px 20px;
  background: var(--bg-glass);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--bg-glass-border);
  border-radius: 100px;
  font-size: 14px;
  transition: all var(--transition);
}

#links ul li a::after {
  display: none;
}

#links ul li a:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

#author-info {
  background: linear-gradient(135deg, rgba(255, 107, 53, 0.06), rgba(108, 92, 231, 0.06));
}

#legal h2 {
  margin-top: 32px;
}

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

footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 48px 24px;
  text-align: center;
  transition: background var(--transition), border-color var(--transition);
}

footer p {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 2;
  margin-bottom: 4px;
}

footer p:first-child {
  color: var(--text-secondary);
  font-weight: 500;
}

footer p:last-child {
  margin-bottom: 0;
}

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

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

@supports (animation-timeline: view()) {
  section {
    animation: fadeInUp 0.7s ease both;
    animation-timeline: view();
    animation-range: entry 0% entry 30%;
  }

  article article {
    animation: fadeInUp 0.6s ease both;
    animation-timeline: view();
    animation-range: entry 0% entry 25%;
  }

  blockquote {
    animation: fadeIn 0.6s ease both;
    animation-timeline: view();
    animation-range: entry 0% entry 30%;
  }
}

@media (max-width: 768px) {
  :root {
    --header-height: 56px;
  }

  header nav {
    padding: 0 12px;
  }

  header nav ul {
    gap: 2px;
    padding: 6px 0;
    min-height: auto;
  }

  header nav ul li a {
    padding: 5px 10px;
    font-size: 12.5px;
  }

  main {
    padding: 0 12px 60px;
  }

  main > article {
    gap: 20px;
  }

  h1 {
    font-size: 1.5rem;
    padding: 32px 20px;
    margin-top: 20px;
    border-radius: var(--radius-lg);
  }

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

  section h2 {
    font-size: 1.15rem;
    margin-bottom: 18px;
    padding-bottom: 12px;
  }

  section h3 {
    font-size: 1rem;
    margin: 22px 0 10px;
  }

  section p {
    font-size: 14px;
    line-height: 1.8;
  }

  section ul li {
    font-size: 14px;
    padding: 4px 0 4px 22px;
  }

  section ul li::before {
    width: 6px;
    height: 6px;
    top: 13px;
  }

  blockquote {
    padding: 16px 18px;
  }

  article article {
    padding: 18px;
  }

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

  #sitemap ul {
    grid-template-columns: repeat(2, 1fr);
  }

  #faq h3 {
    padding: 12px 16px 12px 30px;
    font-size: 0.95rem;
  }

  footer {
    padding: 36px 16px;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.3rem;
    padding: 28px 16px;
  }

  section {
    padding: 20px 14px;
  }

  section h2 {
    font-size: 1.05rem;
  }

  header nav ul li a {
    padding: 4px 8px;
    font-size: 12px;
  }

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

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

@media print {
  header,
  footer {
    display: none;
  }

  body {
    background: #fff;
    color: #000;
    font-size: 12pt;
  }

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

  h1 {
    background: none;
    color: #000;
    text-shadow: none;
    box-shadow: none;
    padding: 0;
    margin-top: 0;
  }
}