/* 致谢轨道页：浅色主题，取色对齐 site.css（白底 / 墨色 / 朱砂） */

html { background: #ffffff; }

@property --border-angle { syntax: '<angle>'; initial-value: 0deg; inherits: false; }

.to-root {
  --to-bg: #ffffff;
  --to-bg-deep: #f6f6f4;
  --to-accent: #b04a2e;
  --to-accent-deep: #8f3c26;
  --to-accent-tint: #f6e7df;
  --to-ink: #28241b;
  --to-ink-soft: #6d675a;
  --to-ink-faint: #a09a8b;
  --to-line: rgb(40 36 27 / 14%);
  --to-line-soft: rgb(40 36 27 / 8%);
  --to-card: rgba(255, 255, 255, .95);
  --to-chip: #ffffff;
  /* 分组语义色：发起/特别感谢=朱砂，反馈 Bug=琥珀，提出建议=绿 */
  --to-glow-founder: #b04a2e;
  --to-glow-special: #b04a2e;
  --to-glow-bug: #8a5f16;
  --to-glow-idea: #3f6d47;
  --to-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --to-sans: 'Almarai', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', 'Segoe UI', sans-serif;
  --to-serif: 'Almarai', 'Songti SC', 'STSong', 'Noto Serif SC', serif;
  --viz-scale: 1;

  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(640px circle at 12% 18%, rgb(176 74 46 / .07), transparent 62%),
    radial-gradient(820px circle at 88% 78%, rgb(176 74 46 / .05), transparent 62%),
    var(--to-bg);
  color: var(--to-ink);
  font-family: var(--to-sans);
  overflow-x: clip;
}

::selection { background: var(--to-accent-tint); }

/* ---------- 页头 ---------- */

.to-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: 1920px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 64px;
  box-sizing: border-box;
}
html.js .to-header { animation: to-fade-down .8s var(--to-ease) both; }

.to-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.to-brand-logo { display: block; width: auto; height: 56px; }
@media (max-width: 768px) { .to-brand-logo { height: 40px; } }

.to-nav { display: flex; align-items: center; gap: 28px; }
.to-nav-links { display: flex; align-items: center; gap: 28px; }
.to-nav a {
  position: relative;
  color: var(--to-ink);
  font-size: 15px;
  font-weight: 400;
  text-decoration: none;
  padding: 4px 0;
}
.to-nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s ease;
}
.to-nav a:hover::after { transform: scaleX(1); }
.to-nav .to-ghost { font-weight: 500; }

/* ---------- 按钮（流光描边 + 滑入填充） ---------- */

.btn-border-wrap {
  position: relative;
  padding: 3px;
  border-radius: 53px;
  box-shadow: 0 0 0 1.5px rgb(176 74 46 / .22);
}
.btn-border-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50px;
  padding: 3px;
  background: conic-gradient(from var(--border-angle), #b04a2e, #f6e7df, #b04a2e, #f6e7df, #b04a2e);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  animation: to-border-rot 3s linear infinite;
}
@keyframes to-border-rot { to { --border-angle: 360deg; } }

.to-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 26px;
  border: 0;
  border-radius: 50px;
  background: var(--to-accent);
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  font-family: var(--to-sans);
  text-decoration: none;
  overflow: hidden;
  cursor: pointer;
  z-index: 1;
}
.to-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--to-accent-deep);
  transform: translateX(-101%);
  transition: transform .4s var(--to-ease);
  z-index: -1;
}
.to-btn:hover::after { transform: translateX(0); }
.to-btn:focus-visible { outline: 2px solid var(--to-accent); outline-offset: 3px; }

.to-btn-lg { padding: 14px 28px; font-size: 16px; }
.to-btn-lg::after { transform: translateX(101%); }
.to-btn-lg:hover::after { transform: translateX(0); }
.to-btn-lg svg { width: 18px; height: 18px; }

/* ---------- 主体两栏 ---------- */

.to-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  max-width: 1920px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 64px 40px;
  box-sizing: border-box;
}

