/* 哈希国际在线客服 · 会员端基础样式（默认暗金）
 * 只定义布局和变量；主题 themes/<名>.css 只覆盖变量和装饰，选择器写 .wkf-root[data-theme=<名>]。
 * 类名一律 wkf- 前缀，变量与类名清单见 README.md「样式定制」。
 * 兼容老 WebView：flex 布局不用 gap、不用 inset / :where / aspect-ratio。 */

.wkf-root {
  --wkf-font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --wkf-font-size: 15px;
  --wkf-page-bg: #050302;
  --wkf-bg: #0c0905;
  --wkf-bg-img: radial-gradient(ellipse at top, rgba(184, 134, 43, .16) 0%, transparent 55%), radial-gradient(ellipse at bottom, rgba(184, 134, 43, .08) 0%, transparent 60%);
  --wkf-fg: #f3e7c9;
  --wkf-sub: #a08a63;
  --wkf-line: rgba(212, 161, 58, .18);
  --wkf-panel: #150f08;
  --wkf-panel-2: #21180d;
  --wkf-accent: #e3b450;
  --wkf-accent-2: #b8862b;
  --wkf-accent-grad: linear-gradient(180deg, #f6d675, #c99636);
  --wkf-accent-fg: #1d1404;
  --wkf-ok: #3ccf91;
  --wkf-warn: #f0a63a;
  --wkf-danger: #ff5f57;
  --wkf-fail-bg: #d93025;
  --wkf-bubble: #1d1610;
  --wkf-bubble-fg: #f3e7c9;
  --wkf-bubble-border: rgba(212, 161, 58, .22);
  --wkf-bubble-mine: linear-gradient(180deg, #f3d06b, #c8952f);
  --wkf-bubble-mine-fg: #1d1404;
  --wkf-bubble-mine-border: transparent;
  --wkf-bubble-radius: 14px;
  --wkf-link: #f6d675;
  --wkf-link-mine: #3d2400;
  --wkf-radius: 12px;
  --wkf-top-h: 56px;
  --wkf-avatar: 36px;
  --wkf-avatar-radius: 50%;
  --wkf-avatar-bg: linear-gradient(180deg, #3a2a14, #1d1409);
  --wkf-avatar-fg: #f6d675;
  --wkf-input-bg: #0f0b06;
  --wkf-input-fg: #f3e7c9;
  --wkf-max-w: 760px;
  --wkf-media-w: 220px;
  --wkf-media-h: 280px;
  --wkf-sticker: 112px;
  --wkf-sys-bg: rgba(212, 161, 58, .10);
  --wkf-sys-fg: #c8ad78;
  --wkf-time-fg: #7d6a49;
  --wkf-queue-bg: linear-gradient(90deg, rgba(240, 166, 58, .20), rgba(240, 166, 58, .06));
  --wkf-queue-fg: #f6d675;
  --wkf-net-bg: rgba(255, 95, 87, .14);
  --wkf-net-fg: #ffb8b3;
  --wkf-shadow: 0 10px 30px rgba(0, 0, 0, .5);
  --wkf-overlay: rgba(0, 0, 0, .92);
  --wkf-z: 9600;

  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--wkf-font);
  font-size: var(--wkf-font-size);
  line-height: 1.5;
  color: var(--wkf-fg);
  background: var(--wkf-page-bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}
.wkf-root[data-mode=page],
.wkf-root[data-mode=overlay] {
  position: fixed;
  left: 0; top: 0; right: 0; bottom: 0;
  width: auto;
  height: auto;
  z-index: var(--wkf-z);
}
.wkf-root[data-mode=overlay] { animation: wkf-rise .22s ease-out; }
.wkf-root[data-mode=embed] {
  position: absolute;
  left: 0; top: 0; right: 0; bottom: 0;
  width: auto;
  height: auto;
}
.wkf-root *, .wkf-root *::before, .wkf-root *::after { box-sizing: border-box; }
.wkf-root [hidden] { display: none !important; }
.wkf-root img { -webkit-user-drag: none; }
.wkf-root .wkf-ico svg { display: block; width: 100%; height: 100%; }

/* 所有按钮都带 .wkf-b：放最前面，后面的组件样式按顺序覆盖 */
.wkf-b {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  line-height: 1.2;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}
.wkf-b:focus { outline: none; }
.wkf-b:focus-visible { outline: 2px solid var(--wkf-accent); outline-offset: 2px; }
.wkf-b[disabled] { opacity: .45; cursor: default; }

.wkf-frame {
  position: relative;
  display: -webkit-box;
  display: flex;
  -webkit-box-orient: vertical;
  flex-direction: column;
  width: 100%;
  max-width: var(--wkf-max-w);
  height: 100%;
  margin: 0 auto;
  overflow: hidden;
  background-color: var(--wkf-bg);
  background-image: var(--wkf-bg-img);
  background-size: cover;
  background-position: center;
}
.wkf-root.wkf-wide .wkf-frame {
  border-left: 1px solid var(--wkf-line);
  border-right: 1px solid var(--wkf-line);
  box-shadow: var(--wkf-shadow);
}

/* ---------- 顶栏 ---------- */
.wkf-top {
  position: relative;
  z-index: 3;
  flex: none;
  display: flex;
  align-items: center;
  height: var(--wkf-top-h);
  height: calc(var(--wkf-top-h) + env(safe-area-inset-top));
  padding: 0 12px;
  padding-top: env(safe-area-inset-top);
  background: var(--wkf-panel);
  border-bottom: 1px solid var(--wkf-line);
}
.wkf-top-back {
  flex: none;
  width: 32px;
  height: 32px;
  margin: 0 4px 0 -6px;
  color: var(--wkf-fg);
}
.wkf-top-back .wkf-ico { display: block; width: 24px; height: 24px; margin: 0 auto; }
.wkf-agent { flex: 1; min-width: 0; display: flex; align-items: center; }
.wkf-agent .wkf-avatar { width: 40px; height: 40px; margin-right: 10px; overflow: visible; }
.wkf-agent .wkf-avatar img { border-radius: var(--wkf-avatar-radius); }
.wkf-agent-text { min-width: 0; }
.wkf-agent-name {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wkf-agent-status {
  font-size: 12px;
  line-height: 1.4;
  color: var(--wkf-sub);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wkf-agent-status.wkf-typing { color: var(--wkf-accent); }
.wkf-agent-status.wkf-typing::after {
  content: "";
  display: inline-block;
  width: 1.2em;
  text-align: left;
  animation: wkf-dots 1.2s steps(4) infinite;
}
.wkf-dot {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 2px solid var(--wkf-panel);
  background: var(--wkf-sub);
}
.wkf-root[data-state=online] .wkf-dot { background: var(--wkf-ok); }
.wkf-root[data-state=queued] .wkf-dot { background: var(--wkf-warn); }
.wkf-root[data-state=reconnecting] .wkf-dot,
.wkf-root[data-state=offline] .wkf-dot,
.wkf-root[data-state=connecting] .wkf-dot { background: var(--wkf-warn); animation: wkf-blink 1s ease-in-out infinite; }
.wkf-root[data-state=fatal] .wkf-dot,
.wkf-root[data-state=kicked] .wkf-dot { background: var(--wkf-danger); }
.wkf-top-extra { flex: none; display: flex; align-items: center; }

/* ---------- 状态条 ---------- */
.wkf-net,
.wkf-queue {
  position: relative;
  z-index: 2;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 7px 12px;
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
}
.wkf-net { background: var(--wkf-net-bg); color: var(--wkf-net-fg); }
.wkf-net-btn {
  flex: none;
  margin-left: 10px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--wkf-accent-fg);
  background: var(--wkf-accent-grad);
}
.wkf-queue { justify-content: flex-start; text-align: left; background: var(--wkf-queue-bg); color: var(--wkf-queue-fg); }
.wkf-queue-icon { flex: none; width: 16px; height: 16px; margin-right: 8px; }
.wkf-queue-icon svg { display: block; width: 100%; height: 100%; animation: wkf-spin 3s linear infinite; }
.wkf-queue--offline .wkf-queue-icon svg { animation: none; }

/* ---------- 消息区 ---------- */
.wkf-body {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  overflow-anchor: none;
  padding: 6px 12px 10px;
}
.wkf-more {
  padding: 8px 0 4px;
  font-size: 12px;
  color: var(--wkf-time-fg);
  text-align: center;
}
.wkf-more[data-state=idle] { cursor: pointer; }
.wkf-more[data-state=idle] span { border-bottom: 1px dashed currentColor; }
.wkf-more[data-state=loading] span::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 6px;
  vertical-align: -1px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: wkf-spin .8s linear infinite;
}
.wkf-list { position: relative; }
.wkf-item { padding: 6px 0; }
.wkf-time {
  margin: 6px 0 8px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--wkf-time-fg);
  text-align: center;
}
.wkf-sys {
  display: table;
  max-width: 88%;
  margin: 2px auto;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--wkf-sys-fg);
  background: var(--wkf-sys-bg);
  text-align: center;
}
.wkf-msg { display: flex; align-items: flex-start; }
.wkf-msg--out { flex-direction: row-reverse; }
.wkf-avatar {
  position: relative;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--wkf-avatar);
  height: var(--wkf-avatar);
  border-radius: var(--wkf-avatar-radius);
  background: var(--wkf-avatar-bg);
  color: var(--wkf-avatar-fg);
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
}
.wkf-avatar img {
  position: absolute;
  left: 0; top: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.wkf-msg--in .wkf-avatar { margin-right: 8px; }
.wkf-msg--out .wkf-avatar { margin-left: 8px; }
.wkf-msg-main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  max-width: 74%;
  max-width: min(74%, 520px);
}
.wkf-msg--out .wkf-msg-main { align-items: flex-end; }
.wkf-msg-main > * + * { margin-top: 4px; }
.wkf-bubble {
  position: relative;
  max-width: 100%;
  padding: 9px 12px;
  border-radius: var(--wkf-bubble-radius);
  border: 1px solid var(--wkf-bubble-border);
  background: var(--wkf-bubble);
  color: var(--wkf-bubble-fg);
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  word-break: break-word;
  -webkit-touch-callout: none;
}
.wkf-msg--in .wkf-bubble { border-top-left-radius: 4px; }
/* 触屏长按走自定义菜单（复制 / 重发），不要系统选字 */
.wkf-root[data-touch] .wkf-bubble { -webkit-user-select: none; user-select: none; }
.wkf-msg--out .wkf-bubble {
  border-color: var(--wkf-bubble-mine-border);
  border-top-right-radius: 4px;
  background: var(--wkf-bubble-mine);
  color: var(--wkf-bubble-mine-fg);
}
.wkf-bubble a { color: var(--wkf-link); text-decoration: underline; word-break: break-all; }
.wkf-msg--out .wkf-bubble a { color: var(--wkf-link-mine); }
.wkf-bubble--media {
  padding: 0;
  overflow: hidden;
  border-radius: var(--wkf-radius);
  background: var(--wkf-panel-2);
  line-height: 0;
}
.wkf-msg--out .wkf-bubble--media { border-top-right-radius: var(--wkf-radius); background: var(--wkf-panel-2); }
.wkf-msg--in .wkf-bubble--media { border-top-left-radius: var(--wkf-radius); }
.wkf-bubble--sticker,
.wkf-bubble--emotion,
.wkf-msg--out .wkf-bubble--sticker,
.wkf-msg--out .wkf-bubble--emotion {
  padding: 0;
  border: 0;
  background: none;
  line-height: 0;
}
.wkf-bubble--audio { padding: 6px 8px; line-height: 0; }
.wkf-img {
  display: block;
  max-width: var(--wkf-media-w);
  max-height: var(--wkf-media-h);
  min-width: 60px;
  min-height: 40px;
  object-fit: cover;
  cursor: zoom-in;
}
.wkf-bubble--media.wkf-loading { width: 160px; height: 120px; }
.wkf-bubble--media.wkf-loading .wkf-img { position: absolute; opacity: 0; }
.wkf-bubble--media.wkf-loading::after,
.wkf-bubble--media.wkf-broken::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 22px;
  height: 22px;
  margin: -11px 0 0 -11px;
  border: 2px solid var(--wkf-sub);
  border-top-color: transparent;
  border-radius: 50%;
  animation: wkf-spin .8s linear infinite;
}
.wkf-bubble--media.wkf-broken { width: 140px; height: 100px; }
.wkf-bubble--media.wkf-broken .wkf-img { display: none; }
.wkf-bubble--media.wkf-broken::after {
  content: "图片加载失败";
  width: auto;
  height: auto;
  margin: 0;
  border: 0;
  animation: none;
  transform: translate(-50%, -50%);
  font-size: 12px;
  line-height: 1.4;
  color: var(--wkf-sub);
  white-space: nowrap;
}
.wkf-video {
  display: block;
  width: 200px;
  height: 150px;
  object-fit: contain;
  background: #000;
}
.wkf-play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 48px;
  height: 48px;
  margin: -24px 0 0 -24px;
  border-radius: 50%;
  color: #fff;
  background: rgba(0, 0, 0, .55);
  border: 2px solid rgba(255, 255, 255, .85);
}
.wkf-play .wkf-ico { display: block; width: 22px; height: 22px; margin: 0 auto; transform: translateX(2px); }
.wkf-video-tip {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  margin-top: 30px;
  font-size: 12px;
  line-height: 1.4;
  color: #fff;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .8);
  pointer-events: none;
}
.wkf-audio { display: block; width: 240px; max-width: 100%; height: 36px; }
.wkf-emotion { display: block; width: 48px; height: 48px; }
.wkf-stk {
  position: relative;
  width: var(--wkf-sticker);
  height: var(--wkf-sticker);
  display: flex;
  align-items: center;
  justify-content: center;
}
.wkf-stk-glyph { font-size: 72px; line-height: 1; }
.wkf-stk-anim { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }
.wkf-stk.wkf-stk-ready .wkf-stk-glyph { visibility: hidden; }
.wkf-up {
  position: absolute;
  left: 0; top: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .45);
  color: #fff;
  font-size: 13px;
  line-height: 1.4;
}
.wkf-up-bar {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 0;
  background: var(--wkf-accent);
  transition: width .2s;
}
.wkf-msg-state {
  flex: none;
  align-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin: 0 4px;
}
.wkf-spin {
  display: block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--wkf-sub);
  border-top-color: transparent;
  border-radius: 50%;
  opacity: 0;
  animation: wkf-spin .8s linear infinite, wkf-show .2s .6s forwards;
}
.wkf-fail {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--wkf-fail-bg);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
}
.wkf-msg-err { font-size: 11px; line-height: 1.4; color: var(--wkf-danger); }
.wkf-empty {
  padding: 48px 24px 24px;
  text-align: center;
  color: var(--wkf-sub);
  font-size: 13px;
}
.wkf-empty-icon { display: block; width: 56px; height: 56px; margin: 0 auto 12px; color: var(--wkf-accent); opacity: .85; }
.wkf-empty-title { margin-bottom: 4px; font-size: 16px; color: var(--wkf-fg); }
.wkf-fatal {
  padding: 56px 24px 24px;
  text-align: center;
  color: var(--wkf-sub);
  font-size: 14px;
}
.wkf-fatal-icon { display: block; width: 52px; height: 52px; margin: 0 auto 12px; color: var(--wkf-danger); }
.wkf-newtip {
  position: absolute;
  z-index: 4;
  right: 14px;
  bottom: 74px;
  padding: 6px 12px 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--wkf-accent-fg);
  background: var(--wkf-accent-grad);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .35);
  animation: wkf-show .2s;
}
.wkf-newtip .wkf-ico { display: inline-block; width: 12px; height: 12px; margin-right: 4px; vertical-align: -1px; }

