:root {
  --primary: #1a73e8;
  --primary-dark: #0d47a1;
  --primary-light: #4a9eff;
  --accent: #ff6b35;
  --accent-dark: #e55a2b;
  --success: #00b894;
  --warning: #fdcb6e;
  --danger: #e74c3c;
  --bg: #f5f7fa;
  --bg-alt: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.72);
  --bg-glass: rgba(255, 255, 255, 0.55);
  --bg-glass-border: rgba(255, 255, 255, 0.65);
  --text: #1a1a2e;
  --text-secondary: #4a4a6a;
  --text-muted: #8888a0;
  --border: rgba(0, 0, 0, 0.08);
  --shadow-sm: 0 2px 8px rgba(26, 115, 232, 0.06);
  --shadow-md: 0 8px 24px rgba(26, 115, 232, 0.1);
  --shadow-lg: 0 16px 48px rgba(26, 115, 232, 0.14);
  --shadow-xl: 0 24px 64px rgba(26, 115, 232, 0.18);
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-mono: "SF Mono", "Fira Code", "Fira Mono", "Roboto Mono", monospace;
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  --gradient-hero: linear-gradient(135deg, #1a73e8 0%, #6c5ce7 40%, #ff6b35 100%);
  --gradient-card: linear-gradient(135deg, rgba(26, 115, 232, 0.06) 0%, rgba(255, 107, 53, 0.06) 100%);
  --gradient-accent: linear-gradient(135deg, #ff6b35 0%, #fdcb6e 100%);
  --gradient-success: linear-gradient(135deg, #00b894 0%, #55efc4 100%);
  --gradient-cool: linear-gradient(135deg, #6c5ce7 0%, #a29bfe 100%);
  --max-width: 1200px;
  --header-height: 72px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary: #4a9eff;
    --primary-dark: #1a73e8;
    --primary-light: #7bb8ff;
    --accent: #ff8a5c;
    --accent-dark: #ff6b35;
    --success: #55efc4;
    --warning: #ffeaa7;
    --danger: #ff7675;
    --bg: #0f0f1a;
    --bg-alt: #1a1a2e;
    --bg-card: rgba(30, 30, 52, 0.72);
    --bg-glass: rgba(30, 30, 52, 0.55);
    --bg-glass-border: rgba(255, 255, 255, 0.08);
    --text: #e8e8f0;
    --text-secondary: #b0b0c8;
    --text-muted: #6a6a88;
    --border: rgba(255, 255, 255, 0.08);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 24px 64px rgba(0, 0, 0, 0.6);
    --gradient-hero: linear-gradient(135deg, #0d47a1 0%, #4a2d8a 40%, #b8451a 100%);
    --gradient-card: linear-gradient(135deg, rgba(74, 158, 255, 0.08) 0%, rgba(255, 138, 92, 0.08) 100%);
  }
}

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

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse at 20% 0%, rgba(26, 115, 232, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 100%, rgba(255, 107, 53, 0.05) 0%, transparent 60%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-height: 100vh;
}

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

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

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

::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: 5px;
  border: 2px solid var(--bg);
}

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

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-fast), opacity var(--transition-fast);
  position: relative;
}

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

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

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

ul, ol {
  list-style: none;
}

address {
  font-style: normal;
}

/* ===== Header ===== */
header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg-glass);
  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-base), box-shadow var(--transition-base);
}

header nav {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  gap: 16px;
}