.to-hero-left { flex: 0 1 600px; padding-top: 40px; position: relative; }
html.js .to-hero-left { animation: to-fade-up 1s var(--to-ease) both; }

.to-eyebrow { margin: 0 0 16px; color: var(--to-accent); font-size: 12px; font-weight: 700; letter-spacing: .3em; text-transform: uppercase; }

.to-heading {
  margin: 0;
  font-family: var(--to-serif);
  font-size: 56px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -1px;
  color: var(--to-ink);
  min-height: 2.4em;
}
.to-heading .tw-a { color: var(--to-ink); }
.to-heading .tw-b { color: var(--to-accent); }
.tw-cursor {
  display: inline-block;
  width: 3px;
  height: .95em;
  margin-left: 4px;
  background: var(--to-accent);
  vertical-align: -0.12em;
  animation: tw-blink .8s steps(1) infinite;
}
@keyframes tw-blink { 50% { opacity: 0; } }

.to-lead {
  max-width: 480px;
  margin: 22px 0 0;
  color: var(--to-ink-soft);
  font-size: 16px;
  line-height: 1.9;
}
.to-cta-row { margin-top: 34px; display: flex; align-items: center; gap: 20px; }

/* 打字机结束后逐个显现的元素 */
html.js:not(.tw-done) .after-type { opacity: 0; transform: translateY(14px); }
html.js .after-type { transition: opacity .6s var(--to-ease), transform .6s var(--to-ease); }
html.tw-done .to-lead { transition-delay: .05s; }
html.tw-done .to-cta-row { transition-delay: .25s; }

/* ---------- 右侧轨道可视化 ---------- */

.to-hero-right { flex: 1; display: flex; justify-content: center; position: relative; align-self: center; }
html.js .to-hero-right { animation: to-hero-scale 1.2s var(--to-ease) .3s both; }

.to-math-chars { position: absolute; inset: 0; pointer-events: none; font-family: var(--to-serif); color: var(--to-ink); opacity: .05; user-select: none; }
.to-math-chars span { position: absolute; }

.viz-box { position: relative; width: calc(720px * var(--viz-scale)); height: calc(720px * var(--viz-scale)); flex-shrink: 0; }
.to-viz { position: absolute; left: 50%; top: 50%; width: 720px; height: 720px; transform: translate(-50%, -50%) scale(var(--viz-scale)); }

@keyframes to-rot { to { rotate: 360deg; } }

.orbit {
  position: absolute;
  left: 50%; top: 50%;
  translate: -50% -50%;
  border-radius: 50%;
}
.orbit::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(180deg, rgb(176 74 46 / 0) 0%, rgb(176 74 46 / .5) 43%, rgb(176 74 46 / 0) 100%);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 1.5px), #000 calc(100% - 1px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 1.5px), #000 calc(100% - 1px));
}
/* 内圈盖在外圈之上：内圈头像的提示框不会被外圈元素遮挡 */
.orbit-1 { width: 353px; height: 353px; z-index: 4; animation: to-rot 30s linear infinite reverse; }
.orbit-2 { width: 501px; height: 501px; z-index: 3; animation: to-rot 40s linear infinite; }
.orbit-3 { width: 649px; height: 649px; z-index: 2; animation: to-rot 50s linear infinite; }
.orbit-4 { width: 797px; height: 797px; z-index: 1; animation: to-rot 60s linear infinite reverse; }

.orbit-1 .av-counter { animation: to-rot 30s linear infinite; }
.orbit-2 .av-counter { animation: to-rot 40s linear infinite reverse; }
.orbit-3 .av-counter { animation: to-rot 50s linear infinite reverse; }
.orbit-4 .av-counter { animation: to-rot 60s linear infinite; }

/* 提示框打开时全部轨道暂停，方便阅读 */
.to-viz.paused .orbit,
.to-viz.paused .av-counter { animation-play-state: paused; }

/* ---------- 人物（头像图片或首字母） ---------- */

