/* ==========================================================================
   沉思波统一控制台 · 会员体系（#/lab）增强层样式（2026-10-11 老板令）
   —— 独立文件交付：**不改 console.js / console.css**（那两个由并行会话维护，见 docs/matrix.md）。
   只加 .labx-* 前缀的新类，颜色一律吃 console.css 的令牌（--panel/--line/--text/--muted/--brand…），
   不写死深色底，因此浅色主题（theme.css）下自动成立；少数写死的半透明品牌蓝/黑两色都成立（下方有说明）。
   布局三件：① 顶部「看/做」分离条（sticky：主按钮永远在手边）② 模块条 ③ 右侧抽屉（做）。
   ========================================================================== */

/* ---------- 顶部：结论 + 四个「做」的入口 ---------- */
.labx { padding-bottom: 8px; }
.labx-load { padding: 40px 4px; color: var(--muted); font-size: 13.5px; }
.labx-top {
  position: sticky; top: var(--topbar-h); z-index: 5;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin: -20px -22px 12px; padding: 16px 22px 13px;
  background: var(--bg); border-bottom: 1px solid var(--line);
}
.labx-top-l { min-width: 260px; flex: 1; }
.labx-h1 { font-size: 15px; font-weight: 650; letter-spacing: .2px; }
.labx-h1 .sub2 { font-weight: 400; }
.labx-hint { color: var(--muted-2); font-size: 12.5px; margin-top: 3px; }
.labx-hint b { color: var(--text); }
.labx-top-r { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.labx-verdict {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  margin-top: 10px; padding: 9px 12px; border: 1px solid var(--line-2); border-left: 3px solid var(--brand);
  border-radius: var(--r-md); background: var(--panel);
}
.labx-verdict-k { font-size: 11.5px; color: var(--muted-2); flex: 0 0 auto; letter-spacing: .4px; }
.labx-verdict-v { font-size: 13.5px; line-height: 1.6; flex: 1 1 320px; }
.labx-verdict-v b { color: var(--brand-2); }
.labx-verdict-t { font-size: 12px; color: var(--muted-2); flex: 0 0 auto; }

/* ---------- 模块条（模块独立：一页一个模块，不再一条长滚动） ---------- */
.labx-tabs {
  display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px;
  padding-bottom: 10px; border-bottom: 1px solid var(--line);
}
.labx-tab {
  height: 32px; padding: 0 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line-2); background: transparent; color: var(--muted); font-size: 13px;
}
.labx-tab:hover { color: var(--text); border-color: var(--muted-2); }
.labx-tab.active { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.labx-body { min-height: 200px; }

/* ---------- 待办 / 漏斗 / 进度条 / 红线 ---------- */
.labx-todo {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  padding: 11px 0; border-bottom: 1px dashed var(--line);
}
.labx-todo:last-child { border-bottom: none; }
.labx-todo-t { flex: 1 1 240px; font-size: 13.5px; line-height: 1.6; }
.labx-fn {
  display: flex; align-items: center; gap: 12px; padding: 9px 0;
  border-bottom: 1px dashed var(--line);
}
.labx-fn:last-child { border-bottom: none; }
.labx-fn-mid { flex: 1 1 200px; min-width: 160px; }
.labx-fn-n { flex: 0 0 auto; min-width: 92px; text-align: right; font-size: 18px; }
/* 进度条轨道吃 --bg-2 令牌：深色 #12171f / 浅色 #eaeef6，两色都成立（theme.css 已覆盖该令牌） */
.labx-fn-bar { height: 8px; border-radius: 6px; background: var(--bg-2); overflow: hidden; margin-bottom: 6px; }
.labx-fn-bar i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--brand), var(--brand-2)); }
.labx-reds { margin: 0; padding-left: 20px; font-size: 13.5px; line-height: 1.9; }

/* ---------- 表内小控件 ---------- */
.labx-mini {
  margin-left: 6px; padding: 1px 6px; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--line-2); background: transparent; color: var(--muted-2); font-size: 11px;
}
.labx-mini:hover { color: var(--brand-2); border-color: var(--brand); }
.labx-tok { letter-spacing: .3px; }