/* ---------- 常用问题 ---------- */
.wkf-quick {
  position: relative;
  z-index: 3;
  flex: none;
  display: flex;
  padding: 6px 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.wkf-quick::-webkit-scrollbar { display: none; }
.wkf-quick-item {
  flex: none;
  margin-right: 8px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--wkf-line);
  background: var(--wkf-panel-2);
  color: var(--wkf-accent);
  font-size: 13px;
  line-height: 1.4;
  white-space: nowrap;
}
.wkf-quick-item:active { opacity: .7; }

/* ---------- 输入栏 ---------- */
.wkf-bar {
  position: relative;
  z-index: 3;
  flex: none;
  display: flex;
  align-items: flex-end;
  padding: 8px 10px;
  padding-bottom: calc(8px + env(safe-area-inset-bottom));
  background: var(--wkf-panel);
  border-top: 1px solid var(--wkf-line);
}
.wkf-root.wkf-kb .wkf-bar,
.wkf-bar.wkf-panel-open { padding-bottom: 8px; }
.wkf-icon-btn {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: var(--wkf-accent);
  background: var(--wkf-panel-2);
  border: 1px solid var(--wkf-line);
}
.wkf-icon-btn .wkf-ico { display: block; width: 22px; height: 22px; }
.wkf-icon-btn.wkf-active { color: var(--wkf-accent-fg); background: var(--wkf-accent-grad); border-color: transparent; }
.wkf-btn-plus .wkf-ico { transition: transform .2s; }
.wkf-btn-plus.wkf-active .wkf-ico { transform: rotate(45deg); }
.wkf-input-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  margin: 0 8px;
  padding: 0 12px;
  border-radius: 19px;
  border: 1px solid var(--wkf-line);
  background: var(--wkf-input-bg);
}
.wkf-input {
  flex: 1;
  min-width: 0;
  display: block;
  height: 36px;
  max-height: 120px;
  margin: 0;
  padding: 7px 0;
  border: 0;
  outline: 0;
  resize: none;
  background: transparent;
  color: var(--wkf-input-fg);
  font: inherit;
  font-size: 16px;
  line-height: 22px;
  -webkit-appearance: none;
  appearance: none;
}
.wkf-input::placeholder { color: var(--wkf-sub); opacity: .8; }
.wkf-send {
  flex: none;
  height: 38px;
  padding: 0 16px;
  border-radius: 19px;
  font-size: 15px;
  font-weight: 600;
  color: var(--wkf-accent-fg);
  background: var(--wkf-accent-grad);
}
.wkf-bar:not(.wkf-has-text) .wkf-send { display: none; }
.wkf-bar.wkf-has-text .wkf-btn-plus { display: none; }
.wkf-root.wkf-disabled .wkf-bar { opacity: .5; pointer-events: none; }