.av-pos {
  position: absolute;
  left: 50%; top: 50%;
  width: 0; height: 0;
  transform: rotate(var(--a)) translateX(var(--r)) rotate(calc(-1 * var(--a)));
}
.av-fly { animation: to-fly .7s var(--to-ease) backwards; animation-delay: var(--delay); }
@keyframes to-fly {
  from { transform: scale(.3) rotate(-180deg); filter: blur(6px); opacity: 0; }
}

.av-btn {
  position: absolute;
  left: calc(var(--size) * var(--av-zoom, 1) / -2);
  top: calc(var(--size) * var(--av-zoom, 1) / -2);
  width: calc(var(--size) * var(--av-zoom, 1));
  height: calc(var(--size) * var(--av-zoom, 1));
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
  z-index: 2;
}
.av-btn.open { z-index: 50; }

.av-core {
  width: 100%; height: 100%;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: var(--to-chip);
  border: 1.5px solid var(--to-line);
  box-shadow: 0 0 24px color-mix(in srgb, var(--glow) 22%, transparent);
  box-sizing: border-box;
  transition: transform .25s var(--to-ease), box-shadow .25s var(--to-ease), border-color .25s ease;
}
.av-core img { width: 100%; height: 100%; object-fit: cover; display: block; }
.av-btn:hover .av-core,
.av-btn.open .av-core,
.av-btn:focus-visible .av-core {
  transform: scale(1.15);
  border-color: var(--glow);
  box-shadow: 0 0 34px color-mix(in srgb, var(--glow) 45%, transparent);
}
.av-btn:focus-visible { outline: none; }
.av-initial { color: var(--to-ink); font-weight: 600; font-size: calc(var(--size) * var(--av-zoom, 1) * .3); letter-spacing: .02em; }

/* 中央发起人卡：朱砂实底圆 + 头像，徽章挂在圆下方 */
.to-center-btn {
  position: absolute;
  left: 50%; top: 50%;
  width: calc(96px * var(--av-zoom, 1));
  height: calc(96px * var(--av-zoom, 1));
  margin: calc(96px * var(--av-zoom, 1) / -2) 0 0 calc(96px * var(--av-zoom, 1) / -2);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  z-index: 3;
}
.to-center-btn .av-core {
  border-width: 2px;
  border-color: var(--to-accent);
  background: var(--to-accent-tint);
  box-shadow: 0 0 44px rgb(176 74 46 / .35);
}
.to-center-btn:hover .av-core,
.to-center-btn.open .av-core { transform: scale(1.08); border-color: var(--to-accent-deep); }
.to-center-fallback { font-size: 34px; font-weight: 600; line-height: 1; color: var(--to-accent); }
.to-role {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  padding: 2px 10px;
  border: 1px solid var(--to-line);
  border-radius: 999px;
  background: var(--to-bg);
  font-size: 11px;
  color: var(--to-ink-soft);
  line-height: 1.4;
  white-space: nowrap;
}

/* ---------- 贡献提示框 ---------- */

.av-tip {
  position: absolute;
  bottom: calc(100% + 14px);
  left: 50%;
  width: max-content;
  max-width: min(240px, 72vw);
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--to-line);
  background: var(--to-card);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 12px 40px rgb(40 36 27 / .14);
  text-align: left;
  opacity: 0;
  transform: translateX(calc(-50% + var(--nudge, 0px))) scale(.92) translateY(6px);
  transition: opacity .2s var(--to-ease), transform .2s var(--to-ease);
  pointer-events: none;
  z-index: 60;
}
.av-btn.open .av-tip { opacity: 1; transform: translateX(calc(-50% + var(--nudge, 0px))) scale(1) translateY(0); }
.av-tip.below { bottom: auto; top: calc(100% + 14px); }
.av-tip::after {
  content: "";
  position: absolute;
  left: calc(50% - var(--nudge, 0px) - 5px);
  bottom: -5px;
  width: 9px; height: 9px;
  rotate: 45deg;
  background: var(--to-bg);
  border-right: 1px solid var(--to-line);
  border-bottom: 1px solid var(--to-line);
}
.av-tip.below::after { bottom: auto; top: -5px; rotate: 225deg; }