/* ---------- 「做」：右侧抽屉 ---------- */
.labx-scrim {
  position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, 0.45);
  display: flex; justify-content: flex-end;
}
.labx-drawer {
  width: min(560px, 94vw); height: 100%; display: flex; flex-direction: column;
  background: var(--panel); border-left: 1px solid var(--line-2); box-shadow: -12px 0 40px rgba(0, 0, 0, 0.35);
  animation: labx-in .18s ease-out;
}
@keyframes labx-in { from { transform: translateX(24px); opacity: .6; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .labx-drawer { animation: none; } }
.labx-drawer-hd {
  flex: 0 0 auto; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 16px 18px 13px; border-bottom: 1px solid var(--line);
}
.labx-drawer-hd h3 { margin: 0; font-size: 15px; font-weight: 650; }
.labx-drawer-hd .sub { color: var(--muted-2); font-size: 12.5px; margin-top: 3px; }
.labx-form { flex: 1 1 auto; overflow-y: auto; padding: 16px 18px; }
.labx-drawer-ft {
  flex: 0 0 auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 13px 18px; border-top: 1px solid var(--line); background: var(--bg-2);
}
.labx-fr { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.labx-f { flex: 1 1 150px; min-width: 130px; display: flex; flex-direction: column; gap: 5px; }
.labx-f > span { color: var(--muted); font-size: 12.5px; }
.labx-f > span b { color: var(--warn); }
.labx-f input, .labx-f select {
  width: 100%; height: 38px; padding: 0 11px; border-radius: var(--r-md);
  background: var(--bg-2); color: var(--text); border: 1px solid var(--line-2); font-size: 13.5px; outline: none;
}
.labx-f input:focus, .labx-f select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.18); }
.labx-more { border: 1px dashed var(--line-2); border-radius: 10px; padding: 9px 12px; margin-bottom: 12px; }
.labx-more > summary { cursor: pointer; color: var(--muted); font-size: 12.5px; list-style: none; }
.labx-more > summary::-webkit-details-marker { display: none; }
.labx-more > summary::before { content: '\25B8'; margin-right: 6px; color: var(--muted-2); }
.labx-more[open] > summary::before { content: '\25BE'; }
.labx-more > .labx-fr:first-of-type { margin-top: 10px; }
.labx-dec {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  padding: 10px 0; border-bottom: 1px dashed var(--line);
}
.labx-dec-l { flex: 1 1 240px; }
.labx-in {
  flex: 1 1 200px; min-width: 160px; height: 38px; padding: 0 11px; border-radius: var(--r-md);
  background: var(--bg-2); color: var(--text); border: 1px solid var(--line-2); font-size: 13.5px; outline: none;
}
.labx-in:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.18); }

/* ---------- 卡型 chip（卡密模块 · 卡号下方）：卡型是身份分级与展示，不是权限 ----------
   深色（默认）与浅色（:root[data-theme='light']）各一套文字色：黑/金底自带对比度，金卡在深底上换亮金、浅底上换深金。 */
