/* =====================================================================
   Arco 风格覆盖层（1:1 对齐原版 https://mer.opdj.top/login 视觉语言）
   主色 #1b56f0，内容底色 #f4f7fb，卡片白底细描边，圆角 6 / 10
   ===================================================================== */
:root {
  --brand: #1b56f0;
  --brand-2: #4a7bf5;
  --brand-dark: #1a4bd0;
  --brand-soft: #e8f0ff;
  --bg: #f4f7fb;
  --text: #1d2129;
  --muted: #86909c;
  --line: #e5e6eb;
  --ok: #00b42a;
  --warn: #ff7d00;
  --danger: #f53f3f;
  --radius: 10px;
  --card-shadow: 0 1px 2px rgba(29, 33, 41, .04);
}

body { background: var(--bg); color: var(--text); font-size: 14px; }

/* ---------- 侧边栏：白底 + 蓝色选中 ---------- */
.sidebar {
  width: 208px; flex: 0 0 208px;
  background: #fff;
  border-right: 1px solid var(--line);
  color: #4e5969;
}
.brand { padding: 16px 16px 14px; border-bottom: 1px solid var(--line); }
.brand .mark {
  background: var(--brand);
  box-shadow: none;
  border-radius: 8px;
  font-size: 14px;
}
.brand .name { color: #1d2129; font-size: 14.5px; }
.brand .sub { color: #86909c; }
.nav { padding: 10px 8px; }
.nav-title { color: #c9cdd4; font-size: 12px; }
.nav a { color: #4e5969; border-radius: 6px; padding: 9px 12px; font-size: 13.5px; }
.nav a:hover { background: #f2f3f5; color: #1d2129; }
.nav a.active {
  background: var(--brand);
  color: #fff;
  box-shadow: none;
}
.nav a.active .ico { opacity: 1; }
.side-foot { border-top: 1px solid var(--line); color: #86909c; background: #fff; }
.side-foot .out { color: #86909c; }
.side-foot .out:hover { color: var(--brand); }

/* ---------- 顶栏：白底 56px，右侧图标 ---------- */
.topbar {
  height: 56px;
  padding: 0 20px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
}
.topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar .menu-btn,
.topbar .icon-btn {
  width: 30px; height: 30px; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  color: #4e5969; cursor: pointer; background: transparent; border: 0;
}
.topbar .menu-btn:hover, .topbar .icon-btn:hover { background: #f2f3f5; color: #1d2129; }
.topbar .page-tab {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 14px; border-radius: 6px;
  background: var(--brand); color: #fff; font-size: 13px; font-weight: 500;
}
.topbar h1 { display: none; }
.topbar .crumb { display: none; }
.topbar .right { gap: 6px; }
.site-chip {
  background: #f2f3f5; color: #4e5969; border-radius: 6px;
  padding: 5px 10px; font-size: 12px;
}
.user-chip { gap: 8px; font-size: 13px; color: #1d2129; }
.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--brand); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px;
}

/* ---------- 内容区与卡片 ---------- */
.content { padding: 16px; }
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--card-shadow);
  padding: 16px 18px;
}
.card + .card { margin-top: 12px; }
.card-head h2 { font-size: 15px; }
.card-head .desc { color: #86909c; }

/* ---------- 表单控件：浅灰底 ---------- */
.input, .select, .textarea {
  background: #f7f8fa;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #1d2129;
  height: 36px;
  padding: 0 12px;
}
.input:hover, .select:hover { background: #f2f3f5; }
.input:focus, .select:focus, .textarea:focus {
  background: #fff;
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(27, 86, 240, .12);
}
.input::placeholder, .textarea::placeholder { color: #c9cdd4; }

.btn {
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #fff;
  color: #4e5969;
  height: 34px;
  padding: 0 14px;
}
.btn:hover { background: #f7f8fa; border-color: #d9dde3; }
.btn-primary {
  background: var(--brand); border-color: var(--brand); color: #fff;
  font-weight: 500;
}
.btn-primary:hover { background: #1a4bd0; border-color: #1a4bd0; }
.btn-danger { color: var(--danger); border-color: #ffd8d8; background: #fff5f5; }
.btn-ghost { color: var(--brand); background: transparent; border-color: transparent; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn-success { background: #00b42a; border-color: #00b42a; color: #fff; }

/* ---------- 标签：浅蓝/浅灰 chip ---------- */
.badge { border-radius: 4px; padding: 2px 8px; font-size: 12px; }
.badge-gray { background: #f2f3f5; color: #86909c; }
.badge-blue { background: #e8f0ff; color: var(--brand); }
.badge-green { background: #e8ffea; color: #00b42a; }
.badge-orange { background: #fff7e8; color: #ff7d00; }
.badge-red { background: #ffece8; color: #f53f3f; }

/* ---------- 统计卡 ---------- */
.stat { border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: none; }
.stat .value { font-size: 24px; }
.stat.brand .value { color: var(--brand); }

/* ---------- 表格 ---------- */
.table th { background: #f7f8fa; color: #4e5969; font-weight: 500; }
.table td, .table th { border-bottom: 1px solid var(--line); }

/* =====================================================================
   登录页（1:1 复刻原版：白底 + 顶部品牌 + 欢迎登录 + 灰底输入 + 蓝色按钮）
   ===================================================================== */
.login-page {
  display: block;
  min-height: 100vh;
  background: #fff;
  position: relative;
  overflow-x: hidden;
}
.login-page::before {
  content: '';
  position: absolute; top: -80px; right: -60px;
  width: 420px; height: 420px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(27,86,240,.10), rgba(27,86,240,0) 62%);
  pointer-events: none;
}
.login-page::after {
  content: '';
  position: absolute; top: 20px; right: 90px;
  width: 260px; height: 200px;
  background: linear-gradient(160deg, rgba(27,86,240,.06), rgba(120,90,240,.10));
  filter: blur(2px);
  transform: rotate(8deg);
  pointer-events: none;
}
.login-left, .login-right { display: none; }
.login-wrap {
  position: relative; z-index: 1;
  max-width: 480px; margin: 0 auto;
  padding: 26px 21px 40px;
}
.login-brand {
  display: flex; align-items: center; gap: 8px;
  font-size: 15.5px; font-weight: 600; color: #1d2129;
  margin-bottom: 34px;
}
.login-brand .mark {
  width: 26px; height: 26px; border-radius: 7px;
  background: var(--brand); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
}
.login-box .hello { font-size: 30px; font-weight: 700; letter-spacing: -.5px; color: #1d2129; }
.login-box .hello-sub { font-size: 13px; color: #86909c; margin-top: 8px; margin-bottom: 26px; }
.login-box .form-row { margin-bottom: 18px; }
.login-box .form-row label { color: #1d2129; font-size: 13px; margin-bottom: 8px; }
.login-box .form-row label .req { color: #f53f3f; margin-right: 3px; }
.login-box .input { height: 42px; font-size: 14px; }
.login-box .btn-primary {
  width: 100%; height: 44px; margin-top: 10px;
  font-size: 15px; font-weight: 600;
  border-radius: 6px;
  box-shadow: none;
}
.login-box .btn-primary:hover { background: #1a4bd0; }
.login-foot { margin-top: 24px; text-align: center; color: #c9cdd4; font-size: 12px; }

/* ---------- 触发条 ---------- */
.cap-trigger {
  width: 100%; height: 42px;
  display: flex; align-items: center; gap: 8px;
  padding: 0 12px;
  background: #f7f8fa; border: 1px solid transparent; border-left: 3px solid var(--brand);
  border-radius: 6px; cursor: pointer;
  color: #86909c; font-size: 13px;
  text-align: left;
}
.cap-trigger:hover { background: #f2f3f5; }
.cap-trigger .cap-trigger-ico { color: #86909c; display: inline-flex; }
.cap-trigger .cap-trigger-text { flex: 1; color: #4e5969; }
.cap-trigger .cap-trigger-right { color: #c9cdd4; font-size: 12px; }
.cap-trigger.done { border-left-color: #00b42a; }
.cap-trigger.done .cap-trigger-text { color: #00b42a; }
.cap-trigger.done .cap-trigger-ico { color: #00b42a; }

/* ---------- 弹窗 ---------- */
.cap-mask {
  position: fixed; inset: 0; z-index: 900;
  display: none; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, .38);
}
.cap-mask.show { display: flex; }
.cap-modal {
  width: 340px; max-width: calc(100vw - 32px);
  background: #fff; border-radius: 10px;
  padding: 0 0 2px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .16);
  overflow: hidden;
}
.cap-modal-head {
  padding: 14px 18px 10px;
  font-size: 14px; font-weight: 600; color: #1d2129;
  text-align: left;
}
.cap-wrap {
  position: relative;
  margin: 0 10px 10px;
  height: auto;
  aspect-ratio: 320 / 150;
  border-radius: 8px;
  overflow: hidden;
  background: #f2f3f5;
}
.cap-img { width: 100%; height: 100%; object-fit: fill; display: block; }
.cap-piece {
  position: absolute; left: 0; top: 0;
  width: 48px; height: 48px;
  pointer-events: none;
}
.cap-loading {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: #86909c; font-size: 12.5px;
  background: #f7f8fa;
}
.cap-ok-tip {
  position: absolute; inset: 0;
  display: none; align-items: center; justify-content: center; gap: 6px;
  background: rgba(0, 180, 42, .1);
  color: #00b42a; font-size: 13px; font-weight: 600;
}
.cap-ok-tip.show { display: flex; }

.slider {
  position: relative;
  margin: 0 10px 6px;
  height: 42px;
  background: #f2f3f5;
  border-radius: 6px;
  overflow: hidden;
}
.slider .track-fill {
  position: absolute; left: 0; top: 0; bottom: 0; width: 0;
  background: #e8f0ff;
}
.slider .handle {
  position: absolute; left: 0; top: 0;
  width: 42px; height: 42px;
  background: var(--brand); color: #fff;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  cursor: grab;
  z-index: 2;
}
.slider .handle:active { cursor: grabbing; }
.slider .hint {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding-left: 42px;
  font-size: 12.5px; color: #86909c;
  pointer-events: none;
  transition: opacity .15s;
}
.slider.done .track-fill { background: #e8ffea; }
.slider.done .handle { background: #00b42a; }
.slider.done .hint { color: #00b42a; }

.cap-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 12px 10px;
  color: #c9cdd4; font-size: 12px;
}
.cap-foot .cap-refresh {
  border: 0; background: transparent; color: #86909c;
  cursor: pointer; padding: 4px; display: inline-flex;
}
.cap-foot .cap-refresh:hover { color: var(--brand); }

/* =====================================================================
   深色主题（与原版一致，localStorage: merchant-admin-theme = dark）
   ===================================================================== */
html[data-theme="dark"] body { background: #17171a; color: #e5e6eb; }
html[data-theme="dark"] .sidebar,
html[data-theme="dark"] .topbar,
html[data-theme="dark"] .card,
html[data-theme="dark"] .stat { background: #232324; border-color: #2e2e30; }
html[data-theme="dark"] .brand .name,
html[data-theme="dark"] .card-head h2,
html[data-theme="dark"] .user-chip { color: #e5e6eb; }
html[data-theme="dark"] .nav a { color: #c9cdd4; }
html[data-theme="dark"] .nav a:hover { background: #2e2e30; color: #fff; }
html[data-theme="dark"] .input,
html[data-theme="dark"] .select,
html[data-theme="dark"] .textarea { background: #2e2e30; border-color: #2e2e30; color: #e5e6eb; }
html[data-theme="dark"] .login-page { background: #17171a; }
html[data-theme="dark"] .login-page::before,
html[data-theme="dark"] .login-page::after { opacity: .35; }
html[data-theme="dark"] .login-box .hello,
html[data-theme="dark"] .login-brand { color: #e5e6eb; }
html[data-theme="dark"] .cap-modal { background: #232324; }
html[data-theme="dark"] .cap-modal-head { color: #e5e6eb; }
html[data-theme="dark"] .page-tab { color: #fff; }

/* ---------- 顶栏补充 ---------- */
.topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.icon-btn { position: relative; }
.icon-btn .dot {
  position: absolute; top: 3px; right: 4px; width: 6px; height: 6px;
  border-radius: 50%; background: #f53f3f;
}
body.side-collapsed .sidebar { display: none; }
@media (max-width: 860px) {
  .sidebar { display: none; }
  .topbar h1, .topbar .crumb { display: none; }
  .site-chip { display: none; }
}

/* ---------- 登录页补充（窄屏） ---------- */
@media (max-width: 520px) {
  .login-wrap { padding: 22px 16px 34px; }
  .login-box .hello { font-size: 26px; }
}