/* ---------- 面板 ---------- */
.wkf-panel {
  position: relative;
  z-index: 3;
  flex: none;
  background: var(--wkf-panel);
  border-top: 1px solid var(--wkf-line);
  padding-bottom: env(safe-area-inset-bottom);
  animation: wkf-show .16s ease-out;
}
.wkf-emoji { display: flex; flex-direction: column; height: 268px; }
.wkf-emoji-tabs {
  flex: none;
  display: flex;
  padding: 6px 8px;
  border-bottom: 1px solid var(--wkf-line);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.wkf-emoji-tab {
  flex: none;
  width: 44px;
  height: 34px;
  margin-right: 4px;
  border-radius: 9px;
  font-size: 22px;
  line-height: 34px;
  text-align: center;
}
.wkf-emoji-tab[aria-selected=true] { background: var(--wkf-panel-2); box-shadow: inset 0 -2px 0 var(--wkf-accent); }
.wkf-emoji-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
  grid-auto-rows: 50px;
  grid-gap: 4px;
  gap: 4px;
  align-content: start;
  padding: 8px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.wkf-emoji-cell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 32px;
  line-height: 1;
  transition: transform .12s, background-color .12s;
}
.wkf-emoji-cell:hover { background: var(--wkf-panel-2); }
.wkf-emoji-cell:active { transform: scale(.88); }
.wkf-emoji-cell .wkf-stk-anim { position: absolute; left: 3px; top: 3px; width: 44px; height: 44px; }
.wkf-more-panel {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-gap: 14px;
  gap: 14px;
  padding: 18px 16px 20px;
}
.wkf-more-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 12px;
  color: var(--wkf-sub);
  cursor: pointer;
  overflow: hidden;
}
.wkf-more-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin-bottom: 6px;
  border-radius: 16px;
  color: var(--wkf-accent);
  background: var(--wkf-panel-2);
  border: 1px solid var(--wkf-line);
}
.wkf-more-icon .wkf-ico { display: block; width: 26px; height: 26px; }
.wkf-file {
  position: absolute;
  left: 0; top: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  font-size: 0;
}

