/* ============================================================
   游戏账号交易平台 · 运营后台样式
   主题：深色 navy premium（默认） + 浅色（可切换）
   ============================================================ */

/* ---------- 主题变量 ---------- */
:root,
[data-theme="dark"] {
  --primary: #1a1a2e;
  --primary-2: #0f3460;
  --gradient: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  --accent: #e94560;
  --price: #ff6b35;
  --profit: #4be1a0;
  --warn: #f39c12;

  --bg: #0e0e1a;
  --bg-soft: #16162a;
  --bg-card: #1d1d38;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-2: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.18);

  --text: #eef1f8;
  --text-soft: #aab0c6;
  --text-mute: #6f7596;

  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --radius: 16px;
  --radius-sm: 10px;
}

[data-theme="light"] {
  --primary: #1a1a2e;
  --primary-2: #0f3460;
  --gradient: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  --accent: #e94560;
  --price: #ff6b35;
  --profit: #12a86f;
  --warn: #d68910;

  --bg: #eef0f6;
  --bg-soft: #ffffff;
  --bg-card: #ffffff;
  --surface: #ffffff;
  --surface-2: #f5f6fb;
  --border: rgba(26, 26, 46, 0.10);
  --border-strong: rgba(26, 26, 46, 0.18);

  --text: #1a1a2e;
  --text-soft: #5a607a;
  --text-mute: #9aa0b8;

  --shadow: 0 10px 30px rgba(26, 26, 46, 0.12);
}

