/* ============================================================
   Shulan GPU —— 全站样式。不引入任何框架/CDN，纯手写。
   ------------------------------------------------------------
   设计语言沿用上线前那版入口页（珍珠黑 + 蓝紫渐变 + 玻璃质感），
   因为它比后来的「藏青 + 绿」更像 AI 产品而不是终端工具。

   ⚠️ 品牌色与状态色是【两套东西】，别混：
      品牌色（--a1/--a2）= 按钮、链接、选中态，走蓝紫渐变
      状态色（--ok/--warn/--bad）= 只表达成败，成功永远是绿的
     把成功改成品牌色，用户就分不清「这是个按钮」和「这是成功了」。
   ============================================================ */

:root {
  /* ---- 底色：珍珠黑。别用藏青（#0b0f14 那种），那个色相会发灰发闷 ---- */
  --bg: #07070b;
  --card: rgba(255, 255, 255, .035);      /* 玻璃，不是实色 */
  --card2: rgba(255, 255, 255, .062);
  --line: rgba(255, 255, 255, .075);
  --line-h: rgba(255, 255, 255, .16);     /* hover 时的亮边 */

  --txt: #e9e9f0;
  --dim: #8b8b9c;
  --dim2: #5c5c6b;

  /* ---- 品牌：蓝 → 紫。想整体换回原来的绿，只改这两个值就够 ---- */
  --a1: #4d8dff;
  --a2: #a855f7;
  --acc: var(--a1);                        /* 兼容旧变量名 */
  --acc-dim: #3a6fd8;
  --acc-bg: rgba(77, 141, 255, .13);
  --grad: linear-gradient(135deg, var(--a1), var(--a2));

  /* ---- 状态 ---- */
  --ok: #2ed573;
  --warn: #f5b954;
  --bad: #ff5c6c;
  --info: #4d8dff;

  --r: 15px;
  --r-sm: 10px;
  --ease: cubic-bezier(.2, .8, .3, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg); color: var(--txt);
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
/* 纵向 flex，把页脚留在视口底部。为什么非做不可：整机出租页在「市场里
   暂时没有机器」时正文只有两百来像素高，块流下页脚就跟着内容停在半空 ——
   1440×900 上量到页脚底边在 580px，下面 320px 全是空黑。而那个状态
   恰好是新用户第一次打开这一页看到的样子。
   剩余空间由页脚的 margin-top:auto 吃掉（见下面 .foot-wrap）。
   ⚠️ 代价：body 的子元素之间不再折叠外边距。现在 26 个页面的顶层子元素
   只有 header / .wrap / .wrap-sm / .mask / script，它们的垂直外边距都是 0，
   没有可折叠的东西，所以这一改是干净的。以后往 body 下加带垂直外边距的
   元素时要记得这一条。 */
body { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
/* 顶部光晕。position:fixed 让它不跟着页面滚，滚到哪都像有环境光。
   透明度压得很低 —— 高了就成廉价霓虹灯了。 */
body::before {
  content: ""; position: fixed; z-index: 0; pointer-events: none;
  top: -38vh; left: 50%; transform: translateX(-50%);
  width: min(1100px, 150vw); height: min(780px, 110vh);
  background: radial-gradient(ellipse at center,
              rgba(77, 141, 255, .14), rgba(168, 85, 247, .07) 42%, transparent 68%);
}
body > * { position: relative; z-index: 1; }

a { color: var(--a1); text-decoration: none; transition: color .18s var(--ease); }
a:hover { color: #7aa9ff; text-decoration: none; }
h1, h2, h3, h4 { margin: 0 0 .6em; font-weight: 620; line-height: 1.25; letter-spacing: -.018em; }
h1 { font-size: clamp(27px, 3.4vw, 34px); }
h2 { font-size: clamp(19px, 2.2vw, 23px); }
h3 { font-size: 16px; }
p { margin: 0 0 1em; }
code, .mono {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 13px; font-variant-numeric: tabular-nums;
}
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
::selection { background: rgba(77, 141, 255, .32); }

/* ---------- 布局 ---------- */
/* ⚠️ width:100% 不是多余的，删掉会静默地毁掉每一页的宽度：
   body 现在是纵向 flex（为了页脚贴底），而 flex 的 stretch【在交叉轴外边距
   是 auto 时会失效】（规范原话：cross-axis margins 不能是 auto）——
   .wrap 的 `margin: 0 auto` 正好就是 auto，于是它退化成「按内容宽收缩」：
   控制台实测从 1080 掉到 976、页脚窄到 742，整页跟着变高，而页面上看着
   只是「字好像挤了点」，没人会往布局模型上想。
   写死 width:100%（配合全局 box-sizing:border-box）让交叉轴尺寸成为确定值，
   拉伸与否都影响不到它。在普通块流里它和默认的 auto 等价，是空操作。 */
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.wrap-sm { width: 100%; max-width: 460px; margin: 0 auto; padding: 0 20px; }
.row { display: flex; gap: 12px; align-items: center; }
.row-between { display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.row-wrap { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.grid-stats { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
/* 只有一两张数字卡时用的变体：给列宽封顶，不让它铺满。
   auto-fit 会把没占满的列收掉、把宽度全分给还在的列，所以同一个类
   在控制台是 4×260（正好），而钱包页只有两张卡时每张被拉到 533px ——
   一个「1737.00」占半个屏、右边大片空着，看着像少画了东西。
   为什么不做成 .grid-stats 的默认行为：三张卡（托管页）铺满整整一行是好看的，
   把它们收窄到 260 反而会在右边留一条缝。所以「收窄」只在卡片少的时候要，
   用这个类显式声明，不动其余的页面。 */
.grid-stats.tight { grid-template-columns: repeat(auto-fit, minmax(150px, 260px)); justify-content: start; }

/* 两栏版式：钱包的「充值码 | 流水」、订单详情的「正文 | 侧栏」。
   ⚠️ 这两处原来把 grid-template-columns 写成【内联样式】，而内联样式优先级
   高于样式表 —— 下面 @media 里那条 `.grid { grid-template-columns: 1fr }`
   被它稳稳压过去，手机上仍然是两栏。实测 500px 下钱包是 109.9px + 562.7px：
   充值码那张卡被挤到 110px（输入框和按钮都没法按），整页横向溢出到 701px，
   用户得左右拖着看。写成一个类才吃得掉媒体查询。
   minmax(0, …) 也是必需的：1fr 等价于 minmax(auto, 1fr)，那个 auto 下限是
   内容的 min-content，流水表的 min-content 有 561px，硬顶着不让列变窄 ——
   换成 0 下限之后列可以缩，表格自己用 .tbl-scroll 横向滚，页面不会被撑开。 */
.cols-2  { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); align-items: start; }
.cols-2r { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; }
.mt { margin-top: 18px; } .mt-sm { margin-top: 8px; } .mt-lg { margin-top: 38px; }
.mb0 { margin-bottom: 0; } .center { text-align: center; }
.dim { color: var(--dim); } .small { font-size: 13px; } .tiny { font-size: 12px; }
.nowrap { white-space: nowrap; }

/* 小节标题：大写 + 字距 + 一条往右淡出的分隔线（旧入口页的手艺） */
.sec-title {
  display: flex; align-items: center; gap: 12px;
  font-size: 12px; font-weight: 600; letter-spacing: .12em;
  color: var(--dim2); margin: 0 0 16px 0;
}
.sec-title::after {
  content: ""; flex: 1; height: 1px;
  background: linear-gradient(90deg, var(--line), transparent);
}

/* ---------- 顶栏 ---------- */
.nav {
  position: sticky; top: 0; z-index: 20;
  background: rgba(7, 7, 11, .72); backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.nav-in { display: flex; align-items: center; gap: 22px; height: 62px; }
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 640; font-size: 15.5px; color: var(--txt); letter-spacing: -.01em;
}
.brand:hover { color: var(--txt); text-decoration: none; }
/* 渐变 logo 方块 —— 品牌最便宜的「贵」感来源 */
.brand .mark {
  width: 28px; height: 28px; border-radius: 9px; flex: 0 0 auto;
  background: var(--grad); display: grid; place-items: center;
  box-shadow: 0 5px 16px -5px rgba(77, 141, 255, .7);
}
.brand .mark svg { width: 15px; height: 15px; stroke: #fff; fill: none; stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; display: block; }
.brand .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--a1); box-shadow: 0 0 12px var(--a1); }
.nav a.item { color: var(--dim); font-size: 14px; padding: 5px 0; position: relative; }
.nav a.item:hover { color: var(--txt); text-decoration: none; }
.nav a.item.on { color: var(--txt); }
.nav a.item.on::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  border-radius: 2px; background: var(--grad);
}
/* 语言切换器。做成一颗描边小胶囊，和普通导航项区分开 ——
   它是「换个地方」而不是「这里还有一页」。刻意不挂 hide-sm：
   手机上也必须能切语言，不然英文用户在小屏上就被锁死在英文站里了。 */
.nav a.item.lang {
  font-size: 12.5px; letter-spacing: .02em; padding: 3px 9px;
  border: 1px solid var(--line); border-radius: 999px;
}
.nav a.item.lang:hover { border-color: var(--line-h); color: var(--txt); }
.nav .sp { flex: 1; }
/* #navRight 只是给 JS 换内容用的锚点，本身不该占一格。
   display:contents 让它「消失」，里面的 <a> 直接当 .nav-in 的 flex 子项 ——
   间距、居中对齐、选中下划线全都跟其他导航项一模一样，不用为它单独写一套。 */
.nav .nav-right { display: contents; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r); padding: 20px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
  transition: background .22s var(--ease), border-color .22s var(--ease), transform .22s var(--ease);
}
a.card:hover { background: var(--card2); border-color: var(--line-h); transform: translateY(-2px); }
.card-pad-sm { padding: 15px; }
.card h3 { margin-bottom: 4px; }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 18px 20px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
}
.stat .n {
  font-size: 30px; font-weight: 640; color: var(--txt);
  letter-spacing: -.03em; line-height: 1.15; font-variant-numeric: tabular-nums;
}
.stat .l { font-size: 12px; color: var(--dim); margin-top: 4px; letter-spacing: .02em; }

/* 大号数字卡（首页用）：数字走品牌渐变。
   ⚠️ 这个修饰类【不能】叫 .hero —— .hero 是首屏那个类，带 92px 的上内边距，
   而它在样式表里排在 .stat 后面，同权重下会赢，数字卡就被套上 92px 上边距、
   左右内边距变成 0（数字贴左边、上方一大片空）。渐变也会被拉满整个高盒子，
   文字只取到末尾那段浅灰蓝，看着发灰。用 .big，别再用任何跟首屏重名的词。 */
.stat.big .n {
  font-size: clamp(30px, 4vw, 40px);
  background: linear-gradient(150deg, #fff 22%, #9db4e8 96%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--grad); color: #fff; border: 0;
  padding: 10px 20px; border-radius: var(--r-sm);
  font-size: 14px; font-weight: 560; font-family: inherit;
  cursor: pointer; white-space: nowrap; letter-spacing: -.005em;
  box-shadow: 0 6px 18px -8px rgba(77, 141, 255, .75);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), filter .18s var(--ease);
}
.btn:hover { filter: brightness(1.09); transform: translateY(-1px); box-shadow: 0 10px 24px -9px rgba(77, 141, 255, .85); text-decoration: none; color: #fff; }
.btn:active { transform: translateY(0) scale(.985); }
.btn:disabled { opacity: .42; cursor: not-allowed; transform: none; filter: none; box-shadow: none; }
.btn.ghost {
  background: var(--card); color: var(--txt);
  border: 1px solid var(--line); box-shadow: none;
}
.btn.ghost:hover { background: var(--card2); border-color: var(--line-h); color: var(--txt); }
.btn.sm { padding: 6px 13px; font-size: 13px; border-radius: 8px; }
/* 触屏上 .sm 只有 29~31px 高，比 44px 的可点下限小一大截 —— 表格行里那些
   「详情 / 刷新 / 提前释放」在手机上是真的会点歪。
   只抬高度不抬字号：桌面（鼠标指针精确）保持现在的紧凑，
   手指（pointer:coarse）和窄屏上给足手指的宽度。 */
@media (pointer: coarse), (max-width: 640px) {
  .btn.sm { min-height: 44px; padding: 10px 15px; }
  /* 表格行里的按钮撑高会顺带撑高整行，所以窄屏上少给一点上下内边距，
     让 44px 正好落在按钮上而不是分散到格子里 */
  td .btn.sm { padding: 8px 15px; }
  /* 页脚的法务链接（服务条款 / 隐私政策 / 法律声明）原来只有 16px 高，
     手指够不着 —— 而它们偏偏是手机上最需要能找到的那几个。
     用上下内边距把可点高度撑到 44px：链接是 inline-block，
     baseline 取最后一行的基线，所以中间那些「·」分隔符仍然跟文字对齐，
     不会飘到半空。代价是页脚在手机上高一些，可以接受。 */
  .foot a { display: inline-block; padding: 14px 0; }

  /* 顶栏的可点高度：实测品牌 28px、「English」28px、用户名和「退出」32px。
     导航是手机上点得最多的东西，而且「退出」就贴在用户名旁边，点歪的代价很大。
     做法是铺一层【看不见的热区】而不是加内边距 —— 加内边距会把
     .on 那条选中下划线（定位在 bottom:-1px）一起推下去，导航条的视觉节奏就变了；
     ::before 只在纵向撑开，外观一个像素都不动。
     导航条本身 62px，44px 的热区塞得下，所以按 44px 给。 */
  .nav a.item, .brand { position: relative; }
  .nav a.item::before, .brand::before {
    content: ""; position: absolute; left: 0; right: 0; top: 50%;
    transform: translateY(-50%); height: 44px;
  }
}
.btn.danger { background: transparent; color: var(--bad); border: 1px solid rgba(255, 92, 108, .34); box-shadow: none; }
.btn.danger:hover { background: rgba(255, 92, 108, .1); border-color: rgba(255, 92, 108, .55); color: var(--bad); }

/* ---------- 表单 ---------- */
.field { margin-bottom: 15px; }
.field label { display: block; font-size: 13px; color: var(--dim); margin-bottom: 7px; }
input, select, textarea {
  width: 100%; background: rgba(255, 255, 255, .028);
  border: 1px solid var(--line); color: var(--txt);
  padding: 11px 13px; border-radius: var(--r-sm);
  font-size: 14px; font-family: inherit;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease);
}
input::placeholder, textarea::placeholder { color: var(--dim2); }
input:hover, select:hover, textarea:hover { border-color: var(--line-h); }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--acc-dim); background: rgba(255, 255, 255, .045);
  box-shadow: 0 0 0 3px rgba(77, 141, 255, .16);
}
select option { background: #12121a; color: var(--txt); }
textarea { resize: vertical; min-height: 78px; }
label.inline { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--txt); }
label.inline input { width: auto; }
input[type="checkbox"] { accent-color: var(--a1); }

