/* ============================================================
   闻道体育 · 商户管理后台  基础层
   主色取馆主小程序 tabBar 的蓝 #1f6feb —— 同一家店，手机和电脑上是同一个颜色。
   平台总后台是绿，商户后台是蓝，两边不会认错。
   颜色只承担三件事：主操作、状态、提醒；不做装饰。
   ============================================================ */

/* 2026-10-27：与概览页对齐，把「专业、克制、有层次」定成整套后台的基调。
   做法是抬高一档中性色（偏冷、少黄），半径放大到 8/10/14，阴影改成双层
   （贴边 1px + 大面积柔光），主按钮用同色系微渐变 + 品牌色投影。
   颜色语义不变：蓝=主操作，绿=正常，橙=提醒，红=危险。 */
:root {
  /* 2026-11-14：按品牌 LOGO 的配色重定调（深墨蓝 + 紫 + 橙 + 品红）。
     LOGO 里最深的是墨紫 #1A1A1A，主色取紫 #FF5000，强调色取橙 #FF7A3D，
     危险/负数用品红 #D93025 —— 和 LOGO 的粉红线同一族，不再是纯红。 */
  /* 顶栏与侧栏 logo 区共用同一个高度：两处各写各的会差几个像素，
     横向分割线就对不齐（2026-11-17 老板指出）。 */
  --topbar-h: 60px;
  --brand: #FF5000;
  --brand-ink: #E04600;
  --brand-tint: #FFF0E8;
  --brand-deep: #C43C00;
  --brand-grad: linear-gradient(135deg, #FF7A33 0%, #FF5000 58%, #E04600 100%);

  /* LOGO 的橙色，只用在「需要跳一下」的地方：选中条、重点标签、首屏光晕 */
  --accent: #ff7a3d;
  --accent-ink: #d9541a;
  --accent-tint: #fff2e9;

  --warm-ink: #9a5b12;
  --warm-bg: #fdf4e7;
  --danger-ink: #D93025;
  --danger-bg: #FDECEA;
  --ok-ink: #26784f;
  --ok-bg: #eef7f1;

  --ink: #1A1A1A;
  --ink-2: #333333;
  --ink-3: #666666;
  --ink-4: #999999;

  --line: #E6E6E6;
  --line-2: #F0F0F0;
  --bg: #F5F5F5;
  --panel: #ffffff;

  --r-sm: 8px;
  --r: 10px;
  --r-lg: 14px;

  --shadow-sm: 0 1px 2px rgba(35, 20, 55, .05);
  --shadow: 0 1px 2px rgba(35, 20, 55, .04), 0 10px 26px rgba(35, 20, 55, .07);
  --shadow-lg: 0 1px 2px rgba(35, 20, 55, .05), 0 24px 60px rgba(35, 20, 55, .20);
  --shadow-brand: 0 1px 2px rgba(255, 80, 0, .26), 0 6px 16px rgba(255, 80, 0, .22);
  --ring: 0 0 0 3px rgba(255, 80, 0, .16);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  --mono: "SFMono-Regular", "Courier New", ui-monospace, monospace;
  --nav-w: 216px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  /* 全站数字等宽对齐（2026-12-01）：同一套字体，不再混用等宽字体 */
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
b, strong { font-weight: 600; }

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #dfe3ea; border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #cfd5df; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 15px;
  border: 1px solid #dfe4ee;
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 1px 1px rgba(24, 36, 56, .03);
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .15s;
}
.btn:hover { background: #f8fafd; border-color: #cfd8e6; box-shadow: 0 2px 6px rgba(24, 36, 56, .07); }
.btn:active { background: #f2f5fa; box-shadow: none; transform: translateY(.5px); }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn:focus-visible { outline: 0; box-shadow: var(--ring); }
/* 用 <a class="btn"> 当"跳转按钮"时（协议全文这类新窗口打开），不要链接默认下划线 */
a.btn { text-decoration: none; }

.btn.primary {
  background: var(--brand-grad);
  border-color: #E04600;
  color: #fff;
  font-weight: 600;
  box-shadow: var(--shadow-brand);
}
.btn.primary:hover { background: linear-gradient(135deg, #C43C00 0%, #FF5000 58%, #E04600 100%); border-color: #C43C00; }

.btn.ghost { border-color: transparent; background: transparent; color: var(--ink-2); box-shadow: none; }
.btn.ghost:hover { background: #f1f4f8; color: var(--ink); }

.btn.danger { color: var(--danger-ink); border-color: #f0d9d2; background: #fff; }
.btn.danger:hover { background: #fff8f6; border-color: #e8c4ba; }
.btn.danger:hover { background: var(--danger-bg); }

.btn.sm { height: 29px; padding: 0 11px; font-size: 12.5px; border-radius: 7px; box-shadow: none; }
.btn.lg { height: 42px; padding: 0 22px; font-size: 14px; border-radius: 10px; }
.btn.block { width: 100%; }

/* ---------- 输入 ---------- */
.field {
  width: 100%;
  height: 36px;
  padding: 0 11px;
  border: 1px solid #dfe4ee;
  border-radius: 9px;
  background: #fff;
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.field::placeholder { color: var(--ink-4); }
.field:hover { border-color: #cfd8e6; }
.field:focus { border-color: #FFC7A8; box-shadow: var(--ring); }

textarea.field { height: auto; min-height: 76px; padding: 8px 10px; line-height: 1.6; resize: vertical; }

select.field {
  appearance: none;
  padding-right: 28px;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' fill='none' stroke='%238b93a0' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  cursor: pointer;
}

/* ---------- 状态标签 ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 23px;
  padding: 0 9px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .1px;
  white-space: nowrap;
}
.tag.blue { background: var(--brand-tint); color: var(--brand-ink); }
.tag.green { background: var(--ok-bg); color: var(--ok-ink); }
.tag.warm { background: var(--warm-bg); color: var(--warm-ink); }
.tag.danger { background: var(--danger-bg); color: var(--danger-ink); }
.tag.gray { background: #f2f3f5; color: #717986; }
.tag.violet { background: #F5F5F5; color: #666666; }
.tag.line { background: #fff; border: 1px solid var(--line); color: var(--ink-2); }
.tag .dot { width: 5px; height: 5px; }

.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---------- 通用小件 ---------- */
.muted { color: var(--ink-3); }
.faint { color: var(--ink-4); }
/* 数字/编号一律用正文字体（2026-12-01 老板：全站数字字体必须统一）。
   等宽效果靠 tabular-nums 实现，不要再换字体族。 */
.mono { font-family: inherit; font-variant-numeric: tabular-nums; font-size: inherit; letter-spacing: 0; }
.num { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }
.ell { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.row { display: flex; align-items: center; gap: 8px; }
.grow { flex: 1; min-width: 0; }
.right { margin-left: auto; }

.empty-box {
  padding: 44px 20px;
  text-align: center;
  color: var(--ink-3);
  font-size: 13px;
}
.empty-box b { display: block; margin-bottom: 4px; color: var(--ink-2); font-size: 14px; }

.avatar {
  flex: none;
  width: 32px; height: 32px;
  border-radius: 50%;
  overflow: hidden;   /* 有头像图时裁成圆的；没图时退回姓名首字 */
  background: var(--brand-tint);
  color: var(--brand-ink);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600;
}
.avatar.lg { width: 44px; height: 44px; font-size: 16px; }
.avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
.avatar.gray { background: #f2f3f5; color: #78808d; }
.avatar.green { background: var(--ok-bg); color: var(--ok-ink); }
.avatar.violet { background: #F5F5F5; color: #666666; }
.avatar.warm { background: var(--warm-bg); color: var(--warm-ink); }

/* 分隔线 */
.hr { height: 1px; background: var(--line-2); margin: 14px 0; }

/* 开关 */
.sw {
  position: relative;
  width: 38px; height: 22px;
  border-radius: 11px;
  background: #dfe3ea;
  border: 0; padding: 0;
  cursor: pointer;
  transition: background .16s;
  flex: none;
}
.sw::after {
  content: "";
  position: absolute; left: 2px; top: 2px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .18);
  transition: transform .16s;
}
.sw.on { background: var(--brand); }
.sw.on::after { transform: translateX(16px); }
.sw:disabled { opacity: .45; cursor: not-allowed; }

/* 关掉动效的偏好：截图工具与「减少动态效果」的用户都走这条，
   弹层不要靠动画结束才变不透明，否则会看到半透明的一层。 */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ---------- toast（2026-11-15 从 app.css 挪过来）----------
   登录页只引 base.css + login.css，原来 toast 样式在 app.css 里，
   登录页点了「忘记密码」弹提示根本没样式、看不见，像是没反应。 */
.toast-wrap {
  position: fixed; left: 50%; top: 24px;
  transform: translateX(-50%);
  z-index: 600;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 16px;
  border-radius: 8px;
  background: #1f2633;
  color: #fff;
  font-size: 13px;
  box-shadow: 0 8px 28px rgba(15, 22, 34, .24);
  animation: toast-in .18s ease-out both;
}
.toast.ok::before { content: "✓"; color: #6ee7a8; font-weight: 700; }
.toast.err::before { content: "!"; color: #ff9c8a; font-weight: 700; }
/* 提醒类（额度到 80% 这种）：不拦操作，但要比普通成功提示更扎眼 */
.toast.warn::before { content: "!"; color: #ffd08a; font-weight: 700; }
@keyframes toast-in { from { transform: translateY(-6px); opacity: 0; } to { transform: none; opacity: 1; } }



/* 「?」说明气泡（2026-11-21）：长说明收起来，点开才看 */
.help-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 17px; height: 17px; margin-left: 7px; padding: 0;
  border: 1px solid rgba(26,23,20,.22); border-radius: 50%;
  background: transparent; color: #8a8071; font-size: 11px; line-height: 1;
  cursor: pointer; vertical-align: 2px; font-family: inherit;
}
.help-btn:hover { border-color: #1a1714; color: #1a1714; }
.help-pop {
  position: fixed; z-index: 90; background: #fff; max-width: calc(100vw - 24px);
  border: 1px solid rgba(26,23,20,.12); border-radius: 10px;
  box-shadow: 0 10px 30px rgba(20,18,15,.14);
  padding: 12px 14px; font-size: 12.5px; line-height: 1.75; color: #4a4038;
}
.help-pop-t { font-weight: 600; color: #1a1714; margin-bottom: 4px; }

.help-pop-b { display: flex; flex-direction: column; gap: 3px; }
.help-pop .help-p { margin: 2px 0; }
.help-pop .help-li { display: flex; align-items: baseline; }
.help-pop .help-dot { flex: none; width: 12px; color: #a49a8e; }
