:root {
  --primary: #0b1a2f;
  --primary-light: #1e3a5f;
  --accent: #f5c542;
  --accent-hover: #ffd966;
  --accent-glow: rgba(245, 197, 66, 0.35);
  --bg: #f5f7fb;
  --bg-alt: #eef3fa;
  --card-bg: #ffffff;
  --card-border: #e9eef4;
  --text: #1e2a3a;
  --text-secondary: #2e3b4e;
  --text-muted: #6b7a8f;
  --heading: #0b1a2f;
  --link: #0a58ca;
  --link-hover: #084298;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.08);
  --shadow-glow: 0 0 24px var(--accent-glow);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(255, 255, 255, 0.35);
  --glass-blur: 16px;
  --font-sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Cascadia Code', Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary: #0a1628;
    --primary-light: #162a45;
    --accent: #f5c542;
    --accent-hover: #ffd966;
    --accent-glow: rgba(245, 197, 66, 0.25);
    --bg: #0d1520;
    --bg-alt: #131f30;
    --card-bg: #162033;
    --card-border: #1e2d45;
    --text: #dce4f0;
    --text-secondary: #b8c6d9;
    --text-muted: #7a8da8;
    --heading: #ffffff;
    --link: #6ea8fe;
    --link-hover: #9ec5fe;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.5);
    --glass-bg: rgba(22, 32, 51, 0.78);
    --glass-border: rgba(255, 255, 255, 0.08);
  }
}

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

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

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

header, main, footer, section, article, aside, nav, figure, figcaption {
  display: block;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  width: 100%;
}

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

h1 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
}

h2 {
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  position: relative;
  padding-bottom: 12px;
  margin-top: 2em;
  margin-bottom: 1em;
}

h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  border-radius: 3px;
  transition: width var(--transition-slow);
}

h2:hover::after {
  width: 100px;
}

h3 {
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  margin-top: 1.4em;
}

h4 {
  font-size: clamp(1rem, 1.5vw, 1.15rem);
  margin-top: 1.2em;
  color: var(--text-secondary);
}

p, li, figcaption, dd, dt {
  font-size: 1rem;
  color: var(--text-secondary);
}

p {
  margin-bottom: 0.8em;
}

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

a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

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

ul, ol {
  padding-left: 1.5em;
  margin-bottom: 0.8em;
}

li {
  margin-bottom: 0.3em;
}

img, svg {
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}

img {
  border-radius: var(--radius-sm);
}

hr {
  border: none;
  border-top: 1px solid var(--card-border);
  margin: 30px 0;
}

blockquote {
  border-left: 4px solid var(--accent);
  padding: 16px 20px;
  margin: 16px 0;
  background: var(--bg-alt);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-secondary);
  font-style: normal;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

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

table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

th, td {
  border: 1px solid var(--card-border);
  padding: 10px 14px;
  text-align: left;
}

th {
  background: var(--bg-alt);
  font-weight: 600;
  color: var(--heading);
}

tr {
  transition: background var(--transition-fast);
}

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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ==================== HEADER ==================== */
header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-bottom: 1px solid var(--glass-border);
  transition: background var(--transition-base), box-shadow var(--transition-base);
}

header.scrolled {
  box-shadow: var(--shadow-md);
}

header .container {
  padding-top: 12px;
  padding-bottom: 12px;
}

header .flex-row {
  justify-content: space-between;
  align-items: center;
}

header strong {
  color: var(--heading) !important;
  transition: color var(--transition-fast);
}

header .meta {
  color: var(--text-muted) !important;
}

header nav ul {
  display: flex;
  list-style: none;
  gap: 24px;
  margin: 0;
  padding: 0;
  font-weight: 500;
}

header nav a {
  position: relative;
  color: var(--text-secondary);
  font-size: 0.95rem;
  padding: 4px 0;
  transition: color var(--transition-fast);
}

header nav a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  transition: width var(--transition-base);
}

header nav a:hover {
  color: var(--accent);
  text-decoration: none;
}

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

header svg {
  transition: transform var(--transition-base), filter var(--transition-base);
}

header svg:hover {
  transform: scale(1.05) rotate(-3deg);
  filter: drop-shadow(0 0 12px var(--accent-glow));
}