/* ---------- 表格 ---------- */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); }
th {
  color: var(--dim2); font-weight: 560; font-size: 11.5px;
  text-transform: uppercase; letter-spacing: .08em; white-space: nowrap;
}
td { font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .16s var(--ease); }
tbody tr:hover { background: rgba(255, 255, 255, .035); }
.tbl-scroll { overflow-x: auto; }

/* 「我的租用」里就地展开的那行连接信息。
   底色压暗一档、去掉 hover 高亮：它是【挂在上面那行下面的附属内容】，
   不是又一条记录 —— 跟着高亮会让人以为多了一条租用。 */
tbody tr.conn, tbody tr.conn:hover { background: rgba(0, 0, 0, .26); }
tbody tr.conn > td { padding: 15px 12px 17px; }
/* 配置块要能横向滚：Windows 那行 ProxyCommand 很长，wrap 断行会把「粘进
   ssh config」的那段文本切碎，用户复制到的就不是能用的配置了。 */
.conn-cfg {
  margin: 9px 0 0; padding: 11px 13px;
  background: rgba(0, 0, 0, .34); border: 1px solid var(--line); border-radius: var(--r-sm);
  white-space: pre; overflow-x: auto;
}
/* 连接密钥是 randHex(24)：48 个十六进制字符，【中间一个空格都没有】。
   等宽 13px 下这一串正好 343px，加上卡片内边距就超过了 360px 的手机屏 ——
   而 overflow-wrap 的默认值 normal 不肯断这种长 token，于是撑破的不是这一行，
   是【整张页面】（body 能左右拖，手机上尤其明显）。
   实测：机器页在 360px 档是唯一一处横向溢出，越界元素就是这个 b.mono。
   放开断行即可 —— 密钥的复制走「复制」按钮（app.js 的 data-copy 读 CONN 里的
   原文），不依赖它在屏幕上排成一行，折行只是看着换了一行，粘出去还是 48 个字符。

   ⚠️ 这条【不能】加到上面的 .mono 上：那个类还管着 pre.conn-cfg 里那段 ssh
   config，那边是 white-space:pre 且必须保持不折行（见上一条注释）。
   加在包裹的 span 上，overflow-wrap 会继承给里面的 b。 */