.av-tip-name { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.av-tip-name b { font-size: 15px; font-weight: 600; color: var(--to-ink); }
.av-tip-group {
  padding: 1px 8px;
  border: 1px solid var(--glow);
  border-radius: 999px;
  color: var(--glow);
  font-size: 11px;
  white-space: nowrap;
}
.av-tip-desc { margin: 0; color: var(--to-ink-soft); font-size: 13px; line-height: 1.7; }

/* ---------- 签名句（沿用原致谢页收尾） ---------- */

.to-sign {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 0;
  padding: 0 24px;
  color: var(--to-ink-faint);
  font-family: var(--to-serif);
  font-size: 15px;
}
.to-sign::before, .to-sign::after { content: ""; width: 44px; border-top: 1px solid var(--to-line); }

/* ---------- 底部贡献滚动条 ---------- */

.to-ticker {
  overflow: hidden;
  padding: 18px 0 26px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
html.js .to-ticker { animation: to-fade-up 1s var(--to-ease) .6s both; }
.tick-track { display: flex; width: max-content; animation: to-tick 22s linear infinite; }
.tick-group { display: flex; gap: 48px; padding-right: 48px; }
.tick-group span {
  padding: 10px 22px;
  border: 1px solid var(--to-line);
  border-radius: 999px;
  background: rgb(246 246 244 / .7);
  color: var(--to-ink-soft);
  font-size: 14px;
  white-space: nowrap;
}
@keyframes to-tick { to { transform: translateX(-50%); } }

/* ---------- 入场动画 ---------- */

@keyframes to-fade-down { from { opacity: 0; transform: translateY(-20px); } }
@keyframes to-fade-up { from { opacity: 0; transform: translateY(40px); } }
@keyframes to-hero-scale { from { opacity: 0; transform: scale(.85); } }

/* ---------- 减少动态 ---------- */

html.rm .orbit,
html.rm .av-counter,
html.rm .av-fly,
html.rm .tick-track,
html.rm .btn-border-wrap::before,
html.rm .tw-cursor { animation: none; }
html.rm .to-header,
html.rm .to-hero-left,
html.rm .to-hero-right,
html.rm .to-ticker { animation: none; }

/* ---------- 响应式 ---------- */

@media (max-width: 1280px) { .to-root { --viz-scale: .85; } }

@media (max-width: 1024px) {
  .to-main { flex-direction: column; align-items: flex-start; gap: 8px; }
  .to-hero-right { align-self: center; width: 100%; }
  .to-heading { font-size: 42px; }
  .to-nav { gap: 18px; }
  .to-root { --viz-scale: .7; }
}

@media (max-width: 768px) {
  .to-nav .to-nav-links { display: none; }
  .to-nav { gap: 14px; }
  .to-header { padding: 18px 24px; }
  .to-hero-left { padding-top: 8px; }
  .to-heading { font-size: 30px; letter-spacing: 0; min-height: 0; }
  .to-eyebrow { margin-bottom: 12px; }
  .to-lead { margin-top: 16px; font-size: 15px; }
  .to-cta-row { margin-top: 24px; }
  .to-main { padding: 8px 24px 24px; gap: 12px; }
  /* 最外圈 797px：768 档缩到 0.58（约 462px），保证不超出屏宽 */
  .to-root { --viz-scale: .58; --av-zoom: 1.7; }
}

@media (max-width: 480px) {
  .to-heading { font-size: 26px; }
  .to-nav .to-ghost { display: none; }
  .to-btn { padding: 10px 20px; font-size: 14px; }
  .to-btn-lg { padding: 12px 22px; font-size: 15px; }
  .to-cta-row { flex-wrap: wrap; }
  .to-root { --viz-scale: .46; }
}

@media (max-width: 380px) {
  .to-root { --viz-scale: .42; --av-zoom: 1.85; }
}
