:root {
  --color-dark: #271334;
  --color-paper: #E9E8EA;
  --color-text: #1D1523;
  --color-brand: #8A13DD;
  --color-accent: #9EED6E;
  --color-card-bg: #DAD9DB;
  --color-card-bg-alt: #F0EFF1;
  --color-divider: rgba(0, 0, 0, 0.08);
  --color-dark-divider: rgba(255, 255, 255, 0.1);

  --radius-card: 20px;
  --radius-btn: 12px;
  --card-border: 0;
  --card-shadow: none;

  --section-y: clamp(2.5rem, 5vw, 4rem);
  --gap: clamp(0.75rem, 1.5vw, 1.25rem);
  --line-height-body: 1.55;

  --content-max: 1280px;

  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans SC", "PingFang SC", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background-color: var(--color-paper);
  color: var(--color-text);
  line-height: var(--line-height-body);
  font-size: 1rem;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4 { font-weight: 500; line-height: 1.15; letter-spacing: -0.01em; color: inherit; }
h1 { font-size: clamp(2.6rem, 6.4vw, 5rem); margin-bottom: var(--gap); text-wrap: balance; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-top: calc(var(--section-y) * 0.5); margin-bottom: var(--gap); }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); margin-bottom: var(--gap); }
p { margin-bottom: var(--gap); max-width: 38em; }
a { color: var(--color-brand); text-decoration: underline; text-underline-offset: 4px; }
.dark-mode a { color: var(--color-accent); }
.dark-mode .container p { color: #e9e8ea; }

/* Layout */
.container { width: 100%; max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gap); }
.section { padding: var(--section-y) 0; position: relative; }
.section + .section { border-top: 1px solid var(--color-divider); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); align-items: center; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }
@media (min-width: 768px) {
  .grid-2-col { grid-template-columns: 1fr 1fr; }
  .grid-3-col { grid-template-columns: repeat(3, 1fr); }
}

/* Header & Footer */
header { position: sticky; top: 0; z-index: 100; background: rgba(233, 232, 234, 0.92); backdrop-filter: blur(10px); border-bottom: 1px solid rgba(0,0,0,0.06); }
.header-inner { display: flex; justify-content: space-between; align-items: center; height: 64px; }
.logo img { height: 32px; width: auto; vertical-align: middle; display: block; }
nav ul { display: flex; gap: var(--gap); list-style: none; }
nav a { color: var(--color-text); text-decoration: none; font-weight: 500; padding: 8px 12px; border-radius: 8px; transition: background 0.2s ease; }
nav a:hover, nav a[aria-current="page"] { background: rgba(0,0,0,0.05); color: var(--color-brand); }
.footer-inner { display: flex; flex-direction: column; gap: var(--gap); align-items: center; text-align: center; }
.footer-nav { display: flex; gap: var(--gap); flex-wrap: wrap; justify-content: center; }
.footer-nav a { color: var(--color-accent); text-decoration: none; font-size: 0.9rem; }
.footer-copy { font-size: 0.85rem; opacity: 0.8; margin-top: var(--gap); }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 12px; padding: 14px 28px; font-size: 1rem; font-weight: 600; border-radius: var(--radius-btn); cursor: pointer; text-decoration: none; transition: transform 0.2s ease, background 0.2s ease; border: none; }
.btn-primary { background: var(--color-accent); color: var(--color-dark); }
.btn-primary:hover { transform: translateY(-2px); background: #8dd860; }
.btn-secondary { background: transparent; border: 2px solid var(--color-text); color: var(--color-text); }
.dark-mode .btn-secondary { border-color: var(--color-paper); color: var(--color-paper); }
.btn-secondary:hover { opacity: 0.85; transform: translateY(-2px); }
.btn:focus-visible { outline: 3px solid var(--color-brand); outline-offset: 2px; }

/* Cards & Panels */
.card { background: var(--color-card-bg); border: var(--card-border); box-shadow: var(--card-shadow); border-radius: var(--radius-card); padding: var(--gap); }
.card-alt { background: var(--color-card-bg-alt); }
.panel { background: var(--color-dark); color: var(--color-paper); border-radius: var(--radius-card); padding: var(--gap); }
.panel .hl { color: var(--color-accent); }

/* Tables */
table { width: 100%; border-collapse: collapse; margin-bottom: var(--gap); }
th, td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--color-divider); }
th { font-weight: 600; white-space: nowrap; }
.dark-mode th, .dark-mode td { border-color: var(--color-dark-divider); }
td { word-break: break-word; }

/* FAQ */
details { margin-bottom: var(--gap); border: 1px solid var(--color-divider); border-radius: 12px; overflow: hidden; background: var(--color-card-bg-alt); }
summary { padding: 16px; cursor: pointer; font-weight: 500; list-style: none; display: flex; justify-content: space-between; align-items: center; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-size: 1.2em; transition: transform 0.2s; }
details[open] summary::after { transform: rotate(45deg); }
details[open] summary { border-bottom: 1px solid var(--color-divider); }
.faq-content { padding: 16px; line-height: 1.6; }

/* SVG Animations */
svg.flow-svg { width: 100%; height: auto; max-width: 100%; display: block; }
.flow-dot { animation: flowDash 4s linear infinite; }
.flow-line { animation: flowDash 6s linear infinite; }
.float-up { animation: floatUp 5s ease-in-out infinite alternate; }
.fade-in { animation: fadeIn 4s ease-in-out infinite alternate; }
@keyframes flowDash { 0% { stroke-dashoffset: 1; } 100% { stroke-dashoffset: 0; } }
@keyframes floatUp { 0% { transform: translateY(0); } 100% { transform: translateY(-8px); } }
@keyframes fadeIn { 0% { opacity: 0.7; } 100% { opacity: 1; } }
.animated-element { transform-box: fill-box; transform-origin: center; }

/* 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; }
  .flow-dot, .flow-line, .float-up, .fade-in { animation: none !important; }
}

/* Utility */
.hl { color: var(--color-brand); }
.dark-mode .hl { color: var(--color-accent); }
.badge { display: inline-block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; margin-bottom: 8px; color: var(--color-brand); }
.dark-mode .badge { color: var(--color-accent); }
.step-num { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; background: var(--color-accent); color: var(--color-dark); font-weight: 700; border-radius: 8px; margin-right: 10px; font-size: 0.9rem; }
.dark-mode .step-num { background: var(--color-accent); color: var(--color-dark); }
ul.list-disc { list-style-type: disc; padding-left: 20px; }
ul.list-disc li { margin-bottom: 8px; }
ol.list-decimal { list-style-type: decimal; padding-left: 20px; }
ol.list-decimal li { margin-bottom: 8px; }
@media (max-width: 767px) {
  .header-inner { flex-direction: column; height: auto; padding: 12px 0; gap: 12px; }
  nav ul { flex-wrap: wrap; justify-content: center; }
  .grid-2-col, .grid-3-col { grid-template-columns: 1fr; }
}