/* ---------- 多主题色板（在暗色基底上切换主色与点缀色） ---------- */
[data-theme="black"] {
  --primary: #1a1a2e; --primary-2: #0f3460;
  --gradient: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  --accent: #e94560; --price: #ff6b35; --profit: #4be1a0; --warn: #f39c12;
  --bg: #000000; --bg-soft: #0a0a12; --bg-card: #16161f;
  --surface: rgba(255,255,255,0.03); --surface-2: rgba(255,255,255,0.06);
  --border: rgba(255,255,255,0.10); --border-strong: rgba(255,255,255,0.18);
  --text: #eef1f8; --text-soft: #aab0c6; --text-mute: #6f7596;
  --shadow: 0 10px 30px rgba(0,0,0,0.55);
}
[data-theme="purple"] {
  --primary: #2a1a4a; --primary-2: #4a2a7a;
  --gradient: linear-gradient(135deg, #2a1a4a 0%, #4a2a7a 50%, #6a3aa0 100%);
  --accent: #b06bff; --price: #ff8a5c; --profit: #4be1a0; --warn: #f39c12;
  --bg: #140d22; --bg-soft: #1d1430; --bg-card: #241a3e;
  --surface: rgba(255,255,255,0.05); --surface-2: rgba(255,255,255,0.09);
  --border: rgba(255,255,255,0.10); --border-strong: rgba(255,255,255,0.20);
  --text: #f1ecff; --text-soft: #b9aed6; --text-mute: #7d7398;
  --shadow: 0 10px 30px rgba(10,4,20,0.55);
}
[data-theme="teal"] {
  --primary: #0a2e2a; --primary-2: #0f4a44;
  --gradient: linear-gradient(135deg, #0a2e2a 0%, #0f4a44 50%, #137a6e 100%);
  --accent: #2ee6b0; --price: #ffb15c; --profit: #4be1a0; --warn: #f0b429;
  --bg: #061a18; --bg-soft: #0c2522; --bg-card: #0f2c28;
  --surface: rgba(255,255,255,0.05); --surface-2: rgba(255,255,255,0.09);
  --border: rgba(255,255,255,0.10); --border-strong: rgba(255,255,255,0.20);
  --text: #e8fbf5; --text-soft: #a9d6cc; --text-mute: #6f9b92;
  --shadow: 0 10px 30px rgba(2,12,10,0.55);
}
[data-theme="sunset"] {
  --primary: #2a1505; --primary-2: #4a2408;
  --gradient: linear-gradient(135deg, #2a1505 0%, #4a2408 50%, #7a3a0f 100%);
  --accent: #ff7a2f; --price: #ffb15c; --profit: #4be1a0; --warn: #f0b429;
  --bg: #1a0f06; --bg-soft: #241608; --bg-card: #2a1a0e;
  --surface: rgba(255,255,255,0.05); --surface-2: rgba(255,255,255,0.09);
  --border: rgba(255,255,255,0.10); --border-strong: rgba(255,255,255,0.20);
  --text: #fdf2e8; --text-soft: #dcb79c; --text-mute: #9b7a5f;
  --shadow: 0 10px 30px rgba(12,6,2,0.55);
}
[data-theme="rose"] {
  --primary: #3a1530; --primary-2: #5a1f48;
  --gradient: linear-gradient(135deg, #3a1530 0%, #5a1f48 50%, #8a2f6a 100%);
  --accent: #ff6fae; --price: #ffb15c; --profit: #4be1a0; --warn: #f0b429;
  --bg: #1f0e1a; --bg-soft: #2a1424; --bg-card: #2e1830;
  --surface: rgba(255,255,255,0.05); --surface-2: rgba(255,255,255,0.09);
  --border: rgba(255,255,255,0.10); --border-strong: rgba(255,255,255,0.20);
  --text: #fdeaf4; --text-soft: #e0b3cf; --text-mute: #a17a93;
  --shadow: 0 10px 30px rgba(14,4,10,0.55);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  transition: background 0.35s ease, color 0.35s ease;
  -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 6px; }
::-webkit-scrollbar-track { background: transparent; }

/* ============================================================
   登录屏
   ============================================================ */
.login-view {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--gradient);
  overflow: hidden;
}
.login-bg-glow {
  position: absolute; width: 600px; height: 600px; border-radius: 50%;
  background: radial-gradient(circle, rgba(233, 69, 96, 0.35), transparent 60%);
  top: -150px; right: -120px; filter: blur(20px);
  animation: float 8s ease-in-out infinite;
}
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(30px); } }

.login-card {
  position: relative; z-index: 2;
  width: 360px; max-width: 90vw;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 24px;
  padding: 38px 32px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  text-align: center;
}
.login-logo { font-size: 46px; }
.login-title { color: #fff; font-size: 24px; font-weight: 800; letter-spacing: 2px; margin-top: 8px; }
.login-sub { color: rgba(255, 255, 255, 0.55); font-size: 12px; letter-spacing: 3px; margin-bottom: 26px; }
.login-form { text-align: left; }
.remember-row { display: flex; align-items: center; gap: 8px; margin: 2px 0 14px; color: rgba(255, 255, 255, 0.72); font-size: 13px; cursor: pointer; user-select: none; }
.remember-row input { width: auto; accent-color: var(--accent, #e94560); }
.login-hint { color: rgba(255, 255, 255, 0.45); font-size: 11px; margin-top: 18px; text-align: center; }

/* ============================================================
   应用外壳
   ============================================================ */
.app-view { display: flex; min-height: 100vh; }

.sidebar {
  width: 232px; flex-shrink: 0;
  background: var(--bg-soft);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 18px 14px;
  position: sticky; top: 0; height: 100vh;
  transition: width 0.3s ease, transform 0.3s ease;
}
.app-view.collapsed .sidebar { width: 0; padding: 18px 0; overflow: hidden; }

.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 10px 18px;
  font-weight: 800; font-size: 16px;
}
.brand-icon { font-size: 22px; }
.brand-text { background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }

.sidebar-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: 12px;
  color: var(--text-soft); cursor: pointer; font-size: 14px; font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease; border: 1px solid transparent;
}
.nav-item:hover { background: var(--surface); color: var(--text); }
.nav-item.active {
  background: var(--surface-2);
  color: #fff;
  border-color: var(--border-strong);
  box-shadow: inset 3px 0 0 var(--accent);
}
.nav-item .nav-ico { font-size: 16px; width: 20px; text-align: center; }

/* 键盘焦点环：Tab 用户清晰可见当前焦点（覆盖链接/按钮/可聚焦卡片） */
a:focus-visible,
button:focus-visible,
.theme-swatch:focus-visible,
.card[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 12px;
}
.nav-group-label { font-size: 11px; color: var(--text-mute); padding: 14px 14px 6px; letter-spacing: 1px; }

/* 分组菜单：可折叠二级/三级，折叠状态由 app.js 存 localStorage */
.nav-group-head {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 10px 14px; margin-top: 4px;
  background: transparent; border: 1px solid transparent; border-radius: 12px;
  color: var(--text-soft); font-size: 13px; font-weight: 600; cursor: pointer;
  text-align: left; transition: all 0.2s ease;
}
.nav-group-head:hover { background: var(--surface); color: var(--text); }
.nav-group-title { flex: 1; }
.nav-caret { font-size: 11px; color: var(--text-mute); transition: transform 0.2s ease; display: inline-block; transform: rotate(-90deg); }
.nav-caret.open { transform: rotate(0); }
.nav-children { display: flex; flex-direction: column; gap: 2px; overflow: hidden; }
.nav-children.collapsed { display: none; }
.nav-children .nav-item { padding-top: 9px; padding-bottom: 9px; font-size: 13px; }
.nav-children .nav-item .nav-ico { font-size: 15px; }

/* 自定义菜单入口按钮 */
.nav-custom-btn {
  display: block; width: 100%; margin-top: 8px;
  padding: 8px 12px; border-radius: 10px;
  background: transparent; border: 1px dashed var(--border-strong);
  color: var(--text-mute); font-size: 12px; cursor: pointer;
  transition: all 0.2s ease;
}
.nav-custom-btn:hover { background: var(--surface); color: var(--text); border-color: var(--accent); }
.ne-group input[type=checkbox], .ne-item input[type=checkbox] { accent-color: var(--accent); }

/* 自动刷新条：绿点脉冲表示在跑，定格时由 JS 置灰 */
.autorefresh-bar {
  background: var(--surface); border-radius: 10px; padding: 4px 8px;
  border: 1px solid var(--border);
}
.autorefresh-bar .ar-dot { animation: ar-pulse 2s ease-in-out infinite; }
.autorefresh-bar.frozen .ar-dot { animation: none; }
@keyframes ar-pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

/* 行情总览区组搜索：命中行加粗高亮，未命中淡化 */
.ov-row { transition: opacity 0.2s ease, background 0.2s ease; }
.ov-row.ov-hit { background: rgba(55,138,221,.12); font-weight: 800; box-shadow: inset 3px 0 0 var(--accent); }
.ov-row.ov-hit td { font-weight: 800; }
.ov-row.ov-dim { opacity: .32; }

.sidebar-foot { padding-top: 12px; border-top: 1px solid var(--border); }
.role-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 20px; font-size: 12px; font-weight: 700;
  background: var(--surface-2); color: var(--text-soft);
}
.role-badge.boss { background: rgba(233, 69, 96, 0.16); color: #ff8ba0; }
.role-badge.user { background: rgba(75, 225, 160, 0.14); color: #6cf0b4; }
.role-badge.guest { background: rgba(127, 140, 160, 0.16); color: #aeb9c9; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
  height: 64px; flex-shrink: 0;
  display: flex; align-items: center; gap: 14px;
  padding: 0 22px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
}
.page-title { font-size: 18px; font-weight: 700; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.user-chip { display: flex; align-items: center; gap: 8px; }
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--gradient); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px;
}
.user-name { font-size: 13px; font-weight: 600; color: var(--text-soft); }

.content { padding: 24px; max-width: 1280px; width: 100%; margin: 0 auto; }

/* ============================================================
   通用组件
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.card-title { font-size: 15px; font-weight: 700; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.order-ctrl { margin-left: auto; display: inline-flex; gap: 4px; }
.order-btn {
  width: 24px; height: 24px; line-height: 1; font-size: 12px; cursor: pointer;
  border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.06);
  color: inherit; border-radius: 7px; opacity: .5; transition: opacity .15s, background .15s;
}
.order-btn:hover { opacity: 1; background: rgba(255,255,255,.16); }
.card-title::before {
  content: ""; width: 3px; height: 15px; border-radius: 2px;
  background: linear-gradient(to bottom, var(--accent), var(--primary-2));
}

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field-label { font-size: 12px; color: var(--text-soft); font-weight: 600; }
.combo { position: relative; }
.combo-input { width: 100%; }
.combo-panel {
  position: fixed; left: 0; top: 0; z-index: 130;
  max-height: 260px; overflow-y: auto; padding: 4px;
  background: var(--bg-card, #1d1d38); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: 0 12px 30px rgba(0,0,0,.28);
}
.combo-item { padding: 8px 10px; border-radius: 8px; font-size: 14px; cursor: pointer; }
.combo-item:hover { background: var(--bg-soft); }
.combo-empty { padding: 8px 10px; font-size: 13px; color: var(--text-mute); }
/* 区组下拉的两级分组标题（分区名，如「双线一区」） */
.combo-group {
  padding: 7px 10px 3px; font-size: 12px; font-weight: 600;
  color: var(--text-mute); letter-spacing: .3px;
  display: flex; align-items: center; gap: 6px;
  position: sticky; top: 0; z-index: 1;
  background: var(--bg-card, #1d1d38);
  border-bottom: 1px solid var(--border);
}
.combo-group .muted { font-weight: 400; font-size: 11px; }
input, select, textarea {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 14px; outline: none;
  transition: border 0.2s, box-shadow 0.2s;
  font-family: inherit;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.15);
}
input::placeholder, textarea::placeholder { color: var(--text-mute); }

/* 原生下拉框（select）的弹出列表背景强制不透明，避免暗色主题下透底 */
select option { background: var(--bg-soft); color: var(--text); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px; border-radius: 12px;
  font-size: 14px; font-weight: 700; cursor: pointer;
  border: 1px solid transparent; transition: transform 0.15s ease, box-shadow 0.2s, background 0.2s;
  font-family: inherit;
}
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 9px; }
.btn-block { width: 100%; }
/* 右上角圆形刷新按钮 */
.btn-icon { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; padding: 0; border-radius: 10px; font-size: 16px; line-height: 1; flex: 0 0 auto; }
.refresh-btn { cursor: pointer; transition: transform .2s ease, background .2s ease, color .2s ease; }
.refresh-btn:hover { background: var(--surface-2); color: var(--accent); }
.refresh-btn.spinning { animation: spin .8s linear infinite; pointer-events: none; opacity: .65; }
@keyframes spin { from { transform: rotate(0); } to { transform: rotate(360deg); } }
.btn-primary { background: var(--gradient); color: #fff; box-shadow: 0 6px 18px rgba(15, 52, 96, 0.4); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(15, 52, 96, 0.5); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-ghost { background: var(--surface-2); color: var(--text-soft); border-color: var(--border); }
.btn-ghost:hover { color: var(--text); background: var(--surface); }
/* 概览「只看自己」开关激活态 */
.btn-ghost.active { color: #fff; background: var(--gradient); border-color: transparent; box-shadow: 0 6px 18px rgba(15, 52, 96, 0.4); }
.btn-success { background: linear-gradient(135deg, #00b09b, #12c2e9); color: #fff; }
.btn-danger { background: rgba(231, 76, 60, 0.14); color: #ff7a6b; border-color: rgba(231, 76, 60, 0.35); }
.btn-danger:hover { background: rgba(231, 76, 60, 0.22); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.icon-btn {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-soft); cursor: pointer; font-size: 16px;
  display: flex; align-items: center; justify-content: center; transition: all 0.2s;
}
.icon-btn:hover { color: var(--text); background: var(--surface); }

/* ---------- 主题选择器弹层 ---------- */
.theme-pop {
  position: fixed; top: 54px; right: 16px; z-index: 200;
  width: 232px; padding: 12px;
  background: var(--bg-soft); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); box-shadow: var(--shadow);
  display: none; animation: pop 0.16s ease;
}
.theme-pop.open { display: block; }
.theme-pop-title { font-size: 12px; color: var(--text-mute); margin: 2px 4px 10px; }
.theme-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.theme-swatch {
  display: flex; align-items: center; gap: 8px;
  padding: 8px; border-radius: 10px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-soft); font-size: 13px; transition: all 0.18s;
}
.theme-swatch:hover { background: var(--surface-2); color: var(--text); transform: translateY(-1px); }
.theme-swatch.active { border-color: var(--accent); color: var(--text); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent); }
.theme-dot { width: 18px; height: 18px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.18); }

.magnetic { transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1); }

/* ---------- 徽章 / 状态 ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 700;
}
.badge-draft { background: var(--surface-2); color: var(--text-mute); border: 1px solid var(--border); }
.badge-sale { background: rgba(0, 176, 155, 0.16); color: #4be1c4; }
.badge-sold { background: var(--surface-2); color: var(--text-mute); text-decoration: line-through; }
.badge-withdrawn { background: rgba(243, 156, 18, 0.16); color: #f0b350; }
.badge-normal { background: rgba(75, 225, 160, 0.14); color: #6cf0b4; }
.badge-off { background: var(--surface-2); color: var(--text-mute); }

/* ---------- 表格 ---------- */
/* 列表筛选栏吸顶：长列表滚动时筛选/搜索常驻，符合后台操作习惯 */
.toolbar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px;
  position: sticky; top: 64px; z-index: 15; background: var(--bg);
  padding-top: 4px; padding-bottom: 4px;
}
.toolbar .search { flex: 1; min-width: 200px; max-width: 320px; }
.toolbar .spacer { flex: 1; }