header nav > a:first-child {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: var(--gradient-hero);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  white-space: nowrap;
  flex-shrink: 0;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

header nav > a:first-child:hover {
  opacity: 0.85;
  transform: scale(1.02);
  -webkit-text-fill-color: transparent;
}

header nav ul {
  display: flex;
  align-items: center;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  flex-wrap: nowrap;
  padding: 4px 0;
  -webkit-overflow-scrolling: touch;
}

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

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

header nav ul li a {
  display: block;
  padding: 8px 14px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  white-space: nowrap;
  transition: all var(--transition-fast);
  position: relative;
}

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

header nav ul li a:hover {
  color: var(--primary);
  background: rgba(26, 115, 232, 0.06);
}

header nav ul li a:hover::after {
  width: 60%;
}

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

section {
  padding: 56px 0;
  scroll-margin-top: calc(var(--header-height) + 16px);
  opacity: 0;
  transform: translateY(32px);
  animation: fadeInUp 0.7s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

section:nth-child(1) { animation-delay: 0.05s; }
section:nth-child(2) { animation-delay: 0.1s; }
section:nth-child(3) { animation-delay: 0.15s; }
section:nth-child(4) { animation-delay: 0.2s; }
section:nth-child(5) { animation-delay: 0.25s; }
section:nth-child(6) { animation-delay: 0.3s; }
section:nth-child(7) { animation-delay: 0.35s; }
section:nth-child(8) { animation-delay: 0.4s; }
section:nth-child(9) { animation-delay: 0.45s; }
section:nth-child(10) { animation-delay: 0.5s; }
section:nth-child(11) { animation-delay: 0.55s; }
section:nth-child(12) { animation-delay: 0.6s; }
section:nth-child(13) { animation-delay: 0.65s; }
section:nth-child(14) { animation-delay: 0.7s; }
section:nth-child(15) { animation-delay: 0.75s; }
section:nth-child(16) { animation-delay: 0.8s; }
section:nth-child(17) { animation-delay: 0.85s; }
section:nth-child(18) { animation-delay: 0.9s; }
section:nth-child(19) { animation-delay: 0.95s; }
section:nth-child(20) { animation-delay: 1s; }
section:nth-child(21) { animation-delay: 1.05s; }
section:nth-child(22) { animation-delay: 1.1s; }

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

/* ===== Hero ===== */
#hero {
  position: relative;
  margin-top: 32px;
  padding: 64px 48px;
  border-radius: var(--radius-xl);
  background: var(--gradient-hero);
  background-size: 200% 200%;
  animation: fadeInUp 0.7s cubic-bezier(0.4, 0, 0.2, 1) forwards, gradientShift 12s ease infinite;
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  color: #fff;
}

#hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 15% 25%, rgba(255, 255, 255, 0.18) 0%, transparent 45%),
    radial-gradient(circle at 85% 75%, rgba(255, 255, 255, 0.12) 0%, transparent 45%);
  pointer-events: none;
}

#hero::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
  pointer-events: none;
  animation: float 8s ease-in-out infinite;
}

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

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

#hero > * {
  position: relative;
  z-index: 1;
}

#hero h1 {
  font-size: clamp(1.6rem, 4vw, 2.75rem);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.03em;
  margin-bottom: 24px;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.15);
  color: #fff;
}

#hero p {
  font-size: 1.05rem;
  line-height: 1.85;
  color: rgba(255, 255, 255, 0.92);
  margin-bottom: 20px;
  max-width: 860px;
}

#hero figure {
  margin-top: 40px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
  transition: transform var(--transition-slow), box-shadow var(--transition-slow);
}

#hero figure:hover {
  transform: translateY(-6px) scale(1.01);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

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

#hero figcaption {
  padding: 16px 24px;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.85);
  text-align: center;
  background: rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* ===== Section Headings ===== */
section h2 {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.02em;
  margin-bottom: 28px;
  position: relative;
  padding-left: 20px;
  color: var(--text);
}

section h2::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.15em;
  bottom: 0.15em;
  width: 5px;
  border-radius: 3px;
  background: var(--gradient-accent);
  box-shadow: 0 0 16px rgba(255, 107, 53, 0.4);
}

section h3 {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.4;
  margin: 28px 0 12px;
  color: var(--text);
  letter-spacing: -0.01em;
  transition: color var(--transition-fast);
}

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

section > p {
  color: var(--text-secondary);
  margin-bottom: 18px;
  font-size: 1rem;
  line-height: 1.85;
}

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

/* ===== Lists ===== */
section ul,
section ol {
  margin: 16px 0 24px;
  padding-left: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

section ul li,
section ol li {
  position: relative;
  padding: 12px 18px 12px 44px;
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast);
}

section ul li::before {
  content: '';
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gradient-accent);
  box-shadow: 0 0 10px rgba(255, 107, 53, 0.5);
}

section ol {
  counter-reset: item;
}

section ol li {
  counter-increment: item;
  padding-left: 52px;
}

section ol li::before {
  content: counter(item);
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--gradient-hero);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(26, 115, 232, 0.35);
}

section ul li:hover,
section ol li:hover {
  transform: translateX(6px);
  border-color: rgba(26, 115, 232, 0.25);
  box-shadow: var(--shadow-md);
  background: var(--bg-alt);
}

section ul li strong,
section ol li strong {
  color: var(--primary);
  font-weight: 700;
}

/* ===== Blockquote ===== */
blockquote {
  position: relative;
  margin: 20px 0;
  padding: 24px 28px 24px 56px;
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--bg-glass-border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
}

blockquote::before {
  content: '\201C';
  position: absolute;
  left: 16px;
  top: 8px;
  font-size: 3.5rem;
  line-height: 1;
  font-family: Georgia, serif;
  color: var(--primary);
  opacity: 0.25;
  pointer-events: none;
}

