/* ============ GMAdM 管理后台样式 ============ */
:root {
  --primary: #2563eb;
  --primary-deep: #1d4ed8;
  --primary-light: #eff6ff;
  --danger: #ef4444;
  --text: #1f2937;
  --text-2: #6b7280;
  --text-3: #9ca3af;
  --bg: #f5f7fb;
  --card: #ffffff;
  --border: #eef0f4;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-lg: 0 8px 30px rgba(16, 24, 40, .10);
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
[v-cloak] { display: none; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

/* ============ 登录 ============ */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(1000px 500px at 85% -10%, rgba(37, 99, 235, .10), transparent 60%),
    radial-gradient(800px 400px at -10% 110%, rgba(239, 68, 68, .06), transparent 60%),
    var(--bg);
  padding: 24px;
}
.login-card {
  width: 380px;
  background: var(--card);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  padding: 40px 36px 28px;
}
.login-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 30px; }
.logo-mark {
  width: 42px; height: 42px; border-radius: 12px;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #fff; font-size: 22px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 16px rgba(37, 99, 235, .35);
}
.logo-text { font-size: 20px; font-weight: 800; line-height: 1.2; }
.logo-text span { display: block; font-size: 12px; font-weight: 500; color: var(--text-2); margin-top: 2px; }
.login-form .field { margin-bottom: 18px; }
.field label {
  display: block; font-size: 13px; color: var(--text-2);
  margin-bottom: 6px; font-weight: 500;
}
.login-tip { margin-top: 22px; text-align: center; font-size: 12px; color: var(--text-3); }
.form-error { color: var(--danger); font-size: 13px; margin-top: 10px; text-align: center; }

input, select {
  width: 100%; height: 40px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: 10px;
  font-size: 14px; color: var(--text);
  background: #fbfcfe; outline: none; transition: all .18s;
}
input:focus, select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
  background: #fff;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 40px; padding: 0 18px; border: none; border-radius: 10px;
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: all .18s; user-select: none; white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #fff; box-shadow: 0 4px 12px rgba(37, 99, 235, .28);
}
.btn-primary:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-ghost {
  background: #fff; color: var(--text-2);
  border: 1px solid var(--border);
}
.btn-ghost:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-light); }
.btn-block { width: 100%; height: 44px; font-size: 15px; }
.btn-sm { height: 30px; padding: 0 12px; font-size: 13px; border-radius: 8px; }

/* ============ 顶栏 ============ */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, .85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1240px; margin: 0 auto; padding: 0 24px;
  height: 60px; display: flex; align-items: center; gap: 16px;
}
.brand { font-size: 18px; font-weight: 800; margin-right: 8px; }
.nav { display: flex; gap: 4px; }
.nav a {
  padding: 8px 16px; border-radius: 10px;
  color: var(--text-2); text-decoration: none; font-weight: 500;
  transition: all .18s;
}
.nav a:hover { color: var(--primary); background: var(--primary-light); }
.nav a.active {
  color: var(--primary); background: var(--primary-light); font-weight: 700;
}
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.callback-url {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--text-3);
  max-width: 520px;
}
.cb-label { font-size: 12px; color: var(--text-3); white-space: nowrap; }
.callback-url code {
  font-family: var(--mono); color: var(--primary-deep);
  background: var(--primary-light); padding: 3px 10px; border-radius: 6px;
  font-size: 12px; cursor: pointer;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  flex: 1; min-width: 0;
  transition: all .15s;
}
.callback-url code:hover { background: #dbeafe; }
.cb-copy {
  display: inline-flex; align-items: center; gap: 5px;
  height: 28px; padding: 0 12px; border: 1px solid var(--primary);
  border-radius: 8px; background: #fff; color: var(--primary);
  font-size: 12px; font-weight: 600; cursor: pointer;
  transition: all .15s; flex-shrink: 0;
}
.cb-copy:hover { background: var(--primary); color: #fff; transform: translateY(-1px); box-shadow: 0 4px 10px rgba(37, 99, 235, .28); }
.cb-copy:active { transform: scale(.97); }
.cb-switch {
  display: inline-flex; align-items: center;
  height: 28px; padding: 0 10px; border: 1px dashed var(--border);
  border-radius: 8px; background: transparent; color: var(--text-3);
  font-size: 12px; cursor: pointer; transition: all .15s; flex-shrink: 0;
}
.cb-switch:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-light); }

