:root {
  --primary: #1a2a6c;
  --primary-light: #2d4a9e;
  --primary-dark: #0f1a45;
  --accent: #f5a623;
  --accent-2: #2ec4b6;
  --accent-3: #e71d36;
  --gradient-1: linear-gradient(135deg, #1a2a6c 0%, #2d4a9e 50%, #4a6dd4 100%);
  --gradient-2: linear-gradient(135deg, #f5a623 0%, #e71d36 100%);
  --gradient-3: linear-gradient(120deg, #2ec4b6 0%, #1a2a6c 100%);
  --bg: #f7f8fc;
  --bg-elevated: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-glass: rgba(255, 255, 255, 0.65);
  --text: #1c2333;
  --text-secondary: #4a5568;
  --text-muted: #718096;
  --border: rgba(26, 42, 108, 0.12);
  --border-strong: rgba(26, 42, 108, 0.24);
  --shadow-sm: 0 2px 8px rgba(26, 42, 108, 0.06);
  --shadow-md: 0 8px 24px rgba(26, 42, 108, 0.1);
  --shadow-lg: 0 16px 48px rgba(26, 42, 108, 0.16);
  --shadow-glow: 0 0 32px rgba(245, 166, 35, 0.25);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-xl: 32px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --max-width: 1200px;
  --header-height: 72px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1020;
    --bg-elevated: #141b33;
    --bg-card: rgba(20, 27, 51, 0.85);
    --bg-glass: rgba(20, 27, 51, 0.65);
    --text: #e8ecf7;
    --text-secondary: #b6c0d8;
    --text-muted: #7d8aa8;
    --border: rgba(120, 150, 220, 0.16);
    --border-strong: rgba(120, 150, 220, 0.32);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 32px rgba(245, 166, 35, 0.35);
  }
}

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

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

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(circle at 12% 8%, rgba(45, 74, 158, 0.08) 0%, transparent 42%),
    radial-gradient(circle at 88% 4%, rgba(245, 166, 35, 0.07) 0%, transparent 38%),
    radial-gradient(circle at 50% 100%, rgba(46, 196, 182, 0.06) 0%, transparent 50%);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

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

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

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

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

h1 {
  font-size: clamp(1.75rem, 4.5vw, 3rem);
  background: var(--gradient-1);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

h2 {
  font-size: clamp(1.4rem, 3vw, 2.1rem);
  position: relative;
  padding-left: 18px;
  margin-bottom: 1.25rem;
}

h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.15em;
  bottom: 0.15em;
  width: 6px;
  border-radius: 3px;
  background: var(--gradient-2);
  box-shadow: var(--shadow-glow);
}

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

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

ul, ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

li {
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

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

blockquote {
  margin: 1.25rem 0;
  padding: 1rem 1.25rem;
  border-left: 4px solid var(--accent);
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  box-shadow: var(--shadow-sm);
}

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

time {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

small {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ============ HEADER ============ */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  padding: 0.75rem clamp(1rem, 4vw, 2.5rem);
  min-height: var(--header-height);
  background: var(--bg-glass);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: background var(--transition), box-shadow var(--transition);
}

header .brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--text);
  white-space: nowrap;
  transition: transform var(--transition);
}

header .brand:hover {
  transform: scale(1.03);
}

header .brand svg {
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  transition: box-shadow var(--transition), transform var(--transition);
}

header .brand:hover svg {
  box-shadow: var(--shadow-glow);
  transform: rotate(-4deg);
}

header nav {
  flex: 1 1 auto;
  min-width: 0;
}

header nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

header nav li {
  margin: 0;
}

header nav a {
  display: inline-block;
  padding: 0.4rem 0.75rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: 999px;
  transition: all var(--transition);
  position: relative;
}

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

header nav a:hover {
  color: var(--text);
  background: rgba(45, 74, 158, 0.08);
}

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

header form[role="search"] {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 0 1 auto;
}

header form[role="search"] label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

header form[role="search"] input[type="search"] {
  width: clamp(140px, 18vw, 240px);
  padding: 0.5rem 0.9rem;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--text);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  transition: all var(--transition);
  -webkit-appearance: none;
  appearance: none;
}

header form[role="search"] input[type="search"]::placeholder {
  color: var(--text-muted);
}

header form[role="search"] input[type="search"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(245, 166, 35, 0.18);
  outline: none;
}

header form[role="search"] button {
  padding: 0.5rem 1.1rem;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  background: var(--gradient-2);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
}

header form[role="search"] button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md), var(--shadow-glow);
}