blockquote:hover {
  transform: translateY(-4px) scale(1.005);
  box-shadow: var(--shadow-lg);
  border-left-color: var(--accent);
}

blockquote p {
  font-size: 1rem;
  line-height: 1.85;
  color: var(--text-secondary);
  margin-bottom: 12px;
  font-style: italic;
}

blockquote cite {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary);
  font-style: normal;
  text-align: right;
}

/* ===== Articles ===== */
article {
  position: relative;
  margin: 20px 0;
  padding: 24px 28px;
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base), background var(--transition-base);
  overflow: hidden;
}

article::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-hero);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition-slow);
}

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

article:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(26, 115, 232, 0.2);
  background: var(--bg-alt);
}

article h3 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 1.1rem;
  transition: color var(--transition-fast);
}

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

article p {
  font-size: 0.925rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 10px;
}

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

article p a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--primary);
  padding: 6px 16px;
  border-radius: 100px;
  background: rgba(26, 115, 232, 0.08);
  transition: all var(--transition-fast);
}

article p a::after {
  content: '\2192';
  transition: transform var(--transition-fast);
}

article p a:hover {
  background: var(--primary);
  color: #fff;
  transform: translateX(4px);
  box-shadow: 0 4px 16px rgba(26, 115, 232, 0.35);
}

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

/* ===== FAQ ===== */
#faq h3 {
  position: relative;
  padding: 18px 24px 18px 52px;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  margin-bottom: 0;
  cursor: default;
  transition: all var(--transition-base);
  font-size: 1.05rem;
}

#faq h3::before {
  content: 'Q';
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--gradient-hero);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(26, 115, 232, 0.3);
}

#faq h3 + p {
  position: relative;
  padding: 18px 24px 18px 52px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  margin-bottom: 16px;
  font-size: 0.925rem;
  color: var(--text-secondary);
  line-height: 1.8;
  transition: all var(--transition-base);
}

#faq h3 + p::before {
  content: 'A';
  position: absolute;
  left: 18px;
  top: 22px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--gradient-success);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 184, 148, 0.3);
}

#faq h3:hover {
  background: var(--bg-alt);
  color: var(--primary);
  border-color: rgba(26, 115, 232, 0.2);
}

#faq h3:hover + p {
  border-color: rgba(26, 115, 232, 0.2);
  box-shadow: var(--shadow-md);
}

/* ===== Address ===== */
address {
  margin: 20px 0;
  padding: 24px 28px;
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: box-shadow var(--transition-base), transform var(--transition-base);
}

address:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

address p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

address p:first-child {
  font-weight: 700;
  color: var(--text);
  font-size: 1rem;
}

address a {
  font-weight: 600;
  color: var(--primary);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: rgba(26, 115, 232, 0.06);
  transition: all var(--transition-fast);
}

address a:hover {
  background: var(--primary);
  color: #fff;
  transform: translateX(2px);
}

/* ===== Sitemap Grid ===== */
#sitemap ul {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

#sitemap ul li {
  padding: 14px 18px;
  text-align: center;
  padding-left: 18px;
}

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

#sitemap ul li a {
  display: block;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.9rem;
  transition: color var(--transition-fast), transform var(--transition-fast);
}

#sitemap ul li:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  background: var(--gradient-card);
  box-shadow: var(--shadow-md);
}

#sitemap ul li:hover a {
  color: var(--primary);
}

/* ===== Links ===== */
#links ul {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

#links ul li {
  padding: 10px 20px;
  padding-left: 20px;
  border-radius: 100px;
  font-size: 0.9rem;
}

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

#links ul li a {
  color: var(--text-secondary);
  font-weight: 500;
}

#links ul li:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  background: var(--gradient-accent);
  box-shadow: 0 6px 20px rgba(255, 107, 53, 0.3);
}

#links ul li:hover a {
  color: #fff;
}

/* ===== Footer ===== */
footer {
  position: relative;
  margin-top: 40px;
  padding: 48px 24px 32px;
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  text-align: center;
}

footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-hero);
}

footer nav ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 4px;
  margin-bottom: 28px;
}

footer nav ul li a {
  display: block;
  padding: 8px 16px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: 100px;
  transition: all var(--transition-fast);
}

footer nav ul li a:hover {
  color: #fff;
  background: var(--gradient-hero);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(26, 115, 232, 0.3);
}