/* ---------- 浮层 ---------- */
.wkf-toast {
  position: absolute;
  z-index: 30;
  left: 50%;
  top: 42%;
  max-width: 80%;
  padding: 10px 16px;
  border-radius: 10px;
  background: rgba(0, 0, 0, .8);
  color: #fff;
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
  pointer-events: none;
  transform: translate(-50%, -50%);
  animation: wkf-show .18s;
}
.wkf-toast[data-type=error] { background: rgba(160, 32, 28, .92); }
.wkf-mask {
  position: absolute;
  z-index: 20;
  left: 0; top: 0; right: 0; bottom: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, .5);
  animation: wkf-fade .16s;
}
.wkf-root.wkf-wide .wkf-mask { align-items: center; }
.wkf-sheet {
  width: 100%;
  max-width: 440px;
  padding: 16px 16px 14px;
  padding-bottom: calc(14px + env(safe-area-inset-bottom));
  border-radius: 16px 16px 0 0;
  background: var(--wkf-panel);
  border: 1px solid var(--wkf-line);
  border-bottom: 0;
  animation: wkf-rise .2s ease-out;
}
.wkf-root.wkf-wide .wkf-sheet { border-radius: 16px; border-bottom: 1px solid var(--wkf-line); padding-bottom: 14px; }
.wkf-sheet-title { margin-bottom: 12px; font-size: 15px; font-weight: 600; text-align: center; }
.wkf-sheet-thumbs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-gap: 8px;
  gap: 8px;
  margin-bottom: 14px;
}
.wkf-sheet-thumb {
  position: relative;
  padding-top: 100%;
  border-radius: 8px;
  overflow: hidden;
  background: var(--wkf-panel-2);
}
.wkf-sheet-thumb img,
.wkf-sheet-thumb .wkf-ico {
  position: absolute;
  left: 0; top: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.wkf-sheet-thumb .wkf-ico { padding: 28%; color: var(--wkf-sub); }
.wkf-sheet-actions { display: flex; }
.wkf-sheet-btn {
  flex: 1;
  height: 42px;
  border-radius: 21px;
  font-size: 15px;
  color: var(--wkf-fg);
  background: var(--wkf-panel-2);
  border: 1px solid var(--wkf-line);
}
.wkf-sheet-btn + .wkf-sheet-btn { margin-left: 10px; }
.wkf-sheet-btn.wkf-primary { color: var(--wkf-accent-fg); background: var(--wkf-accent-grad); border-color: transparent; font-weight: 600; }
.wkf-sheet-btn.wkf-danger { color: var(--wkf-danger); }
.wkf-sheet-list .wkf-sheet-btn { display: block; width: 100%; margin: 0 0 8px; }
.wkf-menu {
  position: absolute;
  z-index: 25;
  display: flex;
  padding: 4px;
  border-radius: 10px;
  background: rgba(24, 24, 24, .96);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .4);
  animation: wkf-show .12s;
}
.wkf-menu .wkf-b { padding: 7px 14px; border-radius: 7px; font-size: 13px; color: #fff; white-space: nowrap; }
.wkf-menu .wkf-b:active { background: rgba(255, 255, 255, .12); }
.wkf-drop {
  position: absolute;
  z-index: 18;
  left: 10px; top: 10px; right: 10px; bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed var(--wkf-accent);
  border-radius: 16px;
  background: rgba(0, 0, 0, .62);
  color: var(--wkf-accent);
  font-size: 16px;
  pointer-events: none;
}

/* ---------- 看大图 ---------- */
.wkf-viewer {
  position: absolute;
  z-index: 40;
  left: 0; top: 0; right: 0; bottom: 0;
  background: var(--wkf-overlay);
  animation: wkf-fade .18s;
  -webkit-user-select: none;
  user-select: none;
}
.wkf-viewer-stage {
  position: absolute;
  left: 0; top: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: none;
}
.wkf-viewer-img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  transform-origin: 50% 50%;
  will-change: transform;
}
.wkf-viewer-img.wkf-anim { transition: transform .22s ease-out; }
.wkf-viewer-count {
  position: absolute;
  left: 50%;
  top: 14px;
  top: calc(14px + env(safe-area-inset-top));
  transform: translateX(-50%);
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 13px;
  color: #fff;
  background: rgba(0, 0, 0, .4);
}
.wkf-viewer-btn {
  position: absolute;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: #fff;
  background: rgba(0, 0, 0, .45);
}
.wkf-viewer-btn .wkf-ico { display: block; width: 22px; height: 22px; margin: 0 auto; }
.wkf-viewer-close { right: 12px; top: 10px; top: calc(10px + env(safe-area-inset-top)); }
.wkf-viewer-prev { left: 12px; top: 50%; margin-top: -20px; }
.wkf-viewer-next { right: 12px; top: 50%; margin-top: -20px; }
.wkf-root[data-touch] .wkf-viewer-prev,
.wkf-root[data-touch] .wkf-viewer-next { display: none; }
.wkf-viewer-open {
  position: absolute;
  right: 14px;
  bottom: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  color: #fff;
  background: rgba(0, 0, 0, .45);
  text-decoration: none;
}

@keyframes wkf-spin { to { transform: rotate(360deg); } }
@keyframes wkf-show { from { opacity: 0; } to { opacity: 1; } }
@keyframes wkf-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes wkf-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes wkf-blink { 50% { opacity: .35; } }
@keyframes wkf-dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }

@media (prefers-reduced-motion: reduce) {
  .wkf-root *, .wkf-root *::before, .wkf-root *::after { animation-duration: .01ms !important; transition: none !important; }
}
