:root {
  --primary: #6B4423;
  --primary-2: #8B5A3C;
  --primary-3: #B87333;
  --primary-glow: #CD853F;
  --accent: #D2691E;
  --accent-2: #E9A368;
  --radius: 20px;
  --maxw: 1160px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font: "Inter", "Noto Sans SC", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", monospace;
}

[data-theme="dark"] {
  --bg: #0F0A08;
  --bg-2: #1A120E;
  --panel: rgba(255, 255, 255, 0.04);
  --panel-2: rgba(255, 255, 255, 0.07);
  --line: rgba(184, 115, 51, 0.16);
  --text: #F5F5F4;
  --muted: #A8A29E;
  --code-bg: #0A0605;
  --accent: var(--accent);
  --cta-text: #FFFFFF;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

[data-theme="light"] {
  --bg: #FFFDFB;
  --bg-2: #F8F4EF;
  --panel: rgba(107, 68, 35, 0.04);
  --panel-2: rgba(107, 68, 35, 0.08);
  --line: rgba(107, 68, 35, 0.15);
  --text: #2C1810;
  --muted: #5C4A3C;
  --code-bg: #2C1810;
  --accent: var(--primary);
  --cta-text: #FFFFFF;
  --shadow: 0 20px 45px rgba(107, 68, 35, 0.12);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background 0.4s var(--ease), color 0.4s var(--ease);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(55vw 55vw at 10% -8%, rgba(160, 82, 45, 0.14), transparent 60%),
    radial-gradient(45vw 45vw at 100% 0%, rgba(205, 133, 63, 0.10), transparent 55%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
  z-index: -2;
  transition: opacity 0.4s;
}

a { color: inherit; text-decoration: none; }

code {
  font-family: var(--mono);
  background: rgba(210, 105, 30, 0.12);
  color: var(--accent);
  padding: 0.12em 0.42em;
  border-radius: 6px;
  font-size: 0.88em;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  transition: background 0.4s var(--ease), box-shadow 0.4s var(--ease), backdrop-filter 0.4s;
}
.nav.scrolled {
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 var(--line);
}
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 15px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 900; }
.brand-mark { width: 28px; height: 28px; object-fit: contain; display: block; filter: drop-shadow(0 2px 8px rgba(160, 82, 45, 0.5)); }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name {
  font-size: 1.2rem; letter-spacing: -0.5px;
  background: linear-gradient(90deg, var(--primary-2), var(--primary-3));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand-cn { font-size: 0.72rem; color: var(--muted); font-weight: 700; letter-spacing: 3px; }
.nav-links { display: flex; gap: 24px; margin-left: auto; }
.nav-links a { color: var(--muted); font-weight: 600; font-size: 0.95rem; position: relative; transition: color 0.25s; }
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: -6px; height: 2px; width: 0;
  background: var(--accent); border-radius: 2px; transition: width 0.3s var(--ease);
}
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { width: 100%; }
.nav-actions { display: flex; align-items: center; gap: 12px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 10px; cursor: pointer; font-size: 1rem;
  background: var(--panel); border: 1px solid var(--line); color: var(--text);
  transition: transform 0.25s, border-color 0.25s;
}
.icon-btn:hover { transform: translateY(-2px); border-color: var(--accent); }
.nav-cta {
  padding: 9px 18px; border-radius: 999px; font-weight: 700; font-size: 0.92rem;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: var(--cta-text); box-shadow: 0 6px 20px rgba(160, 82, 45, 0.32);
  transition: transform 0.25s var(--ease), box-shadow 0.25s;
}
.nav-cta:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(160, 82, 45, 0.45); }
.nav-ghost {
  padding: 8px 16px; border-radius: 999px; font-weight: 600; font-size: 0.92rem;
  border: 1px solid var(--line); color: var(--muted); transition: color 0.25s, border-color 0.25s;
}
.nav-ghost:hover { color: var(--text); border-color: var(--accent); }
.nav-burger { display: none; background: none; border: 0; color: var(--text); font-size: 1.5rem; cursor: pointer; }

