/* ===== 光伏广告投放报表系统 - Google简约风 ===== */
:root {
  --bg: #f8f9fa;
  --surface: #ffffff;
  --border: #e8eaed;
  --border-hover: #dadce0;
  --text-primary: #202124;
  --text-secondary: #5f6368;
  --text-tertiary: #9aa0a6;
  --blue: #1a73e8;
  --blue-hover: #1765cc;
  --blue-light: #e8f0fe;
  --green: #1e8e3e;
  --green-light: #e6f4ea;
  --red: #d93025;
  --red-light: #fce8e6;
  --orange: #f29900;
  --orange-light: #fef7e0;
  --shadow: 0 1px 2px rgba(60,64,67,0.08), 0 1px 3px rgba(60,64,67,0.06);
  --shadow-hover: 0 1px 2px rgba(60,64,67,0.12), 0 2px 6px rgba(60,64,67,0.08);
  --radius: 12px;
  --radius-sm: 8px;
  --font: 'Google Sans', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mono: 'Google Sans Mono', 'SF Mono', Consolas, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* === 布局 === */
.layout { display: flex; min-height: 100vh; }

/* 侧边栏 */
.sidebar {
  width: 240px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  z-index: 100;
}
.sidebar-logo {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.sidebar-logo .logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, #1a73e8, #4285f4);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 18px; font-weight: 700;
}
.sidebar-logo .logo-text { font-size: 16px; font-weight: 600; color: var(--text-primary); }
.sidebar-logo .logo-sub { font-size: 11px; color: var(--text-tertiary); margin-top: 1px; }
.sidebar-nav { flex: 1; padding: 8px 12px; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 2px;
  transition: background .15s, color .15s;
  cursor: pointer;
}
.nav-item:hover { background: var(--blue-light); color: var(--blue); }
.nav-item.active { background: var(--blue-light); color: var(--blue); }
.nav-item svg { width: 20px; height: 20px; flex-shrink: 0; }
.sidebar-footer {
  padding: 12px 16px 14px;
  border-top: 1px solid var(--border);
}
.logout-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  color: var(--text-tertiary);
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  transition: color .15s, background .15s;
}
.logout-link:hover { color: var(--red); background: var(--red-light); }
.logout-link svg { width: 15px; height: 15px; flex-shrink: 0; }

/* 主区域 */
.main {
  flex: 1;
  margin-left: 240px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.topbar {
  height: 64px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 32px;
  position: sticky; top: 0; z-index: 50;
}
.topbar-title { font-size: 20px; font-weight: 600; color: var(--text-primary); }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.content { padding: 24px 32px; flex: 1; }

/* === 卡片 === */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.card-title { font-size: 16px; font-weight: 600; }
.card-body { padding: 24px; }

/* === 统计卡片 === */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--shadow);
  transition: box-shadow .2s;
}
.stat-card:hover { box-shadow: var(--shadow-hover); }
.stat-card .stat-label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 8px;
  display: flex; align-items: center; gap: 6px;
}
.stat-card .stat-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.stat-card .stat-sub {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 6px;
}
.stat-card.accent-blue { border-left: 4px solid var(--blue); }
.stat-card.accent-green { border-left: 4px solid var(--green); }
.stat-card.accent-orange { border-left: 4px solid var(--orange); }
.stat-card.accent-red { border-left: 4px solid var(--red); }

/* === 按钮 === */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { background: var(--bg); border-color: var(--border-hover); }
.btn-primary {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}
.btn-primary:hover { background: var(--blue-hover); border-color: var(--blue-hover); }
.btn-danger {
  color: var(--red);
  border-color: var(--border);
}
.btn-danger:hover { background: var(--red-light); border-color: var(--red); }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-icon {
  width: 36px; height: 36px;
  padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--text-secondary);
  transition: background .15s;
}
.btn-icon:hover { background: var(--bg); }

/* === 表单 === */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-primary);
  background: var(--surface);
  transition: border .15s, box-shadow .15s;
  font-family: var(--font);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 2px var(--blue-light);
}
.form-textarea { resize: vertical; min-height: 80px; }

/* === 表格 === */
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
thead th {
  text-align: left;
  padding: 12px 16px;
  font-weight: 500;
  font-size: 13px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
tbody tr:hover { background: var(--bg); }
tbody tr:last-child td { border-bottom: none; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-danger { color: var(--red); }

/* === 标签 === */
.tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}
.tag-blue { background: var(--blue-light); color: var(--blue); }
.tag-green { background: var(--green-light); color: var(--green); }
.tag-orange { background: var(--orange-light); color: var(--orange); }
.tag-red { background: var(--red-light); color: var(--red); }

/* === 登录页 === */
.login-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.login-card {
  background: var(--surface);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  padding: 40px;
  width: 400px;
  max-width: 90vw;
}
.login-header { text-align: center; margin-bottom: 32px; }
.login-header .icon {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, #1a73e8, #4285f4);
  border-radius: 16px;
  margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 24px; font-weight: 700;
}
.login-header h1 { font-size: 22px; font-weight: 600; margin-bottom: 4px; }
.login-header p { font-size: 14px; color: var(--text-secondary); }

/* === 图表容器 === */
.chart-container {
  position: relative;
  width: 100%;
  height: 320px;
  margin: 0;
}
.chart-container canvas { max-width: 100%; }

/* === 过滤栏 === */
.filter-bar {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.filter-bar .form-group { margin-bottom: 0; min-width: 160px; }
.filter-bar .actions { margin-left: auto; display: flex; gap: 8px; }

/* === 弹窗 === */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(32,33,36,0.4);
  display: none;
  align-items: center; justify-content: center;
  z-index: 1000;
}
.modal-overlay.show { display: flex; }
.modal {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  width: 520px;
  max-width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-size: 18px; font-weight: 600; }
.modal-body { padding: 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 8px;
}

/* === 空状态 === */
.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-tertiary);
}
.empty svg { width: 64px; height: 64px; margin-bottom: 16px; opacity: 0.4; }

/* === 分页 === */
.pagination {
  display: flex; align-items: center; justify-content: center;
  gap: 4px;
  margin-top: 16px;
}
.pagination .page-info { font-size: 13px; color: var(--text-secondary); margin-right: 12px; }
.pagination .btn { min-width: 36px; justify-content: center; }

/* === 响应式 === */
@media (max-width: 768px) {
  .sidebar { width: 64px; }
  .sidebar-logo .logo-text, .sidebar-logo .logo-sub { display: none; }
  .nav-item span { display: none; }
  .sidebar-footer { padding: 12px 8px 14px; }
  .logout-link { justify-content: center; padding: 8px 0; }
  .logout-link span { display: none; }
  .main { margin-left: 64px; }
  .content { padding: 16px; }
  .topbar { padding: 0 16px; }
}

/* === Toast === */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--text-primary);
  color: #fff;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  z-index: 2000;
  transform: translateY(100px);
  opacity: 0;
  transition: all .3s;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { background: var(--green); }
.toast.error { background: var(--red); }
