/* =========================================================================
   瑜帮帮拍卖平台 · 通用组件库 (ds- 前缀)
   仅依赖 tokens.css。可与现有页面共存，按需套用。
   ========================================================================= */

/* ---------- 图标基样式（线性 SVG，1.8 描边圆端点）---------- */
.ic {
  width: 1.25em;
  height: 1.25em;
  display: inline-block;
  vertical-align: -0.22em;
  stroke: currentColor;
  fill: none;
  flex: none;
}
.ic-sm { width: 1em; height: 1em; }
.ic-lg { width: 1.6em; height: 1.6em; }
.ic-xl { width: 2.2em; height: 2.2em; }
/* 图标默认描边样式（symbol 内 path 也内联了，这里兜底） */
svg.ic [stroke] { stroke: currentColor; }

/* ---------- 按钮 ---------- */
.ds-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
  font-family: var(--font-sans);
  white-space: nowrap;
}
.ds-btn:hover { transform: translateY(-1px); }
.ds-btn:active { transform: translateY(0); }
.ds-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.ds-btn .ic { width: 1.1em; height: 1.1em; }

.ds-btn-primary { background: var(--grad-brand); color: #fff; box-shadow: var(--sh-2); }
.ds-btn-primary:hover { box-shadow: var(--sh-3); }
.ds-btn-gold   { background: var(--grad-gold); color: #3A1A00; box-shadow: var(--sh-2); }
.ds-btn-rose   { background: var(--grad-rose); color: #fff; box-shadow: var(--sh-2); }
.ds-btn-success{ background: var(--success); color: #fff; }
.ds-btn-wechat { background: var(--wechat); color: #fff; }
.ds-btn-ghost  { background: transparent; color: var(--brand-600); border-color: var(--brand-100); }
.ds-btn-outline { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.3); }
.ds-btn-sm { padding: 6px 12px; font-size: 13px; border-radius: var(--r-sm); }
.ds-btn-lg { padding: 14px 28px; font-size: 16px; }
.ds-btn-block { width: 100%; }

/* ---------- 卡片 ---------- */
.ds-card {
  background: var(--surface);
  border: 1px solid var(--surface-100);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: var(--sh-2);
}
.ds-card-flat { box-shadow: none; border-color: var(--surface-100); }
.ds-card-glow-gold { box-shadow: 0 0 0 1px var(--gold-500), 0 8px 30px rgba(245,158,11,.18); }
.ds-card-glow-rose { box-shadow: 0 0 0 1px var(--rose-500), 0 8px 30px rgba(244,63,94,.18); }

/* ---------- 徽章 ---------- */
.ds-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.6;
}
.ds-badge .ic { width: .9em; height: .9em; }
.ds-badge-brand   { background: var(--brand-50);  color: var(--brand-600); }
.ds-badge-gold    { background: var(--gold-100);  color: var(--gold-600); }
.ds-badge-rose    { background: var(--rose-100);  color: var(--rose-600); }
.ds-badge-success { background: var(--success-bg); color: var(--success); }
.ds-badge-warning { background: var(--warning-bg); color: var(--warning); }
.ds-badge-danger  { background: var(--danger-bg);  color: var(--danger); }
.ds-badge-info    { background: var(--info-bg);    color: var(--info); }
.ds-badge-muted   { background: var(--surface-100); color: var(--text-muted); }

/* 数字等宽工具类 */
.ds-num { font-variant-numeric: tabular-nums; font-family: var(--font-num); }
.ds-money { font-family: var(--font-num); font-variant-numeric: tabular-nums; font-weight: 700; color: var(--gold-600); }
.ds-money-lg { font-size: 30px; color: var(--gold-500); text-shadow: 0 0 18px rgba(245,158,11,.35); }

/* ---------- 表格 ---------- */
.ds-table-wrap { overflow-x: auto; border-radius: var(--r-lg); border: 1px solid var(--surface-100); background: var(--surface); }
.ds-table { width: 100%; border-collapse: collapse; font-size: 13px; }   /* 规范：表格 13px 基准 */
.ds-table thead th {
  position: sticky; top: 0;
  background: var(--surface-100);
  color: var(--text-muted);
  font-size: 12px; font-weight: 600;
  text-align: left; padding: 10px 14px;
  white-space: nowrap;
}
.ds-table tbody td { padding: 12px 14px; border-top: 1px solid var(--surface-100); color: var(--text); }
.ds-table tbody tr:hover { background: var(--surface-50); }
.ds-table .col-money { text-align: right; }
.ds-table .col-money .ds-money { color: var(--gold-600); }

/* ---------- 表单 ---------- */
.ds-field { display: block; margin-bottom: 14px; }
.ds-field > label { display: block; margin-bottom: 6px; font-weight: 600; opacity: .9; color: var(--text); }
.ds-input,
.ds-select,
.ds-textarea {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--surface-100);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-family: var(--font-sans);
  transition: border-color .12s, box-shadow .12s;
}
.ds-input:focus,
.ds-select:focus,
.ds-textarea:focus { outline: none; border-color: var(--brand-500); box-shadow: 0 0 0 3px var(--brand-100); }
.ds-input::placeholder, .ds-textarea::placeholder { color: var(--text-soft); }

/* 开关 */
.ds-switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.ds-switch input { opacity: 0; width: 0; height: 0; }
.ds-switch .track {
  position: absolute; inset: 0; cursor: pointer;
  background: var(--text-soft); border-radius: var(--r-full); transition: .2s;
}
.ds-switch .track::before {
  content: ""; position: absolute; height: 18px; width: 18px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: .2s; box-shadow: var(--sh-1);
}
.ds-switch input:checked + .track { background: var(--brand-600); }
.ds-switch input:checked + .track::before { transform: translateX(20px); }

/* ---------- 通用布局 ---------- */
.ds-row { display: flex; align-items: center; gap: 12px; }
.ds-col { display: flex; flex-direction: column; gap: 12px; }
.ds-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ds-muted { color: var(--text-muted); }
.ds-soft  { color: var(--text-soft); }

/* ---------- 按钮补充变体（对齐参考实现）---------- */
.ds-btn-secondary { background: var(--surface); color: var(--text-2); border-color: var(--border); }
.ds-btn-secondary:hover { border-color: var(--brand-400); color: var(--brand-600); }
.ds-btn-danger-o { background: transparent; color: var(--danger); border-color: var(--danger-bg); }
.ds-btn-danger-o:hover { background: var(--danger-bg); }
.ds-btn-xs { padding: 4px 10px; font-size: 12px; border-radius: var(--r-sm); gap: 5px; }
.ds-btn-xs .ic { width: .95em; height: .95em; }

/* ---------- 徽章补充色（green/blue/gray/red 命名对齐参考实现）---------- */
.ds-badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; display: inline-block; }
.ds-badge-green  { background: var(--success-bg); color: var(--success); }
.ds-badge-blue   { background: var(--info-bg);    color: var(--info); }
.ds-badge-gray   { background: var(--surface-100); color: var(--text-muted); }
.ds-badge-red    { background: var(--danger-bg);  color: var(--danger); }

/* ---------- KPI 统计卡 ---------- */
.ds-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.ds-kpi {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 16px 18px; box-shadow: var(--sh-2); position: relative; overflow: hidden;
}
.ds-kpi-ico { width: 38px; height: 38px; border-radius: var(--r-md); display: grid; place-items: center; margin-bottom: 10px; }
.ds-kpi-ico .ic { width: 20px; height: 20px; }
.ds-kpi-ico.c-green { background: var(--success-bg); color: var(--success); }
.ds-kpi-ico.c-rose  { background: var(--rose-100);   color: var(--rose-600); }
.ds-kpi-ico.c-gold  { background: var(--gold-100);    color: var(--gold-600); }
.ds-kpi-ico.c-brand { background: var(--brand-50);    color: var(--brand-600); }
.ds-kpi-label { font-size: 13px; color: var(--text-3); }
.ds-kpi-value { font-size: 26px; font-weight: 700; margin-top: 2px; font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.ds-kpi-value small { font-size: 15px; font-weight: 600; margin-right: 2px; color: var(--text-3); }
.ds-kpi-foot { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.ds-kpi-foot .up { color: var(--success); }
.ds-kpi-foot .down { color: var(--danger); }

/* ---------- 次级统计（小指标）---------- */
.ds-ministats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }
.ds-ministat { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-md); padding: 12px 14px; }
.ds-ministat b { font-size: 20px; font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.ds-ministat span { display: block; font-size: 12px; color: var(--text-3); margin-top: 2px; }
.ds-ministat .muted { color: var(--text-3); }

/* ---------- 头像 ---------- */
.ds-avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  color: #fff; font-weight: 600; font-size: 13px; flex: none; background: var(--grad-brand); }
.ds-avatar.sm { width: 28px; height: 28px; font-size: 12px; }

/* ---------- 搜索框 ---------- */
.ds-search { display: inline-flex; align-items: center; gap: 8px; padding: 0 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-full); }
.ds-search .ic { width: 16px; height: 16px; color: var(--text-3); }
.ds-search .ds-input { border: 0; padding: 9px 0; background: transparent; box-shadow: none; }
.ds-search .ds-input:focus { box-shadow: none; border-color: transparent; }

/* ---------- 表格细化（金额/操作/单元）---------- */
.ds-table .t-num { text-align: right; font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.ds-table .t-price { text-align: right; font-weight: 700; color: var(--gold-600); font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.ds-table .t-sub { display: block; font-size: 11px; color: var(--text-3); font-weight: 400; margin-top: 2px; }
.ds-table .t-actions { display: flex; gap: 6px; justify-content: flex-end; }
.ds-table .u-cell { display: flex; align-items: center; gap: 8px; }
.ds-table .u-cell b { font-weight: 600; }

/* ---------- 提示条 ---------- */
.ds-alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-md);
  background: var(--info-bg); color: var(--info); font-size: 13px; line-height: 1.6; }
.ds-alert .ic { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.ds-alert.warn { background: var(--warning-bg); color: var(--warning); }

/* ---------- 数字等宽（对齐参考实现 .num）---------- */
.num { font-variant-numeric: tabular-nums; font-family: var(--font-num); }

/* ---------- 表单补充（对齐参考实现 design-system.html 第 05 节）---------- */
.ds-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.ds-label b { color: var(--danger); margin-left: 2px; }
.ds-field.full { grid-column: 1 / -1; }
.ds-input-group { display: flex; align-items: center; gap: 8px; }
.ds-input-group .ds-input { flex: 1 1 auto; min-width: 0; }
.ds-input-group .ds-btn { flex: none; }

/* ---------- 布局工具（对齐参考实现）---------- */
.flex { display: flex; align-items: center; }

/* ---------- 全局 Toast（对齐参考实现 design-system.html 第 05 节）---------- */
.ds-toast {
  position: fixed; left: 50%; bottom: 40px;
  display: flex; align-items: center; gap: 9px;
  padding: 11px 18px; border-radius: var(--r-md);
  background: var(--bg-sidebar); color: #fff; font-size: 14px;
  box-shadow: var(--sh-4); z-index: 9999;
  opacity: 0; pointer-events: none;
  transform: translateX(-50%) translateY(20px);
  transition: opacity .22s ease, transform .22s ease;
}
.ds-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.ds-toast .ic { width: 18px; height: 18px; color: var(--success); flex: none; }

/* =========================================================================
   补齐参考实现所需布局组件（来源：数据概览 · 拍卖运营台 app.html）
   —— 这些类在参考稿里被大量使用，ds.css 原本缺失
   ========================================================================= */

/* ---------- 页头 ---------- */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.page-head h2 { margin: 0; font-size: 20px; font-weight: 700; color: var(--text-2); letter-spacing: .02em; }
.page-head .desc { color: var(--text-3); font-size: 13px; margin-top: 4px; }
.page-actions { display: flex; gap: 10px; flex: none; }

/* ---------- 卡片 / 面板 ---------- */
.panel-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px 0; }
.panel-title h3 { margin: 0; font-size: 15px; font-weight: 600; color: var(--text-2); display: flex; align-items: center; gap: 8px; }
.panel-title h3 .ic { width: 18px; height: 18px; color: var(--text-3); }
.panel-title a { font-size: 12.5px; color: var(--brand-600); text-decoration: none; }
.dash-grid { display: grid; grid-template-columns: 1fr 340px; gap: 16px; align-items: start; }
.chart-wrap { padding: 8px 20px 18px; }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--text-3); }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; }

