/* ==========================================================================
   wake-ui · 组件样式
   约定：
   1. 每个组件一个 class 家族（BEM），页面禁止自造 class。
   2. 所有数值来自 tokens.css 的变量。
   3. 组件不假设外层容器，可独立放在任何位置。
   ========================================================================== */

/* ---------------------------------------------------------------- 基础 */
.wk, .wk * { box-sizing: border-box; }
.wk {
  font-family: var(--wk-font);
  font-size: var(--wk-fs-14);
  font-weight: var(--wk-fw-normal);
  line-height: var(--wk-lh-body);
  color: var(--wk-ink);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
.wk-btn:focus-visible, .wk-tabs__item:focus-visible,
.wk-cell:focus-visible, .wk-switch:focus-visible {
  outline: 2px solid var(--wk-line-focus); outline-offset: 2px;
}

/* ---------------------------------------------------------------- Button
   Size:   --lg / (默认 md) / --sm
   Variant: --primary / --secondary / --ghost / --danger / --text
   ------------------------------------------------------------------ */
.wk-btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--wk-sp-2);
  height: var(--wk-h-btn-md); padding: 0 var(--wk-sp-5);
  border: 0; border-radius: var(--wk-r-4);
  font-family: inherit; font-size: var(--wk-fs-14);
  font-weight: var(--wk-fw-strong);
  line-height: 1;
  cursor: pointer; user-select: none; white-space: nowrap;
  transition: opacity var(--wk-dur) var(--wk-ease),
              transform var(--wk-dur) var(--wk-ease),
              background-color var(--wk-dur) var(--wk-ease);
  background: var(--wk-fill); color: var(--wk-ink);
}
.wk-btn:active { transform: scale(.97); }

/* ★学小黑盒的 hover 手法：用 color-mix 把「当前文字色」按 8% 叠上去，
   这样同一个规则在任何底色（黑钮/白钮/幽灵钮）上都成立，不用给每个变体写 hover 色。 */
.wk-btn:hover:not(:disabled):not(.is-disabled) {
  background-image: linear-gradient(
    color-mix(in srgb, currentColor 8%, transparent),
    color-mix(in srgb, currentColor 8%, transparent)
  );
}
.wk-btn:active:not(:disabled):not(.is-disabled) {
  background-image: linear-gradient(
    color-mix(in srgb, currentColor 15%, transparent),
    color-mix(in srgb, currentColor 15%, transparent)
  );
}
/* 幽灵/文字按钮没有底色，hover 才需要真的给一层浅底 */
.wk-btn--ghost:hover, .wk-btn--text:hover { background-color: var(--wk-fill-input); }

/* 磨砂材质（小黑盒顶栏/底栏用的就是这套：#F7F8F9CC + blur 32） */
.wk-material-bar {
  background: var(--wk-material-bar);
  backdrop-filter: blur(32px);
  -webkit-backdrop-filter: blur(32px);
}
.wk-material-popover {
  background: var(--wk-material-popover);
  backdrop-filter: blur(32px);
  -webkit-backdrop-filter: blur(32px);
}
.wk-btn[disabled], .wk-btn.is-disabled { opacity: .4; pointer-events: none; }

.wk-btn--primary   { background: var(--wk-accent); color: var(--wk-on-accent); }
.wk-btn--secondary { background: var(--wk-accent-weak); color: var(--wk-accent-ink); }
.wk-btn--ghost     { background: transparent; color: var(--wk-ink);
                     box-shadow: inset 0 0 0 1px var(--wk-line-2); }
.wk-btn--text      { background: transparent; color: var(--wk-accent-ink); padding: 0 var(--wk-sp-2); }
.wk-btn--danger    { background: var(--wk-danger-weak); color: var(--wk-danger-ink); }

.wk-btn--lg { height: var(--wk-h-btn-lg); padding: 0 var(--wk-sp-6);
              font-size: var(--wk-fs-16); line-height: var(--wk-lh-16); border-radius: var(--wk-r-4); }  /* ★圆角不按尺寸分档 */
.wk-btn--sm { height: var(--wk-h-btn-sm); padding: 0 var(--wk-sp-3);
              font-size: var(--wk-fs-12); line-height: var(--wk-lh-12); border-radius: var(--wk-r-4); }

.wk-btn--block { display: flex; width: 100%; }
.wk-btn--icon  { width: var(--wk-h-btn-md); padding: 0; }

/* ★加载态：文字隐藏、中间转圈、不可点（之前整个组件库没有这个态） */
.wk-btn.is-loading { position: relative; pointer-events: none; color: transparent !important; }
.wk-btn.is-loading > * { visibility: hidden; }
.wk-btn.is-loading::after {
  content: ""; position: absolute; width: 16px; height: 16px;
  border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; animation: wk-spin 640ms linear infinite;
  visibility: visible; color: var(--wk-ink);
}
.wk-btn--primary.is-loading::after { color: var(--wk-on-accent); }

/* ★反色按钮（黑底上的白钮，小黑盒满屏黑的时候靠它做次级操作） */
.wk-btn--white { background: var(--wk-card-raised); color: var(--wk-ink);
                 box-shadow: inset 0 0 0 1px var(--wk-line-strong); }

/* ---------------------------------------------------------------- Icon
   ★统一图标容器：24 网格 · currentColor · 尺寸只认 font-size
   装小黑盒字体图标：<i class="wk-icon xhh-i xhh-i-search"></i>
   装 SVG：<svg class="wk-icon">…</svg>
   两边同一套尺寸/颜色规则，页面不用关心用的是哪种实现。
*/
.wk-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1em; height: 1em; flex: none;
  font-size: 20px; color: currentColor;
  vertical-align: middle;
}
.wk-icon svg { width: 100%; height: 100%; display: block; fill: none;
               stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.wk-icon--sm { font-size: 16px; }
.wk-icon--lg { font-size: 24px; }
.wk-icon--xl { font-size: 32px; }

/* ---------------------------------------------------------------- Card */
.wk-card {
  background: var(--wk-card);
  border-radius: var(--wk-r-8);
  padding: var(--wk-gap-8) var(--wk-gap-12);   /* 上下 < 左右，它的实测 6~8 / 10~12 */
  /* ★小黑盒的卡片没有投影：白面浮在浅灰底上，靠底色差分层次 */
}
.wk-card--flush { padding: 0; overflow: hidden; }
.wk-card--flat  { box-shadow: none; border-radius: 0; }
.wk-card__hd {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--wk-sp-3);
}
.wk-card__title { font-size: var(--wk-fs-16); line-height: var(--wk-lh-16); font-weight: var(--wk-fw-strong); }
.wk-card__more  { font-size: var(--wk-fs-12); line-height: var(--wk-lh-12); color: var(--wk-ink-3); }

/* ---------------------------------------------------------------- Tabs
   结构：<div class="wk-tabs"><i class="wk-tabs__item is-on">推荐</i>…</div>
   ------------------------------------------------------------------ */
.wk-tabs {
  display: flex; align-items: center; gap: var(--wk-sp-5);
  overflow-x: auto; scrollbar-width: none;
  padding: 0 var(--wk-pad-x);
}
.wk-tabs::-webkit-scrollbar { display: none; }
.wk-tabs__item {
  position: relative; flex: none;
  padding: var(--wk-sp-3) 0;
  font-size: var(--wk-fs-14); line-height: var(--wk-lh-14); font-style: normal;
  color: var(--wk-ink-2); cursor: pointer;
  transition: color var(--wk-dur) var(--wk-ease);
}
.wk-tabs__item.is-on { color: var(--wk-ink); font-weight: var(--wk-fw-strong); }
.wk-tabs__item.is-on::after {
  content: ""; position: absolute; left: 50%; bottom: 0;
  width: 16px; height: 2px; margin-left: -8px;
  border-radius: 1px; background: var(--wk-accent);   /* ★小黑盒下划线 2px 高、几乎直角 */
}
/* 大号 tab（一级导航） */
.wk-tabs--lg .wk-tabs__item { font-size: var(--wk-fs-18); line-height: var(--wk-lh-18); padding: var(--wk-sp-2) 0 var(--wk-sp-3); }
.wk-tabs--lg .wk-tabs__item.is-on::after { width: 20px; margin-left: -10px; }

/* ---------------------------------------------------------------- Avatar */
.wk-avatar {
  position: relative; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: var(--wk-r-full);   /* 截图实测 28 */
  background: var(--wk-fill); color: var(--wk-ink-3);
  font-size: var(--wk-fs-12); line-height: var(--wk-lh-12); overflow: hidden;
}
.wk-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wk-avatar--sm { width: 24px; height: 24px; font-size: var(--wk-fs-11); line-height: var(--wk-lh-11); }
.wk-avatar--lg { width: 48px; height: 48px; font-size: var(--wk-fs-14); line-height: var(--wk-lh-14); }
.wk-avatar--xl { width: 64px; height: 64px; font-size: var(--wk-fs-18); line-height: var(--wk-lh-18); }

/* 多人头像叠放 */
.wk-avatar-group { display: inline-flex; align-items: center; }
.wk-avatar-group .wk-avatar { box-shadow: 0 0 0 2px var(--wk-card); }
.wk-avatar-group .wk-avatar + .wk-avatar { margin-left: -8px; }

/* ---------------------------------------------------------------- Badge */
.wk-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: var(--wk-r-full);
  background: var(--wk-danger); color: #fff;
  font-size: var(--wk-fs-11); font-weight: var(--wk-fw-strong);
  line-height: 1;
}
.wk-badge--dot { min-width: 8px; width: 8px; height: 8px; padding: 0; }
.wk-badge--accent { background: var(--wk-accent); }
.wk-badge--level { background: var(--wk-accent); color: var(--wk-on-accent); border-radius: var(--wk-r-3);
                   height: 15px; font-size: var(--wk-fs-10); line-height: var(--wk-lh-10); padding: 0 4px; }
.wk-badge-hold { position: relative; display: inline-flex; }
.wk-badge-hold > .wk-badge { position: absolute; top: -6px; right: -8px; }

/* ---------------------------------------------------------------- 状态：空 / 错 / 载 */
.wk-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--wk-sp-3); padding: var(--wk-sp-10) var(--wk-sp-6);
  text-align: center;
}
.wk-state__icon { width: 72px; height: 72px; color: var(--wk-ink-4); }
.wk-state__icon svg { width: 100%; height: 100%; }
.wk-state__title { font-size: var(--wk-fs-14); line-height: var(--wk-lh-14); color: var(--wk-ink-2); }
.wk-state__desc  { font-size: var(--wk-fs-12); color: var(--wk-ink-3); line-height: var(--wk-lh-snug); }
.wk-state__act   { margin-top: var(--wk-sp-1); }

.wk-loading { display: inline-flex; align-items: center; gap: var(--wk-sp-2);
              color: var(--wk-ink-3); font-size: var(--wk-fs-12); line-height: var(--wk-lh-12); }
.wk-loading__spin {
  width: 16px; height: 16px; border-radius: var(--wk-r-full);
  border: 2px solid var(--wk-line-2); border-top-color: var(--wk-accent);
  animation: wk-spin .7s linear infinite;
}
@keyframes wk-spin { to { transform: rotate(360deg); } }

/* 骨架屏 */
.wk-skeleton {
  background: linear-gradient(90deg, var(--wk-fill) 25%, var(--wk-line) 37%, var(--wk-fill) 63%);
  background-size: 400% 100%;
  animation: wk-shimmer 1.4s ease infinite;
  border-radius: var(--wk-r-4);
}
@keyframes wk-shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }


/* ---------------------------------------------------------------- 遮罩 */
.wk-mask {
  position: fixed; inset: 0; z-index: var(--wk-z-mask);
  background: rgba(20,25,29,.45);
  opacity: 0; visibility: hidden;
  transition: opacity var(--wk-dur) var(--wk-ease), visibility var(--wk-dur);
}
.wk-mask.is-open { opacity: 1; visibility: visible; }

/* ---------------------------------------------------------------- Sheet
   底部弹层。靠 .is-open 滑入，不要用 style.display 控制（会停在屏外）。
   ------------------------------------------------------------------ */
.wk-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--wk-z-sheet);
  max-width: 480px; margin: 0 auto;
  background: var(--wk-card);
  border-radius: var(--wk-r-16) var(--wk-r-16) 0 0;
  box-shadow: var(--wk-sh-3);
  transform: translateY(100%);
  transition: transform var(--wk-dur) var(--wk-ease);
  display: flex; flex-direction: column;
  max-height: 82vh;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.wk-sheet.is-open { transform: translateY(0); }
.wk-sheet__head {
  position: relative; flex: none;
  padding: var(--wk-sp-4) var(--wk-pad-x) var(--wk-sp-3);
  font-size: var(--wk-fs-16); line-height: var(--wk-lh-16); font-weight: var(--wk-fw-strong);
  text-align: center;
}
.wk-sheet__close {
  position: absolute; right: var(--wk-pad-x); top: 50%;
  transform: translateY(-50%);
  width: 28px; height: 28px; border: 0; border-radius: var(--wk-r-full);
  background: var(--wk-fill); color: var(--wk-ink-3);
  font-size: 0; cursor: pointer;
}
.wk-sheet__close::before, .wk-sheet__close::after {
  content: ""; position: absolute; left: 8px; right: 8px; top: 13px;
  height: 2px; background: currentColor; border-radius: 2px;
}
.wk-sheet__close::before { transform: rotate(45deg); }
.wk-sheet__close::after  { transform: rotate(-45deg); }
.wk-sheet__body { flex: 1; overflow-y: auto; padding: 0 var(--wk-pad-x); }
.wk-sheet__foot {
  flex: none; padding: var(--wk-sp-3) var(--wk-pad-x) var(--wk-sp-4);
  border-top: 1px solid var(--wk-line);
}

/* ---------------------------------------------------------------- Dialog */
.wk-dialog-wrap {
  position: fixed; inset: 0; z-index: var(--wk-z-dialog);
  display: flex; align-items: center; justify-content: center;
  padding: var(--wk-sp-6);
  opacity: 0; visibility: hidden;
  transition: opacity var(--wk-dur) var(--wk-ease), visibility var(--wk-dur);
}
.wk-dialog-wrap.is-open { opacity: 1; visibility: visible; }
.wk-dialog {
  width: 100%; max-width: 320px;
  background: var(--wk-card-raised); border-radius: var(--wk-r-16);
  padding: var(--wk-sp-5) var(--wk-sp-4) var(--wk-sp-3);
  transform: scale(.94);
  transition: transform var(--wk-dur) var(--wk-ease);
}
.wk-dialog-wrap.is-open .wk-dialog { transform: scale(1); }
.wk-dialog__title { font-size: var(--wk-fs-16); line-height: var(--wk-lh-16); font-weight: var(--wk-fw-strong);
                    text-align: center; margin-bottom: var(--wk-sp-2); }
.wk-dialog__body  { font-size: var(--wk-fs-14); color: var(--wk-ink-2);
                    text-align: center; line-height: var(--wk-lh-snug); }
.wk-dialog__acts  { display: flex; gap: var(--wk-sp-3); margin-top: var(--wk-sp-5); }
.wk-dialog__acts .wk-btn { flex: 1; }

/* ---------------------------------------------------------------- Toast */
.wk-toast-host {
  position: fixed; left: 0; right: 0; bottom: 96px; z-index: var(--wk-z-toast);
  display: flex; flex-direction: column; align-items: center; gap: var(--wk-sp-2);
  pointer-events: none;
}
.wk-toast {
  max-width: 76vw;
  padding: 10px var(--wk-sp-4);
  border-radius: var(--wk-r-8);
  background: rgba(20,25,29,.86); color: #fff;
  font-size: var(--wk-fs-14); line-height: var(--wk-lh-snug);
  text-align: center; word-break: break-word;
  animation: wk-toast-in .2s var(--wk-ease);
}
.wk-toast.is-out { animation: wk-toast-out .2s var(--wk-ease) forwards; }
@keyframes wk-toast-in  { from { opacity: 0; transform: translateY(8px) scale(.96); } }
@keyframes wk-toast-out { to   { opacity: 0; transform: translateY(-4px); } }

/* ---------------------------------------------------------------- 全屏看图 */
.wk-viewer {
  position: fixed; inset: 0; z-index: var(--wk-z-viewer);
  background: #000;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden;
  transition: opacity var(--wk-dur) var(--wk-ease), visibility var(--wk-dur);
}
.wk-viewer.is-open { opacity: 1; visibility: visible; }
.wk-viewer__img {
  max-width: 100%; max-height: 100%;
  object-fit: contain;
  transition: transform var(--wk-dur-slow) var(--wk-ease);
}
.wk-viewer__close {
  position: absolute; top: env(safe-area-inset-top, 12px); right: 16px;
  width: 36px; height: 36px; border: 0; border-radius: var(--wk-r-full);
  background: rgba(255,255,255,.14); color: #fff; cursor: pointer;
}
.wk-viewer__close::before, .wk-viewer__close::after {
  content: ""; position: absolute; left: 10px; right: 10px; top: 17px;
  height: 2px; background: currentColor; border-radius: 2px;
}
.wk-viewer__close::before { transform: rotate(45deg); }
.wk-viewer__close::after  { transform: rotate(-45deg); }
.wk-viewer__idx {
  position: absolute; bottom: calc(24px + env(safe-area-inset-bottom, 0));
  left: 0; right: 0; text-align: center;
  color: rgba(255,255,255,.7); font-size: var(--wk-fs-12); line-height: var(--wk-lh-12);
}

/* ---------------------------------------------------------------- 表单 */
.wk-field { display: flex; flex-direction: column; gap: var(--wk-sp-2); }
.wk-field__label { font-size: var(--wk-fs-12); line-height: var(--wk-lh-12); color: var(--wk-ink-3); }
.wk-input, .wk-textarea {
  width: 100%;
  min-height: var(--wk-h-input);
  padding: 0 var(--wk-sp-4);
  border: 0; border-radius: var(--wk-r-4);       /* ★小黑盒 --radius-surface-sm: 4（控件表面，不是卡片级 8） */
  background: var(--wk-fill-input); color: var(--wk-ink);   /* ★fill-input 不是 fill */
  font-family: inherit; font-size: var(--wk-fs-14);
  line-height: var(--wk-h-input);
  transition: box-shadow var(--wk-dur) var(--wk-ease);
}
.wk-input::placeholder, .wk-textarea::placeholder { color: var(--wk-ink-4); }
.wk-input:focus, .wk-textarea:focus {
  /* ★小黑盒聚焦 = 1px --line-focus(#006EF4) 蓝描边 */
  outline: none; box-shadow: inset 0 0 0 1px var(--wk-line-focus);
}
.wk-textarea { padding: var(--wk-sp-3) var(--wk-sp-4); line-height: var(--wk-lh-body);
               min-height: 96px; resize: none; }
.wk-field__hint { font-size: var(--wk-fs-11); line-height: var(--wk-lh-11); color: var(--wk-ink-4); }
.wk-field__err  { font-size: var(--wk-fs-11); line-height: var(--wk-lh-11); color: var(--wk-danger-ink); }

/* 开关：滑钮（后台/设置统一用这个，不用 checkbox） */
.wk-switch {
  position: relative; flex: none;
  width: 36px; height: 20px; border-radius: var(--wk-r-full);
  background: var(--wk-line-2); cursor: pointer; border: 0;
  transition: background-color var(--wk-dur) var(--wk-ease);
}
.wk-switch::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 14px; height: 14px; border-radius: var(--wk-r-full);
  background: #fff; box-shadow: var(--wk-sh-1);
  transition: transform var(--wk-dur) var(--wk-ease);
}
.wk-switch.is-on { background: var(--wk-accent); }
.wk-switch.is-on::after { transform: translateX(18px); }

/* ---------------------------------------------------------------- Cell 列表项 */
.wk-list { background: var(--wk-card); }
.wk-cell {
  display: flex; align-items: center; gap: var(--wk-sp-3);
  min-height: 52px; padding: var(--wk-sp-3) var(--wk-pad-x);
  background: var(--wk-card); cursor: pointer;
  transition: background-color var(--wk-dur-fast) var(--wk-ease);
}
.wk-cell:active { background: var(--wk-fill); }
.wk-cell + .wk-cell { box-shadow: inset 0 1px 0 var(--wk-line); }
.wk-cell__hd { flex: none; display: flex; align-items: center; color: var(--wk-ink-2); }
.wk-cell__hd svg, .wk-cell__hd .wk-icon { width: 24px; height: 24px; flex: none; }   /* ★图标统一 24 网格 */
.wk-cell__bd { flex: 1; min-width: 0; font-size: var(--wk-fs-14); line-height: var(--wk-lh-14); }
.wk-cell__bd small { display: block; font-size: var(--wk-fs-11); line-height: var(--wk-lh-11); color: var(--wk-ink-3); margin-top: 2px; }
.wk-cell__ft {
  flex: none; display: flex; align-items: center; gap: var(--wk-sp-2);
  font-size: var(--wk-fs-12); line-height: var(--wk-lh-12); color: var(--wk-ink-3);
}
.wk-cell__arrow { width: 7px; height: 7px; border-right: 1.5px solid var(--wk-ink-3);
                  border-bottom: 1.5px solid var(--wk-ink-3); transform: rotate(-45deg); }   /* ★箭头用三级灰，不是 disabled 的中灰 */


/* ==========================================================================
   第二批：通用组件
   ========================================================================== */

/* ---------------------------------------------------------------- Divider */
.wk-divider { height: 1px; background: var(--wk-line); margin: var(--wk-sp-4) 0; border: 0; }
.wk-divider--inset { margin-left: var(--wk-pad-x); margin-right: var(--wk-pad-x); }
.wk-divider--v { width: 1px; height: 14px; margin: 0 var(--wk-sp-2); display: inline-block;
                 vertical-align: middle; background: var(--wk-line-2); }
.wk-gap { height: var(--wk-sp-2); background: var(--wk-bg); }
.wk-gap--lg { height: var(--wk-sp-4); }

/* ---------------------------------------------------------------- Chip / Tag
   用于话题、游戏名、筛选项。可选态 is-on。
   ------------------------------------------------------------------ */
.wk-chip {
  display: inline-flex; align-items: center; gap: 4px;
  height: 28px; padding: 0 var(--wk-sp-3);
  border-radius: var(--wk-r-4);   /* ★小黑盒控件级圆角 4（surface-sm），不是胶囊 */
  background: var(--wk-fill); color: var(--wk-ink-2);
  font-size: var(--wk-fs-12); line-height: 1;
  white-space: nowrap; cursor: pointer;
  transition: background-color var(--wk-dur) var(--wk-ease), color var(--wk-dur) var(--wk-ease);
}
.wk-chip.is-on { background: var(--wk-accent-weak); color: var(--wk-accent-ink); }
.wk-chip--sm { height: 22px; padding: 0 8px; font-size: var(--wk-fs-11); line-height: var(--wk-lh-11); }
.wk-chip--ghost { background: transparent; box-shadow: inset 0 0 0 1px var(--wk-line-2); }
.wk-chip__close {
  width: 12px; height: 12px; margin-right: -2px; opacity: .55;
  position: relative; flex: none;
}
.wk-chip__close::before, .wk-chip__close::after {
  content: ""; position: absolute; left: 0; right: 0; top: 5px; height: 1.5px;
  background: currentColor; border-radius: 1px;
}
.wk-chip__close::before { transform: rotate(45deg); }
.wk-chip__close::after  { transform: rotate(-45deg); }

