/* style.css —— 管理后台样式 */
:root {
  --primary: #1a73e8;
  --primary-dark: #1557b0;
  --primary-light: #e8f0fe;
  --danger: #ea4335;
  --danger-light: #fce8e6;
  --success: #34a853;
  --warning: #fbbc04;
  --text: #202124;
  --text-secondary: #5f6368;
  --text-muted: #9aa0a6;
  --border: #dadce0;
  --bg: #f8f9fa;
  --bg-card: #ffffff;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  background-color: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

/* ===== 顶栏 ===== */
.topbar {
  height: 56px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-logo { font-size: 24px; }
.topbar-title { font-size: 16px; font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.topbar-username { color: var(--text-secondary); font-size: 13px; }

/* ===== Tab ===== */
.tabs {
  display: flex;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  position: sticky;
  top: 56px;
  z-index: 99;
}
.tab {
  padding: 14px 20px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}
.tab:hover { color: var(--primary); }
.tab-active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 500;
}

/* ===== 内容区 ===== */
.content { padding: 24px; max-width: 1400px; margin: 0 auto; }
.tab-panel { display: none; }
.tab-panel-active { display: block; }

/* ===== 卡片 ===== */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
}
.card-title { font-size: 14px; font-weight: 600; margin-bottom: 12px; }

/* ===== 统计卡 ===== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}
.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
}
.stat-card--primary {
  background: linear-gradient(135deg, #1a73e8 0%, #4a9af5 100%);
  color: #fff;
}
.stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.stat-card--primary .stat-label { color: rgba(255,255,255,0.85); }
.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}
.stat-card--primary .stat-value { color: #fff; }
.stat-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}
.stat-card--primary .stat-sub { color: rgba(255,255,255,0.85); }

/* ===== 表格 ===== */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.table th, .table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.table th {
  font-weight: 600;
  color: var(--text-secondary);
  background: #fafbfc;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.table tbody tr:hover { background: #f8f9fa; }
.empty-row { text-align: center; color: var(--text-muted); padding: 40px 0; }
.amount { color: var(--success); font-weight: 500; }
.text-muted { color: var(--text-muted); }
.code-text {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 12px;
  background: #f1f3f4;
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text);
}
.row-actions { white-space: nowrap; }

/* ===== 标签 ===== */
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}
.tag-rewarded { background: #e8f0fe; color: #1a73e8; }
.tag-banner { background: #fef7e0; color: #b06000; }
.tag-interstitial { background: #fce8e6; color: #c5221f; }

/* ===== 开关 ===== */
.switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  cursor: pointer;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider {
  position: absolute;
  inset: 0;
  background: #ccc;
  border-radius: 20px;
  transition: 0.3s;
}
.switch-slider::before {
  content: "";
  position: absolute;
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.3s;
}
.switch input:checked + .switch-slider { background: var(--success); }
.switch input:checked + .switch-slider::before { transform: translateX(16px); }

/* ===== 按钮 ===== */
.btn {
  padding: 8px 16px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
}
.btn:hover { background: #f8f9fa; border-color: #c6c6c6; }
.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-danger {
  background: #fff;
  border-color: var(--border);
  color: var(--danger);
}
.btn-danger:hover { background: var(--danger-light); border-color: var(--danger); }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-block { width: 100%; }
.btn-text {
  border: none;
  background: none;
  color: var(--text-secondary);
}
.btn-text:hover { color: var(--danger); background: none; }

/* ===== 表单 ===== */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}
.required { color: var(--danger); }
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  transition: border-color 0.2s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.form-group textarea { resize: vertical; }
.form-row { display: flex; gap: 16px; }
.form-group-half { flex: 1; }
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}

/* ===== 弹窗 ===== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-content {
  background: #fff;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 16px; font-weight: 600; }
.modal-close {
  border: none;
  background: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-secondary);
  line-height: 1;
}
.modal-close:hover { color: var(--text); }
.form { padding: 20px; }

/* ===== 面板头部 ===== */
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.panel-title { font-size: 18px; font-weight: 600; }
.panel-actions { display: flex; gap: 12px; align-items: center; }
.select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  background: #fff;
  cursor: pointer;
}

/* ===== 登录页 ===== */
.login-page {
  background: linear-gradient(135deg, #1a73e8 0%, #4a9af5 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card {
  background: #fff;
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
  text-align: center;
}
.login-logo { font-size: 48px; margin-bottom: 16px; }
.login-title { font-size: 20px; font-weight: 600; margin-bottom: 4px; }
.login-subtitle { font-size: 13px; color: var(--text-secondary); margin-bottom: 24px; }
.login-tip {
  margin-top: 16px;
  font-size: 12px;
  color: var(--text-muted);
  padding: 8px;
  background: #f8f9fa;
  border-radius: 4px;
}

/* ===== 提示列表 ===== */
.tips-list {
  list-style: none;
  padding: 0;
}
.tips-list li {
  padding: 6px 0;
  color: var(--text-secondary);
  font-size: 13px;
}
.tips-list li::before {
  content: "•";
  color: var(--primary);
  font-weight: bold;
  margin-right: 8px;
}
