:root {
  --color-dark: #141838;
  --color-paper: #FCFCFD;
  --color-text: #151723;
  --color-brand: #142CEB;
  --color-accent: #6EAFED;
  --radius-card: 8px;
  --radius-btn: 6px;
  --card-border: 0;
  --card-shadow: none;
  --section-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --content-max: 1120px;
  --font-sans: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  --lh-body: 1.75;
  --lh-heading: 1.15;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: var(--lh-body);
  color: var(--color-text);
  background: var(--color-paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg {
  display: block;
  max-width: 100%;
}

/* Layout Utilities */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--gap);
}

.section {
  padding-block: var(--section-y);
  position: relative;
}

.section + .section {
  border-top: 1px solid rgba(21, 23, 35, 0.08);
}

.dark-bg {
  background-color: var(--color-dark);
  color: var(--color-paper);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
  align-items: center;
}

.grid-2 > * {
  min-width: 0;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: var(--gap);
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Typography */
h1, h2, h3, h4 {
  font-weight: 500;
  line-height: var(--lh-heading);
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2.6rem, 6.4vw, 5rem);
  margin-bottom: 1.5rem;
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  margin-bottom: var(--gap);
}

h3 {
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  margin-bottom: 0.75rem;
}

p {
  margin-bottom: 1rem;
  max-width: 38em;
}

.overline {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-brand);
  margin-bottom: 0.75rem;
}

.dark-bg .overline {
  color: var(--color-accent);
}

.highlight-card {
  background: var(--color-paper);
  color: var(--color-text);
}

.highlight-card .overline {
  color: var(--color-brand);
}

.hl {
  color: var(--color-brand);
}

.dark-bg .hl {
  color: var(--color-accent);
}

/* Components: Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 52px;
  padding-inline: 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  border-radius: var(--radius-btn);
  text-decoration: none;
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
  cursor: pointer;
  border: none;
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-dark);
}

.btn-primary:hover {
  transform: translateY(-2px);
  background-color: #5a9bd8;
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--color-text);
  color: var(--color-text);
}

.dark-bg .btn-secondary {
  border-color: var(--color-paper);
  color: var(--color-paper);
}

.btn-secondary:hover {
  transform: translateY(-2px);
  background: rgba(21, 23, 35, 0.05);
}

.dark-bg .btn-secondary:hover {
  background: rgba(252, 252, 253, 0.08);
}

.focus-visible:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: 2px;
}

.dark-bg .focus-visible:focus-visible {
  outline-color: var(--color-accent);
}

/* Components: Cards */
.card {
  background: var(--color-paper);
  border-radius: var(--radius-card);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  padding: 1.5rem;
  transition: transform 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
}

.dark-bg .card {
  background: rgba(252, 252, 253, 0.06);
}

/* Components: Table */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-block: 1rem;
  font-size: 0.95rem;
}

th, td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid rgba(21, 23, 35, 0.1);
}

th {
  font-weight: 600;
  color: var(--color-text);
}

td {
  color: var(--color-text);
}

.dark-bg th, .dark-bg td {
  border-bottom-color: rgba(252, 252, 253, 0.1);
  color: var(--color-paper);
}

/* Components: Details/FAQ */
details {
  border-bottom: 1px solid rgba(21, 23, 35, 0.1);
  padding: 1rem 0;
}

summary {
  cursor: pointer;
  font-weight: 500;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-right: 1rem;
}

summary::-webkit-details-marker {
  display: none;
}

summary::after {
  content: "+";
  font-size: 1.2rem;
  font-weight: 400;
  transition: transform 0.2s;
}

details[open] summary::after {
  transform: rotate(45deg);
}

details p {
  margin-top: 0.75rem;
  font-size: 0.95rem;
  color: var(--color-text);
  line-height: 1.7;
}

.dark-bg details {
  border-bottom-color: rgba(252, 252, 253, 0.1);
}

.dark-bg details p {
  color: var(--color-paper);
}

/* Components: Header & Footer */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(252, 252, 253, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(21, 23, 35, 0.08);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--color-text);
  font-weight: 600;
  font-size: 1.1rem;
}

.brand img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.nav-list {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

.nav-link {
  text-decoration: none;
  color: var(--color-text);
  font-weight: 500;
  padding: 0.5rem 0;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s;
}

.nav-link:hover,
.nav-link[aria-current="page"] {
  border-bottom-color: var(--color-brand);
}

.site-footer {
  background: var(--color-dark);
  color: var(--color-paper);
  padding-block: var(--section-y);
  font-size: 0.95rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: var(--gap);
  margin-bottom: var(--gap);
}

.footer-col h4 {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
  opacity: 0.7;
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: 0.6rem;
}

.footer-col a {
  color: var(--color-paper);
  text-decoration: none;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.footer-col a:hover {
  opacity: 1;
  text-decoration: underline;
}

.footer-bottom {
  border-top: 1px solid rgba(252, 252, 253, 0.1);
  padding-top: 1.5rem;
  text-align: center;
  opacity: 0.6;
  font-size: 0.85rem;
}

/* Components: Scenario Tags */
.tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}

.tag-problem { background: rgba(20, 44, 235, 0.1); color: var(--color-brand); }
.tag-action { background: rgba(110, 175, 237, 0.15); color: var(--color-brand); }
.tag-result { background: rgba(16, 185, 129, 0.1); color: #10b981; }

/* Components: Steps */
.step-row {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  align-items: flex-start;
}

.step-num {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  background: var(--color-accent);
  color: var(--color-dark);
  font-weight: 700;
  font-size: 0.9rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-content {
  flex: 1;
}

/* SVG Animations */
svg {
  width: 100%;
  height: auto;
  display: block;
}

svg [class*="anim-"] {
  transform-box: fill-box;
  transform-origin: center;
}

@keyframes drawLine {
  0% { stroke-dashoffset: 1; }
  50% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 1; }
}

@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes breathe {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

@keyframes slideInRight {
  from { transform: translateX(20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes dashFlow {
  to { stroke-dashoffset: 24; }
}

.anim-draw {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: drawLine 4s ease-in-out infinite alternate;
}

.anim-float {
  animation: floatY 5s ease-in-out infinite;
}

.anim-breathe {
  animation: breathe 3s ease-in-out infinite;
}

.anim-slide {
  animation: slideInRight 1.2s ease-out forwards;
}

.anim-flow {
  stroke-dasharray: 8 16;
  animation: dashFlow 2s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Responsive */
@media (max-width: 768px) {
  .grid-2 {
    grid-template-columns: 1fr !important;
  }
  
  .header-inner {
    flex-direction: column;
    gap: 0.5rem;
    height: auto;
    padding-block: 0.75rem;
  }
  
  .nav-list {
    gap: 1rem;
  }
  
  .step-row {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  h1 {
    font-size: clamp(2.2rem, 8vw, 3.5rem);
  }
}
