/* 算力中转站 · 入口页（首页、登录页）的品牌区与动效（加载在 glass.css 之后）
   原则：业务内容和表单立刻可见可用，动效只放在品牌区；只动 transform / opacity / clip-path；
   系统开启「减少动态效果」时 app.css 末尾的规则会关闭全部动画，元素直接停在最终状态。 */
:root {
  --fx-a: rgba(226, 150, 108, .30); --fx-b: rgba(214, 178, 140, .26); --fx-c: rgba(164, 155, 196, .16);
  --fx-grid: rgba(113, 81, 53, .10);
  --demo-bg: #FFFFFF; --demo-code: #FBF7F2; --demo-line: #E8E1D9;
  --tok-key: #9E4931; --tok-str: #346538; --tok-num: #1F6C9F; --tok-p: #8A8178;
}
:root[data-theme="dark"] {
  --fx-a: rgba(238, 164, 126, .13); --fx-b: rgba(185, 138, 104, .11); --fx-c: rgba(143, 135, 174, .10);
  --fx-grid: rgba(235, 210, 186, .07);
  --demo-bg: #2A2622; --demo-code: #231F1C; --demo-line: #43392F;
  --tok-key: #EEA47E; --tok-str: #8FC79A; --tok-num: #82B9E0; --tok-p: #9C9084;
}