.labx-tier {
  display: inline-block; margin-top: 4px; padding: 1px 7px; border-radius: 999px;
  font-size: 11px; line-height: 1.7; letter-spacing: .3px; white-space: nowrap; cursor: help;
  border: 1px solid var(--line-2); color: var(--muted); background: var(--bg-2);
}
.labx-tier-gold { border-color: #c99a20; color: #f0c860; background: rgba(217, 167, 43, .16); }
.labx-tier-black { border-color: #5a5a5a; color: #f2f2f2; background: #16181d; }
.labx-tier-founder { border-color: #b8860b; color: #f6e3b0; background: linear-gradient(135deg, #16181d, #3a2c07); }
:root[data-theme='light'] .labx-tier-gold { color: #7a5600; background: rgba(217, 167, 43, .18); }
:root[data-theme='light'] .labx-tier-founder { border-color: #a9741a; color: #fdf3d8; background: linear-gradient(135deg, #2a2a2a, #6b5008); }

/* ---------- 卡面：真的画一张卡（材质 + 烫金 + 印章 + 专属效果）----------
   每个卡型一套「专属效果」：标准=石墨哑光细网格 · 金卡=拉丝金 + 高光扫过 ·
   黑卡=哑光黑 + 烫金边 + 微光呼吸 · 创始=黑金 + 全息彩带。
   服务端没登记过的卡型落到中性材质（.labx-cf 基类）——不隐藏、不报错。 */
.labx-cf {
  position: relative; display: inline-block; flex: 0 0 auto; overflow: hidden; vertical-align: middle;
  width: 58px; height: 36px; border-radius: 5px; border: 1px solid var(--line-2);
  background: linear-gradient(135deg, #262b34, #171a20 65%, #20242c); color: #e8ecf3;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .06);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; line-height: 1; text-align: left;
}
.labx-cf-sheen, .labx-cf-holo { position: absolute; inset: 0; pointer-events: none; }
.labx-cf-sheen {
  background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, .34) 50%, transparent 62%);
  transform: translateX(-130%);
}
.labx-cf-brand { position: absolute; left: 5px; top: 4px; font-size: 8px; letter-spacing: 1px; opacity: .72; }
.labx-cf-seal {
  position: absolute; top: 3px; right: 3px; padding: 0 3px; border-radius: 3px; font-size: 8px; line-height: 12px;
  font-weight: 600; letter-spacing: .2px; background: rgba(0, 0, 0, .42); color: #ffe9a8;
  border: 1px solid rgba(212, 175, 55, .4);
  font-family: system-ui, -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
}
.labx-cf-no { position: absolute; left: 5px; bottom: 4px; font-size: 10px; font-weight: 600; letter-spacing: .5px; }

/* 标准：石墨哑光 + 细网格 */
.labx-cf-standard { background: linear-gradient(135deg, #2b303a, #1a1e25 60%, #23272f); }
.labx-cf-standard::after {
  content: ''; position: absolute; inset: 0; opacity: .55; pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
  background-size: 6px 6px;
}
/* 金卡：拉丝金 */
.labx-cf-gold {
  border-color: #c99a20; color: #2b1d00;
  background: linear-gradient(135deg, #d9a72b, #f6e3a8 22%, #b8860b 52%, #f0c860 78%, #a9741a);
}
.labx-cf-gold .labx-cf-seal { background: rgba(43, 29, 0, .5); color: #fff3cf; border-color: rgba(43, 29, 0, .35); }
/* 黑卡：哑光黑 + 烫金边 + 微光呼吸（呼吸只在图鉴/大卡上跑，列表里 20 行不跑，省性能） */
.labx-cf-black {
  border-color: rgba(212, 175, 55, .55); color: #f4e6c0;
  background: radial-gradient(120% 120% at 12% 8%, #23262d, #0d0f13 62%, #16181d);
}
.labx-cf-black .labx-cf-holo {
  opacity: .16; mix-blend-mode: screen;
  background: conic-gradient(from 210deg, #d4af37, transparent 30%, #8fd6ff 55%, transparent 75%, #d4af37);
}
/* 创始：黑金 + 全息彩带 */
.labx-cf-founder {
  border-color: #b8860b; color: #f6e3b0;
  background: radial-gradient(120% 120% at 15% 10%, #2a2109, #0b0c0f 60%, #1c1503);
}
.labx-cf-founder .labx-cf-holo {
  opacity: .3; mix-blend-mode: screen;
  background: conic-gradient(from 200deg, #ffd76e, transparent 25%, #7fe0ff 50%, transparent 70%, #ff9ad5 88%, #ffd76e);
}

/* 列表里的卡面：鼠标经过扫一道高光（一行一张，代价很小） */
.labx-cardline { display: flex; align-items: center; gap: 7px; }
.labx-cardline:hover .labx-cf-sheen { animation: labx-sheen 1.1s ease-out 1; }
.labx-no {
  padding: 0; border: none; background: none; color: var(--text); font: inherit; letter-spacing: .2px;
  cursor: pointer; text-align: left;
}
.labx-no:hover { color: var(--brand-2); text-decoration: underline; }
@keyframes labx-sheen { from { transform: translateX(-130%); } to { transform: translateX(130%); } }

/* 图鉴里的卡面（成就卡）：大一号 + 黑卡/创始微光呼吸 */
.labx-cf-tile { width: 132px; height: 82px; border-radius: 8px; }
.labx-cf-tile .labx-cf-brand { left: 8px; top: 7px; font-size: 10px; letter-spacing: 1.6px; }
.labx-cf-tile .labx-cf-seal { top: 6px; right: 6px; font-size: 10px; line-height: 16px; padding: 0 5px; }
.labx-cf-tile .labx-cf-holder { position: absolute; left: 8px; bottom: 8px; font-size: 13px; font-weight: 650; letter-spacing: .6px; }
.labx-cf-tile.labx-cf-black, .labx-cf-tile.labx-cf-founder { animation: labx-glow 4.2s ease-in-out infinite; }
@keyframes labx-glow {
  0%, 100% { box-shadow: 0 1px 3px rgba(0, 0, 0, .35), 0 0 0 0 rgba(212, 175, 55, 0); }
  50% { box-shadow: 0 1px 3px rgba(0, 0, 0, .35), 0 0 12px 1px rgba(212, 175, 55, .38); }
}

/* 大卡（点开一张卡）：开卡扫一道高光 + 3D 倾斜 + 光斑跟随鼠标 */
.labx-cf-lg {
  width: 340px; height: 210px; border-radius: 14px;
  box-shadow: 0 18px 46px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .08);
}
.labx-cf-lg .labx-cf-brand { left: 14px; top: 12px; font-size: 12px; letter-spacing: 2.4px; }
.labx-cf-lg .labx-cf-seal { top: 11px; right: 12px; font-size: 11px; line-height: 18px; padding: 0 7px; }
.labx-cf-lg .labx-cf-no { left: 14px; bottom: 44px; font-size: 17px; letter-spacing: 1.4px; }
.labx-cf-lg .labx-cf-holder { position: absolute; left: 14px; bottom: 20px; font-size: 15px; font-weight: 650; }
.labx-cf-lg .labx-cf-meta { position: absolute; right: 14px; bottom: 20px; font-size: 11px; opacity: .82; }
.labx-cf-lg::after {
  content: ''; position: absolute; inset: 0; opacity: .5; pointer-events: none;
  background-image: repeating-linear-gradient(58deg, rgba(255, 255, 255, .045) 0 1px, transparent 1px 7px),
    repeating-linear-gradient(-58deg, rgba(255, 255, 255, .035) 0 1px, transparent 1px 9px);
}
.labx-cf-lg .labx-cf-sheen { animation: labx-sheen 2.6s ease-out .2s 1; }
.labx-cf-lg.labx-cf-black, .labx-cf-lg.labx-cf-founder { animation: labx-glow 4.2s ease-in-out infinite; }
.labx-cf-3d {
  transform: perspective(760px) rotateY(var(--ty, 0deg)) rotateX(var(--tx, 0deg));
  transition: transform .2s ease-out;
}
.labx-cf-3d::before {
  content: ''; position: absolute; inset: 0; opacity: 0; pointer-events: none; transition: opacity .2s;
  background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, .22), transparent 62%);
}
.labx-cv-stage:hover .labx-cf-3d::before { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .labx-cf-sheen, .labx-cf-3d::before { animation: none !important; }
  .labx-cf-tile.labx-cf-black, .labx-cf-tile.labx-cf-founder,
  .labx-cf-lg.labx-cf-black, .labx-cf-lg.labx-cf-founder { animation: none !important; }
  .labx-cf-3d { transform: none !important; }
}

/* ---------- 卡型图鉴（一套成就） ---------- */
.labx-gallery { margin-bottom: 12px; }
.labx-gtiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(246px, 1fr)); gap: 12px; }
.labx-gtile {
  display: flex; gap: 12px; align-items: center; padding: 10px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2);
}
.labx-gtile .nm { display: flex; align-items: center; gap: 6px; font-weight: 650; }
.labx-rare {
  padding: 1px 6px; border-radius: 999px; font-size: 10.5px; font-weight: 500; font-style: normal;
  border: 1px solid rgba(212, 175, 55, .5); color: #f0c860; background: rgba(212, 175, 55, .12);
}
:root[data-theme='light'] .labx-rare { color: #7a5600; background: rgba(212, 175, 55, .18); }

/* ---------- 大卡详情（点开一张卡 · 居中弹层；里面没有一个输入框） ---------- */
.labx-scrim-center { justify-content: center; align-items: center; padding: 16px; }
.labx-cardview {
  width: min(780px, 100%); max-height: 88vh; overflow: auto;
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .5); animation: labx-in .18s ease-out;
}
.labx-cv-body { display: flex; gap: 18px; padding: 18px; flex-wrap: wrap; align-items: flex-start; }
.labx-cv-stage { flex: 0 0 auto; display: flex; align-items: center; justify-content: center; }
.labx-cv-info { flex: 1 1 320px; min-width: 250px; display: flex; flex-direction: column; gap: 9px; }
.labx-cv-kv { display: flex; gap: 10px; align-items: baseline; padding-bottom: 7px; border-bottom: 1px dashed var(--line); font-size: 13px; }
.labx-cv-kv:last-child { border-bottom: none; }
.labx-cv-kv > span { flex: 0 0 86px; color: var(--muted-2); font-size: 12px; }
.labx-cv-kv > b { flex: 1 1 auto; font-weight: 600; }
.labx-cv-kv > b .sub2 { font-weight: 400; margin-top: 2px; }

/* ---------- 窄屏（console.css 的断点也是 860px） ---------- */
@media (max-width: 860px) {
  .labx-top { position: static; margin: -16px -16px 10px; padding: 12px 16px 10px; }
  .labx-top-r { width: 100%; }
  .labx-top-r .btn { flex: 1 1 auto; }
  .labx-tabs { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 8px; }
  .labx-tab { flex: 0 0 auto; }
  .labx-drawer { width: 100%; }
  .labx-fn-n { min-width: 64px; font-size: 15px; }
  .labx-verdict-t { flex: 1 1 100%; }
  /* 卡型图鉴与大卡：窄屏竖排，卡面不超宽 */
  .labx-gtiles { grid-template-columns: 1fr; }
  .labx-cardview { width: 100%; max-height: 92vh; }
  .labx-cf-lg { width: 100%; max-width: 340px; }
  .labx-cv-info { flex: 1 1 100%; min-width: 0; }
  .labx-cv-kv > span { flex: 0 0 74px; }
}
