:root {
  --color-dark: #231334;
  --color-paper: #E9E8EA;
  --color-text: #1C1523;
  --color-brand: #7D14EB;
  --color-accent: #EDD26E;
  
  --radius-card: 20px;
  --radius-btn: 12px;
  --card-border: 2px solid var(--color-text);
  --card-shadow: 4px 4px 0 var(--color-text);
  --section-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --content-max: 960px;
  
  --text-primary: var(--color-text);
  --text-secondary: var(--color-text);
  --text-link: var(--color-brand);
  --text-highlight: var(--color-brand);
  --bg-surface: var(--color-paper);
}

.dark-surface {
  --text-primary: var(--color-paper);
  --text-secondary: rgba(233, 232, 234, 0.85);
  --text-link: var(--color-accent);
  --text-highlight: var(--color-accent);
  --bg-surface: var(--color-dark);
}

.light-card {
  --text-primary: var(--color-text);
  --text-secondary: var(--color-text);
  --text-link: var(--color-brand);
  --text-highlight: var(--color-brand);
  --bg-surface: var(--color-paper);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.75;
  color: var(--text-primary);
  background-color: var(--bg-surface);
}
img, svg { display: block; max-width: 100%; }
a { color: var(--text-link); text-decoration: none; }
a:hover { text-decoration: underline; }
button, a.btn { cursor: pointer; }

.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}

.section {
  padding-block: var(--section-y);
  background-color: var(--bg-surface);
}

.madein {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 0.5em;
  display: inline-block;
}
.dark-surface .madein { color: var(--text-highlight); }
:not(.dark-surface) .madein { color: var(--text-link); }

h1, h2, h3 {
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
  color: var(--text-primary);
  margin-bottom: 0.8em;
}
h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); }
h3 { font-size: 1.35rem; }

p { margin-bottom: 1em; max-width: 38em; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0 1.5em;
  height: 48px;
  border-radius: var(--radius-btn);
  font-weight: 600;
  font-size: 1rem;
  transition: transform 0.2s ease, background-color 0.2s ease;
}
.btn:focus-visible { outline: 2px solid var(--text-link); outline-offset: 2px; }
.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-dark);
  border: none;
}
.btn-primary:hover { transform: translateY(-2px); }
.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 2px solid var(--text-primary);
}
.btn-secondary:hover { background-color: rgba(0,0,0,0.05); }

.card {
  background-color: var(--bg-surface);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  border-radius: var(--radius-card);
  padding: var(--gap);
  margin-bottom: var(--gap);
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--gap);
}
th, td {
  padding: 0.8em 1em;
  text-align: left;
  border-bottom: 1px solid rgba(0,0,0,0.1);
}
th { font-weight: 700; }
.dark-surface th, .dark-surface td { border-color: rgba(255,255,255,0.15); }

details {
  border: var(--card-border);
  border-radius: var(--radius-card);
  margin-bottom: 1em;
  background-color: var(--bg-surface);
}
summary {
  padding: 1em;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  position: relative;
  padding-left: 2em;
}
summary::-webkit-details-marker { display: none; }
summary::before {
  content: "+";
  position: absolute;
  left: 1em;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 700;
}
details[open] summary::before { content: "-"; }
details p { padding: 0 1em 1em; margin: 0; }

.hl { color: var(--text-highlight); }

/* Header & Footer */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--bg-surface);
  border-bottom: 1px solid rgba(0,0,0,0.1);
  padding: 1em 0;
}
.dark-surface header { border-bottom-color: rgba(255,255,255,0.15); }
.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.logo img { height: 32px; width: auto; vertical-align: middle; margin-right: 0.5em; }
nav { display: flex; gap: 1.5em; align-items: center; }
nav a { font-weight: 500; }
nav a[aria-current="page"] { font-weight: 700; text-decoration: underline; }
footer {
  padding: var(--gap) 0;
  border-top: 1px solid rgba(0,0,0,0.1);
  text-align: center;
  font-size: 0.9rem;
}
.dark-surface footer { border-top-color: rgba(255,255,255,0.15); }

/* SVG Animations */
.svg-block { width: 100%; height: auto; overflow: visible; }
.draw { stroke-dasharray: 1; stroke-dashoffset: 0; }
@keyframes drawLine {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}
.anim-draw { animation: drawLine 4s ease-in-out infinite alternate; }

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.anim-float { animation: float 6s ease-in-out infinite; }

@keyframes breathe {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}
.anim-breathe { animation: breathe 3s ease-in-out infinite; }

@keyframes slideIn {
  0%, 100% { transform: translateX(0); opacity: 0.6; }
  50% { transform: translateX(8px); opacity: 1; }
}
.anim-slide { animation: slideIn 5s ease-in-out infinite alternate; }

@keyframes pulseRing {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.05); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.8; }
}
.anim-pulse { animation: pulseRing 4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }

@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;
  }
}

@media (max-width: 768px) {
  .grid-2 { grid-template-columns: 1fr; }
  .flex-col { flex-direction: column; }
}
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.flex-col { display: flex; gap: var(--gap); }
@media (max-width: 768px) { .flex-col { flex-direction: column; } }

/* 兜底：裁掉横向溢出 */
div.container.flex-col {
  overflow-x: clip;
}
/* factory-contrast-width */
@media (min-width: 1440px) {
  [data-fc-1440="paper"] {
    color: #e9e8ea !important;
    -webkit-text-fill-color: #e9e8ea !important;
  }
}