/* ==================== BREADCRUMB ==================== */
nav[aria-label="面包屑"] ol {
  display: flex;
  list-style: none;
  padding: 0;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

nav[aria-label="面包屑"] a {
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

nav[aria-label="面包屑"] a:hover {
  color: var(--accent);
  text-decoration: none;
}

/* ==================== CARDS ==================== */
.card, .box, .faq-item, .article-item {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 24px 28px;
  margin: 20px 0;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--card-border);
  transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  opacity: 0;
  transition: opacity var(--transition-base);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}

.card:hover::before {
  opacity: 1;
}

/* ==================== GRID ==================== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

/* ==================== FLEX ROW ==================== */
.flex-row {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
}

/* ==================== BADGE ==================== */
.badge {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
  cursor: default;
}

.badge:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: var(--shadow-glow);
}

/* ==================== META ==================== */
.meta {
  color: var(--text-muted);
  font-size: 0.88rem;
}

/* ==================== HERO BANNER ==================== */
#hero .card {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 50%, #2a4a7a 100%);
  color: white;
  border: none;
  padding: 48px 40px;
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(11, 26, 47, 0.3);
}

#hero .card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(245, 197, 66, 0.12) 0%, transparent 70%);
  pointer-events: none;
  animation: heroGlow 8s ease-in-out infinite alternate;
}

#hero .card::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(110, 168, 254, 0.1) 0%, transparent 70%);
  pointer-events: none;
  animation: heroGlow 10s ease-in-out infinite alternate-reverse;
}

@keyframes heroGlow {
  0% { transform: translate(0, 0) scale(1); opacity: 0.6; }
  100% { transform: translate(30px, -20px) scale(1.15); opacity: 1; }
}

#hero h1 {
  color: #ffffff;
  font-size: clamp(1.5rem, 3.5vw, 2.3rem);
  margin-bottom: 0.3em;
  position: relative;
  z-index: 1;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

#hero p {
  color: rgba(224, 233, 245, 0.95);
  max-width: 800px;
  font-size: clamp(0.95rem, 1.5vw, 1.15rem);
  position: relative;
  z-index: 1;
}

#hero .badge {
  background: var(--accent);
  color: var(--primary);
  position: relative;
  z-index: 1;
  font-weight: 700;
}

#hero .badge:hover {
  background: var(--accent-hover);
}

/* ==================== FAQ ==================== */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-item {
  padding: 0;
  margin: 0;
  overflow: hidden;
  transition: box-shadow var(--transition-base), border-color var(--transition-base);
}

.faq-item:hover {
  border-color: var(--accent);
}

.faq-item summary {
  padding: 18px 24px;
  cursor: pointer;
  font-size: 1rem;
  color: var(--heading);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background var(--transition-fast);
  user-select: none;
  position: relative;
}

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

.faq-item summary::after {
  content: '+';
  font-size: 1.4rem;
  font-weight: 300;
  color: var(--accent);
  transition: transform var(--transition-base), color var(--transition-base);
  flex-shrink: 0;
  margin-left: 16px;
  line-height: 1;
}

.faq-item[open] summary::after {
  content: '−';
  transform: rotate(180deg);
}

.faq-item summary:hover {
  background: var(--bg-alt);
}

.faq-item summary strong {
  color: var(--heading);
  font-weight: 600;
}

.faq-item p {
  padding: 0 24px 20px;
  margin: 0;
  color: var(--text-secondary);
  animation: fadeSlideIn 0.3s ease-out;
}

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==================== ARTICLES ==================== */
#articles .card h3 a {
  color: var(--heading);
  transition: color var(--transition-fast);
}

#articles .card h3 a:hover {
  color: var(--accent);
  text-decoration: none;
}

#articles .card > a:last-child {
  display: inline-block;
  margin-top: 8px;
  font-weight: 500;
  color: var(--accent);
  transition: transform var(--transition-fast), color var(--transition-fast);
}

#articles .card > a:last-child:hover {
  transform: translateX(4px);
  color: var(--accent-hover);
  text-decoration: none;
}

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

#howto ol li {
  counter-increment: step;
  position: relative;
  padding-left: 48px;
  margin-bottom: 16px;
  min-height: 32px;
  display: flex;
  align-items: flex-start;
}

#howto ol li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  box-shadow: 0 2px 8px var(--accent-glow);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

#howto ol li:hover::before {
  transform: scale(1.15);
  box-shadow: 0 4px 16px var(--accent-glow);
}