/* ---------- 实时动态 Feed ---------- */
.feed { padding: 8px 20px 16px; max-height: 320px; overflow: auto; }
.feed-item { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--divider); font-size: 13px; color: var(--text-2); }
.feed-item > .ic { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.feed-item .t { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.feed-item:last-child { border-bottom: 0; }

/* ---------- 当前拍品/秒杀 卡片内部 ---------- */
.live-item { padding: 18px 20px; }
.live-item h4 { margin: 12px 0 0; font-size: 16px; font-weight: 700; color: var(--text-2); }
.thumb { position: relative; height: 168px; border-radius: var(--r-md); overflow: hidden;
  background: linear-gradient(135deg, var(--brand-900), var(--brand-700)); display: grid; place-items: center; }
.thumb .ic { width: 56px; height: 56px; color: rgba(199,210,254,.55); }
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.thumb .st { position: absolute; top: 10px; left: 10px; display: flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: var(--r-full); font-size: 12px; color: #fff;
  background: rgba(6,8,20,.62); backdrop-filter: blur(6px); }
.thumb .st .dot { width: 7px; height: 7px; border-radius: 50%; background: #4ADE80; box-shadow: 0 0 8px #4ADE80; }
.price-line { display: flex; align-items: baseline; gap: 8px; margin-top: 8px; }
.price-line b { font-size: 30px; font-weight: 800; font-family: var(--font-num); color: var(--rose-600); }
.price-line span { font-size: 12.5px; color: var(--text-3); }
.price-line + .meta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; font-size: 12.5px; color: var(--text-3); }
.price-line + .meta .ic { width: 14px; height: 14px; }

/* ---------- 前景色工具 ---------- */
.f-brand { color: var(--brand-600) !important; }
.f-gold  { color: var(--gold-500) !important; }
.f-green { color: var(--success) !important; }
.f-rose  { color: var(--rose-600) !important; }

/* ---------- 分页 ---------- */
.ds-pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-top: 1px solid var(--divider); }
.ds-pager-info { font-size: 12.5px; color: var(--text-3); }
.ds-pager-btns { display: flex; gap: 6px; }
.ds-page-btn { min-width: 32px; height: 32px; padding: 0 9px; border-radius: var(--r-sm);
  border: 1px solid var(--border); background: var(--bg-card); color: var(--text-2);
  font-size: 12.5px; cursor: pointer; display: grid; place-items: center; }
.ds-page-btn.on { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.ds-page-btn:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- 帮助文本 ---------- */
.ds-help { font-size: 12px; color: var(--text-3); margin-top: 6px; }