.hero {
  position: relative; min-height: 100vh;
  display: flex; align-items: center; justify-content: center; text-align: center;
  padding: 130px 24px 90px; overflow: hidden;
}
.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.hero-glow {
  position: absolute; width: 720px; height: 720px; border-radius: 50%;
  background: radial-gradient(circle, rgba(160, 82, 45, 0.20), transparent 70%);
  top: 46%; left: 50%; transform: translate(-50%, -50%);
  filter: blur(30px); z-index: 0; animation: pulse 7s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: translate(-50%,-50%) scale(1); opacity: 0.8; }
  50% { transform: translate(-50%,-50%) scale(1.15); opacity: 1; }
}
.hero-content { position: relative; z-index: 2; max-width: 860px; }
.hero-badge {
  display: inline-block; padding: 7px 16px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel);
  color: var(--accent); font-weight: 600; font-size: 0.9rem; margin-bottom: 28px;
  backdrop-filter: blur(6px);
}
.hero-title { font-size: clamp(2.8rem, 8vw, 5.4rem); font-weight: 900; line-height: 1.08; letter-spacing: -2px; }
.hero-title .grad {
  background: linear-gradient(100deg, var(--primary-2) 5%, var(--primary-3) 50%, var(--accent) 110%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-tag { margin-top: 20px; color: var(--accent); font-weight: 700; letter-spacing: 1px; font-size: 1.05rem; }
.hero-sub { margin: 16px auto 0; max-width: 620px; color: var(--muted); font-size: 1.12rem; }
.hero-actions { display: flex; gap: 16px; justify-content: center; margin-top: 40px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 40px; justify-content: center; margin-top: 54px; flex-wrap: wrap; }
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat-num {
  font-size: 1.8rem; font-weight: 900;
  background: linear-gradient(120deg, var(--primary-3), var(--accent));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat-label { color: var(--muted); font-size: 0.85rem; letter-spacing: 1px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 30px; border-radius: 999px; font-weight: 700; font-size: 1rem;
  transition: transform 0.25s var(--ease), box-shadow 0.25s; cursor: pointer; border: 0;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: var(--cta-text); box-shadow: 0 8px 26px rgba(160, 82, 45, 0.38);
}
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 14px 38px rgba(160, 82, 45, 0.52); }
.btn-ghost { background: var(--panel); color: var(--text); border: 1px solid var(--line); }
.btn-ghost:hover { transform: translateY(-3px); border-color: var(--accent); color: var(--accent); }

.scroll-hint {
  position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%); z-index: 2;
  width: 26px; height: 42px; border: 2px solid var(--line); border-radius: 14px;
}
.scroll-hint span {
  position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
  width: 4px; height: 8px; border-radius: 2px; background: var(--accent);
  animation: scrolldot 1.6s infinite;
}
@keyframes scrolldot { 0% { opacity: 0; top: 8px; } 50% { opacity: 1; } 100% { opacity: 0; top: 22px; } }

.section { padding: 110px 0; position: relative; }
.section-alt { background: color-mix(in srgb, var(--text) 2%, transparent); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { text-align: center; margin-bottom: 60px; max-width: 640px; margin-left: auto; margin-right: auto; }
.eyebrow {
  display: inline-block; color: var(--accent); font-weight: 700; font-size: 0.82rem;
  letter-spacing: 2px; text-transform: uppercase; margin-bottom: 14px;
}
.section-head h2 { font-size: clamp(1.9rem, 4vw, 2.8rem); font-weight: 900; letter-spacing: -1px; }
.section-desc { margin-top: 16px; color: var(--muted); font-size: 1.05rem; }

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature {
  padding: 32px 28px; border-radius: var(--radius);
  background: var(--panel); border: 1px solid var(--line);
  position: relative; overflow: hidden;
  transition: transform 0.3s var(--ease), border-color 0.3s, background 0.3s;
}
.feature::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--primary-3), var(--accent));
  transform: scaleX(0); transform-origin: left; transition: transform 0.4s var(--ease);
}
.feature:hover { transform: translateY(-6px); border-color: color-mix(in srgb, var(--accent) 40%, transparent); background: var(--panel-2); }
.feature:hover::before { transform: scaleX(1); }
.feature-icon {
  width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center;
  font-size: 1.7rem; margin-bottom: 18px;
  background: linear-gradient(135deg, rgba(160, 82, 45, 0.18), rgba(205, 133, 63, 0.08));
  border: 1px solid var(--line);
}
.feature h3 { font-size: 1.2rem; margin-bottom: 8px; }
.feature p { color: var(--muted); font-size: 0.96rem; }