/* ---------------------------------------------------------------- Radio / Checkbox */
.wk-radio, .wk-check {
  position: relative; flex: none;
  width: 16px; height: 16px; padding: 0;
  border: 0; background: transparent; cursor: pointer;
  color: var(--wk-line-2);
}
.wk-radio::before {
  content: ""; position: absolute; inset: 0;
  border: 1.5px solid currentColor; border-radius: var(--wk-r-full);
  transition: border-color var(--wk-dur) var(--wk-ease);
}
.wk-radio::after {
  content: ""; position: absolute; inset: 4px;   /* 16 里居中放 8×8，小黑盒真值 */
  border-radius: var(--wk-r-full); background: var(--wk-accent);
  transform: scale(0); transition: transform var(--wk-dur) var(--wk-ease);
}
.wk-radio.is-on { color: var(--wk-accent); }
.wk-radio.is-on::after { transform: scale(1); }

.wk-check::before {
  content: ""; position: absolute; inset: 0;
  border: 1.5px solid currentColor; border-radius: var(--wk-r-3);
  transition: all var(--wk-dur) var(--wk-ease);
}
.wk-check::after {
  content: ""; position: absolute; left: 4.5px; top: 1.5px;
  width: 4px; height: 8px;
  border-right: 1.75px solid #fff; border-bottom: 1.75px solid #fff;
  transform: rotate(45deg) scale(0);
  transition: transform var(--wk-dur) var(--wk-ease);
}
.wk-check.is-on { color: var(--wk-accent); }
.wk-check.is-on::before { background: var(--wk-accent); border-color: var(--wk-accent); }
.wk-check.is-on::after { transform: rotate(45deg) scale(1); }

/* 带文字的行 */
.wk-option {
  display: flex; align-items: center; gap: var(--wk-sp-3);
  min-height: 48px; padding: var(--wk-sp-3) 0;
  font-size: var(--wk-fs-14); line-height: var(--wk-lh-14); cursor: pointer;
}
.wk-option__bd { flex: 1; min-width: 0; }
.wk-option__bd small { display: block; font-size: var(--wk-fs-11); line-height: var(--wk-lh-11); color: var(--wk-ink-3); margin-top: 2px; }

/* ---------------------------------------------------------------- Stepper 数量选择 */
.wk-stepper {
  display: inline-flex; align-items: center; height: 32px;
  border-radius: var(--wk-r-8); background: var(--wk-fill);
}
.wk-stepper__btn {
  width: 32px; height: 32px; border: 0; background: transparent;
  color: var(--wk-ink-2); font-size: 0; position: relative; cursor: pointer;
  border-radius: var(--wk-r-4);
}
.wk-stepper__btn::before, .wk-stepper__btn::after {
  content: ""; position: absolute; left: 11px; right: 11px; top: 15px;
  height: 2px; background: currentColor; border-radius: 2px;
}
.wk-stepper__btn::after { transform: rotate(90deg); }
.wk-stepper__btn[data-act="minus"]::after { display: none; }
.wk-stepper__btn[disabled] { color: var(--wk-ink-4); pointer-events: none; }
.wk-stepper__val {
  min-width: 36px; text-align: center;
  font-size: var(--wk-fs-14); line-height: var(--wk-lh-14); font-variant-numeric: tabular-nums;
  color: var(--wk-ink);
}

/* ---------------------------------------------------------------- Slider 滑杆
   后台配置必用。带实时数值气泡。
   ------------------------------------------------------------------ */
.wk-slider { position: relative; display: flex; align-items: center; height: 32px; }
.wk-slider input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 4px; margin: 0; border-radius: var(--wk-r-full);
  background: var(--wk-line-2); outline: none; cursor: pointer;
}
.wk-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 20px; height: 20px; border-radius: var(--wk-r-full);
  background: #fff; box-shadow: 0 1px 4px rgba(20,25,29,.28);
  border: 2px solid var(--wk-accent); cursor: grab;
}
.wk-slider input[type="range"]:active::-webkit-slider-thumb { cursor: grabbing; transform: scale(1.06); }

/* ---------------------------------------------------------------- Progress */
.wk-progress {
  height: 6px; border-radius: var(--wk-r-full);
  background: var(--wk-fill); overflow: hidden;
}
.wk-progress__bar {
  height: 100%; border-radius: var(--wk-r-full);
  background: var(--wk-accent);
  transition: width var(--wk-dur) var(--wk-ease);
}
.wk-progress--sm { height: 4px; }
.wk-progress__line { display: flex; justify-content: space-between;
                     font-size: var(--wk-fs-11); line-height: var(--wk-lh-11); color: var(--wk-ink-3); margin-bottom: 4px; }

/* ---------------------------------------------------------------- Segmented 分段 */
.wk-seg {
  display: inline-flex; padding: 3px; gap: 2px;
  border-radius: var(--wk-r-6); background: var(--wk-fill);
}
.wk-seg__item {
  padding: 5px 12px; border: 0; border-radius: var(--wk-r-4);
  background: transparent; color: var(--wk-ink-2);
  font-family: inherit; font-size: var(--wk-fs-12); line-height: 1.4;
  cursor: pointer; white-space: nowrap;
  transition: all var(--wk-dur) var(--wk-ease);
}
.wk-seg__item.is-on {
  background: var(--wk-card); color: var(--wk-ink);
  font-weight: var(--wk-fw-strong); box-shadow: var(--wk-sh-1);
}

/* ---------------------------------------------------------------- Searchbar */
.wk-search {
  display: flex; align-items: center; gap: var(--wk-sp-2);
  height: 36px; padding: 0 var(--wk-sp-3);
  border-radius: var(--wk-r-full); background: var(--wk-fill);
  color: var(--wk-ink-3); cursor: text;
}
.wk-search__icon { width: 16px; height: 16px; flex: none; }
.wk-search input {
  flex: 1; min-width: 0; border: 0; background: transparent;
  font-family: inherit; font-size: var(--wk-fs-14); line-height: var(--wk-lh-14); color: var(--wk-ink);
  outline: none;
}
.wk-search input::placeholder { color: var(--wk-ink-4); }
.wk-search .wk-chip { margin-right: -4px; }


/* ==========================================================================
   第三批：荣誉体系 + 交易场景专有组件
   （小黑盒的资源给了荣誉色，交易组件是我们自己的差异化）
   ========================================================================== */

/* ---------------------------------------------------------------- Honor 等级徽章
   连续阶梯：1-9 铜 / 10-29 银 / 30-49 金 / 50+ 钻石。
   每级只换一个属性，不做随机跳变。
   ------------------------------------------------------------------ */
