/* 51token 控制台注入样式（11-22，总经理助理定：版本号是内部信息，整个隐藏）。由 nginx sub_filter 只注入 new-api 页面。
   隐藏 new-api 系统名旁的「系统更新 / 版本号」按钮（管理员才看得到，按钮文字就是 v1.0.0-rc.xx 或「未知版本」）。不改 new-api 源码、不动 /api/status。
   认法（11-22 对照 51token 前端包 index.1ed0c91818.js）：
   - 「版本」样式的按钮 class 里有 @min-[22rem]/system-brand:h-7；aria-label 是「系统更新，当前版本：x」（繁体「目前版本」，英文 current version）；
   - 另一种样式的 aria-label 是「检查更新 / 可更新 / 有新版本可用：x」（繁体、英文同理）。
   巡检：t51_console_check.py（版本标签 0 处）+ console51_check.py（假按钮反例）。删掉本文件或 nginx 注入即恢复显示。 */
button[class*="system-brand:h-7"],
button[aria-label*="当前版本"],button[aria-label*="目前版本"],button[aria-label*="current version" i],
button[aria-label="检查更新"],button[aria-label="檢查更新"],button[aria-label="可更新"],button[aria-label^="有新版本可用"],
button[aria-label="Check for updates" i],button[aria-label="Update available" i],button[aria-label^="New version available" i]{display:none!important}

/* ============================================================================
   tokencn 版（11-24，与 51token 同一套皮肤；只换品牌字样：TOKENCN / Kimi 模型 API）
   登录 / 注册 / 找回密码页（与首页「规格书 · 朱砂印」对齐）
   只在 html.t51-auth 下生效（t51c.js 按路径加类）→ 控制台和其它 new-api 页面完全不受影响。
   沿用首页色板与字体：纸白 #F2F1EC / 白纸 #FBFAF7 / 墨黑 #15171A / 唯一强调色朱砂 #D33A1F /
   发丝线 #D6D4CC / 直角 2px；中文 Noto Sans SC 子集、数字 IBM Plex Mono。
   不改接口、不改表单结构、不发请求；t51c.js 或本文件缺失时页面退回 new-api 原样。
   ============================================================================ */
@font-face{font-family:"T51 Sans SC";src:url(/t51/fonts/t51-sans-sc.woff2) format("woff2");font-weight:300 700;font-display:swap}
@font-face{font-family:"T51 Plex";src:url(/t51/fonts/t51-plex-sans.woff2) format("woff2");font-weight:400 600;font-display:swap}
@font-face{font-family:"T51 Mono";src:url(/t51/fonts/t51-plex-mono-400.woff2) format("woff2");font-weight:400;font-display:swap}
@font-face{font-family:"T51 Mono";src:url(/t51/fonts/t51-plex-mono-500.woff2) format("woff2");font-weight:500;font-display:swap}
@font-face{font-family:"T51 Mono";src:url(/t51/fonts/t51-plex-mono-600.woff2) format("woff2");font-weight:600;font-display:swap}

html.t51-auth{
  --paper:#F2F1EC; --sheet:#FBFAF7; --ink:#15171A; --ink-2:#464A51; --ink-3:#6B7078; --ink-4:#A9ADB3;
  --rule:#D6D4CC; --rule-2:#E6E4DD; --cinnabar:#D33A1F; --cinnabar-ink:#A82A13; --cinnabar-wash:#FBEAE5;
  --sans:"T51 Plex","T51 Sans SC","PingFang SC","Microsoft YaHei",sans-serif;
  --mono:"T51 Mono","T51 Sans SC",ui-monospace,Menlo,Consolas,monospace;
  --r:2px;
  background:var(--paper);
}
html.t51-auth body{background:var(--paper);color:var(--ink);font-family:var(--sans);-webkit-font-smoothing:antialiased}
html.t51-auth a{color:inherit;text-decoration:none}

/* 页面骨架：整页纸白，内容居中的单列 */
html.t51-auth [class*="h-svh"]{display:block;min-height:100svh;position:relative;background:var(--paper)}
html.t51-auth [class*="h-svh"] > .container{
  max-width:520px;width:100%;margin:0 auto;padding:120px 20px 96px;
  min-height:100svh;display:flex;align-items:center;justify-content:center;
}
html.t51-auth [class*="h-svh"] .container > div{width:100%}
html.t51-auth [class*="h-svh"] .mx-auto.flex.w-full{width:100%;max-width:none;padding:0!important}