/* ==================== FOOTER ==================== */
footer {
  background: var(--primary) !important;
  color: #b0c4de !important;
  padding: 48px 0 32px !important;
  margin-top: 60px !important;
  position: relative;
  overflow: hidden;
}

footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), #6ea8fe, var(--accent));
  background-size: 200% 100%;
  animation: gradientShift 4s linear infinite;
}

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

footer h4 {
  color: #ffffff !important;
  margin-bottom: 12px;
}

footer p {
  color: #b0c4de !important;
  font-size: 0.92rem;
  line-height: 1.7;
}

footer a {
  color: #b0c4de !important;
  transition: color var(--transition-fast), padding-left var(--transition-fast);
}

footer a:hover {
  color: var(--accent) !important;
  text-decoration: none;
  padding-left: 4px;
}

footer ul {
  list-style: none;
  padding: 0;
}

footer ul li {
  margin-bottom: 6px;
}

footer hr {
  border-color: rgba(255, 255, 255, 0.1) !important;
  margin: 32px 0 20px !important;
}

/* ==================== SCROLL ANIMATIONS ==================== */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ==================== SECTION SPACING ==================== */
section {
  scroll-margin-top: 80px;
}

#main-content {
  padding-bottom: 20px;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 900px) {
  header nav ul {
    gap: 16px !important;
    font-size: 0.88rem;
  }

  #hero .card {
    padding: 32px 24px;
  }

  .grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
  }
}

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

  .container {
    padding: 0 16px;
  }

  header .flex-row {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 12px;
  }

  header nav ul {
    flex-wrap: wrap;
    gap: 12px !important;
    padding-bottom: 4px;
  }

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

  h2 {
    margin-top: 1.5em;
  }

  .card, .box, .faq-item {
    padding: 18px 20px;
    border-radius: var(--radius-sm);
  }

  #hero .card {
    padding: 28px 20px;
    border-radius: var(--radius-md);
  }

  #hero .flex-row {
    gap: 10px;
  }

  .badge {
    font-size: 0.75rem;
    padding: 5px 12px;
  }

  .faq-item summary {
    padding: 14px 18px;
    font-size: 0.95rem;
  }

  .faq-item p {
    padding: 0 18px 16px;
  }

  #howto ol li {
    padding-left: 40px;
  }

  #howto ol li::before {
    width: 28px;
    height: 28px;
    font-size: 0.78rem;
  }

  footer {
    padding: 32px 0 24px !important;
  }

  footer .grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  blockquote {
    padding: 12px 16px;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 14px;
  }

  .container {
    padding: 0 12px;
  }

  h1 {
    font-size: 1.35rem;
  }

  h2 {
    font-size: 1.15rem;
  }

  h3 {
    font-size: 1rem;
  }

  .card, .box, .faq-item {
    padding: 14px 16px;
    margin: 14px 0;
  }

  #hero .card {
    padding: 22px 16px;
  }

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

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

  .grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  header nav ul {
    gap: 8px !important;
  }

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

  .faq-item summary {
    padding: 12px 14px;
    font-size: 0.88rem;
  }

  .faq-item p {
    padding: 0 14px 14px;
    font-size: 0.88rem;
  }

  .badge {
    font-size: 0.7rem;
    padding: 4px 10px;
  }

  footer {
    padding: 24px 0 16px !important;
  }

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

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

  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ==================== PRINT ==================== */
@media print {
  header, footer, nav, .badge, #hero .card::before, #hero .card::after {
    display: none;
  }

  body {
    background: white;
    color: black;
    font-size: 12pt;
  }

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

  a {
    color: black;
    text-decoration: underline;
  }

  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #666;
  }
}

/* ==================== SELECTION ==================== */
::selection {
  background: var(--accent);
  color: var(--primary);
}

::-moz-selection {
  background: var(--accent);
  color: var(--primary);
}

/* ==================== SCROLLBAR ==================== */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

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

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

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

/* ==================== FOCUS VISIBLE ==================== */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ==================== LOADING SKELETON ==================== */
@keyframes skeletonPulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.8; }
}

.skeleton {
  background: linear-gradient(90deg, var(--bg-alt) 25%, var(--card-border) 50%, var(--bg-alt) 75%);
  background-size: 200% 100%;
  animation: skeletonPulse 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

/* ==================== TOOLTIP ==================== */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  background: var(--primary);
  color: #fff;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.78rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
  z-index: 100;
}