.conn-key { overflow-wrap: anywhere; }

/* ---------- 徽章 / 状态 ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px; font-size: 12px; line-height: 1.65;
  background: var(--card2); color: var(--dim); border: 1px solid var(--line);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.badge.ok { background: rgba(46, 213, 115, .13); color: var(--ok); border-color: transparent; }
.badge.warn { background: rgba(245, 185, 84, .13); color: var(--warn); border-color: transparent; }
.badge.bad { background: rgba(255, 92, 108, .13); color: var(--bad); border-color: transparent; }
.badge.info { background: var(--acc-bg); color: #8fb6ff; border-color: transparent; }
.dot-on {
  width: 7px; height: 7px; border-radius: 50%; background: var(--ok); flex: 0 0 auto;
  animation: pulse 2.6s ease-out infinite;
}
.dot-off { width: 7px; height: 7px; border-radius: 50%; background: #3a3a44; flex: 0 0 auto; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(46, 213, 115, .5); }
  70% { box-shadow: 0 0 0 7px rgba(46, 213, 115, 0); }
  100% { box-shadow: 0 0 0 0 rgba(46, 213, 115, 0); }
}

/* ---------- 类型筛选 ---------- */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 7px 15px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--card); color: var(--dim); cursor: pointer; font-size: 13.5px;
  transition: all .18s var(--ease);
}
.chip:hover { color: var(--txt); border-color: var(--line-h); }
.chip.on { background: var(--acc-bg); color: #9dbcff; border-color: rgba(77, 141, 255, .45); }

/* ---------- 终端日志 ---------- */
.term {
  background: #05050a; border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 13px 15px; height: 320px; overflow-y: auto;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12.5px; line-height: 1.75;
  box-shadow: inset 0 2px 14px rgba(0, 0, 0, .55);
}
.term .ln { white-space: pre-wrap; word-break: break-all; }
.term .t { color: var(--dim2); margin-right: 8px; }
.term .error { color: var(--bad); }
.term .warn { color: var(--warn); }
.term .debug { color: var(--dim2); }
.term .system { color: #7aa9ff; }
.term .empty { color: var(--dim2); }

/* 模型页的日志直接是 <pre class="term term-static">：内容是容器里带回来的原文，
   不是一行行 .ln。pre 默认 white-space:pre，而 .term 只管纵向滚动 ——
   一条几百字符的日志会把【整页】撑宽（手机上是横向拖动整个页面）。
   所以这里放开折行；另外高度自适应：日志短的时候不留一块空的黑色区域。 */
.term-static {
  height: auto; max-height: 320px; margin: 10px 0 0;
  white-space: pre-wrap; overflow-wrap: anywhere;
}

/* 模型仓库名（如 Qwen/Qwen2.5-Coder-7B-Instruct）在卡片里是一个不可折行的长 token。
   和 .conn-key 同一个道理：overflow-wrap 的默认值不会断它，撑破的是整张页面。 */
.model-repo { overflow-wrap: anywhere; }

/* ---------- 进度条 ---------- */
.bar { height: 7px; background: rgba(255, 255, 255, .07); border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--grad); border-radius: 99px; transition: width .45s var(--ease); }

/* ---------- 提示 ---------- */
.toast-box { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: flex; flex-direction: column; gap: 9px; }
.toast {
  background: rgba(22, 22, 30, .92); backdrop-filter: blur(12px);
  border: 1px solid var(--line); border-left: 3px solid var(--a1);
  padding: 12px 16px; border-radius: var(--r-sm); font-size: 14px; max-width: 390px;
  box-shadow: 0 16px 40px -12px rgba(0, 0, 0, .9); animation: tin .2s var(--ease);
}
.toast.bad { border-left-color: var(--bad); }
.toast.warn { border-left-color: var(--warn); }
@keyframes tin { from { opacity: 0; transform: translateY(10px) scale(.98); } }

.alert { padding: 12px 15px; border-radius: var(--r-sm); font-size: 14px; border: 1px solid var(--line); background: var(--card2); }
.alert.bad { border-color: rgba(255, 92, 108, .34); color: #ffb3b8; background: rgba(255, 92, 108, .08); }
.alert.ok { border-color: rgba(46, 213, 115, .34); color: var(--ok); background: rgba(46, 213, 115, .09); }
.hide { display: none !important; }

.empty-box { padding: 44px 20px; text-align: center; color: var(--dim2); }

/* 空状态落进网格里时【必须自己铺满整行】。
   .grid / .grid-stats 是 repeat(auto-fill|auto-fit, minmax(...))，一个 .empty-box
   直接塞进去就只占【第一格】：1080px 的容器里那格是 351px，贴着左边缘，
   右边空着 715px。整机出租页没有可租机器时就是这个样子 —— 全页最重要的一句话
   被挤在左边三分之一，剩下的地方空着，看着像页面坏了而不是「暂时没有机器」。
   grid-column: 1 / -1 让它跨满所有列（列数是运行时算的，-1 指最后一列）。
   顺带给它卡片外观：它占的是本该放机器卡的那一格，「一张空卡」比一行秃字更像有意为之。

   ⚠️ 只管【网格里的】：td.empty-box 是表格那种整行空状态（colspan 已经铺满了），
   在那里加边框会在表格里多出一个框，反而难看。 */
.grid > .empty-box, .grid-stats > .empty-box {
  grid-column: 1 / -1;
  background: var(--card); border: 1px dashed var(--line); border-radius: var(--r);
}

/* ---------- 弹窗 ---------- */
.mask {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .68);
  backdrop-filter: blur(5px); z-index: 50;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: tin .18s var(--ease);
}
.modal {
  background: #101017; border: 1px solid var(--line); border-radius: 18px;
  padding: 26px; width: 100%; max-width: 470px; max-height: 90vh; overflow-y: auto;
  box-shadow: 0 32px 70px -20px rgba(0, 0, 0, .95), inset 0 1px 0 rgba(255, 255, 255, .06);
}

/* ---------- 页脚 ---------- */
/* 全站同一个页脚，四段：品牌 / 产品 / 文档 / 域名。
   原来内页是另做的一版「简版」—— 产品链接没了，右边塞一个每页都不重样的
   「回某个页面 →」（控制台写「算力市场」、整机出租写「我的控制台」、
   钱包写「我的订单」），同一个位置三种语义；而真正需要被找到的那排
   法务链接反倒只有 12px，比它上面的版权行还小。
   现在内页和首页共用这一个类，首页那版 .foot-rich 已经删掉。 */
.foot {
  border-top: 1px solid var(--line); margin-top: 60px; padding: 30px 0 40px;
  display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between;
  font-size: 13px; color: var(--dim2);
}
.foot a { color: var(--dim); }
.foot a:hover { color: var(--txt); }

/* 把页脚推到视口底部（配合上面 body 的纵向 flex）。
   ⚠️ 选择器必须带上 .foot-wrap 这个类名：.wrap 的 `margin: 0 auto`
   也是类选择器，写成元素选择器 `body > footer` 会被它按特异性压过去，
   margin-top 悄悄变回 0，页脚又浮回半空 —— 而且页面上看不出任何异常。 */
body > .foot-wrap { margin-top: auto; }

/* ============================================================
   首页专用（其它页面不用这些类，删掉也不影响别处）
   ============================================================ */

/* ---- 首屏 ---- */
.hero { padding: clamp(48px, 8vw, 92px) 0 0; }
.hero h1 {
  font-size: clamp(32px, 5.4vw, 54px); font-weight: 660; letter-spacing: -.035em;
  line-height: 1.08; margin: 18px 0 16px;
  background: linear-gradient(100deg, #fff 16%, #9db4e8 94%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .lead { color: var(--dim); font-size: clamp(15px, 1.5vw, 17px); line-height: 1.7; max-width: 58ch; }
.hero .cta { margin-top: 30px; display: flex; gap: 12px; flex-wrap: wrap; }
.hero .cta .btn { padding: 13px 26px; font-size: 15px; border-radius: 12px; }

/* 首屏状态条：一排玻璃胶囊，圆点会呼吸 */
.pills { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 30px; }
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line);
  font-size: 12.5px; color: var(--dim); white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.pill b { color: var(--txt); font-weight: 560; }

/* ---- 业务线卡片 ----
   ⚠️ 条数是【后台数据决定的】，不是固定的四条。现有 5 条
   (video/image/audio/llm/general)，所以要按「排得整齐」而不是「排成四张」来写。

   列宽 170px 是算出来的：容器最宽 1080px，1080 里恰好塞得下 5 列、塞不下 6 列
   （6 列要 6×170+5×14=1090 > 1080），所以宽屏一定是整齐的 5 张一行。

   用 auto-fit 而不是 auto-fill：auto-fill 会保留空轨道，5 张卡掉进 6 列里
   右边就会空出一格（看着像错位）。auto-fit 会把空轨道收掉，永远填满整行。

   ⚠️ 5 条业务线【没有任何排法能让每行都填满】——只有 1 列和 5 列是整齐的。
   所以窄屏直接退回固定 2 列：2+2+1 比「四张 + 一张通栏横幅」好看得多。 */
.lines { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
@media (max-width: 940px) { .lines { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .lines { grid-template-columns: 1fr; } }
.line-card {
  position: relative; display: flex; flex-direction: column; align-items: flex-start;
  padding: 18px; border-radius: var(--r); overflow: hidden;
  background: var(--card); border: 1px solid var(--line); color: inherit;
  transition: background .22s var(--ease), border-color .22s var(--ease), transform .22s var(--ease), box-shadow .22s var(--ease);
}
.line-card:hover {
  background: var(--card2); border-color: var(--line-h); color: inherit;
  transform: translateY(-3px); box-shadow: 0 18px 36px -18px rgba(0, 0, 0, .9);
}
/* 悬停时掠过一层高光 —— 廉价感的反面就是「有反应」 */
.line-card::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, .07), transparent 52%);
  transition: opacity .22s var(--ease);
}
.line-card:hover::after { opacity: 1; }
.line-card .ico {
  width: 42px; height: 42px; border-radius: 12px; flex: 0 0 auto; margin-bottom: 13px;
  display: grid; place-items: center;
  background: var(--acc-bg); border: 1px solid rgba(77, 141, 255, .22);
  transition: border-color .22s var(--ease);
}
.line-card:hover .ico { border-color: rgba(77, 141, 255, .5); }
.line-card .ico svg { width: 20px; height: 20px; stroke: #8fb6ff; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; display: block; }
/* display:block 不能省 —— HTML 里这两个是 <span>，行内元素会把标题和描述挤成一行 */
.line-card .name { display: block; font-size: 14.5px; font-weight: 560; letter-spacing: -.01em; margin-bottom: 4px; }
/* flex:1 把描述撑开、把下面的徽章顶到卡底 —— 一行里每张卡描述行数不一样时，
   没有这个就会出现「徽章有的高有的低」，也就是看上去的错位。 */
.line-card .desc { display: block; flex: 1; font-size: 12.5px; color: var(--dim); line-height: 1.6; }
.line-card .badge { margin-top: 14px; }
.line-card .arrow {
  position: absolute; top: 18px; right: 16px; opacity: 0; transform: translateX(-5px);
  transition: opacity .22s var(--ease), transform .22s var(--ease);
}
.line-card:hover .arrow { opacity: 1; transform: translateX(0); }
.line-card .arrow svg { width: 15px; height: 15px; stroke: var(--dim); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; display: block; }

/* ---- 步骤 ---- */
.steps { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.step { position: relative; padding: 20px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); }
.step .no {
  width: 26px; height: 26px; border-radius: 8px; margin-bottom: 12px;
  display: grid; place-items: center; font-size: 12.5px; font-weight: 600;
  background: var(--grad); color: #fff;
  box-shadow: 0 5px 14px -6px rgba(77, 141, 255, .8);
}
.step .name { font-size: 14.5px; font-weight: 560; margin-bottom: 5px; }
.step .desc { font-size: 12.5px; color: var(--dim); line-height: 1.6; }

/* ---- 保障条款 ---- */
.assure { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.assure .item { display: flex; gap: 12px; padding: 18px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); }
.assure .item svg { width: 19px; height: 19px; flex: 0 0 auto; margin-top: 2px; stroke: var(--ok); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.assure .name { font-size: 14px; font-weight: 560; margin-bottom: 4px; }
.assure .desc { font-size: 12.5px; color: var(--dim); line-height: 1.6; }

/* ---- 面向谁 ----
   这四类人是写死在页面里的（不是后台数据），数量固定就是 4，
   所以用固定列数而不是 auto-fit：4 → 2 → 1 每一档都能填满。
   auto-fit 配 minmax(250px) 在 1080px 下只会排成 3+1，最后一张孤零零地
   占一行，看着像漏了东西 —— 业务线那边能 auto-fit 是因为条数不确定，
   这里条数确定，就别让它自己算。 */
.crowd { display: grid; gap: 14px; grid-template-columns: repeat(4, 1fr); }
@media (max-width: 980px) { .crowd { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .crowd { grid-template-columns: 1fr; } }
.crowd .who {
  position: relative; display: flex; flex-direction: column;
  padding: 20px; border-radius: var(--r);
  background: var(--card); border: 1px solid var(--line);
}
.crowd .ico {
  width: 40px; height: 40px; border-radius: 12px; margin-bottom: 13px; flex: 0 0 auto;
  display: grid; place-items: center;
  background: var(--acc-bg); border: 1px solid rgba(77, 141, 255, .22);
}
.crowd .ico svg { width: 19px; height: 19px; stroke: #8fb6ff; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; display: block; }
.crowd .name { font-size: 14.5px; font-weight: 560; letter-spacing: -.01em; margin-bottom: 5px; }
.crowd .desc { font-size: 12.5px; color: var(--dim); line-height: 1.6; }
/* 具体拿这台机器干什么。
   列的不是功能，是【任务的形状】—— 看的人要能一眼对上自己手上的活，
   而不是读一遍产品说明再去想「这跟我有什么关系」。 */
.crowd .uses { list-style: none; margin: 13px 0 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.crowd .uses li { position: relative; padding-left: 15px; font-size: 12.5px; color: var(--dim); line-height: 1.55; }
.crowd .uses li::before {
  content: ""; position: absolute; left: 0; top: 6.5px;
  width: 5px; height: 5px; border-radius: 50%; background: var(--a1); opacity: .75;
}

/* ---- 面向全球 ----
   单独一条通栏，不塞进上面某张卡里 —— 「全球」不是第五类客户，
   是这四类人共同的范围，混在卡片里会被读成「还有一个海外客群」。 */
.reach {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin-top: 14px; padding: 18px 20px; border-radius: var(--r);
  background: var(--card); border: 1px solid var(--line);
}
.reach .ico {
  width: 38px; height: 38px; border-radius: 11px; flex: 0 0 auto;
  display: grid; place-items: center;
  background: var(--acc-bg); border: 1px solid rgba(77, 141, 255, .22);
}
.reach .ico svg { width: 19px; height: 19px; stroke: #8fb6ff; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; display: block; }
/* flex:1 + min-width:0 不是可选的。
   放 flex 里的长段落，基准尺寸是 max-content（整段不折行有多宽），
   flex-wrap 是【先按基准尺寸断行、再在行内收缩】的 —— 所以那段话会
   自己另起一行跑到图标下面去，还留一大块空白，看着像图标是标题。
   flex:1 把基准改成 0（先占住这一行），min-width:0 再解掉 min-content
   的下限，中文长句才能正常折行。 */
.reach .body { flex: 1; min-width: 0; }
.reach .t { font-size: 14px; font-weight: 560; margin-bottom: 3px; }
.reach .d { font-size: 12.5px; color: var(--dim); line-height: 1.6; }

/* 首页那版页脚（.foot-rich）已经并进全站的 .foot，见上面「页脚」一节 ——
   两套类名同一件事，改一处漏一处是迟早的事。 */

@media (max-width: 640px) {
  .nav-in { gap: 14px; } .nav .item.hide-sm { display: none; }
  h1 { font-size: 23px; } .wrap { padding: 0 14px; }
  .hero { padding-top: 40px; }
  /* 单列也必须是 minmax(0, 1fr)，不能图省事写 1fr。
     1fr 等价于 minmax(auto, 1fr)，那个 auto 下限是内容的 min-content ——
     钱包流水表的 min-content 是 561px，写 1fr 的话这一列就【顶到 561px 不肯缩】，
     容器只有 472px，整页照样横向溢出到 577px（第一轮修完就是这个数）。
     下限换成 0，列才能缩到容器宽，宽表格交给 .tbl-scroll 自己横向滚。 */
  .grid, .cols-2, .cols-2r { grid-template-columns: minmax(0, 1fr); }
  /* 窄屏左对齐折行。space-between 在两行的情况下会把第一行的最后一段
     推到右边、第二行只剩一段孤零零吊在最左，看着像排版塌了。 */
  .foot { justify-content: flex-start; }
}

/* ============================================================
   动效
   ------------------------------------------------------------
   三条规矩，破哪条都会显得廉价或者直接出事故：

   1.【只动 transform 和 opacity】。这两个走合成线程，不掉帧。
     动 width/height/top/left 每帧都要重排，卡片一多立刻卡。

   2.【基态绝不写 opacity: 0】。要藏就藏在 @keyframes 的 from 里，
     配 animation-fill-mode: both。基态一旦写成透明的，动画只要没播
     （旧浏览器、扩展拦截、减少动态效果），内容就【永远】看不见 ——
     那不是"动画没生效"，那是白屏。
     下面 .rv 是唯一的例外，因为它由 JS 加 .js 类开门，另有兜底。

   3.【只播一次】。来回滚都重播的进场动画，看第二遍就烦了。
   ============================================================ */

/* ---------- 环境光呼吸 ----------
   顶部那团蓝紫光缓慢起伏。20 秒一个来回 —— 快到能察觉就成霓虹灯了。 */
@keyframes aura {
  0%, 100% { transform: translateX(-50%) scale(1); }
  50%      { transform: translateX(-50%) scale(1.12) translateY(1.5vh); }
}
body::before { animation: aura 20s ease-in-out infinite; }

/* ---------- 首屏错峰进场 ----------
   一个一个上来，不是整块弹出来。延迟按阅读顺序递增。 */
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
.hero .badge.info { animation: rise .7s var(--ease) both; }
.hero .lead       { animation: rise .8s var(--ease) .18s both; }
.hero .cta        { animation: rise .8s var(--ease) .26s both; }
.hero .pills      { animation: rise .8s var(--ease) .36s both; }

/* 标题要同时跑进场和渐变流光，两条动画得写在同一条声明里。
   background-size 拉大到 200%，再让 background-position 来回滑 ——
   文字上的高光就会慢慢扫过去，而不是死板地贴在那儿。 */
@keyframes shimmer { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
.hero h1 {
  background-size: 200% 100%;
  animation: rise .8s var(--ease) .1s both, shimmer 11s ease-in-out 1.6s infinite;
}

/* ---------- 滚动进场（.rv） ----------
   html.js 由各页 <head> 里的内联脚本加上。为什么不在 app.js 里加：
   app.js 在 </body> 前，那时内容可能已经画出来了，再加类就会「先显示、
   再消失、再进场」地闪一下。 */
html.js .rv {
  opacity: 0; transform: translateY(20px);
  transition: opacity .75s var(--ease), transform .75s var(--ease);
  transition-delay: calc(var(--d, 0) * 85ms);   /* --d 是同组里的序号，做错峰 */
}
html.js .rv.rv-in { opacity: 1; transform: none; }

/* 同一组里的卡片自动错峰。用 nth-child 而不是每个元素手写 style="--d:n"：
   业务线卡片是 JS 注入的，手写就得到处补；nth-child 按最终 DOM 算，注入的也吃得到。
   第 1 个不写（--d 缺省 0），第 6 个往后都并到第 5 档 —— 再往后延迟就长到像卡住了。 */
.lines > *:nth-child(2),  .steps > *:nth-child(2),  .assure > *:nth-child(2),  .crowd > *:nth-child(2)  { --d: 1; }
.lines > *:nth-child(3),  .steps > *:nth-child(3),  .assure > *:nth-child(3),  .crowd > *:nth-child(3)  { --d: 2; }
.lines > *:nth-child(4),  .steps > *:nth-child(4),  .assure > *:nth-child(4),  .crowd > *:nth-child(4)  { --d: 3; }
.lines > *:nth-child(5),  .steps > *:nth-child(5),  .assure > *:nth-child(5)  { --d: 4; }
.lines > *:nth-child(n+6), .steps > *:nth-child(n+6), .assure > *:nth-child(n+6) { --d: 5; }
.grid > *:nth-child(2) { --d: 1; }
.grid > *:nth-child(3) { --d: 2; }
.grid > *:nth-child(4) { --d: 3; }
.grid > *:nth-child(n+5) { --d: 4; }

/* 小节标题那条线从左边展开，比整块淡入更有"被画出来"的感觉 */
html.js .sec-title.rv::after {
  transform: scaleX(0); transform-origin: left;
  transition: transform .9s var(--ease) .12s;
}
html.js .sec-title.rv.rv-in::after { transform: scaleX(1); }

/* ---------- 卡片聚光 ----------
   高光跟着鼠标走。isolation: isolate 让卡片成为层叠上下文，
   ::before 才能用 z-index: -1 压到文字【下面】（负数层级画在父元素
   背景之上、内容之下）；不加 isolate，它会一路穿透到 body 那层，
   被卡片自己的背景盖住，白写。 */
.line-card, .card, .step, .assure .item, .crowd .who, .reach { isolation: isolate; }
.line-card::before, .card::before, .step::before, .assure .item::before,
.crowd .who::before, .reach::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  border-radius: inherit; pointer-events: none; opacity: 0;
  transition: opacity .32s var(--ease);
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%),
              rgba(122, 169, 255, .12), transparent 72%);
}
.line-card:hover::before, .card:hover::before,
.step:hover::before, .assure .item:hover::before,
.crowd .who:hover::before, .reach:hover::before { opacity: 1; }

/* ---------- 按钮光泽 ----------
   一道斜光扫过去。只给实心按钮 —— 幽灵按钮底子透明，扫白光会很脏。 */
.btn { position: relative; overflow: hidden; }
.btn:not(.ghost):not(.danger)::after {
  content: ""; position: absolute; top: -60%; bottom: -60%; left: -50%; width: 34%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .42), transparent);
  transform: skewX(-20deg); transition: left .65s var(--ease); pointer-events: none;
}
.btn:not(.ghost):not(.danger):hover::after { left: 120%; }

/* ---------- 步骤序号 ---------- */
.step .no { transition: transform .25s var(--ease); }
.step:hover .no { transform: scale(1.09); }

/* 系统里开了「减少动态效果」就全部关掉 —— 前庭功能敏感的人会真的难受 */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  /* 上面那条管不住 .rv：它的 opacity: 0 是【普通声明】不是动画。
     好在基态可见才是安全的那一侧，这里直接放行即可。 */
  html.js .rv { opacity: 1 !important; transform: none !important; }
  html.js .sec-title.rv::after { transform: none !important; }
}