/* ============ 主体 ============ */
.main { max-width: 1240px; margin: 0 auto; padding: 28px 24px 60px; }
.footer {
  max-width: 1240px; margin: 0 auto; padding: 0 24px 30px;
  color: var(--text-3); font-size: 12px;
}
.page-head { margin-bottom: 22px; }
.page-head h2 { font-size: 22px; font-weight: 800; }
.page-sub { color: var(--text-2); margin-top: 6px; }

.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); border: 1px solid var(--border);
  padding: 22px 24px; margin-bottom: 20px;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.card-head h3 { font-size: 15px; font-weight: 700; }
.card-tag {
  font-size: 12px; font-weight: 600; color: var(--primary);
  background: var(--primary-light); padding: 3px 10px; border-radius: 999px;
  margin-left: 8px; vertical-align: 2px;
}

/* ============ 统计卡片 ============ */
.stat-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 16px; margin-bottom: 20px;
}
.stat-card { margin-bottom: 0; }
.stat-label { font-size: 13px; color: var(--text-2); font-weight: 500; }
.stat-value {
  font-size: 28px; font-weight: 800; margin: 10px 0 8px;
  font-variant-numeric: tabular-nums; letter-spacing: -0.5px;
}
.stat-value em { font-style: normal; color: var(--text-3); font-size: 18px; font-weight: 600; }
.stat-sub { font-size: 12px; color: var(--text-3); }
.stat-hot .stat-value { color: var(--danger); }

/* ============ 表格 ============ */
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: 12px; font-weight: 600;
  color: var(--text-2); padding: 10px 12px;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table td {
  padding: 12px; border-bottom: 1px solid var(--border);
  font-size: 13.5px; white-space: nowrap;
}
.table tbody tr:hover { background: #fafbfe; }
.table tbody tr:last-child td { border-bottom: none; }
.ta-r { text-align: right !important; }
.td-strong { font-weight: 600; }
.td-mono { font-family: var(--mono); font-size: 12.5px; color: var(--text-2); }
.td-dim { color: var(--text-3); font-size: 12.5px; }
.td-revenue { color: var(--danger); font-weight: 700; }
.empty { text-align: center; color: var(--text-3); padding: 32px 0 !important; }

.badge {
  display: inline-block; font-size: 12px; font-weight: 600;
  padding: 3px 10px; border-radius: 999px;
}
.badge.android { background: #ecfdf5; color: #059669; }
.badge.ios { background: #f0f4ff; color: #3b82f6; }
.badge.type { background: var(--primary-light); color: var(--primary); }
.dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  margin-right: 6px; vertical-align: 1px;
}
.dot.on { background: #10b981; box-shadow: 0 0 0 3px rgba(16, 185, 129, .15); }
.dot.off { background: var(--text-3); }

/* ============ 表单 ============ */
.form-inline { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
.form-inline .field { min-width: 200px; flex: 1; }
.form-inline .field:last-of-type { flex: 2; }
.form-inline .btn { height: 40px; }

.filter { display: flex; align-items: center; gap: 8px; }
.filter select { width: 160px; height: 34px; font-size: 13px; }

/* ============ 图表 ============ */
.chart-box { height: 320px; position: relative; }

/* ============ 过渡 ============ */
.fade-enter-active, .fade-leave-active { transition: opacity .16s ease; }
.fade-enter-from, .fade-leave-to { opacity: 0; }

/* ============ Toast ============ */
.toast {
  position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%);
  background: rgba(17, 24, 39, .88); color: #fff;
  padding: 10px 20px; border-radius: 10px; font-size: 13.5px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
  z-index: 999; backdrop-filter: blur(6px);
}
.toast-enter-active, .toast-leave-active { transition: all .22s ease; }
.toast-enter-from, .toast-leave-to { opacity: 0; transform: translateX(-50%) translateY(10px); }

/* ============ 响应式 ============ */
@media (max-width: 960px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .callback-url { display: none; }
}
@media (max-width: 640px) {
  .stat-grid { grid-template-columns: 1fr; }
  .topbar-inner { padding: 0 14px; }
  .main { padding: 18px 14px 40px; }
}