.wk-honor {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 3px; height: 20px; padding: 0 7px;
  border-radius: var(--wk-r-4);        /* ★小黑盒标签是圆角 4，不是胶囊 */
  font-size: 11px; font-weight: 700; line-height: 1;
  color: #fff; letter-spacing: .2px; white-space: nowrap;
  /* ★统一 45° 斜向双色渐变（小黑盒等级标签的手法），不用 135° */
}
/* 铜：高饱和暖褐，字用白（不靠深色字凑对比） */
.wk-honor--bronze { background: linear-gradient(45deg, #D08A4E 0%, #A85E28 100%); }
/* 银：压深一档到能托住白字（小黑盒 Lv1-3 就是这个灰阶） */
.wk-honor--silver { background: linear-gradient(45deg, #B9BEC3 0%, #8E959C 100%); }
/* 金：加饱和，告别米黄 */
.wk-honor--gold   { background: linear-gradient(45deg, #F2C14E 0%, #C08A1E 100%); }
/* 钻石：青蓝 → 紫，和小黑盒 Lv7-9 的蓝系同一气口 */
.wk-honor--diamond{ background: linear-gradient(45deg, #45C4F0 0%, #3E7BFA 50%, #8B5CF6 100%); }
/* 徽章图版本（有图用图，没图用上面的文字版） */
.wk-honor--img { width: 18px; padding: 0; background: none; }
.wk-honor--img img { width: 100%; height: 100%; object-fit: contain; display: block; }

/* ---------------------------------------------------------------- Price 金额
   交易平台的核心显示组件。符号小、整数大、小数小、单位淡。
   <span class="wk-price"><i>¥</i><b>1,280</b><em>.00</em><s>起</s></span>
   ------------------------------------------------------------------ */
.wk-price {
  display: inline-flex; align-items: baseline; gap: 1px;
  color: var(--wk-ink); font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.wk-price i { font-style: normal; font-size: var(--wk-fs-12); line-height: var(--wk-lh-12); color: var(--wk-ink-2); }
.wk-price b { font-size: var(--wk-fs-22); font-weight: var(--wk-fw-strong); line-height: 1; }
.wk-price em { font-style: normal; font-size: var(--wk-fs-12); line-height: var(--wk-lh-12); }
.wk-price s { text-decoration: none; font-size: var(--wk-fs-11); line-height: var(--wk-lh-11); color: var(--wk-ink-3); margin-left: 2px; }
.wk-price--lg b { font-size: var(--wk-fs-24); line-height: var(--wk-lh-24); }
.wk-price--sm b { font-size: var(--wk-fs-16); line-height: var(--wk-lh-16); }
.wk-price--accent { color: var(--wk-accent-ink); }
.wk-price--accent i, .wk-price--accent em { color: var(--wk-accent-ink); }
.wk-price--del { text-decoration: line-through; color: var(--wk-ink-4); }

/* ---------------------------------------------------------------- Status 订单状态
   6 态：待处理 / 进行中 / 待验收 / 已完成 / 已取消 / 争议
   ------------------------------------------------------------------ */
.wk-status {
  display: inline-flex; align-items: center; gap: 4px;
  height: 22px; padding: 0 8px;
  border-radius: var(--wk-r-8);
  font-size: var(--wk-fs-11); line-height: 1; white-space: nowrap;
}
.wk-status--pending { color: var(--wk-st-pending); background: var(--wk-st-pending-bg); }
.wk-status--ongoing { color: var(--wk-st-ongoing); background: var(--wk-st-ongoing-bg); }
.wk-status--check   { color: var(--wk-st-check);   background: var(--wk-st-check-bg); }
.wk-status--done    { color: var(--wk-st-done);    background: var(--wk-st-done-bg); }
.wk-status--cancel  { color: var(--wk-st-cancel);  background: var(--wk-st-cancel-bg); }
.wk-status--dispute { color: var(--wk-st-dispute); background: var(--wk-st-dispute-bg); }
.wk-status__dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex: none; }

/* ---------------------------------------------------------------- Countdown 倒计时 */
.wk-countdown {
  display: inline-flex; align-items: center; gap: 2px;
  font-variant-numeric: tabular-nums; font-size: var(--wk-fs-12); line-height: var(--wk-lh-12);
  color: var(--wk-ink-2);
}
.wk-countdown b {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 3px;
  border-radius: var(--wk-r-4); background: var(--wk-ink); color: #fff;
  font-size: var(--wk-fs-11); line-height: var(--wk-lh-11); font-weight: var(--wk-fw-strong);
}
.wk-countdown--urgent b { background: var(--wk-danger); }
.wk-countdown--urgent { color: var(--wk-danger-ink); }

/* ---------------------------------------------------------------- Timeline 流程
   订单流程用。已完成实心，当前态高亮，未到灰色。
   ------------------------------------------------------------------ */
.wk-timeline { display: flex; flex-direction: column; gap: 0; }
.wk-timeline__item {
  position: relative; display: flex; gap: var(--wk-sp-3);
  padding-bottom: var(--wk-sp-4); min-height: 44px;
}
.wk-timeline__item:last-child { padding-bottom: 0; }
.wk-timeline__item::before {
  content: ""; position: absolute; left: 5px; top: 14px; bottom: 0;
  width: 1px; background: var(--wk-line-2);
}
.wk-timeline__item:last-child::before { display: none; }
.wk-timeline__dot {
  position: relative; z-index: 1; flex: none;
  width: 11px; height: 11px; margin-top: 4px;
  border-radius: 50%; background: var(--wk-line-2);
}
.wk-timeline__item.is-done .wk-timeline__dot { background: var(--wk-st-done); }
.wk-timeline__item.is-now  .wk-timeline__dot {
  background: var(--wk-accent);
  box-shadow: 0 0 0 3px var(--wk-accent-weak);
}
.wk-timeline__bd { flex: 1; min-width: 0; }
.wk-timeline__title { font-size: var(--wk-fs-14); line-height: var(--wk-lh-14); color: var(--wk-ink-2); }
.wk-timeline__item.is-now .wk-timeline__title { color: var(--wk-ink); font-weight: var(--wk-fw-strong); }
.wk-timeline__time { font-size: var(--wk-fs-11); line-height: var(--wk-lh-11); color: var(--wk-ink-4); margin-top: 2px; }

/* ---------------------------------------------------------------- Rate 评分 */
.wk-rate { display: inline-flex; align-items: center; gap: 2px; }
.wk-rate svg { width: 14px; height: 14px; color: var(--wk-line-2); }
.wk-rate .is-on svg { color: var(--wk-gold); }
.wk-rate__num { margin-left: 4px; font-size: var(--wk-fs-12); line-height: var(--wk-lh-12); color: var(--wk-ink-2); }

/* ---------------------------------------------------------------- Notice 公告条 */
.wk-notice {
  display: flex; align-items: center; gap: var(--wk-sp-2);
  padding: 8px var(--wk-sp-3);
  border-radius: var(--wk-r-8); background: var(--wk-accent-weak);
  color: var(--wk-accent-ink); font-size: var(--wk-fs-12); line-height: var(--wk-lh-12);
}
.wk-notice__icon { flex: none; width: 14px; height: 14px; }
.wk-notice__text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------------------------------------------------------- Grid 金刚区 */
.wk-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: var(--wk-sp-4) 0;
}
.wk-grid--5 { grid-template-columns: repeat(5, 1fr); }
.wk-grid__item {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-size: var(--wk-fs-12); line-height: var(--wk-lh-12); color: var(--wk-ink-2); cursor: pointer;
  padding: 2px 0;
}
.wk-grid__icon {
  position: relative;
  width: 40px; height: 40px; border-radius: var(--wk-r-8);
  display: flex; align-items: center; justify-content: center;
  background: var(--wk-fill); color: var(--wk-ink);
}
.wk-grid__icon svg { width: 22px; height: 22px; }
.wk-grid__icon .wk-badge { position: absolute; top: -5px; right: -6px; }

/* ---------------------------------------------------------------- Avatar + Frame 头像框
   框显示尺寸 = 头像尺寸 ÷ hole（默认 hole 0.615）
   这里用 padding 方式实现，素材 512×512 内孔 300~350。
   ------------------------------------------------------------------ */
.wk-av-frame {
  position: relative; display: inline-flex;
  flex: none; align-items: center; justify-content: center;
}
.wk-av-frame > .wk-avatar { width: 100%; height: 100%; }
.wk-av-frame__ring {
  position: absolute; inset: 0;
  background-size: 100% 100%; background-repeat: no-repeat;
  pointer-events: none;
}
/* 尺寸档：给容器，内部按比例缩 */
.wk-av-frame--sm { width: 39px; height: 39px; }
.wk-av-frame--md { width: 52px; height: 52px; }
.wk-av-frame--lg { width: 78px; height: 78px; }
.wk-av-frame--xl { width: 104px; height: 104px; }

/* ---------------------------------------------------------------- Banner 轮播 */
.wk-banner {
  position: relative; width: 100%; aspect-ratio: 16 / 9;
  border-radius: var(--wk-r-16); overflow: hidden; background: var(--wk-fill);
}
.wk-banner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wk-banner__dots {
  position: absolute; left: 0; right: 0; bottom: 8px;
  display: flex; justify-content: center; gap: 4px;
}
.wk-banner__dots i {
  width: 5px; height: 5px; border-radius: var(--wk-r-full);
  background: rgba(255,255,255,.55); transition: all var(--wk-dur) var(--wk-ease);
}
.wk-banner__dots i.is-on { width: 14px; background: #fff; }

/* ---------------------------------------------------------------- 促销角标 */
.wk-ribbon {
  position: absolute; left: 0; top: 0;
  padding: 2px 6px; border-radius: var(--wk-r-4) 0 var(--wk-r-4) 0;
  background: var(--wk-grad-accent); color: #fff;
  font-size: var(--wk-fs-10); line-height: 1.4;
}

/* ---------------------------------------------------------------- 悬浮操作条 */
.wk-actionbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 500;
  display: flex; align-items: center; gap: var(--wk-sp-3);
  padding: var(--wk-sp-2) var(--wk-pad-x);
  padding-bottom: calc(var(--wk-sp-2) + env(safe-area-inset-bottom, 0));
  background: var(--wk-card);
  box-shadow: 0 -1px 0 var(--wk-line);
}
.wk-actionbar__info { flex: 1; min-width: 0; }
.wk-actionbar__info small { display: block; font-size: var(--wk-fs-11); line-height: var(--wk-lh-11); color: var(--wk-ink-3); }


/* ==========================================================================
   第四批：提示 / 加载 / 图片 / 选择
   ========================================================================== */

/* ---------------------------------------------------------------- Alert 内联提示 */
.wk-alert {
  display: flex; gap: var(--wk-sp-2); align-items: flex-start;
  padding: 10px var(--wk-sp-3);
  border-radius: var(--wk-r-8);
  font-size: var(--wk-fs-12); line-height: var(--wk-lh-snug);
}
.wk-alert__icon { flex: none; width: 15px; height: 15px; margin-top: 1px; }
.wk-alert__bd { flex: 1; min-width: 0; }
.wk-alert__title { font-weight: var(--wk-fw-strong); margin-bottom: 2px; }
.wk-alert--info    { background: var(--wk-fill); color: var(--wk-ink-2); }
.wk-alert--success { background: var(--wk-st-done-bg); color: var(--wk-st-done); }
.wk-alert--warning { background: var(--wk-st-pending-bg); color: #A06A00; }
.wk-alert--danger  { background: var(--wk-danger-weak); color: var(--wk-danger-ink); }

/* ---------------------------------------------------------------- LoadMore 加载更多 */
.wk-loadmore {
  display: flex; align-items: center; justify-content: center;
  gap: var(--wk-sp-2); padding: var(--wk-sp-4) 0;
  font-size: var(--wk-fs-12); line-height: var(--wk-lh-12); color: var(--wk-ink-3);
}
.wk-loadmore__dots { display: inline-flex; gap: 3px; }
.wk-loadmore__dots i {
  width: 4px; height: 4px; border-radius: 50%; background: currentColor;
  animation: wk-dot 1.1s ease-in-out infinite;
}
.wk-loadmore__dots i:nth-child(2) { animation-delay: .15s; }
.wk-loadmore__dots i:nth-child(3) { animation-delay: .3s; }
@keyframes wk-dot { 0%,60%,100% { opacity: .25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-2px); } }
.wk-loadmore--end { color: var(--wk-ink-4); }
.wk-loadmore--end::before, .wk-loadmore--end::after {
  content: ""; height: 1px; width: 28px; background: var(--wk-line-2);
}

/* ---------------------------------------------------------------- Skeleton 变体 */
.wk-sk-line { height: 12px; border-radius: var(--wk-r-3); }
.wk-sk-line + .wk-sk-line { margin-top: 8px; }
.wk-sk-avatar { width: 40px; height: 40px; border-radius: 50%; flex: none; }
.wk-sk-card {
  border-radius: var(--wk-r-16); padding: var(--wk-sp-4);
  background: var(--wk-card); box-shadow: var(--wk-sh-1);
}
.wk-sk-row { display: flex; gap: var(--wk-sp-3); align-items: center; }
.wk-sk-cover { width: 100%; aspect-ratio: 16/9; border-radius: var(--wk-r-8); }

/* ---------------------------------------------------------------- Img 图片容器
   固定比例 + cover + 占位 + 失败兜底。换图只丢文件不改代码。
   ------------------------------------------------------------------ */
.wk-img {
  position: relative; overflow: hidden;
  background: var(--wk-fill);
  display: block;
}
.wk-img > img {
  width: 100%; height: 100%; display: block;
  object-fit: var(--wk-img-fit, cover);
  opacity: 0; transition: opacity var(--wk-dur-slow) var(--wk-ease);
}
.wk-img > img.is-loaded { opacity: 1; }
.wk-img__ph {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--wk-ink-4); pointer-events: none;
}
.wk-img__ph img, .wk-img__ph svg { width: 40%; height: 40%; max-width: 48px; max-height: 48px; opacity: .5; }
.wk-img--ratio-1 { aspect-ratio: 1 / 1; }
.wk-img--ratio-43 { aspect-ratio: 4 / 3; }
.wk-img--ratio-169 { aspect-ratio: 16 / 9; }
.wk-img--round { border-radius: var(--wk-r-full); }
.wk-img--r4  { border-radius: var(--wk-r-4); }
.wk-img--r8  { border-radius: var(--wk-r-8); }
.wk-img--r12 { border-radius: var(--wk-r-12); }
.wk-img--r16 { border-radius: var(--wk-r-16); }

/* ---------------------------------------------------------------- Picker 选择器 */
.wk-picker { display: flex; flex-direction: column; }
.wk-picker__wheel {
  position: relative; height: 216px; overflow: hidden;
  display: flex; justify-content: center;
}
.wk-picker__col {
  flex: 1; height: 100%; overflow-y: auto;
  scroll-snap-type: y mandatory; scrollbar-width: none;
  padding: 90px 0; text-align: center;
}
.wk-picker__col::-webkit-scrollbar { display: none; }
.wk-picker__item {
  height: 36px; line-height: 36px;
  font-size: var(--wk-fs-16); color: var(--wk-ink-3);
  scroll-snap-align: center;
  transition: color var(--wk-dur) var(--wk-ease), font-size var(--wk-dur) var(--wk-ease);
  cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wk-picker__item.is-on { color: var(--wk-ink); font-weight: var(--wk-fw-strong); }
.wk-picker__mask {
  position: absolute; left: 0; right: 0; height: 90px; pointer-events: none; z-index: 2;
}
.wk-picker__mask--top { top: 0; background: linear-gradient(var(--wk-card), transparent); }
.wk-picker__mask--btm { bottom: 0; background: linear-gradient(transparent, var(--wk-card)); }
.wk-picker__bar {
  position: absolute; left: 0; right: 0; top: 50%; height: 36px; margin-top: -18px;
  border-top: 1px solid var(--wk-line); border-bottom: 1px solid var(--wk-line);
  pointer-events: none; z-index: 1;
}

/* ---------------------------------------------------------------- ActionSheet 操作表 */
.wk-actions { display: flex; flex-direction: column; }
.wk-action {
  display: flex; align-items: center; justify-content: center; gap: var(--wk-sp-2);
  min-height: 52px; padding: 0 var(--wk-sp-4);
  border: 0; background: transparent; width: 100%;
  font-family: inherit; font-size: var(--wk-fs-16); line-height: var(--wk-lh-16); color: var(--wk-ink);
  cursor: pointer; border-radius: var(--wk-r-8);
}
.wk-action:active { background: var(--wk-fill); }
.wk-action--danger { color: var(--wk-danger-ink); }
.wk-action + .wk-action { box-shadow: inset 0 1px 0 var(--wk-line); }
.wk-actions__cancel {
  margin-top: var(--wk-sp-2); padding-top: var(--wk-sp-2);
  border-top: 6px solid var(--wk-bg);
}

/* ---------------------------------------------------------------- Popover 气泡菜单 */
.wk-pop {
  position: absolute; z-index: var(--wk-z-dialog);
  min-width: 120px; padding: 4px;
  border-radius: var(--wk-r-8);
  background: var(--wk-card); box-shadow: var(--wk-sh-2), 0 0 0 1px var(--wk-line);
  opacity: 0; transform: scale(.94); transform-origin: top right;
  transition: opacity var(--wk-dur-fast) var(--wk-ease), transform var(--wk-dur-fast) var(--wk-ease);
}
.wk-pop.is-open { opacity: 1; transform: scale(1); }
.wk-pop__item {
  display: flex; align-items: center; gap: var(--wk-sp-2);
  padding: 10px var(--wk-sp-3); border-radius: var(--wk-r-8);
  font-size: var(--wk-fs-14); line-height: var(--wk-lh-14); color: var(--wk-ink); cursor: pointer;
}
.wk-pop__item:active { background: var(--wk-fill); }
.wk-pop__item--danger { color: var(--wk-danger-ink); }
.wk-pop__sep { height: 1px; margin: 4px 6px; background: var(--wk-line); }

/* ---------------------------------------------------------------- Badge 更多形态 */
.wk-badge--sm { min-width: 14px; height: 14px; font-size: var(--wk-fs-10); line-height: var(--wk-lh-10); padding: 0 3px; }
.wk-badge--lg { min-width: 20px; height: 20px; font-size: var(--wk-fs-12); line-height: var(--wk-lh-12); padding: 0 6px; }
.wk-badge--outline {
  background: transparent; color: var(--wk-danger);
  box-shadow: inset 0 0 0 1px currentColor;
}
.wk-badge--neutral { background: var(--wk-ink-4); }
.wk-badge--icon { border-radius: var(--wk-r-8); padding: 0 5px; gap: 3px; }
.wk-badge--icon svg { width: 9px; height: 9px; }


/* ---------------------------------------------------------------- 下拉刷新 */
.wk-refresh {
  height: 0; overflow: hidden;
  display: flex; align-items: flex-end; justify-content: center;
}
.wk-refresh__ind {
  display: flex; align-items: center; gap: 6px;
  padding-bottom: 8px; opacity: 0;
  font-size: var(--wk-fs-12); line-height: var(--wk-lh-12); color: var(--wk-ink-3);
}
.wk-refresh__spin {
  display: none; width: 14px; height: 14px;
  border: 2px solid var(--wk-line-2); border-top-color: var(--wk-accent);
  border-radius: var(--wk-r-full);
  animation: wk-spin .7s linear infinite;
}

/* ==========================================================================
   第五批：布局容器（对标小黑盒的结构，不是装饰）
   - .wk-item   列表项卡：固定高、flex 居中、圆角 8、上下内距 < 左右
   - .wk-feed   信息流：卡片之间用 ~5px 浅色带分隔，不是 1px 细线
   - 工具类
   ========================================================================== */

/* ---------------- 列表项（对标 .com-game-card / .com-album-card / .com-mod-card）
   实测三张卡：height 72/76/80  padding 6~8 / 10~12  radius 8  bg #fafbfc  margin-top 10~12 */
.wk-item {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 76px;
  padding: var(--wk-gap-8) var(--wk-gap-12);
  margin-top: var(--wk-gap-10);
  border-radius: var(--wk-r-8);
  background: var(--wk-card);
  cursor: pointer;
  transition: background var(--wk-dur) var(--wk-ease);
}
.wk-item:first-child { margin-top: 0; }
.wk-item:active { background: var(--wk-fill); }

/* 左侧媒体：游戏图标 / 封面 */
.wk-item__media {
  flex: none;
  width: 48px; height: 48px;
  margin-right: var(--wk-gap-10);
  border-radius: var(--wk-r-4);
  object-fit: cover;
  background: var(--wk-fill);
}
.wk-item__media--lg { width: 56px; height: 56px; }

/* 中间主体：min-width:0 是让 ellipsis 生效的关键 */
.wk-item__bd { flex: 1; min-width: 0; }
.wk-item__title {
  font-size: var(--wk-fs-14); line-height: var(--wk-lh-14);
  font-weight: var(--wk-fw-medium); color: var(--wk-ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wk-item__desc {
  margin-top: var(--wk-gap-3);
  font-size: var(--wk-fs-12); line-height: var(--wk-lh-12);
  color: var(--wk-ink-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* 右侧：价格 / 状态 / 箭头 */
.wk-item__ft {
  flex: none; margin-left: var(--wk-gap-8);
  font-size: var(--wk-fs-12); line-height: var(--wk-lh-12);
  color: var(--wk-ink-3); text-align: right;
}
.wk-item__arrow {
  flex: none; margin-left: var(--wk-gap-5);
  width: 16px; height: 16px; color: var(--wk-ink-4);
}

/* ---------------- 信息流（对标截图实测：卡片间 ~5px 浅色带）
   注意：不是 1px 细线。细线像表格，浅带像卡片浮在底色上。 */
.wk-feed { background: var(--wk-sep-band); }
.wk-feed__item {
  padding: var(--wk-gap-12) var(--wk-pad-x);
  background: var(--wk-card-raised);
}
.wk-feed__sep { height: 5px; background: var(--wk-sep-band); }

/* 信息流卡片内部：作者行 / 正文 / 媒体 / 操作栏 */
.wk-feed__hd { display: flex; align-items: center; gap: var(--wk-gap-8); }
.wk-feed__bd {
  margin-top: var(--wk-gap-8);
  font-size: var(--wk-fs-14); line-height: var(--wk-lh-14);
  color: var(--wk-ink);
}
.wk-feed__media {
  margin-top: var(--wk-gap-10);
  border-radius: var(--wk-r-8);
  overflow: hidden;
}
.wk-feed__ft {
  margin-top: var(--wk-gap-10);
  display: flex; align-items: center; justify-content: space-between;
  font-size: var(--wk-fs-12); line-height: var(--wk-lh-12);
  color: var(--wk-ink-3);
}

/* ---------------- 工具类 ---------------- */
.wk-ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wk-ellipsis-2 {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.wk-hairline-b { border-bottom: 1px solid var(--wk-line-2); }
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 2dppx) {
  .wk-hairline-b { border-bottom-width: var(--wk-line-half); }
}
/* =========================================================================
   PART 6 · 页面骨架 + 展示组件
   对标小黑盒的 Flutter 组件：
     HeyboxScaffold              -> .wk-page
     HeyboxTitleAppBar           -> .wk-nav
     HeyboxTabAppBar             -> .wk-nav--tabs
     HeyboxAppBarActionButton    -> .wk-nav__act
     HeyboxAppBarActionButtonWithDot -> .wk-nav__act + .wk-reddot
     HeyboxBottomBarContainer    -> .wk-tabbar
     HeyboxBannerIndicator       -> .wk-indicator
     HeyboxRating / HeyboxScore  -> .wk-rating
     HeyboxRedDot / RedDotBadge  -> .wk-reddot
     HeyboxOnlineStatus          -> .wk-online
     HeyboxPlayButton            -> .wk-play
     HeyboxSection               -> .wk-section
   数值来源：截图实测（顶栏 53、头像 28、边距 14）+ 生产 CSS 卡片规范
   ========================================================================= */

/* ---------------------------------------------------------------- 页面骨架 */
.wk-page {
  display: flex; flex-direction: column;
  height: 100vh; height: 100dvh;
  background: var(--wk-bg);
}
.wk-page__body {
  flex: 1; min-height: 0;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
}
/* 有底栏时给内容留出空间，否则最后一条会被挡住 */
.wk-page--tabbar .wk-page__body {
  padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px));
}

/* ---------------------------------------------------------------- 顶栏 */
.wk-nav {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 8px;
  height: 53px; padding: 0 14px;
  background: var(--wk-card);
  border-bottom: .5px solid var(--wk-line);
}
.wk-nav__title {
  font-size: var(--wk-fs-16); line-height: var(--wk-lh-16);
  font-weight: var(--wk-fw-bold); color: var(--wk-ink);
}
.wk-nav__back {
  width: 28px; height: 28px; margin-left: -6px;
  display: flex; align-items: center; justify-content: center;
  color: var(--wk-ink);
}
.wk-nav__acts { margin-left: auto; display: flex; align-items: center; gap: 14px; }

/* 顶栏 + tab（社区/首页那种：左边 tab，右边图标） */
.wk-nav--tabs { gap: 18px; }
.wk-nav__tab {
  position: relative;
  font-size: var(--wk-fs-16); line-height: var(--wk-lh-20, 20px);
  color: var(--wk-ink-3); cursor: pointer;
}
.wk-nav__tab.is-on { color: var(--wk-ink); font-weight: var(--wk-fw-bold); }
.wk-nav__tab.is-on::after {
  content: ''; position: absolute; left: 50%; bottom: -8px;
  transform: translateX(-50%);
  width: 16px; height: 2px; border-radius: 1px; background: var(--wk-accent);
}

/* 顶栏动作按钮（可带红点） */
.wk-nav__act {
  position: relative; width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  color: var(--wk-ink); cursor: pointer;
}
.wk-nav__act .wk-reddot { position: absolute; top: -2px; right: -3px; }

/* ---------------------------------------------------------------- 底栏 */
.wk-tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex;
  height: 56px; padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--wk-card);
  border-top: .5px solid var(--wk-line);
}
.wk-tabbar__item {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px;
  font-size: var(--wk-fs-10); line-height: var(--wk-lh-14, 14px);
  color: var(--wk-ink-3); cursor: pointer;
}
.wk-tabbar__item.is-on { color: var(--wk-accent-ink); }
/* 中间凸起的「+」 */
.wk-tabbar__plus {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
}
.wk-tabbar__plus i {
  width: 40px; height: 28px; border-radius: var(--wk-r-6, 6px);
  background: var(--wk-fill);
  display: flex; align-items: center; justify-content: center;
  color: var(--wk-ink);
}

/* ---------------------------------------------------------------- 轮播指示器 */
.wk-indicator { display: inline-flex; align-items: center; gap: 4px; }
.wk-indicator i {
  width: 4px; height: 4px; border-radius: 2px;
  background: rgba(255, 255, 255, .45);
  transition: width var(--wk-dur-slow);
}
.wk-indicator i.is-on { width: 14px; background: #fff; }
/* 浅底上用的深色版 */
.wk-indicator--dark i { background: var(--wk-ink-4); }
.wk-indicator--dark i.is-on { background: var(--wk-ink); }

/* ---------------------------------------------------------------- 区块标题 */
.wk-section {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 0 0 10px;
}
.wk-section__title {
  font-size: var(--wk-fs-16); line-height: var(--wk-lh-16);
  font-weight: var(--wk-fw-bold); color: var(--wk-ink);
}
.wk-section__more {
  font-size: var(--wk-fs-12); line-height: var(--wk-lh-16, 16px);
  color: var(--wk-ink-3);
}

/* ---------------------------------------------------------------- 红点 */
.wk-reddot {
  display: inline-block;
  min-width: 6px; height: 6px; border-radius: 3px;
  background: var(--wk-danger);
}
/* 带数字（99+ 上限） */
.wk-reddot--num {
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 8px;
  font-size: var(--wk-fs-10); line-height: 16px;
  font-weight: var(--wk-fw-medium); color: #fff;
  text-align: center;
}
/* 贴在头像/图标右上角 */
.wk-reddot--dot { position: absolute; top: -1px; right: -1px; box-shadow: 0 0 0 1.5px var(--wk-card); }

/* ---------------------------------------------------------------- 在线状态 */
.wk-online {
  display: inline-block;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--wk-success);
}
.wk-online--busy { background: var(--wk-warning); }
.wk-online--off  { background: var(--wk-ink-4); }
/* 压在头像角上 */
.wk-online--avatar {
  position: absolute; right: 0; bottom: 0;
  width: 9px; height: 9px;
  box-shadow: 0 0 0 2px var(--wk-card);
}

/* ---------------------------------------------------------------- 播放按钮 */
.wk-play {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: var(--wk-r-full);
  background: rgba(0, 0, 0, .42);
  color: #fff;
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  cursor: pointer;
}
.wk-play--sm { width: 28px; height: 28px; }
.wk-play--lg { width: 56px; height: 56px; }

/* ---------------------------------------------------------------- 评分 */
.wk-rating {
  display: inline-flex; align-items: center; gap: 1px;
  color: var(--wk-accent);
  font-size: var(--wk-fs-12);
}
.wk-rating i { display: inline-flex; }
.wk-rating i svg, .wk-rating i { width: 12px; height: 12px; }
.wk-rating__num {
  margin-left: 4px;
  font-size: var(--wk-fs-12); font-weight: var(--wk-fw-medium);
  color: var(--wk-ink-2);
}
.wk-rating__count { margin-left: 4px; font-size: var(--wk-fs-11); color: var(--wk-ink-3); }

/* ---------------------------------------------------------------- 成就卡（用它的纹理） */
/* 成就页头部（.wk-achievement-hero）
   它的真实素材用法是两层叠的整页背景，不是小卡片：
     user_achievements_texture_fill.png  1125x2436  深灰纹理（底）
     stars_mask.png                      1125x2436  星空渐变（顶：星点、中部月牙、向下渐隐）
   两层合起来是「夜空」，内容浮在上面。 */
.wk-achievement-hero {
  position: relative; overflow: hidden;
  /* 夜空要占得够高才看得出层次：116px 时只显示星空顶部 15%，月牙完全在画外 */
  min-height: 200px;
  padding: 22px 14px 26px;
  color: #fff;
  background: #12161C;
}
.wk-achievement-hero::before {
  content: ''; position: absolute; inset: 0;
  background: url("../assets/xhh/achievement/user_achievements_texture_fill.png") center top / 100% auto no-repeat;
  opacity: .9;
}
.wk-achievement-hero::after {
  content: ''; position: absolute; inset: 0;
  background: url("../assets/xhh/achievement/stars_mask.png") center top / 100% auto no-repeat;
  opacity: .8;
  mix-blend-mode: screen;          /* 星空要「加光」，不是盖住底色 */
  pointer-events: none;
}
.wk-achievement-hero > * { position: relative; z-index: 1; }

/* 成就条目：15px 等级图标 + 名称 + 进度（图标就是它的 15x15@3x） */
.wk-achievement-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: var(--wk-r-8);
  background: rgba(255, 255, 255, .06);
}
.wk-achievement-item + .wk-achievement-item { margin-top: 8px; }
.wk-achievement-item__ic {
  width: 24px; height: 24px; flex: none;
  display: flex; align-items: center; justify-content: center;
}
.wk-achievement-item__ic img { width: 15px; height: 15px; object-fit: contain; }
.wk-achievement-item__bd { flex: 1; min-width: 0; }
.wk-achievement-item__t {
  font-size: var(--wk-fs-13); line-height: var(--wk-lh-16, 16px);
  font-weight: var(--wk-fw-medium); color: #fff;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wk-achievement-item__d {
  margin-top: 2px;
  font-size: var(--wk-fs-11); line-height: var(--wk-lh-14, 14px);
  color: rgba(255, 255, 255, .55);
}
.wk-achievement-item__prog {
  flex: none; width: 64px;
  height: 3px; border-radius: 2px;
  background: rgba(255, 255, 255, .16);
  overflow: hidden;
}
.wk-achievement-item__prog i {
  display: block; height: 100%;
  background: linear-gradient(90deg, #E2C47B, #FFDFA0);
}
.wk-achievement-item__done {
  flex: none;
  font-size: var(--wk-fs-11);
  color: #E2C47B;
  font-weight: var(--wk-fw-medium);
}

/* 卡片版：在浅色页面里用，背景压成半透明深色，不再铺整页纹理 */
.wk-achievement {
  position: relative; overflow: hidden;
  border-radius: var(--wk-r-8);
  padding: 14px;
  color: #fff;
  background: #1B1D21;
}
.wk-achievement::before {
  content: ''; position: absolute; inset: 0;
  background: url("../assets/xhh/achievement/user_achievements_texture_fill.png") center / cover no-repeat;
  opacity: .55;
}
.wk-achievement > * { position: relative; z-index: 1; }
.wk-achievement__head {
  display: flex; align-items: center; gap: 10px;
}
.wk-achievement__badge {
  width: 40px; height: 40px; flex: none;
  display: flex; align-items: center; justify-content: center;
}
.wk-achievement__badge img { width: 100%; height: 100%; object-fit: contain; }
.wk-achievement__t {
  font-size: var(--wk-fs-14); line-height: var(--wk-lh-14);
  font-weight: var(--wk-fw-bold);
}
.wk-achievement__d {
  margin-top: 3px;
  font-size: var(--wk-fs-11); line-height: var(--wk-lh-14, 14px);
  color: rgba(255, 255, 255, .62);
}
.wk-achievement__bar {
  margin-top: 12px;
  height: 4px; border-radius: 2px;
  background: rgba(255, 255, 255, .14);
  overflow: hidden;
}
.wk-achievement__bar i {
  display: block; height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, #E2C47B, #FFDFA0);
}

/* ---------------------------------------------------------------- 平台入口卡（用它的素材） */
.wk-platform-entry {
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  height: 63px;
  border-radius: var(--wk-r-8);
  background-size: cover; background-position: center;
  color: #fff;
}
.wk-platform-entry i { font-size: 26px; }
.wk-platform-entry img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------------------------------------------------------------- 我的页头部（用它的背景） */
.wk-profile-head {
  position: relative; overflow: hidden;
  /* 它的素材是 375x280 逻辑尺寸（1125x840 物理，比例 1.34）。
     用固定高度会让 cover 裁掉上下 60%，所以按原比例留位置。 */
  aspect-ratio: 375 / 280;
  min-height: 150px;
  display: flex; align-items: flex-end;
  padding: 16px 14px;
  color: #fff;
  background: #23262B url("../assets/xhh/bg/me_header_bg_375x280@3x.png") center / cover no-repeat;
}
.wk-profile-head::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 30%, rgba(0,0,0,.45) 100%);
  pointer-events: none;
}
.wk-profile-head > * { position: relative; z-index: 1; }

/* ================================================================ IM
   ★组件库之前完全没有 IM 组件（老库只有 3 行 .wk-conv/.wk-msg）。
   结构照小黑盒 message-center：.messaging-conversation / .message-thread-header
   / .message-history / .chat-message(+.outgoing) / .chat-message-content

   口径：
   · 气泡圆角 8（不是胶囊）
   · 自己的气泡 = 品牌底 + --wk-on-accent 文字（亮黑底白字 / 暗白底黑字）
   · 对方气泡 = --wk-im-bubble
   · 暗色分隔/hover 一律半透明白，不写死灰值
   · 不画阴影，靠底色差
*/

/* ---- 会话列表 ---- */
.wk-conv-list { background: var(--wk-im-list); }

.wk-conv {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; cursor: pointer;
  background: var(--wk-im-list);
  transition: background-color var(--wk-dur-fast) var(--wk-ease);
}
.wk-conv:hover { background: var(--wk-im-hover); }
.wk-conv.is-on { background: var(--wk-im-hover); }
.wk-conv + .wk-conv { box-shadow: inset 0 1px 0 var(--wk-im-border); }

.wk-conv__avatar { flex: none; width: 42px; height: 42px; border-radius: 8px; object-fit: cover;
                   background: var(--wk-fill); }
.wk-conv__bd { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.wk-conv__name { font-size: 14px; line-height: 20px; color: var(--wk-ink); font-weight: 500;
                 overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wk-conv__last { font-size: 12px; line-height: 16px; color: var(--wk-ink-3);
                 overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wk-conv__ft { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.wk-conv__time { font-size: 11px; line-height: 14px; color: var(--wk-ink-4); }
/* 未读：数字角标，不是红点 —— 小黑盒用数量 */
.wk-conv__unread {
  min-width: 17px; height: 17px; padding: 0 5px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 9px; background: var(--wk-danger); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 1;
}

/* ---- 聊天页 ---- */
.wk-chat { display: flex; flex-direction: column; height: 100%; background: var(--wk-im-main); }

.wk-chat__head {
  flex: none; display: flex; align-items: center; gap: 8px;
  height: 44px; padding: 0 10px;
  background: var(--wk-im-main);
  box-shadow: inset 0 -1px 0 var(--wk-im-border);
}
.wk-chat__title { font-size: 16px; font-weight: 600; color: var(--wk-ink);
                  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.wk-chat__body {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: 12px 14px; display: flex; flex-direction: column; gap: 10px;
}

/* 时间分隔（居中，比正文淡一档） */
.wk-chat__time { align-self: center; font-size: 11px; line-height: 14px;
                 color: var(--wk-ink-4); padding: 2px 0; }

/* ---- 消息行 ---- */
.wk-msg { display: flex; gap: 8px; align-items: flex-start; max-width: 100%; }
.wk-msg__avatar { flex: none; width: 32px; height: 32px; border-radius: 8px; object-fit: cover;
                  background: var(--wk-fill); }

.wk-msg__body { display: flex; flex-direction: column; gap: 3px; min-width: 0; max-width: 76%; }

/* 气泡：对方（默认） */
.wk-bubble {
  padding: 8px 11px; border-radius: 8px;
  background: var(--wk-im-bubble); color: var(--wk-ink);
  font-size: 14px; line-height: 20px;
  word-break: break-word; white-space: pre-wrap;
}

/* 自己（.is-me）：靠右、品牌底、文字色走 --on-accent */
.wk-msg.is-me { flex-direction: row-reverse; }
.wk-msg.is-me .wk-msg__body { align-items: flex-end; }
.wk-msg.is-me .wk-bubble {
  background: var(--wk-accent); color: var(--wk-on-accent);
}

/* 图片消息：气泡不要内边距 */
.wk-bubble--img { padding: 0; overflow: hidden; background: var(--wk-fill-image); }
.wk-bubble--img img { display: block; max-width: 200px; height: auto; }

/* 发送失败 */
.wk-msg.is-failed .wk-bubble { box-shadow: inset 0 0 0 1px var(--wk-danger); }
.wk-msg__err { font-size: 11px; color: var(--wk-danger-ink); }

/* ---- 输入区 ---- */
.wk-chat__input {
  flex: none; display: flex; align-items: flex-end; gap: 8px;
  padding: 8px 12px; background: var(--wk-im-main);
  box-shadow: inset 0 1px 0 var(--wk-im-border);
}
.wk-chat__field {
  flex: 1; min-height: 36px; max-height: 96px;
  padding: 8px 11px; border: 0; border-radius: 8px;
  background: var(--wk-im-field); color: var(--wk-ink);
  font-family: inherit; font-size: 14px; line-height: 20px;
  resize: none; outline: none;
}
.wk-chat__field::placeholder { color: var(--wk-ink-4); }
.wk-chat__field:focus { box-shadow: inset 0 0 0 1px var(--wk-line-focus); }

/* ================================================================ 排版
   ★学小黑盒的 --text-* 语义令牌体系（它有 60 组，这里收核心）：

   1) 用「语义名 + 层级」而不是纯数字：bodyM / captionS / markL，
      一个名字同时决定 字号 + 行高 + 字重，页面不用自己配对。
   2) Long 变体：同字号、更大行高，给长段落用（14/20 → 14/24）。
   3) ★number* 系列：数字专用。行高比同字号文字更小（16/20 vs 15/22），
      因为数字没有下伸部；Narrow 变体是窄体，给金额/比分这种要右对齐的数。

   用法：<p class="wk-t-body">…</p>  <span class="wk-t-num">1,280.00</span>
*/

.wk-t-caption-xs { font-size: 10px; line-height: 14px; font-weight: 400; }
.wk-t-caption-s  { font-size: 11px; line-height: 14px; font-weight: 400; }
.wk-t-caption    { font-size: 12px; line-height: 18px; font-weight: 400; }   /* = captionM */
.wk-t-caption-lg { font-size: 13px; line-height: 20px; font-weight: 400; }

.wk-t-body-s     { font-size: 14px; line-height: 20px; font-weight: 400; }
.wk-t-body       { font-size: 15px; line-height: 22px; font-weight: 400; }   /* = bodyM */
.wk-t-body-lg    { font-size: 16px; line-height: 22px; font-weight: 400; }

/* Long：同字号，行高加大（长段落用） */
.wk-t-body-long-s { font-size: 14px; line-height: 24px; font-weight: 400; }
.wk-t-body-long   { font-size: 15px; line-height: 24px; font-weight: 400; }
.wk-t-body-long-lg{ font-size: 16px; line-height: 26px; font-weight: 400; }

.wk-t-title      { font-size: 16px; line-height: 22px; font-weight: 600; }
.wk-t-subtitle   { font-size: 16px; line-height: 22px; font-weight: 400; }

.wk-t-mark-s     { font-size: 14px; line-height: 20px; font-weight: 700; }
.wk-t-mark       { font-size: 18px; line-height: 28px; font-weight: 700; }
.wk-t-mark-lg    { font-size: 34px; line-height: 50px; font-weight: 700; }

/* 字重修饰（任何档都能挂） */
.wk-t-medium { font-weight: 500; }
.wk-t-semibold { font-weight: 600; }

/* ★数字专用：行高更紧，可选等宽（金额/比分右对齐时不跳动） */
.wk-t-num      { font-size: 14px; line-height: 16px; font-variant-numeric: tabular-nums; }
.wk-t-num-lg   { font-size: 16px; line-height: 20px; font-variant-numeric: tabular-nums; }
.wk-t-num-xl   { font-size: 20px; line-height: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.wk-t-num-2xl  { font-size: 28px; line-height: 34px; font-weight: 900; font-variant-numeric: tabular-nums; }
.wk-t-num-3xl  { font-size: 36px; line-height: 44px; font-weight: 900; font-variant-numeric: tabular-nums; }
/* 窄体：更紧凑，用于大额金额 */
.wk-t-num-narrow { letter-spacing: -.4px; font-variant-numeric: tabular-nums; }

/* ================================================================ 表格（照 mod-manager .local-grid）
   ★它的表格不是 <table>，是 grid：
     grid-template-columns: minmax(0,1fr) 120px 100px 100px 96px
   第一列弹性 + minmax(0,···) 防溢出，其余固定宽；行高 76、gap 16。
   比 flex 手动定宽稳，也不会像 <table> 那样被长内容撑破。
*/
.wk-table { display: flex; flex-direction: column; }

.wk-table__head,
.wk-table__row {
  display: grid;
  grid-template-columns: var(--wk-table-cols, minmax(0,1fr) 96px 88px);
  align-items: center;
  gap: 16px;
  padding: 8px 16px;
}
.wk-table__head {
  min-height: 40px;
  font-size: 12px; line-height: 18px;
  color: var(--wk-ink-3);
  box-shadow: inset 0 -1px 0 var(--wk-line);
}
.wk-table__row { min-height: 56px; font-size: 14px; line-height: 20px; color: var(--wk-ink); }
.wk-table__row:hover { background: var(--wk-fill); }
.wk-table__row + .wk-table__row { box-shadow: inset 0 1px 0 var(--wk-line-subtle); }
/* 单元格对齐：数字列靠右、居中列用 is-center */
.wk-table__cell { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wk-table__cell.is-right { text-align: right; font-variant-numeric: tabular-nums; }
.wk-table__cell.is-center { text-align: center; }

/* 子行（照它的 local-mod-sub-row：极淡上边 + 半透明底） */
.wk-table__subrow {
  background: var(--wk-fill-input);
  box-shadow: inset 0 1px 0 var(--wk-line-subtle);
  padding: 8px 16px;
  font-size: 12px; line-height: 18px; color: var(--wk-ink-3);
}

/* ================================================================ 居中弹窗（照 mod-manager）
   ★宽度：width:100% + max-width:536px，边距由 .wk-mask 的 padding:16px 提供。
     小黑盒原文是 min(536px, 100vw - 32px)，但 100vw 是视口宽、不是容器宽，
     放进窄容器（弹窗嵌在面板里）会被 flex 压扁，所以改用 100% + max-width 更稳。
*/
.wk-mask {
  position: fixed; inset: 0; z-index: var(--wk-z-modal, 900);
  background: var(--wk-scrim);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.wk-dialog {
  width: 100%;
  max-width: 536px;
  max-height: calc(100vh - 64px);
  display: flex; flex-direction: column;
  border-radius: 8px;
  background: var(--wk-card);
  box-shadow: 0 3px 24px var(--wk-shadow-modal);
  overflow: hidden;
}
.wk-dialog__head {
  flex: none; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 16px 20px 8px;
}
.wk-dialog__title { font-size: 16px; line-height: 22px; font-weight: 600; color: var(--wk-ink); }
.wk-dialog__body { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 20px; }
.wk-dialog__foot {
  flex: none; display: flex; align-items: center; justify-content: flex-end; gap: 8px;
  padding: 12px 20px 16px;
}

/* ================================================================ 下拉选择（照 cpt-selector-*）
   ★它的下拉：触发器 r4、面板 r8 + 1px 边框 + padding 8、
     选项高 32 / padding 8 / r5（5px 就是它的选项圆角，不是笔误）、
     选项内部左右分布：左边文字、右边勾选。

   用法：
   <div class="wk-select">
     <button class="wk-select__trigger">暗区突围无限</button>
     <div class="wk-select__panel is-open">
       <div class="wk-select__option is-on">暗区突围无限</div>
       <div class="wk-select__option">三角洲行动</div>
     </div>
   </div>
*/
.wk-select { position: relative; display: inline-block; width: 100%; }

.wk-select__trigger {
  width: 100%; height: 40px; padding: 0 11px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  border: 0; border-radius: 4px;
  background: var(--wk-fill-input); color: var(--wk-ink);
  font-family: inherit; font-size: 14px; line-height: 20px;
  cursor: pointer; text-align: left;
  transition: box-shadow var(--wk-dur-fast) var(--wk-ease);
}
.wk-select__trigger:hover { background: var(--wk-fill); }
.wk-select__trigger:focus-visible,
.wk-select.is-open .wk-select__trigger {
  box-shadow: inset 0 0 0 1px var(--wk-line-focus);
  outline: none;
}
.wk-select__trigger.is-placeholder { color: var(--wk-ink-4); }
/* 箭头：纯 CSS 三角，不依赖图标 */
.wk-select__trigger::after {
  content: ""; flex: none;
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--wk-ink-3);
  transition: transform var(--wk-dur) var(--wk-ease);
}
.wk-select.is-open .wk-select__trigger::after { transform: rotate(180deg); }

.wk-select__panel {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: var(--wk-z-popover, 800);
  padding: 8px;
  display: none; flex-direction: column;
  max-height: 260px; overflow-y: auto;
  border-radius: 8px;
  background: var(--wk-card);
  box-shadow: inset 0 0 0 1px var(--wk-line-strong), 0 2px 15px var(--wk-shadow-modal);
}
.wk-select__panel.is-open { display: flex; }

.wk-select__option {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  height: 32px; padding: 0 8px;
  border-radius: 5px;
  font-size: 14px; line-height: 20px;
  color: var(--wk-ink);
  cursor: pointer;
}
.wk-select__option:hover { background: var(--wk-fill); }
.wk-select__option.is-on { font-weight: 500; }
.wk-select__option.is-on::after {
  content: ""; flex: none;
  width: 5px; height: 9px;
  margin-right: 2px;
  border-right: 1.5px solid var(--wk-accent);
  border-bottom: 1.5px solid var(--wk-accent);
  transform: rotate(45deg) translateY(-1px);
}

/* 复选（Element Plus 风格，但用我们的令牌） */
.wk-checkbox { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; line-height: 20px; color: var(--wk-ink); }
.wk-checkbox__box {
  flex: none; width: 16px; height: 16px;
  display: grid; place-items: center;        /* 小黑盒做法：grid 居中，不硬算 margin */
  border-radius: 4px;
  background: var(--wk-fill-input);
  box-shadow: inset 0 0 0 1px var(--wk-line-strong);
  transition: background-color var(--wk-dur-fast) var(--wk-ease), box-shadow var(--wk-dur-fast) var(--wk-ease);
}
.wk-checkbox.is-on .wk-checkbox__box { background: var(--wk-accent); box-shadow: none; }
.wk-checkbox.is-on .wk-checkbox__box::after {
  content: ""; display: block; grid-area: 1 / 1;   /* 和边框叠在一格 */
  width: 4px; height: 7px; margin-top: -2px;
  border-right: 1.75px solid var(--wk-on-accent);
  border-bottom: 1.75px solid var(--wk-on-accent);
  transform: rotate(45deg);
}

/* ================================================================ 动效
   全部照小黑盒实测：
   · 时长：微交互 100~150ms、主力 200ms、遮罩 240ms
   · 缓动：ease 是它的默认（235 次），但位移收尾用 cubic-bezier(.25,.46,.45,.94)
   · ★进度条用 scaleX 不用 width —— transform 不触发重排
   · ★浮动提示 1s alternate —— 慢速呼吸，不抢戏
   · ★遮罩淡入 240ms，工具栏出现只用 100ms（微交互要快）
*/

/* ---- 关键帧 ---- */
@keyframes wk-fade-in  { from { opacity: 0 } to { opacity: 1 } }
@keyframes wk-fade-out { from { opacity: 1 } to { opacity: 0 } }

/* 底部弹层：位移 + 淡入同时，收尾强减速 */
@keyframes wk-slide-up {
  from { transform: translateY(100%); opacity: .6 }
  to   { transform: translateY(0);   opacity: 1 }
}
/* 居中弹窗：从 96% 微放大 + 淡入（不做 0→1 那种夸张缩放） */
@keyframes wk-dialog-in {
  from { transform: scale(.96); opacity: 0 }
  to   { transform: scale(1);   opacity: 1 }
}
/* 浮动提示：上下 4px，1s 往返，慢速呼吸 */
@keyframes wk-float {
  from { transform: translateY(4px) }
  to   { transform: translateY(0) }
}
/* 进度条：scaleX 1→0（不是 width，避免每帧重排） */
@keyframes wk-progress {
  from { transform: scaleX(1) }
  to   { transform: scaleX(0) }
}
/* 骨架屏微光（已有 wk-shimmer，这里补一个单向扫过版） */
@keyframes wk-shimmer-run {
  0%   { background-position: -200% 0 }
  100% { background-position: 200% 0 }
}

/* ---- 应用 ---- */
.wk-mask { animation: wk-fade-in var(--wk-dur-slow) var(--wk-ease) both; }
.wk-dialog { animation: wk-dialog-in var(--wk-dur-slow) var(--wk-ease-spring) both; }
.wk-sheet.is-open { animation: wk-slide-up var(--wk-dur-slow) var(--wk-ease-spring) both; }

/* 浮动提示：挂在任意元素上即可 */
.wk-float { animation: wk-float 1s linear 0s infinite alternate; }

/* 进度条 */
.wk-progress { height: 3px; border-radius: 2px; background: var(--wk-fill); overflow: hidden; }
.wk-progress__bar {
  height: 100%; background: var(--wk-accent);
  transform-origin: left center;
  animation: wk-progress var(--wk-progress-dur, 3s) linear forwards;
}

/* 骨架屏 */
.wk-skeleton {
  border-radius: 4px;
  background: linear-gradient(90deg, var(--wk-fill) 25%, var(--wk-fill-input) 37%, var(--wk-fill) 63%);
  background-size: 200% 100%;
  animation: wk-shimmer-run 1.4s ease infinite;
}

/* 尊重系统「减少动效」偏好 —— 这不是可选项，是无障碍基线 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ================================================================ 业务组件（吸收自老库）
   这批原本只在 sites/app/assets/wake-ui-hebox.css 里，页面用了 84 处。
   吸收进新库时按新规范重写：
   · 令牌全部用 --wk-*（不再用 --fill/--ink2/--line 这些老短名）
   · 圆角统一：标签 4~5 / 头像 8 / 卡片 8
   · ★去掉 .wk-sec-t 的品牌竖条 —— 小黑盒的区块标题没有竖条，靠字号和字重分层
   · 字号走档位、行高配套
   类名保持不变，页面 HTML 一行都不用改。
*/

/* ---- 状态标签（12 处，用得最多）---- */
.wk-st {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: 4px;
  border: 1px solid transparent;
  font-size: 11px; line-height: 16px; font-weight: 400;
  background: var(--wk-fill); color: var(--wk-ink-2);
}
.wk-st i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex: 0 0 auto; display: none; }
.wk-st.dot i { display: block; }
.wk-st.ok    { background: var(--wk-success-bg); color: var(--wk-success-ink); }
.wk-st.warn  { background: var(--wk-warning-bg); color: var(--wk-warning-ink); }
.wk-st.bad   { background: var(--wk-danger-bg);  color: var(--wk-danger-ink); }
.wk-st.info  { background: var(--wk-info-bg);    color: var(--wk-info-ink); }

/* ---- 小标记 ---- */
.wk-flag {
  display: inline-block;
  font-size: 10px; line-height: 14px; font-weight: 400;
  padding: 2px 5px; border-radius: 4px;
  background: var(--wk-fill); color: var(--wk-ink-2);
}
.wk-flag.g { background: var(--wk-success-bg); color: var(--wk-success-ink); }
.wk-flag.b { background: var(--wk-info-bg);    color: var(--wk-info-ink); }
.wk-flag.r { background: var(--wk-danger-bg);  color: var(--wk-danger-ink); }

/* ---- 数据格（一行几个 KPI）---- */
.wk-kpis { display: flex; margin: 12px 0; padding-top: 11px; box-shadow: inset 0 1px 0 var(--wk-line); }
.wk-kpi { flex: 1; text-align: center; box-shadow: inset -1px 0 0 var(--wk-line); }
.wk-kpi:last-child { box-shadow: none; }
.wk-kpi b {
  display: block; font-size: 16px; line-height: 22px; font-weight: 400;
  font-variant-numeric: tabular-nums; color: var(--wk-ink);
}
.wk-kpi span { display: block; margin-top: 2px; font-size: 11px; line-height: 14px; color: var(--wk-ink-3); }

/* ---- 区块标题：★没有品牌竖条（小黑盒不这么干）---- */
.wk-sec-t {
  display: flex; align-items: center; gap: 6px;
  margin: 0 0 10px;
  font-size: 12px; line-height: 18px; font-weight: 500;
  color: var(--wk-ink-2);
}

/* ---- 表单容器 ---- */
.wk-form { display: flex; flex-direction: column; gap: 12px; }

/* ---- 名片卡 ---- */
.wk-person {
  width: 100%;
  padding: 14px 16px;
  border-radius: 8px;
  background: var(--wk-card);
  box-shadow: inset 0 0 0 1px var(--wk-line);
}
.wk-person .hd { display: flex; gap: 10px; align-items: center; }
.wk-person .nm { display: flex; align-items: center; gap: 6px; font-size: 15px; line-height: 22px; font-weight: 500; color: var(--wk-ink); }

/* ---- 头像（46 / 34 两档，圆角 8 不是 14）---- */
.wk-pav, .wk-cav {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
  border-radius: 8px;
  color: #fff; font-weight: 500;
  background: var(--wk-fill);
  overflow: visible;
}
.wk-pav { width: 46px; height: 46px; font-size: 17px; }
.wk-cav { width: 46px; height: 46px; font-size: 17px; }
.wk-mav { width: 34px; height: 34px; border-radius: 8px; flex: 0 0 auto;
          display: flex; align-items: center; justify-content: center;
          color: #fff; font-size: 13px; font-weight: 500; background: var(--wk-fill); }
/* 在线点 */
.wk-pav .on, .wk-cav .on {
  position: absolute; right: -1px; bottom: -1px;
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--wk-success);
  box-shadow: 0 0 0 2px var(--wk-card);
}

/* ---- 金额 ---- */
.wk-money {
  display: inline-flex; align-items: baseline; white-space: nowrap;
  font-weight: 500; color: var(--wk-ink);
  font-variant-numeric: tabular-nums;
}
.wk-money .cur { font-size: .74em; font-weight: 400; margin-right: 1px; }
.wk-money.small { font-size: 14px; }

/* ---- 会话行（聊聊页侧栏）---- */
.wk-cmain { flex: 1; min-width: 0; }
.wk-crow { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.wk-cnm { font-size: 14px; line-height: 20px; font-weight: 500; color: var(--wk-ink);
          overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wk-ctm { flex: 0 0 auto; font-size: 10px; line-height: 14px; color: var(--wk-ink-4);
          font-variant-numeric: tabular-nums; }
.wk-cpv { margin-top: 3px; font-size: 12px; line-height: 18px; color: var(--wk-ink-3);
          overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- 未读角标 ---- */
.wk-unread {
  display: flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px;
  background: var(--wk-danger); color: #fff;
  font-size: 10px; line-height: 1; font-weight: 500;
}

/* ---- 系统消息 ---- */
.wk-sys { padding: 8px 0; text-align: center; font-size: 11px; line-height: 14px; color: var(--wk-ink-4); }

/* ---- 角色标 ---- */
.wk-role {
  display: inline-block;
  padding: 1px 5px; border-radius: 4px;
  font-size: 9px; line-height: 12px; font-weight: 500;
  color: #fff;
}
.wk-role.owner { background: #F0B429; }
.wk-role.admin { background: #5B8CFF; }

/* ---- 消息体 ---- */
.wk-mbody { flex: 1; min-width: 0; }
.wk-mhd { display: flex; align-items: center; gap: 6px; }
.wk-mnm { font-size: 13px; line-height: 20px; color: var(--wk-ink); }
.wk-mtm { font-size: 10px; line-height: 14px; color: var(--wk-ink-4); font-variant-numeric: tabular-nums; }
.wk-mtxt { margin-top: 3px; font-size: 13px; line-height: 20px; color: var(--wk-ink-2); }

/* ---- 输入区 ---- */
.wk-cin {
  width: 100%; padding: 9px 10px;
  border-radius: 4px;
  background: var(--wk-card);
  box-shadow: inset 0 0 0 1px var(--wk-line);
}
.wk-cin:focus-within { box-shadow: inset 0 0 0 1px var(--wk-line-focus); }
.wk-cin textarea {
  width: 100%; min-height: 44px; max-height: 140px;
  border: 0; outline: none; resize: none;
  background: transparent; color: var(--wk-ink);
  font: inherit; font-size: 13px; line-height: 20px;
}

/* ---- 工具条 ---- */
.wk-ctools {
  display: flex; align-items: center; gap: 12px;
  padding-top: 7px;
  box-shadow: inset 0 1px 0 var(--wk-line);
}
.wk-ctools svg {
  width: 19px; height: 19px; cursor: pointer;
  stroke: var(--wk-ink-3); fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.wk-ctools svg:hover { stroke: var(--wk-accent); }

/* ================================================================
   控件状态色（对齐小黑盒 base-* 的三条规律）
   1) hover 不换色值，只在上面叠一层 color-mix 半透明
   2) disabled 一律 opacity .5，不另设灰阶
   3) 未选中的框/圆，hover 时边框提亮一档（tertiary）
   ================================================================ */

/* --- 单选 / 复选：hover 未选中 → 边框提亮 --- */
.wk-radio:not(.is-on):not(:disabled):hover::before,
.wk-check:not(.is-on):not(:disabled):hover::before {
  border-color: var(--wk-ink-3);
}
/* 已选中的，hover 叠 8% 半透明（不换底色） */
.wk-radio.is-on:not(:disabled):hover::before,
.wk-check.is-on:not(:disabled):hover::before {
  background-image: linear-gradient(
    color-mix(in srgb, currentcolor 8%, transparent),
    color-mix(in srgb, currentcolor 8%, transparent));
}

/* --- 开关：hover 叠层 + active 加深 --- */
.wk-switch:not(:disabled):hover {
  background-image: linear-gradient(
    color-mix(in srgb, currentcolor 6%, transparent),
    color-mix(in srgb, currentcolor 6%, transparent));
}
.wk-switch:not(:disabled):active {
  background-image: linear-gradient(
    color-mix(in srgb, currentcolor 15%, transparent),
    color-mix(in srgb, currentcolor 15%, transparent));
}

/* --- 禁用：opacity .5（小黑盒口径，不换颜色） --- */
.wk-switch:disabled,
.wk-check:disabled,
.wk-radio:disabled,
.wk-checkbox.is-disabled {
  opacity: .5;
  cursor: default;
  pointer-events: none;
}

/* --- 键盘聚焦 --- */
.wk-check:focus-visible,
.wk-radio:focus-visible { outline: none; }
.wk-check:focus-visible::before,
.wk-radio:focus-visible::before {
  box-shadow: 0 0 0 2px var(--wk-fill-input), 0 0 0 4px var(--wk-accent);
}

/* --- 校验失败：边框转 danger --- */
.wk-check.is-invalid::before,
.wk-radio.is-invalid::before,
.wk-checkbox.is-invalid .wk-checkbox__box {
  border-color: var(--wk-danger);
  box-shadow: inset 0 0 0 1px var(--wk-danger);
}
