:root {
  --color-primary: #5C4033;
  --color-primary-dark: #4A332A;
  --color-secondary: #8B6914;
  --color-accent: #A0522D;
  --color-bg-main: #F5F1E8;
  --color-bg-soft: #EBE6DA;
  --color-bg-hover: #E8E2D4;
  --color-surface: #FFFFFF;
  --color-text-main: #2D2A26;
  --color-text-muted: #5A564E;
  --color-border-light: #D6CFC0;
  --color-success: #4A7C59;
  --radius-sm: 0.375rem;
  --radius-md: 0.625rem;
  --radius-lg: 1rem;
  --shadow-sm: 0 2px 8px rgba(45, 42, 38, 0.06);
  --shadow-md: 0 6px 16px rgba(45, 42, 38, 0.1);
  --shadow-lg: 0 12px 28px rgba(45, 42, 38, 0.12);
  --font-sans: system-ui, -apple-system, "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --container-max: 1200px;
  --spacing-section: clamp(3rem, 8vw, 6rem);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 100%;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background-color: var(--color-bg-main);
  color: var(--color-text-main);
  line-height: 1.65;
  overflow-x: hidden;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--color-accent);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Typography */
h1, h2, h3, h4 {
  font-weight: 700;
  letter-spacing: -0.015em;
  text-wrap: balance;
  color: var(--color-text-main);
  line-height: 1.25;
}

h1 { font-size: clamp(2.25rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); margin-bottom: 0.75rem; }
h3 { font-size: clamp(1.25rem, 3vw, 1.5rem); margin-bottom: 0.5rem; }
p { font-size: clamp(0.95rem, 1.5vw, 1.05rem); margin-bottom: 1rem; color: var(--color-text-muted); }
strong { font-weight: 600; color: var(--color-text-main); }

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2rem);
}

section {
  padding: var(--spacing-section) 0;
}

/* Header & Footer */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(245, 241, 232, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border-light);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4.5rem;
}

.nav-list {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  font-weight: 500;
}

.nav-link {
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  transition: background 0.2s, color 0.2s;
}

.nav-link:hover, .nav-link[aria-current="page"] {
  background: var(--color-bg-hover);
  color: var(--color-primary);
}

.site-footer {
  background: var(--color-bg-soft);
  border-top: 1px solid var(--color-border-light);
  padding: 3rem 0 2rem;
  margin-top: 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-col h4 {
  font-size: 1rem;
  margin-bottom: 1rem;
  color: var(--color-primary);
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-links a {
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

.footer-links a:hover {
  color: var(--color-primary);
}

.copyright {
  text-align: center;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border-light);
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

/* Components */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.8rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  border: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  text-decoration: none;
}

.btn-primary {
  background-color: var(--color-primary);
  color: #FFFFFF;
}

.btn-primary:hover {
  background-color: var(--color-primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-primary:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  align-items: start;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

@media (max-width: 480px) {
  .grid-2,
  .grid-3,
  .footer-links[style*="minmax"] {
    grid-template-columns: 1fr !important;
  }
}

/* Table */
.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
}

th, td {
  padding: 0.9rem 1.1rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border-light);
}

th {
  background: var(--color-bg-soft);
  font-weight: 600;
  color: var(--color-primary);
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--color-bg-hover); }

/* FAQ */
.faq-item {
  margin-bottom: 0.75rem;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  overflow: hidden;
}

details {
  width: 100%;
}

summary {
  padding: 1rem 1.25rem;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}

summary::-webkit-details-marker { display: none; }
summary::after {
  content: "+";
  font-size: 1.25rem;
  font-weight: 400;
  transition: transform 0.2s;
  flex-shrink: 0;
}

details[open] summary::after { transform: rotate(45deg); }
details[open] summary { background: var(--color-bg-soft); }

.faq-answer {
  padding: 0 1.25rem 1.1rem;
  color: var(--color-text-muted);
  line-height: 1.7;
}

/* Lists */
.list-steps {
  list-style: none;
  counter-reset: step-counter;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.list-steps li {
  counter-increment: step-counter;
  position: relative;
  padding-left: 2.5rem;
}

.list-steps li::before {
  content: counter(step-counter);
  position: absolute;
  left: 0;
  top: 0.15rem;
  width: 1.8rem;
  height: 1.8rem;
  background: var(--color-bg-soft);
  border: 1px solid var(--color-border-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--color-primary);
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  background: var(--color-bg-soft);
  border: 1px solid var(--color-border-light);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-text-muted);
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
}

/* SVG Animation Utilities */
.anim-spin {
  animation: spin-slow 18s linear infinite;
  transform-box: fill-box;
  transform-origin: center;
}

.anim-rotate-z {
  animation: rotate-z-axis 24s linear infinite;
  transform-box: fill-box;
  transform-origin: center;
}

.anim-draw {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: draw-path 6s ease-in-out infinite alternate;
}

.anim-float {
  animation: float-y 5s ease-in-out infinite;
}

.anim-opac {
  animation: fade-opacity 4s ease-in-out infinite;
}

@keyframes spin-slow {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes rotate-z-axis {
  0% { transform: rotateX(15deg) rotateY(0deg); }
  50% { transform: rotateX(15deg) rotateY(180deg); }
  100% { transform: rotateX(15deg) rotateY(360deg); }
}

@keyframes draw-path {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}

@keyframes float-y {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes fade-opacity {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .anim-spin, .anim-rotate-z, .anim-draw, .anim-float, .anim-opac {
    animation: none !important;
  }
}