header form[role="search"] button:active {
  transform: translateY(0);
}

/* ============ MAIN LAYOUT ============ */
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: clamp(1rem, 3vw, 2rem) clamp(1rem, 4vw, 2.5rem) 3rem;
}

main > nav[aria-label="面包屑导航"] {
  margin-bottom: 1.5rem;
}

main > nav[aria-label="面包屑导航"] ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.85rem;
}

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

main > nav[aria-label="面包屑导航"] li + li::before {
  content: "/";
  margin-right: 0.5rem;
  color: var(--text-muted);
  opacity: 0.6;
}

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

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

main > nav[aria-label="面包屑导航"] [aria-current="page"] {
  color: var(--primary-light);
  font-weight: 600;
}

/* ============ SECTIONS ============ */
section {
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
  padding: clamp(1.25rem, 3vw, 2rem);
  background: var(--bg-card);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
  animation: fadeUp 0.7s cubic-bezier(0.4, 0, 0.2, 1) both;
  animation-timeline: view();
  animation-range: entry 0% cover 25%;
}

@supports not (animation-timeline: view()) {
  section {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

section:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

section:target {
  border-color: var(--accent);
  box-shadow: var(--shadow-md), var(--shadow-glow);
}

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

/* ============ HERO ============ */
#hero {
  position: relative;
  overflow: hidden;
  padding: clamp(1.75rem, 4vw, 3rem);
  background: var(--gradient-1);
  background-size: 200% 200%;
  animation: gradientShift 12s ease infinite;
  border: none;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  color: #fff;
}

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

#hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.18) 0%, transparent 45%),
    radial-gradient(circle at 85% 75%, rgba(245, 166, 35, 0.22) 0%, transparent 50%);
  pointer-events: none;
}

#hero::after {
  content: "";
  position: absolute;
  top: -50%;
  right: -20%;
  width: 60%;
  height: 200%;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.08) 50%, transparent 70%);
  transform: rotate(12deg);
  pointer-events: none;
  animation: shine 8s ease-in-out infinite;
}

@keyframes shine {
  0%, 100% { transform: translateX(-30%) rotate(12deg); opacity: 0.6; }
  50% { transform: translateX(30%) rotate(12deg); opacity: 1; }
}

#hero h1 {
  position: relative;
  z-index: 1;
  color: #fff;
  -webkit-text-fill-color: #fff;
  background: none;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.25);
  margin-bottom: 1rem;
}

#hero p {
  position: relative;
  z-index: 1;
  color: rgba(255, 255, 255, 0.9);
  font-size: clamp(0.95rem, 1.6vw, 1.1rem);
  max-width: 72ch;
  line-height: 1.85;
}

#hero figure {
  position: relative;
  z-index: 1;
  margin-top: 2rem;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.75rem;
  transition: transform var(--transition), box-shadow var(--transition);
}

#hero figure:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

#hero figure svg {
  border-radius: var(--radius-md);
  width: 100%;
  height: auto;
}

#hero figcaption {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.75);
  text-align: center;
}

/* ============ ARTICLE CARDS ============ */
#articles article {
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  position: relative;
  overflow: hidden;
}

#articles article::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--gradient-2);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform var(--transition);
}

#articles article:hover {
  transform: translateX(6px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

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

#articles article h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

#articles article h3 a,
#articles article p a {
  color: var(--primary-light);
}

#articles article:hover h3 {
  color: var(--accent);
}

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

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

#articles article p a {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  background: rgba(45, 74, 158, 0.08);
  transition: all var(--transition);
}

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

