/* =========================================================
   首页 Hero · 模型接入 → TokenHub（员工帐号 / 独立 Key）→ 企业智能体
   结构见 index.html .thx；连线与光点由 assets/js/hero-flow.js 绘制
   ========================================================= */
.thx {
  --thx-l1: #34d399; --thx-l2: #5eead4;      /* 左侧连线：品牌绿 → 青 */
  --thx-r1: #5eead4; --thx-r2: #a78bfa;      /* 右侧连线：青 → 紫 */
  --thx-panel: rgba(16, 21, 28, .72);
  --thx-node: rgba(26, 32, 41, .82);
  --thx-node-b: rgba(255, 255, 255, .07);
  --thx-grid: rgba(255, 255, 255, .045);
  --thx-dur: 4.2s;
  position: relative; margin-top: var(--sp-12);
  padding: var(--sp-6) var(--sp-6) var(--sp-5);
  border-radius: 24px; text-align: left; isolation: isolate;
  background:
    radial-gradient(520px 320px at 50% 52%, rgba(52, 211, 153, .16), transparent 70%),
    radial-gradient(600px 300px at 100% 100%, rgba(167, 139, 250, .10), transparent 70%),
    radial-gradient(600px 300px at 0% 0%, rgba(45, 212, 191, .08), transparent 70%),
    var(--thx-panel);
  border: 1px solid var(--border);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .05);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