footer p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  line-height: 1.7;
}

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

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  :root {
    --header-height: 64px;
  }

  main {
    padding: 0 20px 64px;
  }

  #hero {
    padding: 48px 36px;
  }

  section {
    padding: 44px 0;
  }
}

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

  body {
    font-size: 15px;
    line-height: 1.7;
  }

  header nav {
    padding: 0 16px;
    gap: 12px;
  }

  header nav > a:first-child {
    font-size: 1.15rem;
  }

  header nav ul li a {
    padding: 6px 10px;
    font-size: 0.8rem;
  }

  main {
    padding: 0 16px 56px;
  }

  #hero {
    margin-top: 20px;
    padding: 36px 24px;
    border-radius: var(--radius-lg);
  }

  #hero h1 {
    font-size: 1.5rem;
    margin-bottom: 18px;
  }

  #hero p {
    font-size: 0.95rem;
    line-height: 1.8;
  }

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

  #hero figcaption {
    padding: 12px 16px;
    font-size: 0.8rem;
  }

  section {
    padding: 36px 0;
  }

  section h2 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    padding-left: 16px;
  }

  section h2::before {
    width: 4px;
  }

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

  section ul li,
  section ol li {
    padding: 10px 14px 10px 38px;
    font-size: 0.9rem;
  }

  section ol li {
    padding-left: 46px;
  }

  section ul li::before {
    left: 14px;
    width: 8px;
    height: 8px;
  }

  section ol li::before {
    left: 10px;
    width: 24px;
    height: 24px;
    font-size: 0.7rem;
  }

  blockquote {
    padding: 20px 20px 20px 48px;
  }

  blockquote::before {
    font-size: 2.8rem;
    left: 12px;
  }

  blockquote p {
    font-size: 0.925rem;
  }

  article {
    padding: 20px 20px;
  }

  article h3 {
    font-size: 1rem;
  }

  article p {
    font-size: 0.875rem;
  }

  #faq h3 {
    padding: 14px 18px 14px 46px;
    font-size: 0.95rem;
  }

  #faq h3::before {
    left: 14px;
    width: 22px;
    height: 22px;
    font-size: 0.65rem;
  }

  #faq h3 + p {
    padding: 14px 18px 14px 46px;
    font-size: 0.875rem;
  }

  #faq h3 + p::before {
    left: 14px;
    top: 18px;
    width: 22px;
    height: 22px;
    font-size: 0.65rem;
  }

  address {
    padding: 20px 20px;
    border-radius: var(--radius-md);
  }

  address p {
    font-size: 0.875rem;
  }

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

  #sitemap ul li {
    padding: 10px 12px;
  }

  #sitemap ul li a {
    font-size: 0.82rem;
  }

  #links ul {
    gap: 8px;
  }

  #links ul li {
    padding: 8px 16px;
    font-size: 0.82rem;
  }

  footer {
    padding: 36px 16px 24px;
  }

  footer nav ul {
    gap: 6px 2px;
    margin-bottom: 20px;
  }

  footer nav ul li a {
    padding: 6px 12px;
    font-size: 0.8rem;
  }

  footer p {
    font-size: 0.78rem;
  }
}

@media (max-width: 480px) {
  #hero {
    padding: 28px 18px;
    border-radius: var(--radius-md);
  }

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

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

  section h2 {
    font-size: 1.2rem;
  }

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

  #links ul li {
    padding: 7px 14px;
    font-size: 0.78rem;
  }
}

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

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

  section {
    opacity: 1;
    transform: none;
    animation: none;
    page-break-inside: avoid;
  }

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

/* ===== Accessibility ===== */
@media (prefers-contrast: high) {
  :root {
    --text: #000;
    --text-secondary: #222;
    --border: rgba(0, 0, 0, 0.3);
  }

  header nav ul li a,
  section ul li,
  section ol li {
    border-width: 2px;
  }
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
}

/* ===== Scroll-driven reveal (progressive enhancement) ===== */
@supports (animation-timeline: view()) {
  section {
    animation: fadeInUp 0.7s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    animation-timeline: view();
    animation-range: entry 0% entry 30%;
  }
}

/* ===== Hover lift utility for glass cards ===== */
section ul li,
section ol li,
article,
blockquote,
address,
#sitemap ul li,
#links ul li {
  will-change: transform, box-shadow;
}

/* ===== Smooth hover for all interactive cards ===== */
@media (hover: hover) {
  section ul li:hover,
  section ol li:hover {
    background: var(--bg-alt);
  }

  article:hover {
    background: var(--bg-alt);
  }
}

/* ===== Dark mode explicit toggle support ===== */
@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
  }

  #hero {
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
  }

  #hero figure {
    border-color: rgba(255, 255, 255, 0.1);
  }

  article::before {
    opacity: 0.9;
  }
}