#articles article p a:hover {
  background: var(--gradient-2);
  color: #fff;
  box-shadow: var(--shadow-glow);
}

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

/* ============ NEWS LIST ============ */
#news ul {
  list-style: none;
  padding: 0;
}

#news li {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: baseline;
  padding: 0.85rem 1rem;
  margin-bottom: 0.5rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

#news li:hover {
  border-color: var(--accent);
  transform: translateX(4px);
  box-shadow: var(--shadow-sm);
}

#news li time {
  flex-shrink: 0;
  font-weight: 600;
  color: var(--accent);
  padding: 0.1rem 0.6rem;
  background: rgba(245, 166, 35, 0.12);
  border-radius: 999px;
  font-size: 0.8rem;
}

/* ============ FAQ ============ */
#faq h3 {
  padding: 0.9rem 1.1rem;
  margin-top: 0.75rem;
  margin-bottom: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  font-size: 1rem;
  color: var(--primary-light);
  cursor: default;
  transition: all var(--transition);
  position: relative;
  padding-left: 2.4rem;
}

#faq h3::before {
  content: "Q";
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.4rem;
  height: 1.4rem;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 800;
  color: #fff;
  background: var(--gradient-2);
  border-radius: 50%;
}

#faq h3 + p {
  padding: 0.9rem 1.1rem 1rem 2.4rem;
  margin: 0 0 0.75rem;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  font-size: 0.95rem;
  position: relative;
}

#faq h3 + p::before {
  content: "A";
  position: absolute;
  left: 0.85rem;
  top: 0.95rem;
  width: 1.4rem;
  height: 1.4rem;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--accent-2);
  background: rgba(46, 196, 182, 0.15);
  border-radius: 50%;
}

#faq h3:hover {
  border-color: var(--accent);
  background: rgba(245, 166, 35, 0.06);
}

#faq h3:hover + p {
  border-color: var(--accent);
}

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

#howto ol li {
  counter-increment: step;
  position: relative;
  padding: 1rem 1.25rem 1rem 3.5rem;
  margin-bottom: 0.75rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}

#howto ol li::before {
  content: counter(step);
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.75rem;
  height: 1.75rem;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.9rem;
  color: #fff;
  background: var(--gradient-1);
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}

#howto ol li:hover {
  transform: translateX(6px);
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}

#howto ol li:hover::before {
  background: var(--gradient-2);
  transform: translateY(-50%) scale(1.15) rotate(-8deg);
}

/* ============ CONTACT ============ */
#contact ul {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.75rem;
}

#contact li {
  padding: 0.9rem 1.1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

#contact li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--gradient-3);
  opacity: 0;
  transition: opacity var(--transition);
}

#contact li:hover {
  border-color: var(--accent-2);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

#contact li:hover::before {
  opacity: 1;
}

/* ============ SITEMAP & LINKS ============ */
#sitemap ul,
#links ul {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.5rem;
}

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

#sitemap a,
#links a {
  display: block;
  padding: 0.6rem 0.9rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

#sitemap a::before,
#links a::before {
  content: "›";
  position: absolute;
  left: 0.4rem;
  opacity: 0;
  transform: translateX(-6px);
  transition: all var(--transition);
  color: var(--accent);
  font-weight: 800;
}

#sitemap a:hover,
#links a:hover {
  color: #fff;
  background: var(--gradient-1);
  border-color: transparent;
  padding-left: 1.4rem;
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

#sitemap a:hover::before,
#links a:hover::before {
  opacity: 1;
  transform: translateX(0);
  color: var(--accent);
}

/* ============ CASE BLOCKQUOTES ============ */
#cases blockquote {
  position: relative;
  padding-left: 3rem;
}

#cases blockquote::before {
  content: "“";
  position: absolute;
  left: 0.75rem;
  top: 0.25rem;
  font-size: 2.5rem;
  line-height: 1;
  color: var(--accent);
  font-family: Georgia, serif;
  opacity: 0.7;
}

/* ============ FOOTER ============ */
footer {
  position: relative;
  margin-top: 2rem;
  padding: clamp(2rem, 5vw, 3rem) clamp(1rem, 4vw, 2.5rem) 1.5rem;
  background: var(--gradient-1);
  color: rgba(255, 255, 255, 0.85);
  overflow: hidden;
}

