/* 挪车码 · 管理后台样式（原生 CSS，无构建链） */

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --bg: #f5f7fa;
  --panel: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --success: #16a34a;
  --warn: #f59e0b;
  --danger: #dc2626;
  --radius: 8px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}

a { color: var(--primary); text-decoration: none; }

/* ---------- 登录页 ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1e3a8a, #2563eb);
}
.login-card {
  background: #fff;
  width: 360px;
  padding: 32px 28px;
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.18);
}
.login-card h1 { margin: 0 0 24px; font-size: 20px; text-align: center; }
.login-card .hint { color: var(--muted); font-size: 12px; text-align: center; margin-top: 14px; }

/* ---------- 布局 ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 210px;
  background: #111827;
  color: #d1d5db;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}
.sidebar .brand {
  padding: 20px 18px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  border-bottom: 1px solid #1f2937;
}
.sidebar nav { padding: 10px 0; flex: 1; }
.sidebar nav a {
  display: block;
  padding: 11px 18px;
  color: #d1d5db;
  font-size: 14px;
}
.sidebar nav a:hover { background: #1f2937; color: #fff; }
.sidebar nav a.active { background: var(--primary); color: #fff; }
.sidebar .sysinfo { padding: 14px 18px; font-size: 12px; color: #6b7280; border-top: 1px solid #1f2937; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 56px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
}
.topbar .title { font-size: 16px; font-weight: 600; }
.topbar .user { color: var(--muted); font-size: 13px; }
.content { padding: 22px; flex: 1; }

/* ---------- 卡片 / 表单 ---------- */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 18px;
}
.card h2 { margin: 0 0 16px; font-size: 15px; }

.form-row { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 150px; }
.field label { font-size: 12px; color: var(--muted); }
input, select {
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  outline: none;
  background: #fff;
  color: var(--text);
}
input:focus, select:focus { border-color: var(--primary); }

button {
  height: 36px;
  padding: 0 16px;
  border: none;
  border-radius: 6px;
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
}
button:hover { background: var(--primary-dark); }
button:disabled { opacity: 0.55; cursor: not-allowed; }
button.ghost { background: #fff; color: var(--text); border: 1px solid var(--border); }
button.ghost:hover { background: #f3f4f6; }
button.danger { background: var(--danger); }
button.small { height: 28px; padding: 0 10px; font-size: 12px; }

/* ---------- 表格 ---------- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 13px; }
th { color: var(--muted); font-weight: 500; background: #fafafa; }
tbody tr:hover { background: #f9fafb; }
.table-wrap { overflow-x: auto; }

.tag { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; }
.tag.ACTIVE { background: #dcfce7; color: #166534; }
.tag.UNBOUND { background: #f3f4f6; color: #4b5563; }
.tag.CALL_DISABLED { background: #fef3c7; color: #92400e; }
.tag.DISABLED { background: #fee2e2; color: #991b1b; }
.tag.BLOCKED { background: #fee2e2; color: #991b1b; }
.tag.SUCCESS { background: #dcfce7; color: #166534; }
.tag.FAILED, .tag.TIMEOUT { background: #fee2e2; color: #991b1b; }
.tag.RATE_LIMITED { background: #fef3c7; color: #92400e; }

/* ---------- 统计卡片 ---------- */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.stat .label { color: var(--muted); font-size: 12px; margin-bottom: 8px; }
.stat .value { font-size: 24px; font-weight: 600; }

/* ---------- 二维码预览 ---------- */
.previews { display: flex; flex-wrap: wrap; gap: 12px; margin: 12px 0; }
.previews figure { margin: 0; text-align: center; }
.previews img { width: 120px; height: 120px; border: 1px solid var(--border); border-radius: 6px; }
.previews figcaption { font-size: 12px; color: var(--muted); margin-top: 4px; }
.code-list {
  background: #f9fafb;
  border: 1px dashed var(--border);
  border-radius: 6px;
  padding: 12px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 12px;
  word-break: break-all;
  max-height: 140px;
  overflow: auto;
}

/* ---------- 分页 / 抽屉 ---------- */
.pager { display: flex; gap: 8px; align-items: center; margin-top: 14px; }
.pager .info { color: var(--muted); font-size: 12px; }
.drawer-mask {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.35); z-index: 40;
}
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 460px; max-width: 92vw;
  background: #fff; z-index: 41; padding: 20px; overflow: auto;
  box-shadow: -6px 0 20px rgba(0, 0, 0, 0.15);
}
.drawer h3 { margin-top: 0; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%) translateY(20px);
  background: rgba(17, 24, 39, 0.92); color: #fff; padding: 10px 18px; border-radius: 8px;
  font-size: 13px; opacity: 0; pointer-events: none; transition: all 0.25s; z-index: 60;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.muted { color: var(--muted); }
.mt12 { margin-top: 12px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