/* 顶部一条发丝线：和首页顶栏下沿一致，把品牌和内容分隔开 */
html.t51-auth body::before{
  content:"";position:fixed;left:0;right:0;top:84px;height:1px;background:var(--rule);z-index:1;pointer-events:none;
}

/* 底部量尺：直接从首页搬过来的规格书刻度 */
html.t51-auth body::after{
  content:"";position:fixed;left:0;right:0;bottom:0;height:12px;pointer-events:none;opacity:.5;
  background:
    repeating-linear-gradient(90deg,var(--ink-4) 0 1px,transparent 1px 8px) bottom left/100% 6px no-repeat,
    repeating-linear-gradient(90deg,var(--ink-2) 0 1px,transparent 1px 80px) bottom left/100% 12px no-repeat;
}

/* 品牌（左上） */
html.t51-auth [class*="h-svh"] > a[class*="absolute"]{top:26px;left:24px;gap:10px!important}
html.t51-auth [class*="h-svh"] > a[class*="absolute"] > div{width:32px;height:32px}
html.t51-auth [class*="h-svh"] > a[class*="absolute"] img{width:32px;height:32px;border-radius:2px}
html.t51-auth [class*="h-svh"] > a[class*="absolute"] h1{
  font:600 17px/1 var(--mono);letter-spacing:-.01em;color:var(--ink);margin:0;display:flex;align-items:center;
}
html.t51-auth [class*="h-svh"] > a[class*="absolute"] h1::after{
  content:"Kimi 模型 API";margin-left:11px;padding-left:11px;border-left:1px solid var(--rule);
  font:400 11px/1 var(--mono);letter-spacing:.08em;color:var(--ink-3);white-space:nowrap;
}

/* 右上角「返回首页」（t51c.js 插入） */
html.t51-auth #t51-auth-home{
  position:fixed;top:32px;right:24px;z-index:30;
  font:500 12px/1 var(--mono);letter-spacing:.06em;color:var(--ink-3);
  border-bottom:1px solid var(--rule);padding-bottom:3px;
}
html.t51-auth #t51-auth-home:hover{color:var(--ink);border-bottom-color:var(--ink)}

/* 表单卡片：白纸 + 1px 墨线 + 朱砂角标（首页 SPEC SHEET 的做法） */
html.t51-auth .container [class*="space-y-8"]{
  position:relative;width:100%;background:var(--sheet);border:1px solid var(--ink);
  padding:40px 38px 36px;
}
html.t51-auth .container [class*="space-y-8"]::before,
html.t51-auth .container [class*="space-y-8"]::after{
  content:"";position:absolute;width:9px;height:9px;border:1px solid var(--cinnabar);pointer-events:none;
}
html.t51-auth .container [class*="space-y-8"]::before{top:-5px;left:-5px;border-right:0;border-bottom:0}
html.t51-auth .container [class*="space-y-8"]::after{bottom:-5px;right:-5px;border-left:0;border-top:0}

/* 标题区 */
html.t51-auth .container h2{
  margin:0;font-size:34px;line-height:1.15;font-weight:700;letter-spacing:-.02em;color:var(--ink);
}
html.t51-auth .container h2::before{
  content:"TOKENCN · SIGN IN";display:block;margin-bottom:14px;
  font:500 11px/1 var(--mono);letter-spacing:.14em;color:var(--cinnabar);
}
html.t51-auth[data-t51-page="sign-up"] .container h2::before{content:"TOKENCN · SIGN UP"}
html.t51-auth[data-t51-page="forgot-password"] .container h2::before{content:"TOKENCN · RESET"}
html.t51-auth[data-t51-page="reset"] .container h2::before{content:"TOKENCN · RESET"}
html.t51-auth[data-t51-page="otp"] .container h2::before{content:"TOKENCN · OTP"}
html.t51-auth .container h2 + p,
html.t51-auth .container p[class*="text-muted-foreground"]{
  margin-top:10px;font-size:13px;line-height:1.5;color:var(--ink-3);
}
html.t51-auth .container p a{color:var(--cinnabar);text-decoration:none;border-bottom:1px solid var(--cinnabar);font-weight:500}
html.t51-auth .container p a:hover{color:var(--cinnabar-ink);border-bottom-color:var(--cinnabar-ink)}