.lineage { display: flex; align-items: stretch; justify-content: center; gap: 12px; flex-wrap: wrap; }
.lin-node {
  flex: 1; min-width: 190px; max-width: 240px; padding: 26px 22px; border-radius: var(--radius);
  background: var(--panel); border: 1px solid var(--line);
  transition: transform 0.3s var(--ease), border-color 0.3s;
}
.lin-node:hover { transform: translateY(-5px); }
.lin-tag {
  display: inline-block; font-size: 0.72rem; font-weight: 700; letter-spacing: 1px;
  padding: 3px 10px; border-radius: 999px; margin-bottom: 12px;
  background: rgba(210, 105, 30, 0.12); color: var(--accent);
}
.lin-node h3 { font-size: 1.15rem; margin-bottom: 6px; }
.lin-node p { color: var(--muted); font-size: 0.9rem; }
.lin-current {
  background: linear-gradient(135deg, rgba(160, 82, 45, 0.14), rgba(205, 133, 63, 0.06));
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  box-shadow: 0 10px 34px rgba(160, 82, 45, 0.18);
}
.lin-current .lin-tag { background: var(--accent); color: var(--cta-text); }
.lin-arrow { display: flex; align-items: center; color: var(--accent); font-size: 1.6rem; font-weight: 900; }

.download-grid { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 22px; align-items: start; margin-bottom: 30px; }
.dl-card { padding: 34px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); }
.dl-tag {
  display: inline-block; font-size: 0.76rem; font-weight: 700; letter-spacing: 1px;
  padding: 5px 12px; border-radius: 999px; margin-bottom: 16px;
  background: rgba(160, 82, 45, 0.14); color: var(--accent);
}
.dl-tag.alt { background: rgba(205, 133, 63, 0.16); color: var(--accent-2); }
.dl-card h3 { font-size: 1.3rem; margin-bottom: 10px; }
.dl-card > p { color: var(--muted); margin-bottom: 20px; font-size: 0.96rem; }