footer::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 10% 10%, rgba(245, 166, 35, 0.15) 0%, transparent 40%),
    radial-gradient(circle at 90% 90%, rgba(46, 196, 182, 0.12) 0%, transparent 45%);
  pointer-events: none;
}

footer > section {
  position: relative;
  z-index: 1;
  max-width: var(--max-width);
  margin: 0 auto 1.5rem;
  padding: 0;
  background: none;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  animation: none;
}

footer > section:hover {
  box-shadow: none;
  border: none;
}

footer h2 {
  color: #fff;
  font-size: 1.15rem;
  padding-left: 14px;
}

footer h2::before {
  background: var(--gradient-2);
  width: 4px;
}

footer h3 {
  color: rgba(255, 255, 255, 0.95);
  font-size: 1rem;
  margin-top: 1rem;
}

footer p {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.92rem;
}

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

footer a:hover {
  color: #fff;
}

footer > p {
  position: relative;
  z-index: 1;
  max-width: var(--max-width);
  margin: 1.5rem auto 0;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  text-align: center;
}

footer small {
  color: rgba(255, 255, 255, 0.65);
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1024px) {
  header {
    gap: 0.75rem 1rem;
  }

  header nav a {
    padding: 0.35rem 0.6rem;
    font-size: 0.85rem;
  }
}

@media (max-width: 860px) {
  :root {
    --header-height: auto;
  }

  header {
    flex-direction: column;
    align-items: stretch;
    padding: 0.75rem 1rem;
    gap: 0.6rem;
  }

  header .brand {
    justify-content: center;
  }

  header nav ul {
    justify-content: center;
  }

  header form[role="search"] {
    justify-content: center;
  }

  header form[role="search"] input[type="search"] {
    flex: 1 1 auto;
    width: auto;
    max-width: 320px;
  }
}

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

  section {
    padding: 1.1rem;
    border-radius: var(--radius-md);
  }

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

  #hero figure {
    padding: 0.5rem;
  }

  h2 {
    padding-left: 14px;
  }

  h2::before {
    width: 4px;
  }

  header nav ul {
    gap: 0.15rem 0.25rem;
  }

  header nav a {
    padding: 0.3rem 0.5rem;
    font-size: 0.8rem;
  }

  #articles article {
    padding: 1rem;
  }

  #articles article:hover {
    transform: none;
  }

  #news li {
    flex-direction: column;
    gap: 0.3rem;
  }

  #faq h3 {
    font-size: 0.95rem;
    padding: 0.8rem 0.9rem 0.8rem 2.2rem;
  }

  #faq h3 + p {
    padding: 0.8rem 0.9rem 0.9rem 2.2rem;
  }

  #howto ol li {
    padding: 0.9rem 1rem 0.9rem 3rem;
  }

  #howto ol li::before {
    left: 0.75rem;
    width: 1.5rem;
    height: 1.5rem;
    font-size: 0.8rem;
  }

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

  #contact li {
    padding: 0.75rem 0.9rem;
    font-size: 0.88rem;
  }

  footer {
    padding: 1.5rem 1rem 1rem;
  }

  footer > section {
    margin-bottom: 1rem;
  }
}

@media (max-width: 400px) {
  #contact ul,
  #sitemap ul,
  #links ul {
    grid-template-columns: 1fr;
  }

  header form[role="search"] {
    flex-wrap: wrap;
  }

  header form[role="search"] input[type="search"] {
    max-width: none;
    width: 100%;
  }
}

/* ============ ACCESSIBILITY & 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;
  }

  section {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-contrast: more) {
  :root {
    --border: rgba(26, 42, 108, 0.4);
    --border-strong: rgba(26, 42, 108, 0.6);
    --text-secondary: #2d3748;
  }
}

/* ============ PRINT ============ */
@media print {
  header,
  footer,
  #hero figure,
  header form[role="search"] {
    display: none !important;
  }

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

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

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