/* ---------------------------------------------------------------- 背景：三团暖光缓慢漂移 + 点阵 */
.fx-bg { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.fx-bg i { position: absolute; border-radius: 50%; filter: blur(60px); will-change: transform; }
.fx-bg i:nth-child(1) { width: 52vw; height: 52vw; left: -14vw; top: -18vw; background: var(--fx-a); }
.fx-bg i:nth-child(2) { width: 44vw; height: 44vw; right: -12vw; top: 18vh; background: var(--fx-b); }
.fx-bg i:nth-child(3) { width: 36vw; height: 36vw; left: 30vw; bottom: -20vw; background: var(--fx-c); }
.fx-bg::after {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(var(--fx-grid) 1px, transparent 1.2px); background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(70% 60% at 30% 30%, #000 20%, transparent 75%);
  mask-image: radial-gradient(70% 60% at 30% 30%, #000 20%, transparent 75%);
}
body.fx::before { display: none; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin: 0; height: 28px; padding: 0 12px 0 10px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); font-size: 12px; letter-spacing: .04em; width: max-content;
}
.eyebrow .dot { width: 6px; height: 6px; background: var(--green); box-shadow: 0 0 0 3px var(--green-bg); }
.display {
  font-family: var(--serif); color: var(--ink); font-weight: 600; letter-spacing: -.01em;
  font-size: clamp(34px, 4vw, 54px); line-height: 1.18; margin: 0;
}
.display em {
  font-style: normal; color: var(--accent);
  background: linear-gradient(100deg, var(--accent) 20%, var(--accent-soft) 50%, var(--accent) 80%);
  background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.lead { color: var(--mute); font-size: 15px; line-height: 1.75; margin: 0; max-width: 480px; }

/* ---------------------------------------------------------------- 演示窗：一次请求经过中转站、失败自动切换线路 */
.demo { position: relative; width: min(460px, 100%); perspective: 1000px; }
.demo::before {   /* 后面垫一张斜放的纸页，制造层次 */
  content: ""; position: absolute; inset: 18px -14px -14px 18px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--line); transform: rotate(4deg); box-shadow: 0 20px 50px -24px var(--shadow-lg);
}
.demo-win {
  position: relative; border-radius: 16px; background: var(--demo-bg); border: 1px solid var(--line); overflow: hidden;
  box-shadow: 0 30px 60px -28px var(--shadow-lg), 0 2px 6px var(--shadow);
}
.demo-win::after {   /* 斜向扫光 */
  content: ""; position: absolute; inset: -40% auto -40% -60%; width: 40%; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .5), transparent); transform: rotate(18deg) translateX(-200%);
}
:root[data-theme="dark"] .demo-win::after { background: linear-gradient(90deg, transparent, rgba(255, 240, 226, .06), transparent); }
.demo-hd { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-bottom: 1px solid var(--demo-line); }
.demo-hd .tl { display: flex; gap: 6px; }
.demo-hd .tl i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); }
.demo-hd .tl i:nth-child(1) { background: #E8907A; } .demo-hd .tl i:nth-child(2) { background: #E6C068; } .demo-hd .tl i:nth-child(3) { background: #98C49A; }
.demo-hd .ep { font: 12px var(--mono); color: var(--mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.demo-hd .ep b { color: var(--accent); font-weight: 600; margin-right: 6px; }
.demo-hd .live { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--faint); white-space: nowrap; }
.demo-hd .live i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }

.demo-code { margin: 0; padding: 14px 16px; background: var(--demo-code); font: 12px/1.75 var(--mono); color: var(--ink); min-height: 120px; white-space: pre; overflow: hidden; }
.demo-code .ln { display: block; width: max-content; clip-path: inset(0 0 0 0); }
.demo-code .k { color: var(--tok-key); } .demo-code .s { color: var(--tok-str); } .demo-code .n { color: var(--tok-num); } .demo-code .p { color: var(--tok-p); }
.demo-code .caret { display: inline-block; width: 7px; height: 14px; margin-left: 2px; vertical-align: -2px; background: var(--accent); border-radius: 1px; }

.demo-route { position: relative; padding: 10px 12px 4px; border-top: 1px solid var(--demo-line); }
.demo-route svg { display: block; width: 100%; height: auto; overflow: visible; }
.demo-route .wire { fill: none; stroke: var(--line-2); stroke-width: 1.5; stroke-dasharray: 3 4; transition: stroke .3s var(--ease); }
.demo-route .flow { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 16 100; stroke-dashoffset: 16; opacity: 0; }
.demo-route .node rect { fill: var(--surface); stroke: var(--line-2); stroke-width: 1; transition: fill .3s var(--ease), stroke .3s var(--ease); }
.demo-route .node text { font: 500 11px var(--sans); fill: var(--ink-2); }
.demo-route .node .sub { font: 11px var(--mono); fill: var(--faint); }
.demo-route .hub rect { fill: var(--accent); stroke: var(--accent); }
.demo-route .hub text { fill: var(--on-accent); font-weight: 600; }
.demo-route .hub .ring { fill: none; stroke: var(--accent); stroke-width: 1.5; opacity: 0; transform-box: fill-box; transform-origin: center; }
.demo-route .ch.fail rect { fill: var(--red-bg); stroke: var(--red); }
.demo-route .ch.fail text { fill: var(--red); }
.demo-route .ch.ok rect { fill: var(--green-bg); stroke: var(--green); }
.demo-route .ch.ok text { fill: var(--green); }
.demo-route .wire.fail { stroke: var(--red); opacity: .55; }
.demo-route .wire.ok { stroke: var(--green); stroke-dasharray: none; }

.demo-res {
  display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px; border-top: 1px solid var(--demo-line);
  font-size: 12px; color: var(--mute); transition: opacity .3s var(--ease);
}
.demo-res .st { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 6px; font: 600 11px var(--mono); background: var(--sunk); color: var(--faint); transition: background .3s, color .3s; }
.demo-res .st.ok { background: var(--green-bg); color: var(--green); }
.demo-res .msg { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.demo-res .ms { font: 12px var(--mono); color: var(--ink); }

.demo-chip {
  position: absolute; z-index: 2; display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 14px 0 10px;
  border-radius: 999px; background: var(--glass); border: 1px solid var(--glass-line); color: var(--ink); font-size: 12px; font-weight: 500;
  box-shadow: inset 0 1px 0 var(--glass-edge), var(--glass-shadow); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  white-space: nowrap;
}
.demo-chip .ic { width: 14px; height: 14px; color: var(--accent); }
/* 两枚标签浮在窗口边缘的空白处，不压住标题栏和结果行的文字 */
.demo-chip.c1 { right: 92px; top: -22px; }
.demo-chip.c2 { right: 28px; bottom: -26px; }

/* ---------------------------------------------------------------- 登录页 */
body.auth-page { min-height: 100svh; }
.auth {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 48px;
  max-width: 1264px; min-height: 100svh; margin: 0 auto; padding: 32px 48px;
}
.auth-brand { display: flex; flex-direction: column; gap: 28px; justify-content: center; min-width: 0; padding: 24px 0; }
.auth-brand .logo { position: absolute; top: 32px; }
.auth-copy { display: flex; flex-direction: column; gap: 18px; }
.auth-links { display: flex; gap: 16px; font-size: 13px; color: var(--faint); margin: 0; }
.auth-links a { color: var(--mute); display: inline-flex; align-items: center; gap: 4px; }
.auth-links a:hover { color: var(--accent); }
.auth-links .ic { width: 14px; height: 14px; }

/* 表单区：卡片顶部位置固定，三个表单高度不同时只往下长，不再上下跳 */
.auth-side { display: flex; justify-content: center; align-items: flex-start; padding-top: clamp(48px, calc(50svh - 300px), 220px); min-width: 0; }
.auth-card {
  width: min(420px, 100%); padding: 32px; border-radius: 24px; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); box-shadow: 0 24px 60px -28px var(--shadow-lg);
}
.auth-card .hd { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.auth-card h2 { font-size: 22px; font-weight: 600; margin: 0; }
.auth-card .seg { display: flex; margin-bottom: 18px; }
.auth-card .seg button { flex: 1; }
.auth-card .form { gap: 14px; }
/* 表单区统一 lg 档：输入框、获取验证码、提交按钮、分段控件都是 40 高 */
.auth-card input { height: 40px; font-size: 14px; }
.auth-card .code-row .btn { height: 40px; min-width: 104px; }
.auth-card .strip { font-size: 12px; }
/* 没有错误时不占位，避免密码框和按钮之间空一大块 */
.auth-card .err-line:empty { min-height: 0; margin: -7px 0; }
.auth-mlogo { display: none; }
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .auth-card { background: var(--glass); border-color: var(--glass-line); box-shadow: inset 0 1px 0 var(--glass-edge), 0 24px 60px -28px var(--shadow-lg); }
}

@media (max-width: 1080px) { .demo-chip.c2 { display: none; } .auth { gap: 32px; padding: 32px; } }
@media (max-width: 860px) {
  .auth { grid-template-columns: minmax(0, 1fr); padding: 20px 16px; }
  .auth-brand { display: none; }
  .auth-side { padding-top: 40px; }
  .auth-card { padding: 24px 20px; border-radius: 16px; }
  .auth-mlogo { display: flex; margin-bottom: 20px; }
}

/* ---------------------------------------------------------------- 首页首屏 */
.home-hero {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 56px; align-items: center;
  padding: 48px 0 40px; min-height: min(600px, calc(100svh - 56px));
}
.home-copy { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.home-copy .strip { gap: 10px; margin-top: 6px; }
.home-demo { display: flex; justify-content: center; min-width: 0; padding: 20px 24px 20px 0; }
.facts { display: flex; gap: 0; margin-top: 14px; padding-top: 22px; border-top: 1px solid var(--line); max-width: 520px; }
.facts > div { flex: 1; min-width: 0; padding: 0 16px; border-left: 1px solid var(--line); }
.facts > div:first-child { padding-left: 0; border-left: 0; }
.facts .v { font-size: 28px; font-weight: 600; color: var(--ink); line-height: 1.2; font-variant-numeric: tabular-nums; }
.facts .v small { font-size: 13px; font-weight: 500; color: var(--mute); margin-left: 2px; }
.facts .k { font-size: 12px; color: var(--faint); margin-top: 4px; }

.feats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0 0 48px; }
.feat { display: flex; gap: 12px; align-items: flex-start; padding: 16px; }
.feat .fi {
  width: 36px; height: 36px; border-radius: 8px; flex: none; display: grid; place-items: center;
  background: var(--accent-bg); color: var(--accent);
}
.feat h3 { font-size: 14px; margin: 1px 0 2px; }
.feat p { margin: 0; color: var(--mute); font-size: 13px; line-height: 1.6; }
.sec-hd { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; margin: 0 0 16px; }
.sec-hd h2 { font-size: 22px; }
.sec-hd .mute { font-size: 13px; }

@media (max-width: 980px) {
  .home-hero { grid-template-columns: minmax(0, 1fr); gap: 40px; padding: 32px 0 48px; min-height: 0; }
  .home-demo { padding: 8px 12px 8px 0; }
}
@media (max-width: 720px) { .feats { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) { .demo-chip { display: none; } .facts .v { font-size: 22px; } .facts > div { padding: 0 10px; } }

/* ---------------------------------------------------------------- 入场与氛围动效 */
@media (prefers-reduced-motion: no-preference) {
  .fx-bg i:nth-child(1) { animation: fx-drift-a 18s ease-in-out infinite alternate; }
  .fx-bg i:nth-child(2) { animation: fx-drift-b 22s ease-in-out infinite alternate; }
  .fx-bg i:nth-child(3) { animation: fx-drift-c 26s ease-in-out infinite alternate; }
  .rise { animation: fx-rise .8s var(--ease) both; animation-delay: calc(var(--d, 0) * 90ms + 60ms); }
  .display em { animation: fx-shine 6s ease-in-out 1.2s infinite; }
  .demo { animation: fx-tilt-in 1.1s cubic-bezier(.16, 1, .3, 1) .25s both; }
  .demo::before { animation: fx-sheet 1.3s cubic-bezier(.16, 1, .3, 1) .35s both; }
  .demo-win { animation: fx-float 7s ease-in-out 1.6s infinite; }
  .demo-win::after { animation: fx-sheen 9s ease-in-out 2s infinite; }
  .demo-chip.c1 { animation: fx-pop .7s cubic-bezier(.3, 1.5, .5, 1) 1.1s both, fx-float 6s ease-in-out 2s infinite; }
  .demo-chip.c2 { animation: fx-pop .7s cubic-bezier(.3, 1.5, .5, 1) 1.35s both, fx-float 8s ease-in-out 2.2s infinite reverse; }
  .demo-code .caret { animation: fx-caret 1s steps(1) infinite; }
  .demo-hd .live i { animation: fx-ping 1.8s ease-out infinite; }
  .auth-card { animation: fx-form-in .7s cubic-bezier(.16, 1, .3, 1) .1s both; }
  .auth-brand .logo { animation: fx-rise .6s var(--ease) both; }
  .feat { animation: fx-rise .7s var(--ease) both; animation-delay: calc(var(--d, 0) * 80ms + 500ms); }
}
@keyframes fx-drift-a { to { transform: translate(10vw, 8vh) scale(1.12); } }
@keyframes fx-drift-b { to { transform: translate(-8vw, 10vh) scale(.92); } }
@keyframes fx-drift-c { to { transform: translate(-6vw, -8vh) scale(1.15); } }
@keyframes fx-rise { from { opacity: 0; transform: translateY(18px); filter: blur(4px); } }
@keyframes fx-shine { 0%, 100% { background-position: 100% 0; } 50% { background-position: 0 0; } }
@keyframes fx-tilt-in { from { opacity: 0; transform: translateY(40px) rotateX(14deg) rotateY(-12deg) scale(.94); } }
@keyframes fx-sheet { from { opacity: 0; transform: rotate(14deg) translate(30px, 20px); } }
@keyframes fx-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes fx-sheen { 0%, 70% { transform: rotate(18deg) translateX(-200%); } 100% { transform: rotate(18deg) translateX(520%); } }
@keyframes fx-pop { from { opacity: 0; transform: scale(.6) translateY(10px); } }
@keyframes fx-caret { 50% { opacity: 0; } }
@keyframes fx-ping { 0% { box-shadow: 0 0 0 0 var(--green); } 80%, 100% { box-shadow: 0 0 0 6px transparent; } }
@keyframes fx-form-in { from { opacity: 0; transform: translateY(16px) scale(.98); } }

/* 网格里的卡片不叠加 .card + .card 的上边距；锚点跳转避开吸顶栏 */
.feats > .card + .card { margin-top: 0; }
#models { scroll-margin-top: 72px; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