[data-tooltip]:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(-8px);
}

/* ==================== UTILITY ==================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.p-0 { padding: 0; }
.w-full { width: 100%; }
.rounded { border-radius: var(--radius-md); }
.shadow { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.overflow-hidden { overflow: hidden; }
.relative { position: relative; }
.z-1 { z-index: 1; }

/* ==================== GRADIENT TEXT ==================== */
.gradient-text {
  background: linear-gradient(135deg, var(--accent), #6ea8fe);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* ==================== GLASS CARD ==================== */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
}

/* ==================== PULSE DOT ==================== */
.pulse-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  position: relative;
  margin-right: 6px;
}

.pulse-dot::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 2px solid #22c55e;
  animation: pulseRing 1.5s ease-out infinite;
}

@keyframes pulseRing {
  0% { transform: scale(0.8); opacity: 1; }
  100% { transform: scale(2); opacity: 0; }
}

/* ==================== RIPPLE EFFECT ==================== */
.ripple {
  position: relative;
  overflow: hidden;
}

.ripple::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--x, 50%) var(--y, 50%), rgba(245, 197, 66, 0.3) 0%, transparent 60%);
  opacity: 0;
  transition: opacity var(--transition-fast);
  pointer-events: none;
}

.ripple:active::after {
  opacity: 1;
}

/* ==================== BADGE PULSE ==================== */
@keyframes badgePulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--accent-glow); }
  50% { box-shadow: 0 0 0 8px transparent; }
}

.badge-pulse {
  animation: badgePulse 2s ease-in-out infinite;
}

/* ==================== LINK UNDERLINE ANIMATION ==================== */
.link-underline {
  position: relative;
  text-decoration: none;
}

.link-underline::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width var(--transition-base);
}

.link-underline:hover::after {
  width: 100%;
}

/* ==================== CARD GLOW ON HOVER ==================== */
.card-glow:hover {
  box-shadow: var(--shadow-lg), 0 0 30px var(--accent-glow);
}

/* ==================== STAGGERED LIST ==================== */
.staggered-list li {
  opacity: 0;
  transform: translateX(-10px);
  animation: staggerIn 0.4s ease-out forwards;
}

.staggered-list li:nth-child(1) { animation-delay: 0.05s; }
.staggered-list li:nth-child(2) { animation-delay: 0.1s; }
.staggered-list li:nth-child(3) { animation-delay: 0.15s; }
.staggered-list li:nth-child(4) { animation-delay: 0.2s; }
.staggered-list li:nth-child(5) { animation-delay: 0.25s; }
.staggered-list li:nth-child(6) { animation-delay: 0.3s; }
.staggered-list li:nth-child(7) { animation-delay: 0.35s; }
.staggered-list li:nth-child(8) { animation-delay: 0.4s; }