.code { border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--code-bg); text-align: left; }
.code-bar {
  display: flex; align-items: center; gap: 8px; padding: 10px 14px;
  background: rgba(255, 255, 255, 0.04); border-bottom: 1px solid rgba(255,255,255,0.06);
}
.dot { width: 11px; height: 11px; border-radius: 50%; }
.dot:nth-child(1) { background: #ff5f56; }
.dot:nth-child(2) { background: #ffbd2e; }
.dot:nth-child(3) { background: #27c93f; }
.code-title { color: #9a958f; font-size: 0.82rem; font-family: var(--mono); margin-left: 6px; }
.copy {
  margin-left: auto; background: rgba(210, 105, 30, 0.14); color: var(--primary-3);
  border: 1px solid rgba(210, 105, 30, 0.2); border-radius: 7px; padding: 4px 12px;
  font-size: 0.8rem; cursor: pointer; transition: background 0.2s, color 0.2s; font-family: var(--font);
}
.copy:hover { background: var(--primary-3); color: #FFFFFF; }
.copy.done { background: var(--primary-2); color: #FFFFFF; }
.code pre { padding: 18px 16px; overflow-x: auto; }
.code code { background: none; color: #d6e8c8; padding: 0; font-size: 0.86rem; line-height: 1.8; display: block; white-space: pre; }
.c-cmt { color: #6b7a5c; font-style: italic; }
.c-fn { color: var(--primary-3); }
.c-str { color: #ffca6b; }
.c-tag { color: var(--accent); }

.api-block { max-width: 860px; margin: 0 auto; }
.api-title { text-align: center; font-size: 1.4rem; margin-bottom: 24px; }
.tab-btns { display: flex; gap: 8px; margin-bottom: 16px; justify-content: center; }
.tab-btn {
  padding: 10px 24px; border-radius: 10px; cursor: pointer; font-weight: 700;
  background: var(--panel); color: var(--muted); border: 1px solid var(--line);
  transition: all 0.25s var(--ease); font-family: var(--font); font-size: 0.95rem;
}
.tab-btn.active { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: var(--cta-text); border-color: transparent; }
.tab-panel { display: none; animation: fade 0.4s var(--ease); }
.tab-panel.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.about-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.about-card {
  padding: 30px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line);
  transition: transform 0.3s var(--ease), border-color 0.3s, background 0.3s;
}
.about-card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--accent) 40%, transparent); background: var(--panel-2); }
.about-card h3 { color: var(--accent); margin-bottom: 10px; font-size: 1.2rem; }
.about-card p { color: var(--muted); }
.about-card a { color: var(--accent); border-bottom: 1px dashed color-mix(in srgb, var(--accent) 50%, transparent); }

.support-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 40px; }
.support-card {
  padding: 30px; border-radius: var(--radius); background: var(--panel);
  border: 1px solid var(--line); transition: transform 0.3s var(--ease), border-color 0.3s;
}
.support-card:hover { transform: translateY(-5px); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.support-card h3 { margin-bottom: 6px; font-size: 1.15rem; }
.support-card p { color: var(--muted); font-size: 0.95rem; }
.feedback {
  padding: 38px; border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(160, 82, 45, 0.08), rgba(205, 133, 63, 0.04));
  border: 1px solid var(--line);
}
.feedback h3 { font-size: 1.3rem; margin-bottom: 20px; }
.feedback-list { list-style: none; display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.feedback-list li { display: flex; gap: 12px; align-items: flex-start; }
.feedback-list li span { font-size: 1.3rem; }
.feedback-list li strong { color: var(--accent); }
.feedback-list div { color: var(--muted); }
.feedback-note { margin-top: 24px; color: var(--muted); }
.feedback-note a { color: var(--accent); border-bottom: 1px dashed color-mix(in srgb, var(--accent) 50%, transparent); }

.partners {
  margin-top: 20px;
  padding: 30px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--line);
}
.partners h3 {
  font-size: 1.3rem;
  margin-bottom: 20px;
  text-align: center;
}
.partners table {
  width: 100%;
  border-collapse: collapse;
}
.partners td {
  padding: 20px;
  vertical-align: top;
}
.partners img {
  max-width: 250px;
  height: auto;
  display: block;
  margin: 0 auto 16px;
  border-radius: 12px;
}
.partners b {
  display: block;
  margin: 12px 0;
  font-size: 1.1rem;
}
.partners p {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
  margin: 8px 0;
}
.partners a {
  color: var(--accent);
  border-bottom: 1px dashed color-mix(in srgb, var(--accent) 50%, transparent);
}

.pledge {
  grid-column: 1 / -1;
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 26px 30px;
  border-radius: var(--radius);
  background: linear-gradient(120deg, color-mix(in srgb, var(--primary-3) 20%, transparent), color-mix(in srgb, var(--primary-glow) 12%, transparent));
  border: 1px solid color-mix(in srgb, var(--primary-3) 45%, transparent);
  box-shadow: 0 0 36px color-mix(in srgb, var(--primary-3) 22%, transparent);
  position: relative;
  overflow: hidden;
}
.pledge::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent, color-mix(in srgb, var(--primary-glow) 16%, transparent), transparent);
  transform: translateX(-100%);
  animation: pledge-sweep 4.5s var(--ease) infinite;
}
@keyframes pledge-sweep {
  0%, 60% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
.pledge-icon { width: 40px; height: 40px; object-fit: contain; flex-shrink: 0; filter: drop-shadow(0 2px 10px color-mix(in srgb, var(--primary-3) 60%, transparent)); position: relative; z-index: 1; }
.pledge-text { position: relative; z-index: 1; text-align: center; }
.pledge-text h3 {
  font-size: 1.15rem;
  background: linear-gradient(90deg, var(--primary-3), var(--primary-glow));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  margin-bottom: 6px;
}
.pledge-text p { color: var(--text); opacity: 0.9; font-size: 0.95rem; }

.footer { padding: 60px 0 40px; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--text) 3%, transparent); }
.footer-inner { display: grid; grid-template-columns: 1fr; gap: 30px; align-items: start; }
.footer-brand { text-align: center; }
.footer-brand .brand { justify-content: center; }
.footer-brand p { color: var(--muted); font-size: 0.95rem; margin-top: 12px; max-width: 320px; margin-left: auto; margin-right: auto; }
.footer-links { display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; }
.footer-links a { color: var(--muted); transition: color 0.25s; width: fit-content; }
.footer-links a:hover { color: var(--accent); }
.footer-credit { grid-column: 1 / -1; text-align: center; color: var(--muted); opacity: 0.75; font-size: 0.85rem; border-top: 1px solid var(--line); padding-top: 22px; margin-top: 8px; }
.footer-bottom { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); text-align: center; color: var(--muted); opacity: 0.7; font-size: 0.82rem; }
.footer-bottom p { margin: 8px 0; }
.footer-bottom p + p { margin-top: 4px; }

.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

@media (max-width: 900px) {
  .nav-links, .nav-ghost { display: none; }
  .nav-burger { display: block; }
  .nav-links.open {
    display: flex; flex-direction: column; position: absolute; top: 100%; left: 0; right: 0;
    background: color-mix(in srgb, var(--bg) 96%, transparent); padding: 20px 24px; gap: 16px; border-bottom: 1px solid var(--line);
  }
  .feature-grid, .support-grid { grid-template-columns: repeat(2, 1fr); }
  .lin-arrow { transform: rotate(90deg); }
  .lineage { flex-direction: column; align-items: center; }
  .lin-node { max-width: 100%; width: 100%; }
}
@media (max-width: 620px) {
  .about-grid, .feature-grid, .download-grid, .support-grid, .feedback-list, .footer-inner { grid-template-columns: 1fr; }
  .hero-stats { gap: 26px; }
}
