/* 商务后台：单一组件体系。只重构界面，权限、订单和资金流程沿用现有实现。
   Design references: Tabler / Ant Design Pro / RuoYi; no external UI runtime. */
:root {
  --bg: #f3f4f6; --card: #fff; --line: #e2e5e9; --text: #23272f; --muted: #737983;
  --primary: #1769db; --primary-dark: #125abe; --indigo: #1769db; --violet: #737983;
  --orange: #b7791f; --rose: #d93d43; --green: #21845b; --amber: #b7791f; --teal: #21845b;
  --cyan-soft: #edf4ff; --indigo-soft: #edf4ff; --violet-soft: #f2f3f5;
  --orange-soft: #fff7e8; --rose-soft: #fff1f0; --green-soft: #eef8f2;
  --amber-soft: #fff7e8; --teal-soft: #eef8f2; --side: #243041;
  /* GitHub: ant-design/ant-design theme seed; soybeanjs/soybean-admin transition.css. */
  --motion-fast: .1s; --motion-mid: .2s; --motion-ease: cubic-bezier(0.215, 0.61, 0.355, 1);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--text); background: var(--bg); font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif; }
button, input, textarea, select { font: inherit; }
button { min-height: 32px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 4px; color: var(--text); background: #fff; font-weight: 400; cursor: pointer; transition: background-color var(--motion-fast) ease, border-color var(--motion-fast) ease, color var(--motion-fast) ease, translate var(--motion-fast) var(--motion-ease); }
button:hover:not(:disabled) { border-color: #a8b0bc; background: #f8f9fb; }
button:active { transform: none; }
button:disabled { cursor: not-allowed; opacity: .5; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
label { display: grid; gap: 6px; color: #4b515b; font-size: 13px; }
input, textarea, select { min-width: 0; width: 100%; border: 1px solid #d8dce2; border-radius: 4px; padding: 8px 10px; color: var(--text); background: #fff; outline: 0; }
input, select { min-height: 36px; }
input[type="checkbox"], input[type="radio"] { width: 16px; min-height: 16px; height: 16px; padding: 0; accent-color: var(--primary); vertical-align: middle; }
input:focus, textarea:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 2px #edf4ff; }
input[readonly], textarea[readonly] { color: var(--muted); background: #f6f7f9; }
textarea { line-height: 1.6; }
small, .hint { color: var(--muted); font-size: 12px; line-height: 1.6; }
code { font-family: Consolas, monospace; font-size: 12px; color: var(--muted); }
a { color: var(--primary); }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 32px 20px; background: #f3f4f6; }
.login-card { width: min(420px, 100%); border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.login-card-body { padding: 36px 40px; }
.login-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 30px; }
.login-mark { display: grid; place-items: center; flex: 0 0 40px; width: 40px; height: 40px; background: var(--primary); border-radius: 4px; }
.login-mark svg { width: 24px; height: 24px; }
.login-card h1 { margin: 0; font-size: 20px; font-weight: 600; }
.login-sub { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.login-field { margin-bottom: 18px; }
.login-field label { margin-bottom: 6px; }
.login-input { position: relative; }
.login-ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: #89919d; pointer-events: none; }
.login-input input { height: 40px; padding: 8px 40px; }
.login-card .login-eye { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 28px; min-height: 28px; height: 28px; padding: 5px; border: 0; background: transparent; color: var(--muted); }
.login-eye svg { width: 18px; height: 18px; }
.login-remember { display: flex; align-items: center; gap: 8px; margin: 20px 0; cursor: pointer; }
#loginBtn { width: 100%; min-height: 40px; color: #fff; border-color: var(--primary); background: var(--primary); font-weight: 500; }
#loginBtn:hover:not(:disabled) { background: var(--primary-dark); }
.login-tip { margin: 22px 0 0; color: var(--muted); font-size: 12px; text-align: center; }
.login-tip b { font-weight: 400; }
.admin-shell { min-height: 100vh; display: grid; grid-template-columns: 216px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 16px; padding: 0 12px 16px; background: var(--side); color: #c4cbd5; overflow: hidden; }
.brand { display: flex; gap: 10px; align-items: center; min-height: 72px; padding: 16px 4px; border-bottom: 1px solid #354153; }
.brand-symbol { flex: 0 0 30px; width: 30px; height: 30px; color: #fff; }
.brand strong { display: block; color: #fff; font-size: 15px; font-weight: 600; }
.brand span { display: block; margin-top: 2px; color: #95a1b2; font-size: 11px; }
.menu-search { height: 34px; min-height: 34px; padding: 6px 10px; border: 1px solid #455164; color: #f1f3f5; background: #2d394b; font-size: 12px; }
.menu-search::placeholder { color: #9aa6b8; }
.menu-search:focus { border-color: #7f9fcb; box-shadow: none; }
.menu { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #506078 transparent; }
.menu-group { margin: 0 0 4px; }
.menu-title { width: 100%; display: flex; align-items: center; gap: 10px; min-height: 40px; border: 0; border-radius: 4px; padding: 8px 10px; color: #c4cbd5; background: transparent; text-align: left; }
.menu-title::after { content: "⌄"; margin-left: auto; color: #8996aa; transition: transform var(--motion-mid) var(--motion-ease); }
.menu-title.collapsed::after { transform: rotate(-90deg); }
.menu-icon { width: 18px; height: 18px; flex: 0 0 18px; }
.menu-title:hover:not(:disabled), .menu-title.current { color: #fff; background: #303e52; border: 0; }
.menu-items { display: grid; gap: 2px; padding: 2px 0 4px; animation: admin-surface-in var(--motion-mid) var(--motion-ease); }
.menu-items.is-collapsed { display: none; }
.menu-item { width: 100%; min-height: 36px; border: 0; border-radius: 4px; padding: 7px 10px 7px 38px; text-align: left; font-size: 13px; color: #b7c0ce; background: transparent; }
.menu-item:hover:not(:disabled) { color: #fff; background: #303e52; }
.menu-item.active, .menu-item.active:hover:not(:disabled) { color: #fff; background: var(--primary); }
.logout { color: #b7c0ce; background: transparent; border: 1px solid #455164; font-size: 12px; text-align: left; }
.logout:hover:not(:disabled) { color: #fff; background: #303e52; border-color: #68758a; }
.workspace { min-width: 0; padding: 0 24px 28px; }
.topbar { display: flex; justify-content: space-between; gap: 18px; align-items: center; margin: 0 -24px 20px; padding: 16px 24px; min-height: 84px; background: #fff; border-bottom: 1px solid var(--line); }
.topbar p { margin: 0 0 4px; color: var(--muted); font-size: 12px; }
.topbar h1 { margin: 0; font-size: 20px; font-weight: 600; }
.top-actions { display: flex; align-items: center; gap: 18px; }
.account-summary { color: var(--muted); font-size: 12px; white-space: nowrap; }
.top-actions button, .button-row button, .merchant-create button { border: 1px solid var(--primary); border-radius: 4px; padding: 7px 14px; color: #fff; background: var(--primary); font-weight: 400; }
.top-actions button:hover:not(:disabled), .button-row button:hover:not(:disabled), .merchant-create button:hover:not(:disabled) { background: var(--primary-dark); border-color: var(--primary-dark); }
.top-actions button.saved { color: #fff; background: var(--green); border-color: var(--green); }
.button-row select { width: auto; max-width: 220px; }
.merchant-strip { display: flex; justify-content: space-between; gap: 14px; align-items: center; margin-bottom: 16px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 4px; background: #fff; }
.merchant-strip span, .merchant-strip em { display: block; color: var(--muted); font-style: normal; font-size: 12px; }
.merchant-strip strong { display: block; margin-top: 3px; font-size: 15px; font-weight: 600; }
.merchant-strip-tools, .merchant-switch { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; justify-content: flex-end; }
.merchant-chip { padding: 6px 10px; font-size: 12px; }
.merchant-chip.active { border-color: var(--primary); color: var(--primary); background: var(--cyan-soft); }
.merchant-strip .merchant-view-role { font-size: 12px; color: var(--muted); }
.merchant-back-btn { font-size: 12px; }
.page { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.panel { min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: 4px; background: #fff; }

.panel h2 { margin: 0 0 16px; font-size: 15px; font-weight: 600; }
.panel-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 13px; }
.panel-head h2 { margin: 0; }

.log-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.log-summary div { padding: 12px; border-radius: 4px; border: 1px solid var(--line); background: #fff; }

.log-summary span { display: block; color: var(--muted); font-size: 12px; }
.log-summary strong { display: block; margin-top: 6px; font-size: 18px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stat-card { min-height: 100px; padding: 16px; border-radius: 4px; background: #fff; border: 1px solid var(--line); border-left: 1px solid var(--line); }

.stat-card span { color: var(--muted); font-size: 13px; }
.stat-card strong { display: block; margin-top: 12px; font-size: 28px; }

.overview-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px 0; }
.overview-grid div { min-width: 0; padding: 16px 20px; border-left: 1px solid var(--line); background: #fff; }
.overview-grid b, .overview-grid span { display: block; color: var(--muted); font-size: 13px; }
.overview-grid strong { display: block; margin: 8px 0; font-size: 28px; font-weight: 600; font-variant-numeric: tabular-nums; }
/* 卡片只有 ~186px 宽（5 列 + 40px 内边距），长说明必然折行。
   把「（不含退款）」这类限定语锁成不可拆的整体，断点才会落在语义边界，
   而不是「…不含退 / 款）」这种孤字。ID 前缀是为了压过上面的 `.overview-grid span`。 */
#completionRateNote .note-keep { display: inline; white-space: nowrap; }
.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 11px 9px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: #4b515b; background: #f7f8fa; font-weight: 500; white-space: nowrap; }
.tag { display: inline-flex; border-radius: 4px; padding: 4px 8px; color: #0369a1; background: #e0f2fe; font-size: 12px; font-weight: 600; }

.tag.is-pending { color: #8a5a00; background: var(--amber-soft); }

.tag.is-blocked { color: #b42318; background: #fee4e2; }
.staff-fine-due { color: #b42318; }
.form-grid, .switch-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.switch-grid label { display: flex; min-height: 42px; align-items: center; gap: 9px; padding: 10px 12px; border-radius: 4px; background: #f8fbff; border-left: 1px solid var(--line); }
.switch-grid input { width: auto; }
.price-option-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}
.price-option-toggle {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border: 1px solid #d7e3f0;
  border-radius: 4px;
  background: #f8fbff;
  color: #52647a;
  white-space: nowrap;
}
.price-option-toggle input {
  width: auto;
  margin: 0;
}
/* 「打手分成」的单位下拉：全局 select 是 width:100%，放进 .price-option-row 的 auto 列会被撑满，
   这里收回成按内容宽度。 */
.share-unit-select {
  width: auto;
  min-width: 64px;
}
.feature-copy-grid { margin-top: 13px; padding-top: 13px; border-top: 1px dashed var(--line); }
.feature-copy-grid textarea { min-height: 104px; background: #fff; }
.full { grid-column: 1 / -1; }
.member-benefit-panel { border-top-color: #f59e0b; }
.member-benefit-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.member-benefit-card { display: grid; gap: 10px; padding: 14px; border: 1px solid rgba(245, 158, 11, .22); border-radius: 4px; background: #fff; }
.member-benefit-card header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.member-benefit-card header strong { color: #92400e; font-size: 16px; }
.member-benefit-card header span { color: #64748b; font-size: 12px; }
.panel-tip { color: #64748b; font-size: 13px; }
.image-preview { min-height: 126px; display: grid; place-items: center; border-radius: 4px; overflow: hidden; color: var(--muted); background: #f8fbff; }
.image-preview img { width: 100%; height: 230px; object-fit: cover; }
/* 有图时必须切回 block：.image-preview 是 grid + place-items:center，列宽被内容撑成 max-content，
   子项 .product-image-list 的 width:100% 就失去了确定基准（width 与列宽互相依赖 → 退回 auto），
   结果 justify-content:center 在一个"跟内容一样宽"的容器里毫无作用，缩略图仍然靠左。
   空状态那句「尚未上传商品图」还要靠 grid 居中，所以只在有图时覆盖。 */
.image-preview.is-filled { display: block; }

/* 商品图缩略图（用户 2026-10-18：原来的 92×92 放在 336px 高的框里，"太违和、图片太小"）。
   现在是「单张 260 / 多张 168」两档，整组居中；外面那圈虚线框不再写死 336px 高 ——
   固定高度配小图就是大片空白的来源。点图能看原图（.product-image-open 走 data-order-image）。 */
/* justify-content 用 flex-start 而不是 center：多图换行时每行各自居中会让行首参差不齐
   （9 张时量出 5 种不同的 left）。整组居中交给外层 #imagePreview.is-filled 的
   width:fit-content + justify-self:center 完成，单张时效果一样。 */
.product-image-list { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 12px; width: 100%; padding: 0; box-sizing: border-box; }
.product-image-item { position: relative; width: 168px; height: 168px; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: #f8fafc; }
.product-image-list.is-single .product-image-item { width: 300px; height: 300px; }
/* <img> 单独包一层按钮：不能把整个 .product-image-item 变成按钮 —— 里面还有「×」移除按钮，
   button 套 button 是非法结构，点 × 会连带把大图预览弹出来。 */
.product-image-open { display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
/* 用 .product-image-item 当锚点而不是 .product-image-open：按钮将来若被去掉，图还得是 100%，
   否则会落回 .image-preview img 的 height:230px（0,1,1 同权重，谁在后面谁赢）。 */
.product-image-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-image-item.is-primary { border-color: var(--primary);  }
.product-image-flag { position: absolute; left: 0; bottom: 0; z-index: 1; padding: 1px 6px; border-radius: 0 4px 0 4px; background: var(--primary); color: #fff; font-size: 11px; font-style: normal; font-weight: 600; }
.product-image-drop { position: absolute; z-index: 2; right: 2px; top: 2px; width: 20px; min-width: 20px; height: 20px; min-height: 20px; padding: 0; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(15, 23, 42, .62); color: #fff; font-size: 14px; font-weight: 600; line-height: 1; cursor: pointer; }
.product-image-drop:hover { background: var(--rose); }
/* 以前写死 min-height: 336px —— 配 92px 的小缩略图就是「图缩在左上角、右下大片空白」的元凶。
   现在高度跟着内容走：没图时由 .image-preview 的 126px 兜底，有图时是缩略图本身的高度。 */
.product-image-row {
  display: block;
  padding-bottom: 4px;
}
.product-editor-label {
  gap: 8px;
}
.product-editor-label > span {
  color: var(--muted);
  font-size: 13px;
}
.rich-editor-shell {
  border: 1px solid #d7e3ee;
  border-radius: 4px;
  background: #fff;
  overflow: hidden;
}
.rich-toolbar {
  display: grid;
  gap: 6px;
  padding: 8px;
  border-bottom: 1px solid #e2edf7;
  background: #fff;
}
.rich-toolbar-help {
  margin: 0 0 2px;
  color: #64748b;
  font-size: 12px;
  font-weight: 500;
}
.rich-toolbar-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  align-items: center;
}
.rich-toolbar button,
.rich-toolbar select {
  min-height: 32px;
  border: 1px solid #d8e3ee;
  border-radius: 0;
  padding: 6px 10px;
  background: #fff;
  color: #172033;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.rich-toolbar-row > :first-child {
  border-radius: 4px 0 0 4px;
}
.rich-toolbar-row > :last-child {
  border-radius: 0 4px 4px 0;
}
.rich-toolbar-row > * + * {
  margin-left: -1px;
}
.rich-toolbar select {
  min-width: 118px;
  font-weight: 600;
}
.rich-toolbar .tool-btn {
  min-width: 64px;
  text-align: center;
}
.rich-toolbar .strong { font-weight: 600; }
.rich-toolbar .underline { text-decoration: underline; }
.rich-toolbar .strike { text-decoration: line-through; }
.rich-toolbar button:hover,
.rich-toolbar select:hover {
  position: relative;
  z-index: 1;
  border-color: #38bdf8;
  background: #eefaff;
}
.rich-editor-shell textarea {
  min-height: 128px;
  border: 0;
  border-radius: 0;
  background: #fff;
  resize: vertical;
}
/* 商品图预览框（用户 2026-10-18：图太小、位置太违和）。
   原来是 width:min(320px,100%) + height:320px + aspect-ratio:1/1 + justify-self:start ——
   外层 .product-image-row 有 822px 宽，框却只占左边 320，右边全是空；框里再放 92px 的缩略图，
   就是截图里那种"小图飘在左上角"。现在框撑满整行、高度跟着缩略图走。 */
#imagePreview {
  width: 100%;
  height: auto;
  min-height: 126px;
  justify-self: stretch;
  border: 1px dashed #bfd3e7;
  background: #fff;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  background-size: 20px 20px;
}
/* 有图时：虚线框只包住图片本身（fit-content），并在整行里居中。
   撑满 822px 再往里放一张 260 的图，左右各空 280px —— 那还是"框大图小"，只是从靠左变成居中而已。 */
#imagePreview.is-filled {
  width: fit-content;
  max-width: 100%;
  justify-self: center;
  padding: 10px;
}
#imagePreview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
}
/* 缩略图格子是固定方块，必须 cover 填满（否则竖版海报会在格子里留白边）。
   ⚠️ 特异性要压过上面的 #imagePreview img（1,0,1）—— 只写 .product-image-item img（0,1,1）赢不了。 */
#imagePreview .product-image-item img {
  object-fit: cover;
}
#heroImagePreview {
  width: min(320px, 100%);
  height: min(320px, calc(96vw - 72px));
  aspect-ratio: 1 / 1;
  min-height: 0;
  justify-self: start;
  border: 1px dashed #bfd3e7;
  background: #fff;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  background-size: 20px 20px;
}
#heroImagePreview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
}
.hero-upload-field {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}
.product-upload-field {
  display: grid;
  gap: 7px;
}
.saved-file-control {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 10px;
  border: 1px solid #bfd3e7;
  border-radius: 4px;
  background: #f8fbff;
}
.saved-file-control button {
  flex: 0 0 auto;
  border: 0;
  border-radius: 4px;
  padding: 8px 14px;
  color: #fff;
  background: var(--primary);
  font-weight: 600;
}
.saved-file-control span,
.saved-file-control a {
  min-width: 0;
  overflow: hidden;
  color: #475569;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.saved-file-control a[href] {
  color: #0879b5;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.visually-hidden-file {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.product-page { display: grid; gap: 14px; }
.product-filter { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; padding: 20px; border: 1px solid var(--line); border-radius: 4px; background: #fff; }
.product-filter-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.product-filter-actions button, .product-pagination button, .product-row-actions button, .product-dialog footer button { border: 1px solid var(--line); border-radius: 4px; padding: 9px 14px; color: var(--primary); background: #fff; font-weight: 600; cursor: pointer; }
.product-filter-actions button:active, .product-pagination button:active, .product-row-actions button:active, .product-dialog footer button:active, .product-dialog footer button.is-clicking {  opacity: .82; }
.product-filter-actions .plain, .product-dialog footer .plain { color: #475569; background: #f1f5f9; }
.product-filter-actions .soft { color: var(--primary); background: #fff; border-color: #c6d6ef; }
.product-filter-actions .danger { color: var(--rose); background: var(--rose-soft); }
.product-table-wrap { border: 1px solid var(--line); border-radius: 4px; background: #fff; overflow: auto;  }
.product-tabs { display: flex; gap: 22px; padding: 16px 16px 0; border-bottom: 1px solid var(--line); }
.product-tabs button { min-height: 36px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; padding: 0 0 12px; color: #4b515b; background: transparent; font-weight: 400; }
.product-tabs button.active { color: var(--primary); border-bottom-color: var(--primary); }

.product-table { min-width: 1320px; }
.product-table th { white-space: nowrap; }
.product-table td { color: #334155; }
.product-info-cell { display: grid; grid-template-columns: 52px minmax(160px, 1fr); gap: 10px; align-items: center; }
.product-info-cell strong, .product-info-cell small { display: block; }
.product-info-cell small, .product-table small { color: #64748b; margin-top: 4px; }
.product-thumb { position: relative; width: 52px; height: 42px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 4px; color: #94a3b8; background: #f8fafc; overflow: hidden; }

.product-thumb-count { position: absolute; right: 0; bottom: 0; min-width: 14px; padding: 0 3px; border-radius: 4px 0 0 0; background: rgba(15, 23, 42, .72); color: #fff; font-size: 10px; font-style: normal; font-weight: 600; text-align: center; }
.product-thumb img { width: 100%; height: 100%; object-fit: cover; }

.product-thumb-button { width: 100%; height: 100%; display: block; padding: 0; border: 0; border-radius: 0; background: transparent; cursor: zoom-in; }
.product-thumb-button:focus-visible { outline: 2px solid #1769db; outline-offset: -2px; }
.product-thumb-button img { display: block; width: 100%; height: 100%; object-fit: cover; }

.admin-image-preview-nav { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; padding: 6px 10px; border-radius: 4px; background: rgba(15, 23, 42, .72); color: #fff; font-size: 13px; font-weight: 600; }
.admin-image-preview-nav[hidden] { display: none; }
.admin-image-preview-nav button { width: 32px; height: 32px; border: 1px solid rgba(255, 255, 255, .5); border-radius: 50%; background: rgba(255, 255, 255, .12); color: #fff; font-size: 20px; line-height: 1; cursor: pointer; }
.admin-image-preview-nav button:hover { background: rgba(255, 255, 255, .28); }
.admin-image-preview-nav [data-preview-counter] { min-width: 44px; text-align: center; font-variant-numeric: tabular-nums; }

.product-row-actions button { min-height: 28px; padding: 4px 0; border: 0; color: var(--primary); background: transparent; font-weight: 400; }
.product-status-toggle {
  width: 70px;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 7px;
  padding: 4px 8px;
  border: 0;
  border-radius: 4px;
  color: #2563eb;
  background: transparent;
  font-weight: 600;
  cursor: pointer;
}
.product-status-toggle i {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  border-radius: 50%;
  
  background: #22c55e;
  border: 1.5px solid #22c55e;
  
}
.product-status-toggle.is-hidden { color: #64748b; }

.product-status-toggle.is-hidden i { background: #ef4444; border-color: #ef4444;  }
.product-status-toggle:hover { background: #eff6ff; }
.product-status-toggle.is-hidden:hover { background: #f1f5f9; }
.product-status-toggle:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }
.product-pagination { display: flex; justify-content: flex-end; align-items: center; gap: 10px; padding: 14px 16px; border-top: 1px solid var(--line); }
.product-pagination button { min-width: 32px; padding: 6px 10px; color: var(--text); background: #fff; border: 1px solid var(--line); font-weight: 400; }
.product-pagination button.active { color: #fff; background: var(--primary); border-color: var(--indigo); }
#productPages { display: flex; gap: 6px; }
.product-modal { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 24px; background: rgba(15, 23, 42, .35); }
.product-lottery-badge {
  display: inline-flex;
  margin-left: 7px;
  padding: 2px 6px;
  border-radius: 4px;
  color: #92400e;
  background: #fef3c7;
  font-size: 10px;
  font-style: normal;
  vertical-align: middle;
}
.wallet-table .wallet-balance {
  color: #0f766e;
  font-size: 15px;
}
.customer-wallet-table .wallet-balance { color: var(--rose); }
/* 员工列表的余额跟客户钱包统一走红色。权重必须写到 (0,3,0) 才压得过上面那条
   `.wallet-table .wallet-balance` (0,2,0) —— 只写单类名会被它盖回去。 */
.wallet-table .wallet-balance.staff-wallet-balance { color: var(--rose); }
.wallet-table button[data-wallet-credit] {
  border-color: #0ea5a8;
  color: #fff;
  background: var(--primary);
  white-space: nowrap;
}
.wallet-list-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid #d8e3ee;
  border-radius: 4px;
  background: #f8fbff;
}
.wallet-list-toolbar label {
  width: min(520px, 100%);
  color: #475569;
  font-weight: 600;
}
.wallet-list-toolbar input[type="search"] {
  height: 40px;
  background: #fff;
}
.wallet-list-toolbar > span {
  padding-bottom: 10px;
  color: #64748b;
  font-size: 13px;
  white-space: nowrap;
}
.wallet-search-empty td {
  padding: 28px 12px;
  color: #64748b;
  text-align: center;
}
.wallet-loading,
.wallet-error {
  color: #64748b;
}
.wallet-credit-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, .46);
}
.wallet-credit-dialog {
  width: min(420px, 100%);
  padding: 20px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background: #fff;
  
}
.wallet-credit-dialog header,
.wallet-credit-dialog footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.wallet-credit-dialog header {
  margin-bottom: 18px;
}
.wallet-credit-dialog header h3,
.wallet-credit-dialog header p {
  margin: 0;
}
.wallet-credit-dialog header p,
.wallet-credit-hint {
  margin-top: 5px;
  color: #64748b;
  font-size: 12px;
}
.wallet-credit-dialog header button {
  width: 34px;
  height: 34px;
  padding: 0;
  color: #fff;
  background: var(--primary);
}
.wallet-credit-dialog label {
  display: grid;
  gap: 7px;
  margin-top: 14px;
  color: #334155;
  font-weight: 600;
}
.wallet-amount-input {
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  overflow: hidden;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
}
.wallet-amount-input b {
  display: grid;
  align-self: stretch;
  place-items: center;
  color: #0f766e;
  background: #ecfdf5;
}
.wallet-amount-input input {
  border: 0;
  border-radius: 0;
}
.wallet-credit-dialog textarea {
  min-height: 88px;
}
.wallet-credit-dialog footer {
  justify-content: flex-end;
  margin-top: 18px;
}
.wallet-credit-dialog footer .ghost {
  color: #475569;
  background: #f1f5f9;
}

.staff-grant-panel { margin-top: 14px; }
.staff-grant-panel .wallet-credit-hint { margin: -4px 0 12px; }
.staff-grant-name { color: #0f172a; font-size: 14px; }
.staff-grant-id {
  border-radius: 4px;
  padding: 3px 8px;
  color: #0f766e;
  background: #ecfdf5;
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  font-weight: 600;
}
.staff-grant-empty { padding: 26px 12px; color: #64748b; text-align: center; }
.staff-grant-table td { vertical-align: middle; }
button.staff-revoke-button {
  border: 1px solid #fecdd3;
  border-radius: 4px;
  padding: 7px 14px;
  color: #fff;
  background: #d93d43;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
button.staff-revoke-button:hover:not(:disabled) {
  border-color: #e8576f;
  color: #fff;
  background: #d93d43;
  
}
button.staff-revoke-button:disabled { opacity: .62; cursor: progress; }

.admin-toast-stack {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 1400;
  display: grid;
  gap: 10px;
  width: min(340px, calc(100vw - 44px));
}

.admin-toast strong { display: block; color: #0f172a; font-size: 13px; }
.admin-toast span { display: block; margin-top: 4px; color: #64748b; font-size: 12px; }
.admin-toast.is-success { border-left-color: #10b981; }
.admin-toast.is-error { border-left-color: #e8576f; }

.admin-confirm-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, .46);
  
}
.admin-confirm-dialog {
  width: min(430px, 100%);
  padding: 20px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background: #fff;
  
}
.admin-confirm-dialog h3 { margin: 0; color: #0f172a; font-size: 17px; }
.admin-confirm-dialog p { margin: 9px 0 0; color: #64748b; font-size: 13px; line-height: 1.6; }
.admin-confirm-target {
  margin-top: 13px;
  padding: 10px 12px;
  border: 1px solid #fecdd3;
  border-radius: 4px;
  color: #9f1239;
  background: #fff5f6;
  font-size: 13px;
  font-weight: 600;
}
.admin-confirm-dialog footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.admin-confirm-dialog footer button { border: 0; border-radius: 4px; padding: 10px 16px; font-weight: 600; }
.admin-confirm-cancel { color: #475569; background: #f1f5f9; }
.admin-confirm-ok { color: #fff; }
.admin-confirm-ok.is-danger { background: var(--rose); }
.admin-confirm-ok.is-primary { background: var(--primary); }
.wallet-ledger-stats { margin: 4px 0 6px; }
.wallet-ledger-stats .stat-card strong { font-size: 24px; }
.wallet-ledger-subtitle { margin: 20px 0 10px; font-size: 15px; color: #0f172a; }
.wallet-ledger-table small { display: block; margin-top: 3px; color: #64748b; font-size: 12px; }
.wallet-ledger-table td { vertical-align: top; }
.wallet-ledger-income { color: #0f766e; font-weight: 600; white-space: nowrap; }
.wallet-ledger-expense { color: #b91c1c; font-weight: 600; white-space: nowrap; }
.wallet-ledger-amount { font-weight: 600; white-space: nowrap; }
.wallet-ledger-amount.is-income { color: #0f766e; }
.wallet-ledger-amount.is-expense { color: #b91c1c; }
.wallet-ledger-link {
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 6px 10px;
  color: #168fd0;
  background: #fff;
  font-weight: 600;
  white-space: nowrap;
}
.wallet-ledger-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
button.wallet-ledger-credit {
  border: 0;
  border-radius: 4px;
  padding: 7px 12px;
  color: #fff;
  background: var(--primary);
  
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.wallet-ledger .admin-toolbar-actions .admin-add-button { order: -1; }
.lottery-pool-table-wrap { overflow-x: auto; }

.lottery-pool-table td > small { display: block; margin-top: 4px; color: var(--muted); }
.lottery-prize-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 3px 5px 3px 0;
  padding: 4px 7px;
  border-radius: 4px;
  color: #155e75;
  background: #ecfeff;
  font-size: 12px;
}
.lottery-prize-tag img { width: 26px; height: 26px; flex: 0 0 26px; border-radius: 4px; object-fit: cover; }
.lottery-pool-backdrop {
  position: fixed;
  inset: 0;
  z-index: 320;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, .38);
}
.lottery-pool-dialog {
  width: min(900px, calc(100vw - 32px));
  height: min(680px, calc(100vh - 40px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border-radius: 4px;
  background: #fff;
  
}
.lottery-pool-dialog > header,
.lottery-pool-dialog > footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}
.lottery-pool-dialog > header h3 { margin: 0; font-size: 16px; }
.lottery-pool-dialog > header > button { width: 34px; min-width: 34px; height: 34px; padding: 0; border: 0; color: var(--muted); background: transparent; font-size: 20px; }
.lottery-pool-dialog > footer { justify-content: flex-end; border-top: 1px solid var(--line); border-bottom: 0; background: #fff; }
.lottery-save-status { min-height: 20px; margin-right: auto; color: #0f766e; font-size: 12px; font-weight: 600; }
.lottery-save-status.is-error { color: #dc2626; }
#saveLotteryPoolBtn { min-width: 76px; }
#saveLotteryPoolBtn:disabled { cursor: wait; opacity: .68; }
.admin-save-feedback { margin: -2px 0 12px; padding: 9px 12px; border: 1px solid #a7f3d0; border-radius: 4px; color: #047857; background: #ecfdf5; font-size: 13px; font-weight: 600; }
.lottery-pool-form { display: block; padding: 22px 52px 36px; overflow: auto; }
.lottery-form-row { display: grid; grid-template-columns: 110px minmax(0, 1fr); align-items: center; gap: 14px; margin-bottom: 16px; }
.lottery-form-row > label,
.lottery-row-label { color: #172033; font-size: 14px; font-weight: 600; text-align: right; }
.lottery-form-row > input { height: 42px; background: #fff; }
.lottery-prize-editor-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.lottery-prize-editor-head strong { font-size: 16px; }
.lottery-percent-input { display: flex; align-items: center; gap: 10px; min-width: 0; }
.lottery-percent-input input { min-width: 0; width: 100%; }
.lottery-probability-total { text-align: right; color: #555; font-size: 13px; }
.lottery-prize-editor-head button { min-height: 34px; border: 0; border-radius: 4px; padding: 0 13px; color: #fff; background: var(--primary); font-weight: 600; }
.lottery-prize-rows { display: grid; }
.lottery-prize-row { position: relative; padding: 22px 40px 6px 0; border-bottom: 1px solid #edf2f7; }
.lottery-remove-prize { position: absolute; top: 22px; right: 0; width: 32px; height: 32px; padding: 0; border: 1px solid #fecaca; border-radius: 4px; color: #dc2626; background: #fff5f5; font-size: 18px; }
.lottery-prize-image-control { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: stretch; gap: 6px; }
.lottery-prize-image-value { min-width: 0; min-height: 42px; display: flex; align-items: center; gap: 10px; overflow: hidden; border: 1px solid var(--line); border-radius: 4px; padding: 4px 10px; background: #fff; }
.lottery-prize-image-value img { width: 38px; height: 32px; flex: 0 0 38px; border-radius: 4px; object-fit: cover; }
.lottery-prize-image-value span { min-width: 0; }
.lottery-prize-image-value strong,
.lottery-prize-image-value small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lottery-prize-image-value strong { color: #475569; font-size: 12px; }.lottery-prize-image-value small { margin-top: 2px; color: #94a3b8; font-size: 10px; }
.lottery-upload-image { min-width: 86px; min-height: 42px; display: grid; place-items: center; margin: 0; border: 0; border-radius: 4px; color: #fff; font-size: 13px; font-weight: 600; background: var(--primary); }
.lottery-upload-image:disabled { cursor: wait; opacity: .65; }
.product-dialog { width: min(860px, 96vw); max-height: 88vh; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; border-radius: 4px; background: #fff;  overflow: hidden; }
.product-dialog header, .product-dialog footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.product-dialog footer { position: relative; z-index: 4; justify-content: flex-end; border-top: 1px solid var(--line); border-bottom: 0; background: rgba(255, 255, 255, .96);  pointer-events: auto; }
.product-dialog header button { border: 0; color: var(--muted); background: transparent; font-size: 24px; }
.product-dialog .form-grid {
  align-items: start;
  gap: 18px 14px;
  padding: 18px;
  overflow: auto;
}
.product-dialog textarea {
  min-height: 78px;
  resize: vertical;
}
.staff-level-table input,
.staff-level-table select {
  min-width: 86px;
  padding: 7px 9px;
}
.staff-level-table input[type="checkbox"] {
  width: 18px;
  min-width: 18px;
  height: 18px;
}
.staff-level-table button { color: #d93d43; border-color: #f1c4c6; background: #fff; font-weight: 400; }
.staff-level-table tr:nth-child(1) td:first-child input { border-color: #f7c948; background: #fff9db; }

.merchant-create { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; align-items: end; }
.data-list { display: grid; gap: 8px; }
.list-item { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--line); border-left: 1px solid var(--line); border-radius: 4px; background: #f8fbff; }
.list-item small { display: block; color: var(--muted); margin-top: 4px; }
.list-actions { display: flex; gap: 7px; }
.list-actions button { border: 1px solid var(--line); border-radius: 4px; padding: 6px 10px; color: var(--text); background: #fff; font-weight: 400; }
.list-actions button.danger { color: #d93d43; border-color: #f1c4c6; background: #fff; }

.list-item.is-current { border-left-color: var(--primary); background: #fff;  }
.list-item .tag { margin-left: 7px; }
.list-actions .enter-merchant-btn { color: #075985; border-color: var(--primary); background: var(--cyan-soft); font-weight: 600; }
.list-actions .enter-merchant-btn:hover { background: #fff; }
.server-edit-main { flex: 1; min-width: 0; }
.server-edit-main input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 12px;
  background: #fff;
  color: var(--text);
}
.game-server-category-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.category-server-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(14, 165, 233, .24);
  border-left: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
}
.category-server-card header {
  margin-bottom: 12px;
}
.category-server-card header strong,
.category-server-card header small {
  display: block;
}
.category-server-card header strong {
  color: var(--text);
  font-size: 16px;
}
.category-server-card header small {
  margin-top: 4px;
  color: var(--muted);
}
.server-add-row {
  margin-top: 0;
}
.category-server-card .list-item {
  align-items: flex-end;
}
.empty { color: var(--muted); padding: 14px; border-radius: 4px; background: #f8fbff; }
.category-manager {
  padding: 0;
  overflow: hidden;
  border-top-color: #2563eb;
}
.category-create-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-bottom: 14px;
}
.category-create-row.compact {
  margin: 12px 0 0;
}
.category-create-row input,
.category-inline-editor input,
.category-inline-editor select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 12px;
  background: #fff;
  color: var(--text);
}
.category-create-row button,
.category-inline-editor button {
  border: 0;
  border-radius: 4px;
  padding: 0 13px;
  color: #fff;
  background: var(--primary);
  font-weight: 600;
}
.category-inline-editor label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}
.category-table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px 12px;
  background: #fff;
}
.category-toolbar-actions,
.category-search,
.category-row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

button.admin-icon-reset {
  width: 42px;
  min-width: 42px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--primary);
  background: #fff;
  
  font-size: 19px;
  font-weight: 600;
  line-height: 36px;
}

button.admin-add-button {
  min-height: 36px;
  padding: 0 18px;
  border: 0;
  border-radius: 4px;
  color: #fff;
  background: var(--primary);
  
  font-weight: 600;
}

button.admin-icon-reset:hover { background: #fff; }
button.admin-add-button:hover { background: var(--primary); }
.category-auto-save-note {
  margin-left: 4px;
  color: #0f766e;
  font-size: 12px;
  font-weight: 600;
}
.category-action {
  min-height: 36px;
  border: 0;
  border-radius: 4px;
  padding: 0 15px;
  color: #fff;
  font-weight: 600;
  
}
.category-action.refresh { background: var(--primary); }
.category-action.add { background: var(--primary); }
.category-action.edit { color: var(--primary); background: #fff; border: 1px solid #c6d6ef; }
.category-action.delete { background: #d93d43; }
.category-action.servers { background: var(--primary); }
.category-action:disabled {
  cursor: not-allowed;
  opacity: .42;
  
}
.category-search input {
  width: min(270px, 28vw);
  min-height: 38px;
  border: 1px solid #dce3ec;
  border-radius: 4px;
  padding: 0 12px;
  background: #fff;
}
.category-search button {
  min-width: 62px;
  min-height: 38px;
  border: 0;
  border-radius: 4px;
  color: #fff;
  background: var(--primary);
  font-weight: 600;
}
.category-create-panel {
  display: grid;
  grid-template-columns: minmax(160px, .35fr) minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  margin: 0 18px 14px;
  padding: 14px;
  border: 1px solid #99f6e4;
  border-left: 1px solid var(--line);
  border-radius: 4px;
  background: #f0fdfa;
}
.category-create-panel .category-create-row {
  grid-template-columns: minmax(0, 1fr) auto auto;
  margin: 0;
}
.category-create-panel .category-create-row button {
  color: #fff;
  background: var(--primary);
}
.category-create-panel .category-create-row .category-create-cancel {
  color: #475569;
  background: #e2e8f0;
}
.category-table-wrap {
  width: 100%;
  overflow-x: auto;
}
.category-data-table {
  width: 100%;
  min-width: 800px;
  border-collapse: collapse;
}
.category-data-table th {
  padding: 12px 10px;
  border-bottom: 1px solid #e5eaf1;
  color: #334155;
  background: #f4f7fb;
  font-size: 12px;
  text-align: left;
  white-space: nowrap;
}
.category-data-table td {
  padding: 11px 10px;
  border-bottom: 1px solid #edf1f5;
  color: #334155;
  vertical-align: middle;
}
.category-data-table th:first-child,
.category-data-table td:first-child {
  width: 42px;
  text-align: center;
}

.category-data-table th:nth-child(6),
.category-data-table td:nth-child(6) {
  width: 88px;
  text-align: center;
}
.category-data-table th:nth-child(7),
.category-data-table td:nth-child(7) {
  width: 120px;
}
.category-data-table th:last-child,
.category-data-table td:last-child {
  width: 210px;
}
.category-data-row:hover td,
.category-data-row.is-editing td {
  background: #f8fbff;
}
.category-data-row td > strong,
.category-data-row td > small {
  display: block;
}
.category-data-row td > small {
  margin-top: 4px;
  color: #94a3b8;
  font-size: 12px;
}
.category-id {
  color: #64748b;
  font-weight: 600;
}
.category-table-image {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  margin: auto;
  border: 1px dashed #cbd5e1;
  border-radius: 4px;
  color: #94a3b8;
  background: #f8fafc;
  font-size: 11px;
  overflow: hidden;
}
.category-table-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.category-count-badge {
  display: inline-grid;
  min-width: 30px;
  height: 26px;
  place-items: center;
  border-radius: 4px;
  color: #075985;
  background: #e0f2fe;
  font-weight: 600;
}
.category-visibility-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.category-visibility-status i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.category-visibility-status.visible {
  color: #047857;
  background: #d1fae5;
}
.category-visibility-status.visible i {
  background: #10b981;
  
}
.category-visibility-status.hidden {
  color: #64748b;
  background: #e2e8f0;
}
.category-visibility-status.hidden i {
  background: #94a3b8;
  
}
.category-server-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.category-server-status i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2563eb;
  
}
.category-row-actions button {
  min-height: 31px;
  border: 0;
  border-radius: 4px;
  padding: 0 10px;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}
.category-row-actions .edit { color: var(--primary); background: #fff; border: 1px solid #c6d6ef; }
.category-row-actions .delete { color: #d93d43; background: #fff; border: 1px solid #f1c4c6; }
.category-row-actions .category-drag-handle {
  width: auto;
  min-width: 72px;
  height: 31px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 11px;
  border: 1px solid #1d4ed8;
  color: #fff;
  background: #2563eb;
  
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.category-row-actions .category-drag-handle:hover {
  background: #1d4ed8;

}
.category-row-actions .category-drag-handle:active,
.category-row-actions .category-drag-handle.is-arming {
  cursor: grabbing;
  border-color: #d97706;
  background: #f59e0b;

}
.category-row-actions .category-drag-handle.is-active {
  border-color: #c2410c;
  background: #ea580c;

}
.category-drag-dots {
  display: grid;
  grid-template-columns: repeat(2, 4px);
  grid-template-rows: repeat(3, 4px);
  gap: 3px;
}
.category-drag-dots i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
}
.category-drag-label {
  line-height: 1;
  white-space: nowrap;
}
.category-drag-banner {
  position: fixed;
  z-index: 80;
  top: 22px;
  left: 50%;
  display: none;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 9px 18px;
  border: 3px solid #f59e0b;
  border-radius: 4px;
  color: #fff;
  background: #172033;
  
  transform: translateX(-50%);
  pointer-events: none;
}
.category-drag-banner strong {
  color: #fbbf24;
  font-size: 15px;
}
.category-drag-banner span {
  color: #fff;
  font-size: 13px;
}
.category-reordering .category-drag-banner {
  display: flex;
  
}
.category-data-row.is-dragging td {
  color: #7c2d12;
  background: #fff7ed !important;
  border-top: 2px solid #f97316;
  border-bottom: 2px solid #f97316;
  
  opacity: 1;
}
.category-data-row.is-dragging td:first-child {
  border-left: 5px solid #f97316;
}
.category-data-row.is-dragging td:last-child {
  border-right: 2px solid #f97316;
}
.category-data-row.drop-before td,
.category-data-row.drop-after td {
  background: #ecfdf5 !important;
  color: #065f46;
}
.category-data-row.drop-before td {
  border-top: 5px solid #10b981;
}
.category-data-row.drop-after td {
  border-bottom: 5px solid #10b981;
}
.category-reordering,
.category-reordering * {
  cursor: grabbing !important;
  user-select: none !important;
}

.category-editor-backdrop {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, .32);
}
.category-editor-dialog {
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  
}
.category-editor-dialog-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.category-editor-dialog-head h3,
.category-editor-dialog-head p {
  margin: 0;
}
.category-editor-dialog-head h3 {
  color: #0f172a;
  font-size: 17px;
}
.category-editor-dialog-head p {
  margin-top: 3px;
  color: #64748b;
  font-size: 12px;
}
.category-editor-close {
  width: 34px;
  min-width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  color: #475569;
  background: #f1f5f9;
  font-size: 20px;
  line-height: 1;
}
.category-editor-dialog-footer {
  display: flex;
  justify-content: flex-end;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: #fff;
}
.category-editor-dialog-footer button {
  min-width: 88px;
  min-height: 36px;
  border: 0;
  border-radius: 4px;
  color: #fff;
  background: var(--primary);
  font-weight: 600;
}

.category-editor-note {
  margin-right: auto;
  color: #0f766e;
  font-size: 12px;
  font-weight: 600;
}
.category-inline-editor {
  padding: 16px;
  text-align: left;
}
.category-editor-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 180px minmax(250px, .8fr);
  align-items: start;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.category-field {
  color: #475569 !important;
  font-weight: 600;
}
.category-field > span,
.category-image-copy > span {
  color: #475569;
  font-size: 13px;
  font-weight: 600;
}
.category-field small {
  color: #94a3b8;
  font-size: 12px;
  font-weight: 400;
}
.category-editor-section {
  padding-top: 16px;
}
.category-editor-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.category-editor-title span {
  color: #64748b;
  font-size: 12px;
}
.category-image-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}
.category-image-copy {
  display: grid;
  align-content: center;
}
.category-image-preview {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: #94a3b8;
  background: #f8fafc;
  font-size: 11px;
  overflow: hidden;
}
.category-image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.category-image-upload {
  width: auto;
  min-height: 34px;
  align-content: center;
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 11px;
  color: #334155;
  background: #fff;
  font-weight: 600;
  cursor: pointer;
}
.category-image-upload input {
  display: none;
}
.sub-category-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.sub-category-chip {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  width: min(260px, 100%);
  padding: 0;
  border-radius: 4px;
  background: transparent;
}
.sub-category-name {
  flex: 1;
  min-width: 0;
}
.sub-category-name small {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: #64748b;
}
.sub-category-chip input {
  width: 100%;
  min-width: 0;
  min-height: 30px;
  border-radius: 4px;
}
.sub-category-chip button {
  width: 30px;
  min-width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 4px;
  color: #fff;
  background: var(--primary);
}
.sub-category-chip .sub-category-visibility {
  width: 48px;
  min-width: 48px;
  font-size: 13px;
  color: #0f766e;
  background: #e4f5f1;
}
.sub-category-chip.is-hidden input {
  color: #94a3b8;
  background: #f8fafc;
}
.sub-category-chip.is-hidden .sub-category-visibility {
  color: #64748b;
  background: #f1f5f9;
}
.category-empty-row {
  height: 120px;
  color: #94a3b8 !important;
  text-align: center;
}
.category-table-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px;
  color: #64748b;
  background: #f8fafc;
  font-size: 12px;
}

@media (max-width: 980px) {
  .admin-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .stats-grid, .overview-grid, .split, .form-grid, .switch-grid, .member-benefit-grid, .merchant-create, .log-summary { grid-template-columns: 1fr; }
  .topbar, .merchant-strip { align-items: stretch; flex-direction: column; }
  .game-server-category-grid { grid-template-columns: 1fr; }
  .category-table-toolbar, .category-create-panel { align-items: stretch; grid-template-columns: 1fr; flex-direction: column; }
  .category-toolbar-actions { flex-wrap: wrap; }
  .category-search input { width: 100%; flex: 1; }
  .category-search { width: 100%; }
  .category-editor-grid { grid-template-columns: 1fr; }
  .wallet-list-toolbar { align-items: stretch; flex-direction: column; }
  .wallet-list-toolbar label { width: 100%; }
  .wallet-list-toolbar > span { padding-bottom: 0; }
  .lottery-pool-backdrop { padding: 12px; }
  .lottery-pool-dialog { width: calc(100vw - 24px); height: min(720px, calc(100vh - 24px)); }
  .lottery-pool-form { padding: 18px 20px 28px; }
  .lottery-form-row { grid-template-columns: 1fr; gap: 7px; }
  .lottery-form-row > label,
  .lottery-row-label { text-align: left; }
}
.live-order-tracker {
  grid-column: 1 / -1;
  padding: 14px;
  border: 1px solid #b9dfe8;
  border-radius: 4px;
  background: #f7fcfd;
}

.live-order-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.live-order-head strong,
.live-order-head small {
  display: block;
}

.live-order-head strong {
  color: #173143;
  font-size: 14px;
}

.live-order-head small {
  margin-top: 4px;
  color: #66808e;
  line-height: 1.5;
}

.live-order-head .tag.error {
  border-color: #f4b9b7;
  color: #b8322e;
  background: #fff1f0;
}

.live-order-feed {
  display: grid;
  border-top: 1px solid #dcecf0;
}

.live-order-row {
  display: grid;
  grid-template-columns: 8px minmax(90px, auto) minmax(160px, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 38px;
  border-bottom: 1px solid #e5f0f3;
  color: #354a58;
}

.live-order-row:last-child {
  border-bottom: 0;
}

.live-order-row strong {
  color: #173143;
}

.live-order-row small {
  color: #78909c;
  text-align: right;
}

.live-order-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #16a085;
  
}

.live-order-empty {
  padding: 18px 4px 6px;
  color: #718792;
}

.live-order-empty.error {
  color: #b8322e;
}

@media (max-width: 760px) {
  .lottery-pool-dialog > header,
  .lottery-pool-dialog > footer { padding: 10px 12px; }
  .lottery-pool-form { padding: 14px 12px 22px; }
  .lottery-prize-editor-head { align-items: flex-start; gap: 10px; }
  .lottery-prize-row { padding-right: 0; padding-top: 54px; }
  .lottery-remove-prize { top: 12px; }
  .lottery-prize-image-control { grid-template-columns: 1fr 1fr; }
  .lottery-prize-image-value { grid-column: 1 / -1; }
  .live-order-head {
    align-items: center;
  }

  .live-order-row {
    grid-template-columns: 8px 1fr;
  }

  .live-order-row span:not(.live-order-dot),
  .live-order-row small {
    grid-column: 2;
    text-align: left;
  }
}

.admin-dialog {
  border: 1px solid #e2e5e9;
  border-radius: 4px;
  background: #fff;

}
.admin-dialog.wallet-credit-dialog,
.admin-dialog.admin-confirm-dialog {
  width: min(460px, 100%);
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  padding: 24px;
}
.admin-dialog > header {
  gap: 16px;
  background: #fff;
  border-bottom-color: #e8eaed;
}
.admin-dialog > header :is(h3, strong),
.admin-dialog > h3 {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  color: #23272f;
}
.admin-dialog > header p { font-weight: 400; line-height: 1.6; }
.admin-dialog > header > button {
  display: grid;
  place-items: center;
  flex: 0 0 32px;
  width: 32px;
  min-width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  
  color: var(--muted);
  font-size: 22px;
  font-weight: 400;
  line-height: 1;
}
.admin-dialog > header > button:hover:not(:disabled) { color: var(--text); background: #f3f4f6; }
.admin-dialog > footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid #e8eaed;
  background: #fff;
  
}
.admin-dialog:is(.wallet-credit-dialog, .admin-confirm-dialog) > footer { padding-top: 18px; margin-top: 22px; }
.admin-dialog > footer > button {
  appearance: none;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  flex: 0 0 auto;
  order: 1;
  min-width: 80px;
  min-height: 38px;
  padding: 8px 18px;
  border: 1px solid #1769db;
  border-radius: 4px;
  background: var(--primary);
  
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  letter-spacing: 0;
  cursor: pointer;
}
.admin-dialog > footer > button.is-primary { background: var(--primary);  }
.admin-dialog > footer > button:hover:not(:disabled) { background: var(--primary); border-color: #125abe; }
.admin-dialog > footer > button:is(.plain, .ghost, .admin-confirm-cancel) {
  order: 0;
  color: var(--primary);
  background: #fff;
  border-color: #d8dce2;
}
.admin-dialog > footer > button:is(.plain, .ghost, .admin-confirm-cancel):hover:not(:disabled) { background: #fff; border-color: #b8bec8; color: var(--primary); }
.admin-dialog > footer > button.is-danger { background: #d93d43; border-color: #d93d43;  }
.admin-dialog > footer > button.is-danger:hover:not(:disabled) { background: #d93d43; border-color: #bd2f35; }
.admin-dialog > footer > button:active:not(:disabled),
.admin-dialog > header > button:active:not(:disabled) { transform: none; opacity: 1; }
.admin-dialog button:focus-visible { outline: 2px solid #1769db; outline-offset: 3px; }
.admin-dialog > footer > button:disabled,
.admin-dialog > header > button:disabled { opacity: .45; cursor: not-allowed; transform: none;  }
.admin-dialog :is(input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="range"]), select, textarea) {
  border-color: #d8dce2;
  background-color: #fff;
  font-weight: 400;
}
.admin-dialog :is(input, select, textarea):focus { border-color: #5995e5;  }
.admin-dialog.wallet-credit-dialog label { font-weight: 500; }

@media (max-width: 480px) {
  .admin-dialog:is(.wallet-credit-dialog, .admin-confirm-dialog) { padding: 18px; }
  .admin-dialog > footer { gap: 8px; }
  .admin-dialog > footer > button { min-height: 40px; padding-inline: 14px; }
}

.review-summary { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.review-summary .tag { padding: 5px 12px; border-radius: 4px; background: var(--cyan-soft); color: var(--primary-dark); font-size: 13px; font-weight: 600; }

.review-summary .review-filter-tab:hover { border-color: var(--primary); background: var(--cyan-soft); }
.review-summary .review-filter-tab:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.review-audit-table { table-layout: fixed; }
.review-audit-table th:nth-child(1) { width: 132px; }

/* 操作列要放得下「同意投诉 / 驳回投诉」两颗按钮（实测并排 177px）——
   132px 会把第二颗挤出列外、被表格边界裁成「驳回投」（用户 2026-10-12 要的那两颗按钮）。
   三张审核表共用这条，提现 / 评价审核的「通过 / 驳回」跟着宽松一点，无害。 */
.review-audit-table th:nth-child(6) { width: 200px; }
.review-order-no { color: var(--muted); font-size: 12px; }
.review-stars { color: var(--orange); letter-spacing: 0; }
.review-content { white-space: normal; word-break: break-word; line-height: 1.6; }
.review-state { display: inline-block; padding: 3px 10px; border-radius: 4px; font-size: 12px; font-weight: 600; }
.review-state.is-pending { background: var(--amber-soft); color: #8a5a00; }
.review-state.is-approved { background: var(--green-soft); color: #0d6b53; }
.review-state.is-rejected { background: var(--rose-soft); color: #a3233c; }
.review-state.is-resolved { background: var(--green-soft); color: #0d6b53; }
.review-reason { color: var(--rose); }
.review-time { color: var(--muted); font-size: 12px; }
/* ⚠️ `td` 上**不能**挂 `display: flex`：td 会不再是 table-cell，高度塌成内容高，
   行分隔线（border-bottom）只画半截、比别的列高出一截 —— 用户 2026-10-11 截图报「对齐」的真因。
   两个按钮改走 inline-block + margin-left 排开，td 保持 table-cell，行高和分隔线就归位了。 */
.review-actions { vertical-align: middle; white-space: nowrap; }
.review-actions button + button { margin-left: 8px; }
.review-actions button { border: 0; border-radius: 4px; padding: 7px 12px; color: #fff; background: var(--primary); font-weight: 600;  }
.review-actions .review-reject-button { background: #d93d43;  }
.review-actions button[disabled] { opacity: .6; cursor: default; transform: none; }
.review-empty { padding: 18px 6px; color: var(--muted); line-height: 1.7; }
.admin-prompt-input { min-height: 84px; resize: vertical; margin-top: 4px; }
.panel-tip.full { display: block; margin-top: 12px; }
.admin-order-statuses { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 18px; }

.admin-order-scroll-controls label { color: var(--muted); font-size: 12px; }
.admin-order-scroll-controls input { width: 100%; height: 24px; padding: 0; border: 0; background: transparent;  appearance: none; cursor: ew-resize; }
.admin-order-scroll-controls input::-webkit-slider-runnable-track { height: 8px; border-radius: 4px; background: #dce7f1; }

.admin-order-scroll-controls input:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.admin-order-table-wrap { width: 100%; max-width: 100%; max-height: max(260px, calc(100dvh - 280px)); overflow-x: auto; overflow-y: auto; }
.admin-order-table-wrap::-webkit-scrollbar { width: 12px; height: 12px; }
.admin-order-table-wrap::-webkit-scrollbar-thumb { border: 2px solid #f4f8fc; border-radius: 4px; background: #8aa7bd; }

.order-list-table::-webkit-scrollbar:horizontal { height: 0; display: none; }
.admin-order-table { width: max-content; min-width: 100%; font-size: 13px; }
.admin-order-table th, .admin-order-table td { padding: 7px 8px; white-space: nowrap; vertical-align: middle; }
.admin-order-table thead th { position: sticky; top: 0; z-index: 2; }
.admin-order-table tbody tr { height: 56px; }

.admin-order-table th:last-child { z-index: 3; background: #f4f8fc; }
/* 订单状态标签：渐变胶囊 + 左侧状态点。
   每个状态只声明三个变量（--st-c 文字/圆点色、--st-a/--st-b 渐变两端），
   避免为每态重复写 padding / 圆角；新增状态只加一行变量即可。 */
.tag.admin-order-status-tag {
  --st-c: #606a78; --st-a: #f5f6f8; --st-b: #d7dbe2;
  display: inline-flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 12px 0 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; letter-spacing: .2px; white-space: nowrap;
  color: var(--st-c);
  background: linear-gradient(135deg, var(--st-a) 0%, var(--st-b) 100%);
  box-shadow: 0 1px 2px rgba(16, 24, 40, .06), inset 0 0 0 1px rgba(255, 255, 255, .7);
}
.tag.admin-order-status-tag::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; flex: 0 0 6px;
  background: var(--st-c);
  box-shadow: 0 0 0 2.5px rgba(255, 255, 255, .75);
}
.admin-order-status-tag[data-status="待付款"] { --st-c: #a86b0e; --st-a: #fff9ec; --st-b: #f8deab; }
.admin-order-status-tag[data-status="待接单"] { --st-c: #1461cf; --st-a: #eff6ff; --st-b: #c8dcfb; }
.admin-order-status-tag[data-status="待开始"] { --st-c: #5540cc; --st-a: #f3f0ff; --st-b: #d1c4ff; }
.admin-order-status-tag[data-status="服务中"] { --st-c: #0d6f67; --st-a: #eaf8f5; --st-b: #b6e5dc; }
.admin-order-status-tag[data-status="待结单"] { --st-c: #a82662; --st-a: #fdf1f7; --st-b: #f4c0d7; }
.admin-order-status-tag[data-status="已完成"] { --st-c: #1c7a51; --st-a: #eff9f3; --st-b: #b7e3ca; }
.admin-order-status-tag[data-status="已取消"] { --st-c: #606a78; --st-a: #f5f6f8; --st-b: #d7dbe2; }
.admin-order-status-tag[data-status="取消申请中"] { --st-c: #a84a08; --st-a: #fff6e9; --st-b: #f9cb9c; }
.admin-order-status-tag[data-status="取消已通过"] { --st-c: #455873; --st-a: #f0f3f7; --st-b: #ccd5e2; }
.admin-order-status-tag[data-status="取消已驳回"] { --st-c: #39568a; --st-a: #eff4fb; --st-b: #c8d8ee; }
.admin-order-status-tag[data-status="退款中"] { --st-c: #b03c0a; --st-a: #fff4ea; --st-b: #f9c49b; }
.admin-order-status-tag[data-status="退款异常"] { --st-c: #8c2f0f; --st-a: #fff2ea; --st-b: #f6c3a8; }
.admin-order-status-tag[data-status="退款失败"] { --st-c: #b31f1f; --st-a: #fff1f0; --st-b: #f6bdbc; }
.admin-order-status-tag[data-status="已退款"] { --st-c: #841818; --st-a: #fdeeee; --st-b: #efb9b9; }
.admin-order-status-tag[data-status="协助订单"] { --st-c: #6430c9; --st-a: #f5f0ff; --st-b: #d5c4ff; }
.admin-order-actions { display: flex; align-items: center; gap: 5px; }

.admin-order-action:disabled { opacity: .55; cursor: not-allowed; }
.admin-order-staff-select { width: 100%; margin-top: 8px; padding: 9px; border: 1px solid var(--line); border-radius: 4px; background: #fff; color: var(--text); }
.admin-order-image { width: 36px; height: 36px; margin-right: 4px; border-radius: 4px; object-fit: cover; }
.admin-order-image-button { display: inline-flex; padding: 0; border: 0; border-radius: 4px; background: transparent; cursor: zoom-in; vertical-align: middle; }
.admin-order-image-button:focus-visible { outline: 2px solid #1769db; outline-offset: 2px; }
.admin-order-image-button .admin-order-image { display: block; margin: 0; }
.admin-order-image-preview-backdrop { position: fixed; inset: 0; z-index: 1400; display: grid; place-items: center; padding: 24px; background: rgba(15, 23, 42, .82); }
.admin-order-image-preview-backdrop section { position: relative; display: grid; place-items: center; max-width: 100%; max-height: 100%; }
.admin-order-image-preview-backdrop img { display: block; max-width: min(90vw, 1200px); max-height: 88vh; object-fit: contain; border-radius: 4px; background: #fff; }
.admin-order-image-preview-backdrop section > button { position: absolute; z-index: 1; top: 12px; right: 12px; width: 40px; height: 40px; border: 1px solid #fff; border-radius: 50%; background: var(--primary); color: #fff; font-size: 28px; line-height: 1; cursor: pointer; }
.admin-image-preview-open { overflow: hidden; }

.order-proof-preview { display: block; max-width: 100%; object-fit: contain; }
.admin-detail-open { overflow: hidden; }
.admin-detail-page {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}
.category-editor-dialog.admin-detail-page {
  height: min(520px, calc(100dvh - 32px));
  max-height: calc(100dvh - 32px);
}
.admin-detail-scroll {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.admin-order-detail-page {
  width: min(760px, 100%);
  height: min(720px, calc(100dvh - 40px));
}
.admin-order-detail-page > header,
.admin-order-detail-page > footer { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; }
.admin-order-detail-page > header h3 { margin: 0; }
.admin-order-detail-page > footer { justify-content: flex-end; }

.admin-order-detail-page > footer > button.is-secondary { order: 1; color: #4b515b; background: #fff; border-color: #d8dce2; }
.admin-order-detail-page > footer > button.is-secondary:hover:not(:disabled) { background: #f5f6f8; border-color: #b8bec8; color: #23272f; }
.admin-order-detail-page .admin-detail-scroll { padding: 0 20px 20px; }
.admin-order-detail-section { padding: 18px 0; border-bottom: 1px solid #e8eaed; }
.admin-order-detail-section h4 { margin: 0 0 12px; font-size: 15px; }
.admin-order-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 20px; }
.admin-order-detail-field { min-width: 0; display: grid; gap: 4px; }
.admin-order-detail-field > span:first-child,
.admin-order-detail-media > span { color: #64748b; font-size: 12px; }
.admin-order-detail-field > .admin-order-status-tag { justify-self: start; }
.admin-order-detail-field strong { color: #233044; font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
.admin-order-detail-media { display: grid; gap: 10px; padding: 18px 0; border-bottom: 1px solid #e8eaed; }

.order-proof-gallery { display: flex; flex-wrap: wrap; gap: 10px; }
.order-proof-gallery .order-proof-preview { max-height: 160px; }
.admin-order-detail-media .admin-order-image { width: 96px; height: 96px; }
@media (max-width: 600px) {
  .category-editor-backdrop, .order-review-backdrop { padding: 12px; }
  .admin-order-detail-grid { grid-template-columns: 1fr; }
}

.password-dialog { width: min(460px, 96vw); }
.password-dialog .form-grid { align-content: start; }
.password-dialog input[readonly] { color: #64748b; background: #f6f8fa; }

.panel-subhead { margin: 18px 0 9px; color: var(--muted); font-size: 14px; font-weight: 600; }
.panel-subhead:first-of-type { margin-top: 12px; }

.admin-chat-panel .panel-head { flex-wrap: wrap; gap: 12px; }
.admin-chat-panel [role="status"] { color: #64748b; font-size: 12px; }
.admin-chat-panel .wallet-error { color: #c0392b; }
.admin-chat-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.admin-chat-toolbar input { width: min(340px, 100%); min-width: 0; }
.admin-chat-table-wrap { overflow-x: auto; }
.admin-chat-table-wrap table { min-width: 940px; width: 100%; }
.admin-chat-table-wrap td small { display: block; margin-top: 5px; color: #64748b; }
.admin-chat-preview { display: block; max-width: 250px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-chat-unread { background: #fff0d9; color: #ad5800; }
.admin-chat-pagination { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.admin-chat-pagination span { margin-right: auto; color: #64748b; font-size: 13px; }
.admin-chat-dialog { width: min(820px, 100%); height: min(740px, calc(100dvh - 40px)); background: #fff; border-radius: 4px; }
.admin-chat-dialog { width: min(1160px, 100%); grid-template-rows: auto minmax(0, 1fr) auto; }
.admin-chat-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; min-height: 0; overflow: hidden; }
.admin-chat-main { display: grid; grid-template-rows: minmax(0,1fr) auto auto; min-width: 0; min-height: 0; }
/* align-items:start —— 输入框会随内容长高，默认的 stretch 会把「发送」按钮一起拉成一根竖条。 */
.admin-chat-form { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: start; gap: 8px; padding: 12px 18px 0; }
.admin-chat-form > button { min-height: 38px; }
.admin-chat-form label { grid-column: 1 / -1; font-size: 12px; color: #667085; }
.admin-chat-form textarea { min-width: 0; resize: none; max-height: 160px; overflow-y: auto; }
#adminChatSendStatus { margin: 4px 18px 10px; min-height: 18px; color: #667085; font-size: 12px; }
.admin-chat-order-info { overflow-y: auto; padding: 18px; border-left: 1px solid #e8edf3; background: #fff; font-size: 13px; }
.admin-chat-order-info dl { display: grid; grid-template-columns: 74px minmax(0,1fr); gap: 10px 8px; }
.admin-chat-order-info dt { color: #667085; }
.admin-chat-order-info dd { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.chat-person { margin-top: 18px; padding-top: 8px; border-top: 1px solid #e8edf3; }
.chat-person img, .chat-avatar-placeholder { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; float: left; margin-right: 10px; }
.chat-avatar-placeholder { display: grid; place-items: center; background: #f1f3f5; }
.chat-person strong, .chat-person small { display: block; overflow-wrap: anywhere; }
.chat-product-cover { width: 80px; height: 80px; object-fit: cover; }
.official-badge { display: inline-block; padding: 2px 8px; color: #9b4b00; background: #fff0d9; border: 1px solid #f4c582; border-radius: 4px; font-weight: 700; }
.is-official .admin-chat-bubble { color: #623b17; background: #fff7e8; border: 1px solid #f1d4aa; }
.admin-chat-system { color: #7c8490; text-align: center; margin: 12px 0; font-size: 12px; white-space: pre-wrap; }
.admin-chat-system time { display: block; font-size: 11px; margin-top: 4px; }
@media (max-width: 760px) { .admin-chat-layout { grid-template-columns: minmax(0,1fr) 190px; } .admin-chat-order-info { padding: 10px; } }
@media (max-width: 520px) { .admin-chat-layout { grid-template-columns: minmax(0,1fr); grid-template-rows: minmax(0,1fr) 180px; } .admin-chat-order-info { border-left: 0; border-top: 1px solid #e8edf3; } }
.admin-chat-dialog > header { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid #e8edf3; gap: 12px; }
.admin-chat-dialog h3 { margin: 0 0 6px; }
.admin-chat-dialog header small { color: #64748b; overflow-wrap: anywhere; }
.admin-chat-dialog > footer { padding: 12px 22px; border-top: 1px solid #e8edf3; font-size: 12px; color: #64748b; }
.admin-chat-scroll { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 18px 22px; background: #f7f9fc; }
.admin-chat-message { display: flex; flex-direction: column; align-items: flex-start; margin: 18px 0; gap: 7px; }
.admin-chat-message.is-staff { align-items: flex-end; }
.admin-chat-message-meta { font-size: 12px; color: #64748b; max-width: 100%; overflow-wrap: anywhere; }
.admin-chat-message-meta time { display: block; margin-top: 4px; }
.admin-chat-bubble { max-width: 85%; padding: 12px 16px; border: 1px solid #dce5ef; border-radius: 4px 4px 4px; background: #fff; color: #25354a; white-space: pre-wrap; overflow-wrap: anywhere; }
.is-staff .admin-chat-bubble { background: #e5f6f2; border-color: #c2e7de; border-radius: 4px 4px 4px 4px; }
.admin-chat-read { color: #22856d; font-size: 12px; }
.admin-chat-read.is-unread { color: #b86b13; }
.admin-chat-empty { text-align: center; color: #64748b; padding: 30px 0; }
.settings-header { padding-bottom: 0; }
.settings-tabs { flex-wrap: wrap; padding-inline: 0; gap: 16px 32px; border-bottom: 0; }
.settings-tabs button { min-width: 96px; text-align: center; border-bottom-width: 4px; }
.product-tabs.settings-tabs button.active { color: #1769db; border-bottom-color: #1769db; }
.login-page-fields { display: grid; gap: 18px; max-width: 800px; padding: 0; margin: 24px 0 0; border: 0; min-width: 0; }
.login-page-fields label { display: grid; gap: 8px; }
.login-page-fields input, .login-page-fields textarea { width: 100%; min-width: 0; }
.login-page-fields small { color: #64748b; font-weight: 400; }
#h5SettingsPanel .form-grid { align-items: start; }
#h5SettingsPanel label > span { display: flex; align-items: center; gap: 8px; }
#h5SettingsPanel input[type="checkbox"] { width: 16px; flex: 0 0 16px; }
.login-avatar-editor { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.login-avatar-preview { display: grid; place-items: center; width: 96px; height: 96px; border: 1px dashed #cbd5e1; border-radius: 4px; overflow: hidden; color: #64748b; }
.login-avatar-preview img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 600px) {
  .admin-chat-dialog { height: calc(100dvh - 24px); }
  .admin-chat-scroll { padding: 12px; }
  .admin-chat-bubble { max-width: 95%; }
}
.gift-editor { display: grid; grid-template-columns: 56px minmax(100px, 1fr) 110px minmax(140px, 1fr) 56px minmax(140px, 1fr) auto; align-items: center; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.gift-editor > img { width: 48px; height: 48px; object-fit: contain; }

#giftControls { border: 0; padding: 0; }
#giftControls > label { display: inline-flex; align-items: center; gap: 10px; margin: 12px 20px 12px 0; }

/* Shared business controls, including read-only modules rendered by JavaScript. */
.table-wrap { min-width: 0; max-width: 100%; overflow-x: auto; }
.table-wrap table { min-width: 760px; }
.panel-head > button, .panel [data-export], #giftRefresh { color: var(--primary); border-color: #c6d6ef; background: #fff; }
.panel > h2 + p { margin-top: 0; }
#settingsBasicPanel > .panel + .panel { margin-top: 16px; }
.page > .panel + .panel { margin-top: 0; }
.button-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.admin-order-statuses button { border: 1px solid #e1e6ec; border-radius: 4px; padding: 7px 13px; color: #4b515b; background: #fff; border-color: var(--line); font-weight: 400; }

.admin-order-statuses button.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.admin-order-statuses button:hover:not(:disabled):not(.active) { color: var(--primary); background: var(--cyan-soft); border-color: #c6d6ef; }
.review-summary .review-filter-tab { padding: 6px 14px; border: 1px solid var(--line); border-radius: 4px; background: #fff; color: #4b515b; font-size: 13px; font-weight: 400; line-height: 1.2; }

.review-summary .review-filter-tab.is-active { border-color: var(--primary); background: var(--primary); color: #fff; }

.panel-head .button-row [data-action="refresh"] { color: var(--primary); background: #fff; border-color: #c6d6ef; }
#orderSearchForm { display: flex; gap: 8px; align-items: center; margin-bottom: 18px; }
#orderSearchForm input { max-width: 400px; }
#orderSearchForm button { flex: 0 0 auto; }
.admin-order-scroll-controls { display: grid; gap: 4px; margin: -6px 0 8px; margin-top: 0; }

.admin-order-scroll-controls input::-webkit-slider-thumb { width: 72px; height: 22px; margin-top: -7px; border: 2px solid #fff; border-radius: 4px; background: var(--primary); appearance: none; }

.button-row .danger, .button-row button.danger { background: #fff; color: #d93d43; border-color: #f1c4c6; }

button.danger:hover:not(:disabled) { color: #d93d43; border-color: #d93d43; background: #fff1f0; }
.tag, .review-state, .category-count-badge { border-radius: 3px; font-weight: 400; }
.admin-order-action { border: 1px solid var(--line); border-radius: 4px; padding: 5px 9px; color: #fff; font-size: 12px; font-weight: 400; line-height: 1.2; white-space: nowrap; min-height: 30px; }

.admin-order-action--teal { background: #fff; color: var(--primary); border-color: #c6d6ef; }

.admin-order-action--orange { background: #fff; color: #b7791f; border-color: #ebd4af; }

.admin-order-action--red { background: #fff; color: #d93d43; border-color: #f1c4c6; }

.admin-order-action--green { background: #fff; color: #21845b; border-color: #bddccb; }

.admin-order-action--teal:hover:not(:disabled) { color: var(--primary-dark); background: #edf4ff; border-color: var(--primary); }
.admin-order-action--red:hover:not(:disabled) { color: #bd2f35; background: #fff1f0; border-color: #d93d43; }
.admin-order-table th:last-child, .admin-order-table td:last-child { position: sticky; right: 0; z-index: 1; background: #fff; border-left: 1px solid var(--line); }

.product-pagination select { width: auto; }
.product-row-actions { display: flex; gap: 14px; white-space: nowrap; }

tbody tr:hover > td { background-color: #fafbfc; }
.gift-editor > label { display: flex; flex-direction: column; gap: 6px; max-width: none; min-width: 0; font-size: 12px; }

.gift-editor input[type="file"] { padding: 5px; font-size: 11px; }
#giftPercent { width: 100px; }
#giftControls > .button-row { padding-top: 20px; }
.gift-editor .danger { color: #d93d43; background: #fff; border-color: #f1c4c6; }
.admin-chat-bubble, .is-staff .admin-chat-bubble { border-radius: 4px; }
.admin-dialog, .category-editor-dialog, .lottery-pool-dialog, .admin-confirm-dialog, .product-dialog { box-shadow: 0 8px 32px rgba(20,24,32,.16); }
.admin-toast { padding: 12px 14px; border: 1px solid var(--line); border-left: 1px solid var(--line); border-radius: 4px; background: #fff; box-shadow: 0 4px 16px rgba(20,24,32,.12); }

/* Short feedback only; never delay a business action or animate polled tables. */
button:not(:disabled):not(.category-drag-handle):not(.product-thumb-button):active { translate: 0 1px; }
button:disabled { translate: none; }
.admin-dialog, .category-editor-dialog, .lottery-pool-dialog, .product-dialog, .admin-chat-dialog {
  animation: admin-surface-in var(--motion-mid) var(--motion-ease);
}
.admin-toast { animation: admin-surface-in var(--motion-mid) var(--motion-ease); }
@keyframes admin-surface-in {
  from { opacity: .65; translate: 0 4px; }
  to { opacity: 1; translate: 0 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0s !important; }
  button:not(:disabled):active { translate: none; }
}

@media (max-width: 1200px) {
  .gift-editor { grid-template-columns: 48px minmax(130px, 1fr) 110px minmax(140px, 1fr); }
  .gift-editor > label:nth-of-type(4) { grid-column: 2; }
  .gift-editor > label:nth-of-type(5) { grid-column: 3; }
  /* 981~1200px 还保留 5 列的话，每列只剩 ~130px，十张卡的说明文字全部折行，
     会断出「订单」这种孤字。这一档改 3 列，每列回到 ~215px，一张卡一行说明。
     ≤980px 由下面的 1fr 规则接管，两条同特异性、后者在后，所以窄屏仍是单列。 */
  .overview-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .admin-shell { grid-template-columns: 188px minmax(0, 1fr); }
  .sidebar { position: sticky; height: 100vh; }
  .workspace { padding-inline: 16px; }
  .topbar { margin-inline: -16px; padding-inline: 16px; }
  .topbar { flex-direction: row; align-items: center; }
  .account-summary { display: none; }
}
@media (max-width: 640px) {
  .admin-shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; height: auto; max-height: 320px; }
  .brand { min-height: 58px; padding: 12px 4px; }
  .top-actions { gap: 8px; }
  .gift-editor { grid-template-columns: 48px minmax(0, 1fr); gap: 12px; }
  .gift-editor > label:nth-of-type(n), .gift-editor > button { grid-column: 2; }
  .gift-editor > img { align-self: start; grid-row: span 2; }
  .overview-grid div { padding: 14px; }
  .login-card-body { padding: 28px; }
}
.development-previews { display: grid; grid-template-columns: repeat(2, minmax(0, 190px)); gap: 18px; }
#clubPetEnabled { width: 16px; }
.development-previews figure { min-width: 0; margin: 0; padding: 10px; border: 1px solid #e6e9ef; border-radius: 12px; background: #fafbfc; }
.development-previews a { display: block; }
.development-previews img { display: block; width: 100%; height: auto; border-radius: 8px; }
.development-previews figcaption { margin-top: 8px; color: #667085; font-size: 12px; text-align: center; }
.club-ui-previews { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; max-width: 1060px; }
.club-ui-previews figure { min-width: 0; margin: 0; padding: 12px; border: 2px solid #e6e9ef; border-radius: 12px; background: #fafbfc; }
.club-ui-previews figure.selected { border-color: #315fe9; background: #f3f6ff; }
.club-ui-previews .club-ui-ref { display: block; margin-bottom: 10px; }
.club-ui-previews .club-ui-ref img { border: 1px solid #e6e9ef; background: #fff; }
.club-ui-previews a, .club-ui-previews img { display: block; width: 100%; height: auto; border-radius: 8px; }
.club-ui-previews figcaption { display: grid; gap: 8px; padding-top: 12px; }
.club-ui-previews figcaption span { color: #667085; font-size: 12px; }
.club-ui-previews button { justify-self: start; }
.club-ui-palette { display: flex; height: 90px; overflow: hidden; border: 1px solid #e6e9ef; border-radius: 8px; }
.club-ui-palette span { flex: 1; }
@media (max-width: 760px) { .club-ui-previews { grid-template-columns: minmax(0, 1fr); } }
/* 基础配置专用滑动开关，不改变其他后台按钮。 */
.timeout-refund-toggle { position: relative; display: inline-flex; align-items: center; gap: 12px; cursor: pointer; }
.timeout-refund-toggle input { position: absolute; right: 0; width: 46px; height: 26px; opacity: 0; margin: 0; cursor: pointer; }
.timeout-refund-toggle span { width: 46px; height: 26px; flex: 0 0 46px; border-radius: 16px; background: #a5acb8; transition: background .15s; pointer-events: none; }
.timeout-refund-toggle span::after { content: ''; display: block; width: 20px; height: 20px; margin: 3px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px #0002; transition: transform .15s; }
.timeout-refund-toggle input:checked + span { background: #2563eb; }
.timeout-refund-toggle input:checked + span::after { transform: translateX(20px); }
.timeout-refund-toggle input:focus-visible + span { outline: 2px solid #1d4ed8; outline-offset: 3px; }
.development-fields { max-width: 960px; gap: 16px; }
.development-feature { display: grid; gap: 12px; min-width: 0; padding: 16px 20px; border: 1px solid var(--line); border-radius: 8px; }
.development-feature .timeout-refund-toggle { display: flex; justify-content: space-between; min-height: 30px; gap: 16px; }
.development-feature .timeout-refund-toggle input { width: 46px; min-width: 0; }
.development-feature :is(.live-order-tracker, .panel-tip) { margin: 0; }
/* 桌宠总开关放开发设置第一块：浅暖底 + 左侧橙条 + 状态徽标，进去就能看见。 */
.development-pet { border-color: #f2cd9a; border-left: 4px solid var(--brand, #ff8800); background: linear-gradient(180deg, #fffaf2, #ffffff); }
.development-pet-head { display: flex; align-items: center; gap: 16px; }
.development-pet-head .timeout-refund-toggle { flex: 1 1 auto; }
.development-pet-head .tag { flex: 0 0 auto; }
#homeCategoryPopupFields { display: grid; gap: 8px; }

.admin-chat-picture{display:block;max-width:280px;max-height:320px;border-radius:8px}.admin-chat-tools{display:flex;gap:16px;align-items:center;padding:8px}.admin-chat-tools input{max-width:220px}.admin-chat-order-card{text-align:left;background:#fff7eb!important;color:#4a350d!important;padding:12px!important;max-width:280px;overflow-wrap:anywhere}.support-settings{padding:12px;background:#f8fafc}.support-settings label{display:inline-flex;gap:8px;margin:10px;align-items:center}
.staff-support-switch { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; font-size: 12px; }
.staff-support-switch i { display: inline-block; width: 28px; height: 16px; border-radius: 12px; background: #94a3b8; }
.staff-support-switch i::after { content: ''; display: block; width: 12px; height: 12px; margin: 2px; border-radius: 50%; background: #fff; }
.staff-support-switch[aria-checked="true"] i { background: #2563eb; }
.staff-support-switch[aria-checked="true"] i::after { transform: translateX(12px); }
.support-settings > label { white-space: nowrap; }
.support-settings > label input:not([type=checkbox]) { width: 200px; }
.support-settings > label textarea { width: 300px; white-space: normal; }
#miniSubscriptionSettings fieldset{border:1px solid #e5e7eb;border-radius:8px;margin:12px 0;padding:12px;min-width:0}
#miniSubscriptionSettings fieldset label{display:inline-flex;gap:10px;margin:8px 18px 8px 0;align-items:center;white-space:nowrap}
#miniSubscriptionSettings select{max-width:100%;min-width:130px;padding:8px}
#miniSubscriptionSettings p{line-height:1.7}