@keyframes staggerIn {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ==================== FLOATING ANIMATION ==================== */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.float {
  animation: float 3s ease-in-out infinite;
}

/* ==================== SHIMMER LOADING ==================== */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.shimmer {
  background: linear-gradient(90deg, transparent 25%, rgba(255,255,255,0.15) 50%, transparent 75%);
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
}

/* ==================== DARK MODE SPECIFIC ==================== */
@media (prefers-color-scheme: dark) {
  #hero .card {
    background: linear-gradient(135deg, #0a1628 0%, #162a45 50%, #1e3a5f 100%);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  }

  header {
    background: rgba(13, 21, 32, 0.85);
  }

  footer {
    background: #080f1a !important;
  }

  ::-webkit-scrollbar-track {
    background: #0d1520;
  }

  ::-webkit-scrollbar-thumb {
    background: #2a3f5a;
    border-color: #0d1520;
  }

  blockquote {
    background: rgba(22, 32, 51, 0.6);
  }

  .faq-item summary:hover {
    background: rgba(22, 32, 51, 0.5);
  }

  table th {
    background: #131f30;
  }

  tbody tr:hover {
    background: rgba(22, 32, 51, 0.5);
  }
}

/* ==================== HIGH CONTRAST MODE ==================== */
@media (prefers-contrast: high) {
  :root {
    --card-border: #000;
    --text-secondary: #000;
    --text-muted: #333;
  }

  .card {
    border-width: 2px;
  }

  a {
    text-decoration: underline;
  }
}

/* ==================== LANDSCAPE MOBILE ==================== */
@media (max-height: 500px) and (orientation: landscape) {
  header {
    position: relative;
  }

  #hero .card {
    padding: 20px 16px;
  }

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

/* ==================== TOUCH DEVICE OPTIMIZATIONS ==================== */
@media (hover: none) {
  .card:hover {
    transform: none;
    box-shadow: var(--shadow-sm);
  }

  .card:active {
    transform: scale(0.98);
    box-shadow: var(--shadow-md);
  }

  .badge:hover {
    transform: none;
  }

  header nav a::after {
    display: none;
  }

  header nav a:hover {
    color: var(--text-secondary);
  }
}

/* ==================== SAFE AREA ==================== */
@supports (padding: env(safe-area-inset-bottom)) {
  footer {
    padding-bottom: calc(32px + env(safe-area-inset-bottom)) !important;
  }

  .container {
    padding-left: max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
  }
}

/* ==================== SMOOTH APPEAR FOR SECTIONS ==================== */
section {
  opacity: 0;
  transform: translateY(20px);
  animation: sectionAppear 0.6s ease-out 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; }

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

/* ==================== CUSTOM CHECKBOX ==================== */
input[type="checkbox"] {
  accent-color: var(--accent);
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* ==================== CUSTOM RADIO ==================== */
input[type="radio"] {
  accent-color: var(--accent);
  cursor: pointer;
}

/* ==================== BUTTON RESET ==================== */
button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

/* ==================== IMAGE HOVER ZOOM ==================== */
.img-zoom {
  overflow: hidden;
  border-radius: var(--radius-md);
}

.img-zoom img {
  transition: transform var(--transition-slow);
}

.img-zoom:hover img {
  transform: scale(1.05);
}

/* ==================== GRADIENT BORDER ==================== */
.gradient-border {
  position: relative;
  background: var(--card-bg);
  border-radius: var(--radius-md);
}

.gradient-border::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: calc(var(--radius-md) + 2px);
  background: linear-gradient(135deg, var(--accent), #6ea8fe, var(--accent));
  background-size: 200% 200%;
  z-index: -1;
  animation: gradientRotate 3s linear infinite;
}

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

/* ==================== TEXT TRUNCATE ==================== */
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ==================== BACKDROP OVERLAY ==================== */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 26, 47, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
}

.overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* ==================== MODAL ==================== */
.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 560px;
  width: calc(100% - 40px);
  max-height: 80vh;
  overflow-y: auto;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base), transform var(--transition-base);
  box-shadow: var(--shadow-lg);
}

.modal.active {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

/* ==================== SKIP LINK ==================== */
.skip-link {
  position: absolute;
  top: -100px;
  left: 20px;
  background: var(--accent);
  color: var(--primary);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  z-index: 10000;
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: 10px;
}

/* ==================== RESPONSIVE TYPOGRAPHY ==================== */
@media (min-width: 1400px) {
  .container {
    max-width: 1320px;
  }
}

@media (min-width: 1600px) {
  .container {
    max-width: 1440px;
  }
}

/* ==================== DARK MODE TOGGLE SUPPORT ==================== */
[data-theme="dark"] {
  --primary: #0a1628;
  --primary-light: #162a45;
  --bg: #0d1520;
  --bg-alt: #131f30;
  --card-bg: #162033;
  --card-border: #1e2d45;
  --text: #dce4f0;
  --text-secondary: #b8c6d9;
  --text-muted: #7a8da8;
  --heading: #ffffff;
  --link: #6ea8fe;
  --link-hover: #9ec5fe;
  --glass-bg: rgba(22, 32, 51, 0.78);
  --glass-border: rgba(255, 255, 255, 0.08);
}

[data-theme="light"] {
  --primary: #0b1a2f;
  --primary-light: #1e3a5f;
  --bg: #f5f7fb;
  --bg-alt: #eef3fa;
  --card-bg: #ffffff;
  --card-border: #e9eef4;
  --text: #1e2a3a;
  --text-secondary: #2e3b4e;
  --text-muted: #6b7a8f;
  --heading: #0b1a2f;
  --link: #0a58ca;
  --link-hover: #084298;
  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(255, 255, 255, 0.35);
}

/* ==================== END OF STYLESHEET ==================== */