.table-wrap { overflow-x: auto; border-radius: var(--radius); -webkit-overflow-scrolling: touch; }
/* 表格首列横向滚动时固定，便于长表左右滚动核对（账号名/选择框常驻） */
.table-wrap table th:first-child,
.table-wrap table td:first-child {
  position: sticky; left: 0; z-index: 2; background: var(--surface);
}
.table-wrap table thead th:first-child { z-index: 3; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead th {
  text-align: left; padding: 12px 14px; color: var(--text-soft);
  font-weight: 700; font-size: 12px; letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
tbody td { padding: 13px 14px; border-bottom: 1px solid var(--border); color: var(--text); vertical-align: middle; }
tbody tr { transition: background 0.15s; }
tbody tr:hover { background: var(--surface); }
.price-cell { color: var(--price); font-weight: 800; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.pin-badge { font-size: 13px; filter: drop-shadow(0 0 2px rgba(233,69,96,.5)); }
tr:has(.pin-badge) td:first-child { box-shadow: inset 3px 0 0 var(--accent); }

.empty {
  text-align: center; color: var(--text-mute); padding: 50px 20px; font-size: 14px;
}

/* ---------- 行高密度（紧凑）模式 ---------- */
.content.compact table { font-size: 12.5px; }
.content.compact thead th { padding: 8px 12px; }
.content.compact tbody td { padding: 6px 12px; }
.content.compact .stat-card { padding: 14px; }
.content.compact .card { padding: 14px; }
#density-toggle.active { color: var(--accent); background: var(--surface); }

/* ---------- 列设置弹层 ---------- */
.col-pop {
  position: absolute; z-index: 120; min-width: 168px; padding: 10px;
  background: var(--bg-soft); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); box-shadow: var(--shadow);
  display: none; max-height: 340px; overflow: auto;
}
.col-pop.open { display: block; }
.col-pop-title { font-size: 12px; color: var(--text-mute); margin: 2px 4px 8px; }
.col-pop label {
  display: flex; align-items: center; gap: 8px; padding: 6px 4px;
  font-size: 13px; color: var(--text); cursor: pointer; border-radius: 6px;
}
.col-pop label:hover { background: var(--surface); }
.col-pop label input { accent-color: var(--accent); }

/* ---------- 分页 ---------- */
.pager { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 18px; }
.pager .page-info { color: var(--text-soft); font-size: 13px; margin: 0 8px; }
.pager-size { display: inline-flex; align-items: center; gap: 4px; margin-left: 6px; color: var(--text-soft); font-size: 13px; white-space: nowrap; }
.pg-size, .pg-size-custom { height: 28px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); color: var(--text); font-size: 13px; padding: 0 6px; }
.pg-size { cursor: pointer; }
.pg-size-custom { width: 58px; text-align: center; }
.pg-size-custom::-webkit-outer-spin-button, .pg-size-custom::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pg-size-custom { -moz-appearance: textfield; }

/* ---------- 统计卡 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 22px; }
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; position: relative; overflow: hidden;
  box-shadow: var(--shadow);
}
.stat-card::after {
  content: ""; position: absolute; right: -20px; top: -20px;
  width: 90px; height: 90px; border-radius: 50%;
  background: radial-gradient(circle, rgba(233, 69, 96, 0.18), transparent 70%);
}
.stat-label { font-size: 12px; color: var(--text-soft); margin-bottom: 8px; }
.stat-value { font-size: 28px; font-weight: 800; }
.stat-value.profit { color: var(--profit); }
.stat-value.price { color: var(--price); }
/* 亏损（负利润）统一红色 */
.stat-value.loss, .boss-val.loss, .profit-bar-val.loss, .module-profit-tag.loss { color: #ff6b6b; }

/* ============================================================
   老板视图：成本 / 利润
   ============================================================ */
.boss-card {
  background: var(--gradient);
  border-radius: var(--radius); padding: 20px; margin-bottom: 18px;
  box-shadow: var(--shadow); color: #fff;
}
.boss-card-title { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.boss-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.boss-item { background: rgba(255, 255, 255, 0.08); border-radius: 12px; padding: 14px; }
.boss-key { font-size: 11px; color: rgba(255, 255, 255, 0.6); margin-bottom: 6px; }
.boss-val { font-size: 20px; font-weight: 800; }
.boss-val.cost { color: #ffd479; }
.boss-val.profit { color: #4be1a0; }
.boss-rate {
  display: inline-block; margin-top: 6px; font-size: 11px; font-weight: 700;
  padding: 2px 9px; border-radius: 8px; background: rgba(75, 225, 160, 0.18); color: #6cf0b4;
}
.module-profit-tag {
  display: inline-block; margin-left: 8px; font-size: 11px; font-weight: 700;
  color: #6cf0b4; background: rgba(75, 225, 160, 0.12); padding: 2px 8px; border-radius: 6px;
}
.boss-field { background: rgba(255, 212, 121, 0.08); }
.boss-field input { color: #ffd479; border-color: rgba(255, 212, 121, 0.3); }
.boss-field .field-label { color: #e0a64a; }

/* ---------- 利润分布条 ---------- */
.profit-bars { display: flex; flex-direction: column; gap: 12px; margin-top: 6px; }
.profit-bar-row { display: grid; grid-template-columns: 90px 1fr 90px; align-items: center; gap: 10px; font-size: 13px; }
.profit-bar-track { height: 12px; background: var(--surface-2); border-radius: 8px; overflow: hidden; }
.profit-bar-fill { height: 100%; background: linear-gradient(90deg, var(--accent), #ff8ba0); border-radius: 8px; transition: width 0.6s ease; }
.profit-bar-val { text-align: right; font-weight: 700; color: var(--profit); }

/* 老板看板：时间维度切换 + 利润趋势图 */
.period-tabs { display: inline-flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 10px; flex-wrap: wrap; }
.period-tabs button { border: none; background: transparent; color: var(--text-soft); padding: 6px 14px; border-radius: 7px; cursor: pointer; font-size: 13px; font-weight: 600; transition: all .15s ease; }
.period-tabs button:hover { color: var(--text); }
.period-tabs button.active { background: var(--accent); color: #fff; }
.trend-chart { display: flex; gap: 10px; overflow-x: auto; padding: 12px 4px 6px; align-items: flex-end; min-height: 170px; }
.trend-col { display: flex; flex-direction: column; align-items: center; min-width: 48px; cursor: pointer; flex: 0 0 auto; }
.trend-col.dim { opacity: 0.4; }
.trend-col:hover { opacity: 1; }
.trend-bars { display: flex; gap: 4px; align-items: flex-end; height: 120px; }
.trend-bar { width: 16px; border-radius: 4px 4px 0 0; transition: height .5s ease; }
.trend-bar.cost { background: var(--surface-2); border: 1px solid var(--border); }
.trend-bar.profit { background: linear-gradient(180deg, var(--accent), #ff8ba0); }
.trend-bar.profit.loss { background: linear-gradient(180deg, #ff6b6b, #ff9a9a); }
.trend-label { font-size: 11px; color: var(--text-soft); margin-top: 6px; white-space: nowrap; }
.trend-label.active { color: var(--accent); font-weight: 700; }
.trend-val { font-size: 11px; font-weight: 700; margin-bottom: 4px; }
.trend-val.loss { color: #ff6b6b; }
.trend-val.profit { color: var(--profit); }
.drill-panel { margin-top: 18px; }
.mini-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.mini-table th, .mini-table td { padding: 7px 10px; border-bottom: 1px solid var(--border); text-align: left; }
.mini-table th { color: var(--text-soft); font-weight: 600; }

/* ============================================================
   详情布局
   ============================================================ */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.detail-grid .full { grid-column: 1 / -1; }
@media (max-width: 900px) { .detail-grid { grid-template-columns: 1fr; } }

.kv { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.kv:last-child { border-bottom: none; }
.kv .k { color: var(--text-soft); }
.kv .v { font-weight: 600; }

.module-block { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; margin-bottom: 12px; background: var(--surface-2); }
.module-block-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.module-block-name { font-weight: 700; font-size: 14px; }
.module-block-sub { font-size: 12px; color: var(--text-mute); }
.module-block.sold { opacity: 0.55; }
.module-block-actions { display: flex; align-items: center; gap: 8px; }
.btn-xs { padding: 2px 10px; font-size: 12px; line-height: 1.6; }
.module-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { font-size: 11px; color: var(--text-soft); background: var(--surface); border: 1px solid var(--border); padding: 2px 9px; border-radius: 6px; }

/* ============================================================
   表单网格
   ============================================================ */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 720px) { .form-grid { grid-template-columns: 1fr; } }
.form-actions { display: flex; gap: 12px; margin-top: 20px; }
/* 移动端：表单操作栏吸附底部，保存/取消拇指可达，长表单无需滚到底 */
@media (max-width: 720px) {
  .form-actions {
    position: sticky; bottom: 0; z-index: 15;
    background: var(--bg); padding: 12px 0; margin-top: 8px;
  }
}

/* 图片上传 */
.uploader { display: flex; flex-wrap: wrap; gap: 10px; }
.upload-item {
  width: 88px; height: 88px; border-radius: 12px; overflow: hidden; position: relative;
  background: var(--surface-2); display: flex; align-items: center; justify-content: center;
}
.upload-item img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1); }
.upload-item img:hover { transform: scale(1.06); }
.upload-del {
  position: absolute; top: -4px; right: -4px; width: 20px; height: 20px;
  background: var(--accent); color: #fff; border-radius: 50%; font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.upload-add {
  width: 88px; height: 88px; border-radius: 12px; border: 1.5px dashed var(--border-strong);
  background: var(--surface-2); display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; cursor: pointer; color: var(--text-mute);
}
.upload-add:hover { border-color: var(--accent); color: var(--accent); }
/* 拖拽上传高亮 + 操作提示 */
.uploader.drag-over { outline: 2px dashed var(--accent); outline-offset: 6px; border-radius: 14px; background: color-mix(in srgb, var(--accent) 8%, transparent); }
.upload-hint { flex-basis: 100%; font-size: 12px; color: var(--text-mute); margin-top: 2px; line-height: 1.5; }

/* ============================================================
   弹窗 / Toast
   ============================================================ */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; }
.modal-mask { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(4px); }
.modal-card {
  position: relative; z-index: 2; width: 520px; max-width: 92vw; max-height: 88vh; overflow-y: auto;
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow); animation: pop 0.25s ease;
}
@keyframes pop { from { opacity: 0; } to { opacity: 1; } }
.modal-title { font-size: 17px; font-weight: 800; margin-bottom: 16px; }
.modal-foot { display: flex; gap: 12px; justify-content: flex-end; margin-top: 20px; }

/* 我的资料弹窗 */
.profile-row { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.profile-avatar {
  width: 72px; height: 72px; border-radius: 50%; overflow: hidden;
  background: rgba(120,120,160,.18); display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 800; color: var(--primary);
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-avatar-actions { display: flex; flex-direction: column; align-items: flex-start; }
.profile-avatar.avatar-dropzone { cursor: copy; transition: box-shadow .2s ease, transform .2s ease; box-shadow: 0 0 0 0 transparent; }
.profile-avatar.avatar-dropzone:hover { box-shadow: 0 0 0 2px var(--primary); }
.profile-avatar.avatar-dropzone.dragover { box-shadow: 0 0 0 3px var(--primary); transform: scale(1.06); }
.field-static { padding: 9px 12px; border-radius: 10px; background: var(--bg); border: 1px solid var(--border); color: var(--text); }
.field-hint { display: block; margin-top: 6px; font-size: 12px; color: var(--muted); }

.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%);
  background: var(--primary); color: #fff; padding: 12px 22px; border-radius: 12px;
  font-size: 14px; font-weight: 600; box-shadow: var(--shadow); z-index: 200;
  border: 1px solid var(--border-strong); animation: toastIn 0.3s ease;
}
.toast.error { background: #c0392b; }
.toast.success { background: #12a86f; }
@keyframes toastIn { from { transform: translate(-50%, 20px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }

.section-gap { margin-bottom: 18px; }
.muted { color: var(--text-mute); }
.text-right { text-align: right; }
.flex { display: flex; gap: 12px; align-items: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }

/* ============================================================
   图片相册 / 缩略图 / 放大预览 Lightbox
   ============================================================ */
.album-count { font-size: 12px; font-weight: 600; color: var(--text-mute); margin-left: 6px; }

.thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  cursor: zoom-in;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.thumb:hover { transform: translateY(-3px) scale(1.03); box-shadow: var(--shadow); border-color: var(--primary); }

/* 视频素材缩略：复用 .thumb 尺寸，但取消 zoom-in（改为内联播放） */
.mat-item video.thumb {
  cursor: default;
  background: #000;
  object-fit: contain;
}
.mat-item video.thumb:hover { transform: translateY(-3px) scale(1.03); }

/* 导入预览里的视频标签 */
.mat-tag {
  position: absolute;
  top: 2px; left: 2px;
  background: rgba(0,0,0,.6);
  color: #fff;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 6px;
  pointer-events: none;
}

/* 横向滑动轮播：移动端手指横滑 + 桌面端左右箭头，点击图片进灯箱 */
.carousel { position: relative; width: 100%; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); }
.carousel-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; -ms-overflow-style: none; scrollbar-width: none; }
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-slide { flex: 0 0 100%; scroll-snap-align: center; }
.carousel-slide img { width: 100%; height: 100%; max-height: 420px; object-fit: cover; display: block; cursor: zoom-in; transition: transform .2s ease; }
.carousel-slide img:active { transform: scale(.985); }
.carousel-btn { position: absolute; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border: none; border-radius: 50%; background: rgba(10,12,28,.55); color: #fff; font-size: 22px; line-height: 1; cursor: pointer; opacity: 0; transition: opacity .2s ease, background .2s ease; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(4px); z-index: 2; }
.carousel-btn:hover { background: rgba(10,12,28,.82); }
.carousel:hover .carousel-btn { opacity: 1; }
.carousel-prev { left: 8px; }
.carousel-next { right: 8px; }
.carousel-dots { position: absolute; left: 0; right: 0; bottom: 8px; display: flex; gap: 6px; justify-content: center; z-index: 2; pointer-events: none; }
.carousel-dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.5); transition: background .2s ease, transform .2s ease; }
.carousel-dots i.on { background: #fff; transform: scale(1.35); }
/* 列表卡片封面轮播：与原 .browse-card-cover 等高贴合 */
.browse-card .carousel { height: 150px; border-radius: 0; }
.browse-card .carousel-slide img { height: 100%; max-height: none; }
/* 详情页模块 / 角色截图轮播：限高，避免超长 */
.module-item .carousel-slide img, .card .carousel-slide img { max-height: 380px; }

.lightbox {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center;
  background: rgba(8, 10, 20, 0.88);
  backdrop-filter: blur(8px);
  animation: lbIn 0.2s ease;
}
@keyframes lbIn { from { opacity: 0; } to { opacity: 1; } }
.lb-img {
  max-width: 90vw; max-height: 86vh;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  cursor: default;
}
.lb-close {
  position: absolute; top: 22px; right: 26px;
  width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.1); color: #fff;
  font-size: 18px; cursor: pointer;
  transition: background 0.18s ease;
}
.lb-close:hover { background: rgba(255,255,255,0.25); }
.lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 52px; height: 52px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.1); color: #fff;
  font-size: 28px; line-height: 1; cursor: pointer;
  transition: background 0.18s ease;
}
.lb-nav:hover { background: rgba(255,255,255,0.25); }
.lb-prev { left: 26px; }
.lb-next { right: 26px; }
.lb-count {
  position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%);
  color: #fff; font-size: 14px; font-weight: 600;
  background: rgba(0,0,0,0.45); padding: 6px 16px; border-radius: 20px;
}
@media (max-width: 600px) {
  .lb-nav { width: 42px; height: 42px; font-size: 22px; }
  .lb-prev { left: 12px; } .lb-next { right: 12px; }
  .lb-close { top: 14px; right: 14px; }
}

/* 自动汇总字段：只读展示（人物单价 / 账号成本） */
.field .readonly, input.readonly {
  background: var(--surface-2);
  color: var(--text-mute);
  cursor: not-allowed;
  opacity: 0.85;
}
.field-hint {
  display: block;
  font-size: 12px;
  color: var(--text-mute);
  margin-top: 4px;
  line-height: 1.4;
}

/* ---------- 账号搜索栏（多字段筛选：下拉 + 模糊 + 价格区间） ---------- */
.filter-bar { align-items: center; gap: 8px; row-gap: 8px; }
.filter-bar .search,
.filter-bar select { flex: 0 0 auto; width: 132px; min-width: 0; max-width: none; }
.filter-bar .search.num { width: 88px; padding-left: 8px; padding-right: 8px; text-align: right; }
.filter-bar .combo { flex: 0 0 auto; width: 150px; }
.filter-bar .combo .search { width: 100%; }
.filter-bar .range { display: inline-flex; align-items: center; gap: 4px; }
.filter-bar .tilde { color: var(--text-mute); font-size: 12px; }
.filter-bar .btn { flex: 0 0 auto; }
@media (max-width: 720px) {
  .filter-bar .search, .filter-bar select, .filter-bar .combo, .filter-bar .range { width: 100%; }
  .filter-bar .range .search.num { flex: 1; width: auto; }
}

/* ---------- 注册 / 图形验证码 ---------- */
.btn-block { width: 100%; margin-top: 8px; }
.captcha-row { display: flex; align-items: center; gap: 10px; }
.captcha-row input { flex: 1; min-width: 0; }
.captcha-img {
  height: 40px; width: 110px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--border, rgba(255,255,255,0.15));
  background: #fff; flex: 0 0 auto;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.captcha-img:hover { transform: scale(1.03); box-shadow: 0 4px 14px rgba(0,0,0,0.2); }

/* ---------- 用户列表：实名标识 / 信用等级 ---------- */
.verified-badge {
  display: inline-flex; align-items: center; gap: 3px;
  color: #2ecc71; font-weight: 600; font-size: 13px; white-space: nowrap;
}
.unverified-badge {
  display: inline-flex; align-items: center; gap: 3px;
  color: var(--text-mute); font-size: 13px; white-space: nowrap;
}
.credit-cell { font-size: 15px; letter-spacing: 2px; white-space: nowrap; line-height: 1; }

/* ---------- 账号列表：勾选列 / 短编号 ---------- */
.col-sel { width: 36px; text-align: center; padding-left: 8px; padding-right: 8px; }
.code-cell { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .5px; color: #e94560; font-weight: 600; }
.code-chip {
  display: inline-block; margin-left: 10px; padding: 3px 12px; border-radius: 999px;
  background: rgba(233,69,96,.14); color: #e94560;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px; font-weight: 700; letter-spacing: .5px; vertical-align: middle;
}
.code-chip:hover { background: rgba(233,69,96,.24); }

/* ---------- 概览页：无成本数据时的友好提示（替代满屏 ¥0.00） ---------- */
.cost-hint {
  margin-top: 14px;
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; line-height: 1.5;
  color: var(--text-mute);
  background: rgba(255,255,255,0.03);
  border: 1px dashed var(--border, rgba(255,255,255,0.18));
}
.cost-hint span { display: inline-flex; align-items: center; gap: 6px; }

/* ============================================================
   收藏 & 浏览市场
   ============================================================ */
.browse-header {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px; margin-bottom: 14px;
}
.share-find { display: flex; align-items: center; gap: 8px; }
.search-input {
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 8px 12px; font-size: 14px; outline: none; min-width: 120px;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.search-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(233,69,96,.18); }
.search-input.num { width: 96px; min-width: 96px; }
.browse-filter {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  margin-bottom: 14px;
  position: sticky; top: 64px; z-index: 15; background: var(--bg);
  padding-top: 4px; padding-bottom: 4px;
}
.browse-filter .tilde { color: var(--text-mute); }

.browse-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  padding: 6px 0;
}
.browse-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  transition: transform .25s cubic-bezier(.16,1,.3,1), box-shadow .25s ease, border-color .25s ease;
}
.browse-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.browse-card-cover {
  width: 100%; height: 150px; object-fit: cover; display: block; cursor: pointer;
  background: linear-gradient(135deg, #1a1a2e, #0f3460);
}
.browse-card-cover.placeholder {
  display: flex; align-items: center; justify-content: center;
  font-size: 40px; color: rgba(255,255,255,.35);
}
.browse-card-body { padding: 12px 14px; }
.browse-card-title { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.browse-card-meta { font-size: 13px; color: var(--text-soft); margin-bottom: 10px; }
.browse-card-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* 浏览详情页顶部 hero: 装备首图(回退角色截图) */
.browse-hero {
  width: 100%; max-height: 360px; object-fit: cover; display: block;
  border-radius: 16px; margin-bottom: 14px; background: var(--surface-2);
}

/* 收藏按钮高亮态 */
.fav-toggle-btn.fav-on { color: #ff5b7f; border-color: rgba(255,91,127,.5); }
.fav-toggle-btn.fav-on:hover { background: rgba(255,91,127,.14); }

/* 分享弹窗 */
.share-code-box {
  display: flex; align-items: center; gap: 12px;
  margin: 14px 0 6px; padding: 14px 16px;
  background: var(--surface-2); border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
}
.share-code-num {
  flex: 1; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 26px; font-weight: 800; letter-spacing: 4px; color: var(--price);
  text-align: center; user-select: all;
}

/* 浏览市场公开详情：子模块卡片 */
.module-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.module-item { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; }

/* 浏览市场公开统计看板 */
.browse-stats { margin-bottom: 14px; }
.stat-cards { display: flex; gap: 12px; flex-wrap: wrap; }
.stat-card {
  flex: 1; min-width: 130px;
  background: linear-gradient(135deg, #1a1a2e, #0f3460);
  color: #fff; border-radius: 16px; padding: 16px 14px; text-align: center;
  box-shadow: 0 6px 20px rgba(26, 26, 46, .18);
}
.stat-num { font-size: 26px; font-weight: 800; line-height: 1.1; }
.stat-label { font-size: 13px; opacity: .82; margin-top: 6px; }
.stat-dist { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 14px; }
.dist-block {
  flex: 1; min-width: 260px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
}
.dist-title { font-weight: 800; font-size: 15px; margin-bottom: 10px; }
.dist-row { display: flex; align-items: center; gap: 10px; margin: 7px 0; font-size: 13px; }
.dist-name { width: 72px; flex-shrink: 0; color: var(--text-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dist-bar { flex: 1; height: 8px; background: var(--surface-2); border-radius: 6px; overflow: hidden; }
.dist-bar i { display: block; height: 100%; background: linear-gradient(90deg, #e94560, #ff6b35); border-radius: 6px; transition: width .4s ease; }
.dist-cnt { width: 92px; text-align: right; color: var(--text-mute); flex-shrink: 0; font-variant-numeric: tabular-nums; }
.module-item-title { font-weight: 700; font-size: 14px; margin-bottom: 8px; color: var(--text); }
.module-item .kv { font-size: 13px; }
.badge-count { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 7px; margin-left: 4px; border-radius: 11px; background: var(--primary); color: #fff; font-size: 12px; font-weight: 700; }

/* ---------------- 浏览市场 tab（账号 / 独立杂物） ---------------- */
.browse-tabs { display: flex; gap: 8px; margin: 14px 0 4px; }
.browse-tab {
  padding: 9px 18px; border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text-soft); border-radius: 12px; font-weight: 700; font-size: 14px; cursor: pointer;
  transition: all .2s ease;
}
.browse-tab:hover { border-color: var(--border-strong); color: var(--text); }
.browse-tab.active { background: linear-gradient(135deg, #1a1a2e, #0f3460); color: #fff; border-color: transparent; box-shadow: 0 6px 18px rgba(15,52,96,.35); }

/* ---------------- 独立杂物分组与卡片 ---------------- */
.loose-groups { display: flex; flex-direction: column; gap: 18px; }
.loose-group-title { font-weight: 800; font-size: 15px; margin-bottom: 10px; display: flex; align-items: center; }
.loose-card { cursor: pointer; }
.loose-tag {
  display: inline-flex; align-items: center; padding: 1px 8px; margin-right: 6px;
  border-radius: 8px; font-size: 12px; font-weight: 700;
  background: rgba(233,69,96,.16); color: #ff7a90; border: 1px solid rgba(233,69,96,.35);
}
.tag {
  display: inline-flex; align-items: center; padding: 2px 9px; margin-right: 6px;
  border-radius: 8px; font-size: 12px; font-weight: 600;
  background: var(--surface-2); color: var(--text-soft); border: 1px solid var(--border);
}
.module-detail-head { margin-bottom: 12px; }
.module-detail-title { font-weight: 800; font-size: 17px; margin-bottom: 8px; }
.module-detail-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.kv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
.kv-grid .kv { font-size: 13.5px; }
@media (max-width: 560px) { .kv-grid { grid-template-columns: 1fr; } }

/* 必填星号（独立发布时的区组/门派） */
.req { color: #ff6b6b; font-weight: 700; }

/* 区组/门派维护页：搜索框 + 分页器 */
.search-box { display: inline-flex; align-items: center; }
.search-box .input { height: 34px; }
.pager .btn[disabled] { opacity: .45; cursor: not-allowed; }
@media (max-width: 640px) {
  .pager { justify-content: center; }
  .search-box .input { width: 140px !important; }
}

/* ---------------- 游戏币市场 ---------------- */
.coin-card { cursor: pointer; }
.online-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px; border-radius: 8px; font-size: 12px; font-weight: 700;
}
.online-badge.on { background: rgba(75,225,160,.16); color: #4be1a0; border: 1px solid rgba(75,225,160,.35); }
.online-badge.off { background: var(--surface-2); color: var(--text-mute); border: 1px solid var(--border); }
.contact-box {
  margin-top: 14px; padding: 12px 14px; border-radius: var(--radius-sm);
  background: rgba(233,69,96,.08); border: 1px solid rgba(233,69,96,.22);
}
.contact-box.muted { background: var(--surface); border-color: var(--border); color: var(--text-mute); }
.contact-head { font-weight: 800; font-size: 14px; margin-bottom: 8px; }
.contact-box .kv { font-size: 13.5px; }

/* 售卖人卡片：头像 + 昵称 + 联系方式（浏览市场账号详情） */
.seller-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.seller-avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; background: var(--surface-2); border: 1px solid var(--border); }
.seller-avatar.placeholder { display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px; color: var(--text-mute); }
.seller-name { font-weight: 700; font-size: 15px; }

/* 键值行 + 一键复制按钮（联系方式） */
.copy-kv { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.copy-kv .v { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.copy-btn {
  flex: none; margin-left: 8px; padding: 3px 10px; border-radius: 8px; font-size: 12px; font-weight: 700;
  cursor: pointer; border: 1px solid var(--border); background: var(--surface-2); color: var(--accent);
  transition: all .18s ease;
}
.copy-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.copy-btn:active { transform: scale(.94); }

/* ============================================================
   C. 响应式补全
   ============================================================ */

/* 侧边栏遮罩层：默认隐藏，仅窄屏抽屉态可交互；桌面端永不显示，不挡操作 */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 40;
  background: rgba(0,0,0,.45);
  opacity: 0; transition: opacity .3s ease;
}

/* 窄屏（iPad 竖屏 / 小窗）：侧边栏改为 off-canvas 抽屉 */
@media (max-width: 900px) {
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: 240px; height: 100vh; z-index: 50;
    transform: translateX(-100%);
    box-shadow: 0 0 40px rgba(0,0,0,.4);
  }
  /* 桌面端 collapsed 的 width:0 收起态在窄屏需还原为抽屉隐藏态，避免侧边栏被吃成 0 宽 */
  .app-view.collapsed .sidebar { width: 240px; padding: 18px 14px; transform: translateX(-100%); }
  /* 抽屉打开态：侧边栏滑入 */
  .app-view.drawer-open .sidebar { transform: translateX(0); }
  /* 遮罩：窄屏下默认可渲染但不可交互/透明，抽屉态才激活 */
  .sidebar-overlay { display: block; pointer-events: none; }
  .app-view.drawer-open .sidebar-overlay { opacity: 1; pointer-events: auto; }
  /* 内容区始终占满宽度（侧边栏脱离文档流覆盖其上） */
  .main { width: 100%; }
}

/* 窄屏表格：收紧字号与内边距，横向滚动更易用（首列 sticky 已在 B 中实现） */
@media (max-width: 720px) {
  .table-wrap table { font-size: 12.5px; }
  .table-wrap table th,
  .table-wrap table td { padding: 9px 10px; }
  /* 顶栏在窄屏允许换行，避免按钮被挤掉 */
  .topbar { flex-wrap: wrap; gap: 8px; }
  .topbar-right { flex-wrap: wrap; }
}

/* ============================================================
   智能 AI 客服（最流行通用 bot 样式）
   ============================================================ */
.chat-launcher {
  position: fixed; right: 24px; bottom: 24px; z-index: 60;
  width: 58px; height: 58px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: none; cursor: grab; color: #fff;
  background: linear-gradient(135deg, #5b8cff, #7c5cff);
  box-shadow: 0 10px 30px rgba(91,140,255,.45);
  transition: transform .25s cubic-bezier(.16,1,.3,1), box-shadow .25s;
  /* 可自由拖拽：touch-action 关闭触摸默认滚动/缩放手势，will-change 提示合成器优化 left/top 位移 */
  touch-action: none;
  will-change: left, top;
}
.chat-launcher:hover { transform: scale(1.08) translateY(-2px); box-shadow: 0 16px 38px rgba(91,140,255,.55); }
.chat-launcher:active { cursor: grabbing; }
.chat-launcher-dot {
  position: absolute; top: 12px; right: 12px; width: 10px; height: 10px;
  border-radius: 50%; background: #ff5c7c; border: 2px solid #fff;
  animation: chatPulse 1.8s infinite;
}
@keyframes chatPulse { 0%,100%{ transform: scale(1); opacity:1 } 50%{ transform: scale(1.35); opacity:.6 } }

.chat-panel {
  position: fixed; right: 24px; bottom: 96px; z-index: 61;
  width: 380px; max-width: calc(100vw - 32px); height: 560px; max-height: calc(100vh - 140px);
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--bg-card, #fff);
  border: 1px solid var(--border, rgba(255,255,255,.12));
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0,0,0,.35);
  animation: chatPop .28s cubic-bezier(.16,1,.3,1);
}
@keyframes chatPop { from { opacity:0; transform: translateY(16px) scale(.96) } to { opacity:1; transform: none } }

.chat-header {
  display: flex; align-items: center; gap: 10px; padding: 14px 32px 14px 16px;
  background: linear-gradient(135deg, #5b8cff, #7c5cff); color: #fff;
}
.chat-avatar { font-size: 22px; }
.chat-head-text { flex: 1; line-height: 1.25; }
.chat-title { font-weight: 700; font-size: 15px; }
.chat-sub { font-size: 11.5px; opacity: .85; }
.chat-close {
  background: rgba(255,255,255,.18); border: none; color: #fff; cursor: pointer;
  width: 28px; height: 28px; border-radius: 8px; font-size: 14px;
  transition: background .2s;
}
.chat-close:hover { background: rgba(255,255,255,.32); }

/* 恢复默认大小按钮（与收起按钮同款 header 按钮样式） */
.chat-reset {
  background: rgba(255,255,255,.18); border: none; color: #fff; cursor: pointer;
  width: 28px; height: 28px; border-radius: 8px; font-size: 14px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.chat-reset:hover { background: rgba(255,255,255,.32); }

/* 四角拖拽手柄：拖动调整聊天面板大小。每个角一个，data-dir 决定方向；
   手柄仅 14px 贴在面板角落，不挡内容；右上角(ne)因 header 右侧留出 32px 而不与关闭/恢复按钮冲突 */
.chat-resize {
  position: absolute; width: 14px; height: 14px; z-index: 6; touch-action: none;
  border: 0 solid rgba(124,92,255,.6);
}
.chat-resize-nw { top: 2px; left: 2px; cursor: nwse-resize; border-top-width: 2px; border-left-width: 2px; border-top-left-radius: 4px; }
.chat-resize-ne { top: 2px; right: 2px; cursor: nesw-resize; border-top-width: 2px; border-right-width: 2px; border-top-right-radius: 4px; }
.chat-resize-sw { bottom: 2px; left: 2px; cursor: nesw-resize; border-bottom-width: 2px; border-left-width: 2px; border-bottom-left-radius: 4px; }
.chat-resize-se { bottom: 2px; right: 2px; cursor: nwse-resize; border-bottom-width: 2px; border-right-width: 2px; border-bottom-right-radius: 4px; }

.chat-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.chat-msg { display: flex; max-width: 86%; }
.chat-msg.bot { align-self: flex-start; }
.chat-msg.user { align-self: flex-end; justify-content: flex-end; }
.chat-bubble {
  padding: 10px 13px; border-radius: 14px; font-size: 13.5px; line-height: 1.55;
  white-space: pre-wrap; word-break: break-word;
}
.chat-msg.bot .chat-bubble {
  background: var(--bg-soft, #f1f3f9); color: var(--text, #1c2333);
  border-bottom-left-radius: 4px;
}
.chat-msg.user .chat-bubble {
  background: linear-gradient(135deg, #5b8cff, #7c5cff); color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-bubble.typing::after {
  content: '▍'; animation: chatBlink 1s steps(2) infinite; margin-left: 2px;
}
@keyframes chatBlink { 50% { opacity: 0 } }

/* 聊天正文里的「编号#N」可点击跳转（账号详情） */
.chat-link {
  color: #5b8cff; font-weight: 600; cursor: pointer;
  text-decoration: underline; text-underline-offset: 2px;
  padding: 0 1px;
}
.chat-link:hover { color: #7c5cff; }

/* 机器人回复下方挂一排「可点击账号卡片」 */
.chat-cards {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; max-width: 100%;
}
.chat-account-card {
  flex: 1 1 150px; min-width: 140px; max-width: 200px;
  background: var(--bg-soft, #f1f3f9);
  border: 1px solid var(--border, rgba(0,0,0,.08));
  border-radius: 12px; padding: 9px 11px; cursor: pointer;
  transition: transform .18s cubic-bezier(.16,1,.3,1), box-shadow .18s, border-color .18s;
}
.chat-account-card:hover {
  transform: translateY(-2px); border-color: #5b8cff;
  box-shadow: 0 6px 18px rgba(91,140,255,.18);
}
.chat-account-card .ck-title { font-size: 13px; font-weight: 600; color: var(--text, #1c2333); }
.chat-account-card .ck-meta { font-size: 11.5px; color: var(--muted, #6b7280); margin-top: 3px; line-height: 1.4; }

.chat-input-row { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--border, rgba(255,255,255,.1)); }
.chat-input {
  flex: 1; resize: none; max-height: 96px; padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--border, rgba(255,255,255,.18));
  background: var(--bg-soft, #f1f3f9); color: var(--text, #1c2333);
  font-size: 13.5px; outline: none; line-height: 1.5;
}
.chat-input:focus-visible { border-color: #5b8cff; box-shadow: 0 0 0 3px rgba(91,140,255,.25); }
.chat-send {
  align-self: flex-end; padding: 0 16px; height: 40px; border: none; border-radius: 12px; cursor: pointer;
  color: #fff; font-weight: 600; background: linear-gradient(135deg, #5b8cff, #7c5cff);
  transition: transform .2s, opacity .2s;
}
.chat-send:hover { transform: translateY(-1px); }
.chat-send:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.chat-foot { padding: 7px 16px 10px; font-size: 11px; color: var(--text-muted, #8892a6); text-align: center; }

/* ===== 广告前置模态 ===== */
.ad-modal { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; }
.ad-mask { position: absolute; inset: 0; background: rgba(8,10,20,.72); backdrop-filter: blur(4px); }
.ad-card {
  position: relative; width: 360px; max-width: calc(100vw - 32px);
  background: var(--bg-card, #fff); border-radius: 18px; overflow: hidden;
  box-shadow: 0 30px 70px rgba(0,0,0,.5); animation: chatPop .3s cubic-bezier(.16,1,.3,1);
}
.ad-media { height: 220px; background: linear-gradient(135deg, #2a3358, #3a2a58); display: flex; align-items: center; justify-content: center; }
.ad-placeholder { text-align: center; color: rgba(255,255,255,.6); font-size: 18px; letter-spacing: 1px; line-height: 1.8; }
.ad-placeholder span { font-size: 11px; opacity: .6; letter-spacing: 3px; }
.ad-tip { padding: 14px 16px 4px; font-size: 13.5px; text-align: center; color: var(--text, #1c2333); font-weight: 600; }
/* 额度用尽警示：暖色强调，区别于首次进入的普通引导 */
.ad-tip.warn {
  color: #c0392b; font-size: 14px; letter-spacing: .3px;
  background: rgba(192,57,43,.08); border-radius: 10px; margin: 0 12px 2px; padding: 12px 14px;
}
.ad-skip {
  display: block; width: calc(100% - 32px); margin: 10px 16px 18px; height: 44px; border: none; border-radius: 12px; cursor: pointer;
  font-size: 14px; font-weight: 600; color: #fff; background: linear-gradient(135deg, #5b8cff, #7c5cff);
  transition: opacity .2s, transform .2s;
}
.ad-skip:disabled { background: #b9c0d4; cursor: not-allowed; }
.ad-skip:not(:disabled):hover { transform: translateY(-1px); }

/* 窄屏自适应 */
@media (max-width: 480px) {
  .chat-panel { right: 12px; left: 12px; width: auto; bottom: 86px; }
  .chat-launcher { right: 16px; bottom: 16px; }
}

/* ===== 商品素材（卖家朋友圈整理导入） ===== */
.mat-item { position: relative; }
.mat-cap-text { font-size: 12px; color: #9aa0b5; margin-top: 4px; line-height: 1.4; padding: 0 2px; word-break: break-word; }
.mat-del {
  position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%;
  border: none; background: rgba(0,0,0,.55); color: #fff; cursor: pointer; font-size: 12px;
  line-height: 22px; padding: 0; z-index: 2;
}
.mat-del:hover { background: #e94560; }
.mat-rows { margin-top: 10px; display: flex; flex-direction: column; gap: 10px; }
.mat-row {
  display: flex; gap: 10px; align-items: center; background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08); border-radius: 10px; padding: 8px;
}
.mat-thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; flex: 0 0 auto; }
.mat-cap { flex: 1; }
.mat-file { margin-bottom: 6px; }

/* ===== P2 前端新增样式 ===== */

/* 登录内联校验错误提示 */
.login-error {
  margin: 2px 0 10px; padding: 8px 12px; border-radius: 10px;
  font-size: 13px; color: #fff; background: #e94560;
  box-shadow: 0 6px 16px rgba(233,69,96,.25);
}
.input-err { border-color: #e94560 !important; box-shadow: 0 0 0 3px rgba(233,69,96,.25) !important; }

/* 分页「跳至第 N 页」 */
.pager-jump {
  display: inline-flex; align-items: center; gap: 6px; margin-left: 10px;
  font-size: 13px; color: var(--text-muted, #8892a6);
}
.pg-jump {
  width: 56px; height: 30px; padding: 0 6px; border-radius: 8px; text-align: center;
  border: 1px solid var(--border, rgba(255,255,255,.18));
  background: var(--bg-soft, #f1f3f9); color: var(--text, #1c2333); font-size: 13px;
}
.pg-jump:focus-visible { outline: none; border-color: #5b8cff; box-shadow: 0 0 0 3px rgba(91,140,255,.25); }

/* 广告：额度可解释 + 不再提示开关 */
.ad-quota {
  padding: 8px 16px 0; font-size: 12.5px; text-align: center; color: var(--text-muted, #8892a6);
  letter-spacing: .3px;
}
.ad-noad {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 16px 16px; font-size: 12.5px; color: var(--text-muted, #8892a6); cursor: pointer;
  user-select: none;
}
.ad-noad input { width: 15px; height: 15px; accent-color: #5b8cff; cursor: pointer; }

/* 焦点陷阱：被聚焦元素高亮（a11y） */
.modal-card :focus-visible,
.chat-panel :focus-visible,
.ad-card :focus-visible {
  outline: 2px solid #5b8cff; outline-offset: 2px;
}

/* ============================================================
   P1-3 统一加载态：骨架屏 / spinner
   ============================================================ */
.skeleton { position: relative; overflow: hidden; background: var(--skel-bg, rgba(140,150,180,.14)); border-radius: 8px; }
.skeleton::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.18), transparent);
  transform: translateX(-100%); animation: skeletonShine 1.25s infinite;
}
@keyframes skeletonShine { 100% { transform: translateX(100%); } }
.skeleton-cover { width: 100%; aspect-ratio: 16 / 10; border-radius: 14px 14px 0 0; }
.skeleton-line { height: 12px; margin: 10px 14px 0; }
.skeleton-line.short { width: 55%; }
.skeleton-block { padding: 16px 14px; display: flex; flex-direction: column; gap: 12px; }
.skeleton-grid { gap: 16px; padding: 4px; }
.skeleton-card {
  background: var(--bg-card, #fff); border-radius: 16px; overflow: hidden;
  box-shadow: 0 6px 20px rgba(20,30,60,.10); border: 1px solid var(--border, rgba(140,150,180,.18));
}

/* 居中旋转 spinner：用于详情页 / 表单 / 弹窗内加载 */
.spinner-wrap { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 36px 16px; }
.spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid var(--skel-bg, rgba(140,150,180,.25));
  border-top-color: var(--accent, #5b8cff);
  animation: spin .8s linear infinite;
}
.spinner-label { font-size: 13px; color: var(--text-muted, #8892a6); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   P1-2 卡片缩略图条（多图进灯箱）
   ============================================================ */
.card-thumbs { display: flex; gap: 6px; padding: 0 12px 12px; overflow-x: auto; }
.card-thumb {
  width: 46px; height: 46px; object-fit: cover; border-radius: 8px; cursor: pointer; flex: 0 0 auto;
  border: 1px solid var(--border, rgba(140,150,180,.22)); transition: transform .15s, box-shadow .15s;
}
.card-thumb:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.2); }

/* ============================================================
   P1-6 错误态 + 重试按钮（与 .empty 共用排版）
   ============================================================ */
.error-card { border-color: rgba(224,49,49,.4) !important; }
.error-retry-wrap { padding: 4px 16px 8px; text-align: center; }

/* ============================================================
   P1-1 首入广告「稍后再说」弱跳过
   ============================================================ */
.ad-skip-weak {
  display: block; width: calc(100% - 32px); margin: 0 16px 8px; height: 38px; border: 1px solid var(--border, rgba(140,150,180,.3));
  border-radius: 12px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text-muted, #8892a6);
  background: transparent; transition: opacity .2s, transform .2s, background .2s;
}
.ad-skip-weak:hover { background: rgba(140,150,180,.10); transform: translateY(-1px); }
/* F6：「不再提示广告」开关 */
.ad-noask {
  display: flex; align-items: center; gap: 6px; justify-content: center;
  font-size: 12px; color: var(--text-muted, #8892a6); cursor: pointer; user-select: none;
  margin: 4px 16px 14px;
}
.ad-noask input { width: 14px; height: 14px; accent-color: var(--accent, #e94560); cursor: pointer; }

/* ============================================================
   P2 F6 「不再提示广告」开关
   ============================================================ */
.ad-noask {
  display: flex; align-items: center; gap: 8px; justify-content: center;
  margin: 4px 16px 12px; font-size: 13px; color: var(--text-soft, #aab0c6); cursor: pointer; user-select: none;
}
.ad-noask input { width: 16px; height: 16px; accent-color: var(--accent, #e94560); cursor: pointer; }

/* ============================================================
   P2 F7 客服游戏币卡片「在线/离线」徽标
   ============================================================ */
.ck-badge {
  display: inline-block; margin: 2px 0 4px;
  padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; line-height: 1.5;
}
.ck-badge.on { background: rgba(75,225,160,.16); color: #4be1a0; border: 1px solid rgba(75,225,160,.35); }
.ck-badge.off { background: var(--surface-2, rgba(255,255,255,.07)); color: var(--text-mute, #6f7596); border: 1px solid var(--border, rgba(255,255,255,.1)); }

/* ============================================================
   P2 F9 回到顶部悬浮按钮
   ============================================================ */
.back-to-top {
  position: fixed; right: 22px; bottom: 92px; z-index: 1200;
  width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--border-strong, rgba(255,255,255,.18));
  background: var(--gradient, linear-gradient(135deg, #1a1a2e, #0f3460)); color: #fff; font-size: 22px; line-height: 1;
  display: none; align-items: center; justify-content: center; cursor: pointer;
  box-shadow: var(--shadow, 0 10px 30px rgba(0,0,0,.45)); transition: transform .15s, opacity .15s;
}
.back-to-top:hover { transform: translateY(-2px); }

/* 聊天面板打开时（body.chat-open 由 app.js openPanel/closePanel 切换）：
   面板占据右下 380px 宽区域，返回顶部按钮改停左下角避让，互不遮挡。
   选择器特异性 (0,2,0) 高于上面的 .back-to-top (0,1,0)，无需 !important。 */
body.chat-open .back-to-top { right: auto; left: 22px; bottom: 22px; }

/* ============================================================
   秒杀模块样式（Flash Sale）
   ============================================================ */

/* 秒杀横幅 */
.flash-banner {
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(135deg, #FF4444, #cc2222);
  color: #fff; font-weight: 800; font-size: 22px;
  padding: 18px 24px; border-radius: var(--radius);
  margin-bottom: 20px; box-shadow: 0 6px 24px rgba(204, 34, 34, 0.35);
}
.flash-banner-icon { font-size: 32px; animation: flashPulse 1.2s ease-in-out infinite; }
@keyframes flashPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.15); } }
.flash-banner-text { letter-spacing: 2px; }

/* 场次分组标题 */
.flash-section-title {
  font-size: 17px; font-weight: 800; margin: 14px 0 10px;
  color: var(--text); display: flex; align-items: center; gap: 6px;
}

/* 场次卡片网格 */
.flash-card-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  margin-bottom: 20px;
}

/* 场次卡片 */
.flash-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px;
  cursor: pointer; transition: all 0.2s ease;
  box-shadow: var(--shadow);
}
.flash-card:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: 0 12px 32px rgba(0,0,0,0.3); }
.flash-card-top {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 10px;
}
.flash-card-name { font-weight: 700; font-size: 16px; color: var(--text); }
.flash-card-meta {
  display: flex; justify-content: space-between; gap: 10px;
  font-size: 13px; color: var(--text-soft);
}

/* 场次详情页头部 */
.flash-detail-header {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 24px;
  margin-bottom: 18px; box-shadow: var(--shadow);
}
.flash-detail-title { font-size: 22px; font-weight: 800; margin-bottom: 10px; }
.flash-detail-status { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.flash-detail-time { font-size: 14px; color: var(--text-soft); margin-bottom: 8px; }
.flash-detail-countdown { font-size: 16px; font-weight: 700; color: var(--accent); }

/* 倒计时数字 */
.flash-countdown {
  font-size: 20px; font-weight: 800;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--accent); letter-spacing: 1px;
}

/* 状态标签 */
.flash-status-tag {
  display: inline-flex; align-items: center; padding: 4px 14px;
  border-radius: 20px; font-size: 13px; font-weight: 700;
}
.flash-status-tag.pending { background: rgba(243,156,18,0.18); color: #f0b350; border: 1px solid rgba(243,156,18,0.35); }
.flash-status-tag.active { background: rgba(233,69,96,0.18); color: #ff7a90; border: 1px solid rgba(233,69,96,0.35); }
.flash-status-tag.ended { background: var(--surface-2); color: var(--text-mute); border: 1px solid var(--border); }

/* 商品卡片（详情页） */
.flash-items-wrap { display: flex; flex-direction: column; gap: 12px; }
.flash-item-card {
  display: grid; grid-template-columns: 2fr 1.2fr 1.5fr auto;
  align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 18px;
  box-shadow: var(--shadow); transition: border-color 0.2s ease;
}
.flash-item-card:hover { border-color: var(--border-strong); }
@media (max-width: 720px) {
  .flash-item-card { grid-template-columns: 1fr; gap: 10px; }
}

.flash-item-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.flash-item-thumb { font-size: 13px; color: var(--text-mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flash-item-name { font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 6px; }

.flash-item-prices { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; }
.flash-original-price { font-size: 13px; color: var(--text-mute); text-decoration: line-through; }
.flash-sale-price { font-size: 20px; font-weight: 800; color: #FF4444; }

.flash-item-stock { min-width: 120px; }
.flash-item-action { text-align: right; }

/* 秒杀抢购按钮 */
.flash-grab-btn {
  background: linear-gradient(135deg, #FF4444, #cc2222) !important;
  color: #fff !important; font-weight: 800 !important;
  padding: 10px 18px !important; border: none !important;
  box-shadow: 0 4px 14px rgba(204, 34, 34, 0.35) !important;
  transition: all 0.2s ease !important;
}
.flash-grab-btn:hover { transform: translateY(-2px) !important; box-shadow: 0 8px 24px rgba(204, 34, 34, 0.5) !important; }
.flash-grab-btn:active { transform: scale(0.96) !important; }
.flash-grab-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

/* 库存进度条 */
.flash-stock-bar {
  display: flex; align-items: center; gap: 8px;
}
.flash-stock-track {
  flex: 1; height: 8px; background: var(--surface-2);
  border-radius: 6px; overflow: hidden;
}
.flash-stock-fill {
  height: 100%; border-radius: 6px;
  transition: width 0.5s ease, background 0.5s ease;
}
.flash-stock-text { font-size: 12px; color: var(--text-soft); white-space: nowrap; min-width: 60px; text-align: right; }

/* 商品类型徽标（秒杀专用） */
.flash-type-badge {
  display: inline-flex; align-items: center; padding: 1px 8px;
  border-radius: 8px; font-size: 11px; font-weight: 700;
  vertical-align: middle;
}
.flash-type-badge.type-account { background: rgba(75, 225, 160, 0.16); color: #4be1a0; border: 1px solid rgba(75, 225, 160, 0.35); }
.flash-type-badge.type-coin { background: rgba(243, 156, 18, 0.16); color: #f0b350; border: 1px solid rgba(243, 156, 18, 0.35); }
.flash-type-badge.type-misc { background: rgba(91, 140, 255, 0.16); color: #5b8cff; border: 1px solid rgba(91, 140, 255, 0.35); }

/* ===== 秒杀管理后台 ===== */
.flash-admin-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; flex-wrap: wrap; gap: 12px;
}
.flash-admin-header h2 {
  font-size: 22px; font-weight: 800;
  background: linear-gradient(135deg, #FF4444, #cc2222);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.flash-admin-table { margin-top: 4px; }
.flash-admin-table th {
  background: var(--surface-2); font-weight: 600; font-size: 13px;
  padding: 10px 12px; white-space: nowrap;
}
.flash-admin-table td { padding: 10px 12px; vertical-align: middle; }
.flash-admin-table tr:hover td { background: rgba(255,68,68,0.04); }

/* 商品管理面板 */
.flash-items-panel {
  margin-top: 16px; border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.flash-items-panel .card-title {
  font-size: 15px; font-weight: 700; padding: 14px 18px;
  background: var(--surface-2); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}

/* 搜索面板 */
.flash-search-panel {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px; margin: 8px 0;
}
.flash-search-panel input[type="text"] {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 6px; padding: 8px 12px; font-size: 14px;
  outline: none; transition: border-color 0.2s;
}
.flash-search-panel input[type="text"]:focus { border-color: var(--accent); }
.flash-search-panel table th {
  font-size: 12px; padding: 6px 8px; white-space: nowrap;
}
.flash-search-panel table td { padding: 6px 8px; font-size: 13px; }
.flash-search-panel table tbody tr:hover {
  background: rgba(255,68,68,0.08); cursor: pointer;
}

/* 选中信息 */
.flash-selected-info {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 12px; margin: 6px 0;
  background: rgba(75,225,160,0.1); border: 1px solid rgba(75,225,160,0.3);
  border-radius: var(--radius); font-size: 14px; font-weight: 600;
}

/* 原价行 */
.flash-orig-row {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 0; margin-bottom: 6px;
  font-size: 14px; color: var(--text-soft);
}
.flash-orig-price-val { font-weight: 700; font-size: 18px; color: var(--text); }

/* 秒杀价+库存并排行 */
.flash-price-stock {
  display: flex; gap: 16px; flex-wrap: wrap;
}
.flash-price-stock > div {
  flex: 1; min-width: 140px;
}
.flash-price-stock input {
  width: 100%; box-sizing: border-box;
}

/* 场次表单 - 日期时间行 */
.flash-datetime-row {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
}
.flash-datetime-row .field-label { flex: none; }
.flash-datetime-row input[type="date"] {
  flex: 1; min-width: 140px;
}
.flash-datetime-row input[type="text"] {
  width: 100px; text-align: center;
}

/* 秒杀订单表 */
.flash-order-table th { white-space: nowrap; font-size: 13px; }
.flash-order-table td { vertical-align: middle; }

/* 空状态 */
.flash-empty {
  text-align: center; padding: 40px 20px;
  color: var(--text-mute); font-size: 15px;
}