/* 表单 */
html.t51-auth .container [class*="space-y-8"] > *,
html.t51-auth .container [class*="space-y-2"] > *{margin-top:0!important}
html.t51-auth .container h2 + p,
html.t51-auth .container p[class*="text-muted-foreground"]{margin-top:10px!important}
html.t51-auth form{display:grid;gap:16px;margin-top:26px!important}
html.t51-auth form label,
html.t51-auth .container > div label{
  font-size:12px;font-weight:500;letter-spacing:.02em;color:var(--ink-2);
}
html.t51-auth input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]){
  height:44px;width:100%;padding:0 12px;border:1px solid var(--rule);border-radius:var(--r);
  background:#fff;color:var(--ink);font:400 14px/1 var(--sans);box-shadow:none;
  transition:border-color .12s ease,box-shadow .12s ease;
}
html.t51-auth input::placeholder{color:var(--ink-4)}
html.t51-auth input:focus,
html.t51-auth input:focus-visible{
  outline:none;border-color:var(--ink);box-shadow:inset 0 -2px 0 var(--cinnabar);
}
html.t51-auth input[disabled],html.t51-auth input:disabled{background:var(--sheet-2,#F6F5F1);color:var(--ink-3)}
html.t51-auth input[aria-invalid="true"]{border-color:var(--cinnabar);box-shadow:inset 0 -2px 0 var(--cinnabar)}

/* 主要按钮 / 次要按钮 / 链接色：把 new-api 的蓝色主色统一成朱砂 */
html.t51-auth [class*="bg-primary"]{background:var(--cinnabar)!important;border-color:var(--cinnabar)!important;color:#fff!important;border-radius:var(--r)!important}
html.t51-auth [class*="bg-primary"]:hover{background:var(--cinnabar-ink)!important;border-color:var(--cinnabar-ink)!important}
/* 禁用态：浅灰底 + 灰字，不能是「白字压浅朱砂」看不见 */
html.t51-auth [class*="bg-primary"]:disabled,
html.t51-auth button:disabled[class*="bg-primary"]{
  background:var(--rule-2)!important;border-color:var(--rule)!important;color:var(--ink-3)!important;opacity:1!important;
}
html.t51-auth a[class*="text-primary"]{color:var(--cinnabar)!important}
html.t51-auth form > button[type="submit"],
html.t51-auth button[class*="bg-primary"]{color:#fff!important}
html.t51-auth .container button[type="button"]{border-radius:var(--r)!important;height:42px;font-size:13px;letter-spacing:.02em}
html.t51-auth .container button[type="button"]:not([class*="bg-primary"]):not([aria-label*="password" i]):not([aria-label*="密码"]){border:1px solid var(--rule)!important;background:var(--sheet)!important;color:var(--ink-2)!important}
html.t51-auth .container button[type="button"]:not([class*="bg-primary"]):not([aria-label*="password" i]):not([aria-label*="密码"]):hover{border-color:var(--ink)!important;color:var(--ink)!important}

/* 页面里的提醒条（如「重置链接无效」）：朱砂描边 + 浅朱砂底 */
html.t51-auth [role="alert"]{border-radius:var(--r)!important;border-color:var(--cinnabar)!important;background:var(--cinnabar-wash)!important}
html.t51-auth [role="alert"] *{color:var(--cinnabar-ink)!important}
html.t51-auth form button[aria-label*="password" i],
html.t51-auth form button[aria-label*="密码"]{color:var(--ink-3)!important;width:auto!important;height:auto!important;padding:4px!important;border:0!important;background:transparent!important;box-shadow:none!important;border-radius:0!important}
html.t51-auth form button[aria-label*="password" i] svg,
html.t51-auth form button[aria-label*="密码"] svg{width:18px!important;height:18px!important}
html.t51-auth form button[aria-label*="password" i]:hover,
html.t51-auth form button[aria-label*="password" i]:focus,
html.t51-auth form button[aria-label*="password" i]:focus-visible,
html.t51-auth form button[aria-label*="password" i][data-state="on"],
html.t51-auth form button[aria-label*="password" i][aria-pressed="true"]{
  background:transparent!important;border:0!important;outline:none!important;box-shadow:none!important;color:var(--ink)!important;
}
html.t51-auth form button[aria-label*="password" i]:hover,
html.t51-auth form button[aria-label*="密码"]:hover{color:var(--ink);background:transparent}
html.t51-auth form a[class*="absolute"]{font-size:12px;color:var(--ink-3);font-weight:500}
html.t51-auth form a[class*="absolute"]:hover{color:var(--cinnabar)}

/* 主按钮：朱砂实心，直角 */
html.t51-auth form > button[type="submit"]{
  height:46px;margin-top:8px;border:1px solid var(--cinnabar);border-radius:var(--r);
  background:var(--cinnabar);color:#fff;font:500 14px/1 var(--sans);letter-spacing:.08em;
  gap:8px;box-shadow:none;transition:background .12s ease,border-color .12s ease;
}
html.t51-auth form > button[type="submit"]:hover{background:var(--cinnabar-ink);border-color:var(--cinnabar-ink);color:#fff}
html.t51-auth form > button[type="submit"]:focus-visible{outline:2px solid var(--ink);outline-offset:2px}
html.t51-auth form > button[type="submit"] svg{width:16px;height:16px;opacity:.9}
html.t51-auth form > button[type="submit"]:disabled{opacity:.55}

/* 报错提示（sonner toast）：白纸 + 朱砂左边条，不用圆角和粉底；与卡片对齐，位于卡片正下方 */
html.t51-auth [data-sonner-toaster]{
  position:fixed!important;
  left:50%!important;transform:translateX(-50%)!important;
  top:112px!important;bottom:auto!important;
  --width:440px;z-index:999!important;
}
html.t51-auth [data-sonner-toast]{
  background:var(--sheet)!important;border:1px solid var(--cinnabar)!important;border-left-width:3px!important;
  border-radius:var(--r)!important;box-shadow:0 6px 24px rgba(21,23,26,.10)!important;
  color:var(--ink)!important;font-family:var(--sans)!important;padding:12px 14px!important;
}
html.t51-auth [data-sonner-toast] [data-title]{font-size:13px!important;line-height:1.5!important;color:var(--ink)!important}
html.t51-auth [data-sonner-toast] svg{color:var(--cinnabar)!important}
html.t51-auth [data-sonner-toast] [data-close-button]{
  display:none!important;   /* 自动消失，不需要右上角的关闭圈，避免压住卡片 */
}

/* 窄屏（手机）：整宽卡片、更大的点按区域、16px 输入字号避免 iOS 自动放大 */
@media (max-width:700px){
  html.t51-auth [class*="h-svh"] > .container{padding:92px 16px 84px}
  html.t51-auth .container [class*="space-y-8"]{padding:26px 20px 24px}
  html.t51-auth .container h2{font-size:24px;text-align:left!important}
  html.t51-auth .container h2 + p,
  html.t51-auth .container p[class*="text-muted-foreground"]{text-align:left!important}
  html.t51-auth form input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]){height:48px;font-size:16px}
  html.t51-auth form > button[type="submit"]{height:48px}
  html.t51-auth [class*="h-svh"] > a[class*="absolute"]{top:18px;left:16px}
  html.t51-auth [class*="h-svh"] > a[class*="absolute"] h1::after{display:none}
  html.t51-auth #t51-auth-home{top:24px;right:16px}
}
@media (prefers-reduced-motion:reduce){
  html.t51-auth *{transition:none!important}
}

/* tokencn 专属：站名显示。new-api 后台站名仍是「51token」（改名待老板定，这里不动后台设置），
   只在登录/注册这几页把字标文字显示成 tokencn；左上那个红色「51」方块是后台配的 logo 图，不动。
   后台站名正式改掉之后，删掉这一段即可。 */
html.t51-auth [class*="h-svh"] > a[class*="absolute"] h1{font-size:0!important;gap:0!important}
html.t51-auth [class*="h-svh"] > a[class*="absolute"] h1::before{
  content:"tokencn";font:600 17px/1 var(--mono);letter-spacing:-.01em;color:var(--ink);
}