/* 渐变描边 */
.thx::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; z-index: -1; pointer-events: none;
  background: conic-gradient(from var(--thx-a, 0deg), rgba(52,211,153,.0), rgba(52,211,153,.55), rgba(94,234,212,.0) 30%, rgba(167,139,250,.45) 60%, rgba(52,211,153,0) 80%);
  -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: thx-border 9s linear infinite;
}
@property --thx-a { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@keyframes thx-border { to { --thx-a: 360deg; } }
/* 背景网格 */
.thx::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: -1; pointer-events: none;
  background-image: linear-gradient(var(--thx-grid) 1px, transparent 1px), linear-gradient(90deg, var(--thx-grid) 1px, transparent 1px);
  background-size: 32px 32px;
  -webkit-mask-image: radial-gradient(ellipse 60% 70% at 50% 50%, #000, transparent 75%);
  mask-image: radial-gradient(ellipse 60% 70% at 50% 50%, #000, transparent 75%);
}

/* ---------- 步骤 ---------- */
.thx-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: var(--sp-8); }
.thx-step {
  position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; gap: 10px;
  height: 52px; padding: 0 14px; border-radius: var(--r-full); cursor: pointer;
  font: 600 15px/1 var(--font-sans); color: var(--text-2);
  background: rgba(255, 255, 255, .03); border: 1px solid var(--thx-node-b);
  transition: color .3s, border-color .3s, background .3s, box-shadow .3s;
}
.thx-step b {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; flex: none;
  font: 700 13px/1 var(--font-mono); color: var(--text-3); background: rgba(255, 255, 255, .06);
  transition: background .3s, color .3s, box-shadow .3s;
}
.thx-step:hover { color: var(--text); border-color: var(--border-strong); }
.thx-step.is-active { color: var(--text); border-color: rgba(52, 211, 153, .45); background: rgba(52, 211, 153, .07); box-shadow: 0 0 24px rgba(52, 211, 153, .12); }
.thx-step.is-active b { background: var(--grad-brand); color: #06281c; box-shadow: 0 0 14px rgba(52, 211, 153, .55); }
.thx-step i { position: absolute; left: 0; bottom: 0; height: 2px; width: 0; background: var(--grad-brand); }
.thx-step.is-active i { animation: thx-prog var(--thx-dur) linear forwards; }
.thx.is-paused .thx-step.is-active i { animation-play-state: paused; }
@keyframes thx-prog { to { width: 100%; } }

/* ---------- 舞台 ---------- */
.thx-stage {
  position: relative; display: grid; align-items: center; gap: 0 var(--sp-4);
  grid-template-columns: minmax(230px, 290px) 1fr minmax(230px, 290px);
}
.thx-wires { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; z-index: 0; }
.thx-col { position: relative; z-index: 1; display: grid; gap: var(--sp-4); }
.thx-group {
  padding: 14px; border-radius: 18px;
  background: rgba(255, 255, 255, .025); border: 1px solid var(--thx-node-b);
  transition: border-color .4s, box-shadow .4s, background .4s;
}
.thx-group h5 {
  display: flex; align-items: center; gap: 8px; margin: 2px 4px 10px;
  font-size: 12px; font-weight: 700; letter-spacing: .08em; color: var(--text-3);
}
.thx-group h5 i { width: 6px; height: 6px; border-radius: 2px; background: var(--thx-l1); box-shadow: 0 0 8px var(--thx-l1); }
.thx-right .thx-group h5 i { background: var(--thx-r2); box-shadow: 0 0 8px var(--thx-r2); }
.thx-group h5 em { margin-left: auto; font-style: normal; font-weight: 600; letter-spacing: 0; font-size: 11px; color: var(--text-3); }
.thx-list { display: grid; gap: 8px; }

.thx-node {
  position: relative; display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 12px;
  border-radius: 12px; background: var(--thx-node); border: 1px solid var(--thx-node-b);
  transition: transform .35s var(--ease), border-color .35s, box-shadow .35s;
}
.thx-node:hover { transform: translateY(-1px); border-color: var(--border-strong); }
.thx-mark {
  flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px;
  font: 800 13px/1 var(--font-sans); letter-spacing: -.02em; color: #fff;
  background: var(--vm, #34d399); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14), 0 4px 12px rgba(0, 0, 0, .25);
}
.thx-name { display: grid; line-height: 1.25; font-size: 14.5px; font-weight: 650; color: var(--text); min-width: 0; }
.thx-name small { font-size: 11.5px; font-weight: 500; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thx-port {
  position: absolute; top: 50%; width: 9px; height: 9px; margin-top: -4.5px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--thx-l1); transition: box-shadow .3s, background .3s;
}
.thx-left .thx-port { right: -5px; }
.thx-right .thx-port { left: -5px; border-color: var(--thx-r2); }
.thx-node.is-hit { border-color: rgba(52, 211, 153, .55); box-shadow: 0 0 0 1px rgba(52, 211, 153, .25), 0 0 26px rgba(52, 211, 153, .22); }
.thx-right .thx-node.is-hit { border-color: rgba(167, 139, 250, .6); box-shadow: 0 0 0 1px rgba(167, 139, 250, .25), 0 0 26px rgba(167, 139, 250, .25); }
.thx-node.is-hit .thx-port { background: var(--thx-l1); box-shadow: 0 0 12px var(--thx-l1); }
.thx-right .thx-node.is-hit .thx-port { background: var(--thx-r2); box-shadow: 0 0 12px var(--thx-r2); }
/* 右侧：已绑定 Key 标签 */
.thx-key {
  margin-left: auto; flex: none; display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 7px; border-radius: 6px; font: 600 10.5px/1.2 var(--font-mono);
  color: #c4b5fd; background: rgba(167, 139, 250, .12); border: 1px solid rgba(167, 139, 250, .22);
  opacity: .55; transition: opacity .3s, transform .3s;
}
.thx-key svg { width: 11px; height: 11px; }
.thx-node.is-hit .thx-key { opacity: 1; transform: scale(1.06); }
.thx-more {
  display: grid; place-items: center; height: 44px; border-radius: 12px; font-size: 13.5px; font-weight: 600;
  color: var(--text-3); border: 1px dashed var(--border-strong); text-decoration: none; transition: color .25s, border-color .25s;
}
.thx-more:hover { color: var(--primary); border-color: var(--primary); text-decoration: none; }

/* 步骤强调 */
.thx[data-step="1"] .thx-left .thx-group,
.thx[data-step="3"] .thx-right .thx-group { border-color: rgba(52, 211, 153, .28); background: rgba(52, 211, 153, .035); box-shadow: 0 0 40px rgba(52, 211, 153, .07); }
.thx[data-step="3"] .thx-right .thx-group { border-color: rgba(167, 139, 250, .32); background: rgba(167, 139, 250, .04); box-shadow: 0 0 40px rgba(167, 139, 250, .08); }
.thx-wires .w-base { fill: none; stroke-width: 1.2; opacity: .28; }
.thx-wires .w-flow { fill: none; stroke-width: 1.6; stroke-dasharray: 5 7; opacity: .55; animation: thx-dash 1.4s linear infinite; transition: opacity .4s, stroke-width .4s; }
.thx-wires .is-on .w-flow { opacity: 1; stroke-width: 2.2; }
.thx[data-step="1"] .thx-wl .w-flow, .thx[data-step="3"] .thx-wr .w-flow { opacity: .95; }
.thx[data-step="1"] .thx-wr .w-flow, .thx[data-step="3"] .thx-wl .w-flow { opacity: .3; }
@keyframes thx-dash { to { stroke-dashoffset: -24; } }

/* ---------- 中枢 ---------- */
.thx-hub { position: relative; z-index: 1; display: grid; justify-items: center; text-align: center; padding: var(--sp-6) 0; }
.thx-core { position: relative; width: 236px; height: 236px; display: grid; place-items: center; }
.thx-core > * { grid-area: 1 / 1; }
.thx-halo {
  position: absolute; inset: -34px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(52, 211, 153, .30) 0%, rgba(52, 211, 153, .10) 40%, transparent 68%);
  animation: thx-breathe 3.6s ease-in-out infinite;
}
.thx-ring { width: 100%; height: 100%; border-radius: 50%; }
.thx-ring.r1 { border: 1px dashed rgba(94, 234, 212, .35); animation: thx-spin 28s linear infinite; }
.thx-ring.r2 {
  width: 82%; height: 82%;
  background: conic-gradient(from 0deg, transparent 0 62%, rgba(52, 211, 153, .0) 62%, rgba(52, 211, 153, .85) 100%);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 1.5px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 1.5px));
  animation: thx-spin 3.2s linear infinite;
}
.thx-ring.r3 { width: 64%; height: 64%; border: 1px solid rgba(52, 211, 153, .22); }
.thx-orbit { width: 100%; height: 100%; animation: thx-spin 12s linear infinite; }
.thx-orbit.o2 { width: 82%; height: 82%; animation-duration: 7s; animation-direction: reverse; }
.thx-orbit i { position: absolute; top: -3px; left: 50%; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: var(--thx-l2); box-shadow: 0 0 10px var(--thx-l2), 0 0 2px #fff; }
.thx-orbit.o2 i { background: var(--thx-r2); box-shadow: 0 0 10px var(--thx-r2); top: auto; bottom: -3px; }
.thx-hex {
  position: relative; width: 92px; height: 104px; display: grid; place-items: center;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  background: linear-gradient(160deg, #3be3a6 0%, #10b981 45%, #0d9488 100%);
  transition: transform .4s var(--ease);
}
.thx-hex::before {
  content: ""; position: absolute; inset: 3px; clip-path: inherit;
  background: radial-gradient(circle at 50% 30%, #18342b 0%, #0c1a16 75%);
}
.thx-hex svg { position: relative; width: 50px; height: 50px; filter: drop-shadow(0 0 10px rgba(52, 211, 153, .6)); }
.thx-core.is-absorb .thx-hex { transform: scale(1.07); }
.thx-core.is-absorb .thx-halo { animation: none; transform: scale(1.12); opacity: 1; transition: transform .25s; }
.thx[data-step="2"] .thx-ring.r2 { animation-duration: 1.4s; }
.thx[data-step="2"] .thx-halo { background: radial-gradient(circle, rgba(52, 211, 153, .42) 0%, rgba(52, 211, 153, .14) 42%, transparent 70%); }
@keyframes thx-spin { to { transform: rotate(360deg); } }
@keyframes thx-breathe { 50% { transform: scale(1.08); opacity: .8; } }

.thx-title { margin-top: 2px; display: flex; align-items: center; gap: 8px; font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
.thx-title .dot { width: 8px; height: 8px; border-radius: 50%; background: #fb923c; box-shadow: 0 0 0 0 rgba(251, 146, 60, .6); animation: thx-ping 1.8s ease-out infinite; }
.thx-title span:last-child { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
@keyframes thx-ping { 70% { box-shadow: 0 0 0 8px rgba(251, 146, 60, 0); } 100% { box-shadow: 0 0 0 0 rgba(251, 146, 60, 0); } }
.thx-sub { margin: 4px 0 var(--sp-4); font-size: 13px; color: var(--text-3); line-height: 1.6; }

/* Key 发放流水 */
.thx-ticker {
  position: relative; width: min(100%, 330px); height: 46px; overflow: hidden; border-radius: 12px;
  background: rgba(10, 14, 19, .7); border: 1px solid rgba(52, 211, 153, .22);
  box-shadow: inset 0 0 20px rgba(52, 211, 153, .06);
  transition: border-color .4s, box-shadow .4s;
}
.thx[data-step="2"] .thx-ticker { border-color: rgba(52, 211, 153, .55); box-shadow: inset 0 0 20px rgba(52, 211, 153, .1), 0 0 28px rgba(52, 211, 153, .18); }
.thx-tick {
  position: absolute; inset: 0; display: flex; align-items: center; gap: 9px; padding: 0 12px;
  font-size: 12.5px; color: var(--text-2); white-space: nowrap;
  transition: transform .45s var(--ease), opacity .45s;
}
.thx-tick.is-enter { transform: translateY(100%); opacity: 0; }
.thx-tick.is-leave { transform: translateY(-100%); opacity: 0; }
.thx-tick .av { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #06281c; background: var(--grad-brand); }
.thx-tick .who { font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; }
.thx-tick code { font: 600 11.5px var(--font-mono); color: var(--brand-300); background: none; padding: 0; }
.thx-tick .to { margin-left: auto; flex: none; font-size: 11.5px; color: #c4b5fd; }
.thx-stats { display: flex; gap: var(--sp-6); margin-top: var(--sp-4); }
.thx-stats div { display: grid; line-height: 1.3; }
.thx-stats b { font: 700 18px var(--font-mono); color: var(--text); font-variant-numeric: tabular-nums; }
.thx-stats span { font-size: 11.5px; color: var(--text-3); }

.thx-caption { margin: var(--sp-6) 0 0; text-align: center; font-size: 13px; color: var(--text-3); }
.thx-caption b { color: var(--text-2); font-weight: 600; }
.thx-caption .demo { margin-left: 8px; padding: 1px 6px; border-radius: 4px; font-size: 11px; background: rgba(255, 255, 255, .06); }

/* ---------- 亮色主题 ---------- */
:root[data-theme="light"] .thx {
  --thx-l1: #10b981; --thx-l2: #0d9488; --thx-r1: #0d9488; --thx-r2: #7c3aed;
  --thx-panel: rgba(255, 255, 255, .78); --thx-node: #fff; --thx-node-b: #e3ebe8; --thx-grid: rgba(17, 24, 32, .05);
  box-shadow: 0 30px 80px rgba(17, 24, 32, .10), inset 0 1px 0 #fff;
}
:root[data-theme="light"] .thx-step { background: #fff; }
:root[data-theme="light"] .thx-group { background: rgba(247, 250, 249, .8); }
:root[data-theme="light"] .thx-ticker { background: #0f1a17; }
:root[data-theme="light"] .thx-tick .who { color: #e9eef3; }
:root[data-theme="light"] .thx-tick { color: #b4bfcc; }
:root[data-theme="light"] .thx-key { color: #6d28d9; background: rgba(124, 58, 237, .08); border-color: rgba(124, 58, 237, .2); }
:root[data-theme="light"] .thx-wires .w-base { opacity: .35; }
:root[data-theme="light"] .thx-caption .demo { background: var(--bg-muted); }

/* ---------- 响应式 ---------- */
@media (max-width: 1100px) {
  .thx-stage { grid-template-columns: minmax(210px, 250px) 1fr minmax(210px, 250px); }
  .thx-core { width: 190px; height: 190px; }
  .thx-name small { display: none; }
  .thx-key { display: none; }
}
@media (max-width: 900px) {
  .thx { padding: var(--sp-4); border-radius: 18px; }
  .thx-steps { display: flex; gap: 8px; margin-bottom: var(--sp-5); }
  .thx-step { flex: none; height: 44px; padding: 0 7px; font-size: 14px; }
  .thx-step span { display: none; }
  .thx-step.is-active { flex: 1; padding: 0 14px 0 7px; justify-content: flex-start; }
  .thx-step.is-active span { display: inline; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .thx-stage { grid-template-columns: 1fr; gap: 0; }
  .thx-wires { display: none; }
  .thx-port { display: none; }
  .thx-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .thx-left .thx-group:first-child .thx-list { grid-template-columns: 1fr; }
  .thx-list .thx-more { height: auto; min-height: 52px; }
  .thx-key { display: none; }
  .thx-name { font-size: 13.5px; }
  .thx-hub { padding: 36px 0; }
  /* 竖向数据流 */
  .thx-hub::before, .thx-hub::after {
    content: ""; position: absolute; left: 50%; width: 2px; height: 30px; margin-left: -1px;
    background: linear-gradient(180deg, transparent, var(--thx-l1), transparent) 0 0 / 100% 200%;
    animation: thx-vflow 1.2s linear infinite;
  }
  .thx-hub::before { top: 2px; }
  .thx-hub::after { bottom: 2px; background-image: linear-gradient(180deg, transparent, var(--thx-r2), transparent); }
  .thx-core { width: 160px; height: 160px; }
  .thx-halo { inset: -22px; }
  .thx-hex { width: 74px; height: 84px; }
  .thx-hex svg { width: 40px; height: 40px; }
}
@media (max-width: 480px) {
  .thx-node { gap: 9px; padding: 8px 9px; }
  .thx-mark { width: 30px; height: 30px; font-size: 12px; }
  .thx-name { font-size: 13px; }
  .thx-tick .to { display: none; }
  .thx-stats { gap: var(--sp-4); }
}
@keyframes thx-vflow { from { background-position: 0 100%; } to { background-position: 0 -100%; } }

@media (prefers-reduced-motion: reduce) {
  .thx *, .thx::before { animation: none !important; transition: none !important; }
}
