/* style.css — 管理后台样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Microsoft YaHei', 'PingFang SC', -apple-system, sans-serif;
  font-size: 14px;
  color: #2c3e50;
  background: #f4f6f9;
}

.hidden { display: none !important; }

/* ===== 登录页 ===== */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a73e8 0%, #174ea6 100%);
}

.login-card {
  width: 360px;
  background: #fff;
  border-radius: 12px;
  padding: 40px 36px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  text-align: center;
}

.login-logo { font-size: 52px; }

.login-card h1 { font-size: 18px; margin: 10px 0 26px; color: #174ea6; }

.form-item { margin-bottom: 16px; text-align: left; }

.form-item label { display: block; font-size: 12px; color: #7f8c8d; margin-bottom: 6px; }

.form-item input, .form-item select, .form-item textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d7dee8;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
}

.form-item input:focus { border-color: #1a73e8; }

.login-error { color: #e74c3c; font-size: 13px; min-height: 18px; margin-top: 12px; }

/* ===== 按钮 ===== */
.btn {
  padding: 9px 20px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
}

.btn-primary { background: #1a73e8; color: #fff; width: 100%; }
.btn-primary:hover { background: #1558b8; }
.btn-plain { background: #fff; color: #1a73e8; border: 1px solid #1a73e8; width: auto; }
.btn-sm { padding: 5px 12px; font-size: 12px; border-radius: 6px; }
.btn-danger { background: #fdecea; color: #e74c3c; border: 1px solid #f5b7b1; }
.btn-success { background: #eaf7ea; color: #27ae60; border: 1px solid #a9dfbf; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

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

.sidebar {
  width: 220px;
  background: #174ea6;
  color: #fff;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-title { padding: 20px 18px; font-size: 16px; font-weight: 700; border-bottom: 1px solid rgba(255,255,255,0.15); }

.menu { flex: 1; padding: 12px 0; overflow-y: auto; }

.menu a {
  display: block;
  padding: 12px 20px;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  cursor: pointer;
  font-size: 14px;
}

.menu a:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }

.menu a.active { background: #1a73e8; color: #fff; font-weight: 600; }

.sidebar-footer { padding: 16px 18px; border-top: 1px solid rgba(255,255,255,0.15); font-size: 12px; }

.current-user { margin-bottom: 10px; opacity: 0.85; }

.sidebar-footer .btn-plain { background: transparent; color: #fff; border-color: rgba(255,255,255,0.5); }

.content { flex: 1; padding: 24px; min-width: 0; }

/* ===== 通用组件 ===== */
.panel {
  background: #fff;
  border-radius: 10px;
  padding: 20px 24px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.panel h3 { font-size: 16px; color: #174ea6; margin-bottom: 14px; }

.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }

.toolbar input, .toolbar select {
  padding: 8px 10px;
  border: 1px solid #d7dee8;
  border-radius: 6px;
  font-size: 13px;
}

.toolbar label { font-size: 13px; color: #7f8c8d; display: flex; align-items: center; gap: 4px; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }

th, td { padding: 10px 12px; border-bottom: 1px solid #eef2f7; text-align: left; }

th { background: #f4f6f9; font-weight: 600; color: #34495e; }

tr:hover td { background: #fafbfc; }

.badge { display: inline-block; padding: 2px 10px; border-radius: 10px; font-size: 11px; color: #fff; }
.badge-success { background: #27ae60; }
.badge-warning { background: #f39c12; }
.badge-gray { background: #95a5a6; }
.badge-danger { background: #e74c3c; }
.badge-blue { background: #1a73e8; }

.stat-grid { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }

.stat-card {
  flex: 1;
  min-width: 180px;
  background: #fff;
  border-radius: 10px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.stat-num { font-size: 30px; font-weight: 700; color: #1a73e8; }
.stat-num.warn { color: #e67e22; }
.stat-label { font-size: 12px; color: #7f8c8d; margin-top: 6px; }

/* 趋势柱状图 */
.trend { display: flex; align-items: flex-end; gap: 10px; height: 140px; padding-top: 10px; }
.trend-col { flex: 1; display: flex; flex-direction: column; align-items: center; }
.trend-bar { width: 60%; background: #1a73e8; border-radius: 4px 4px 0 0; min-height: 3px; }
.trend-bar.reg { background: #27ae60; }
.trend-date { font-size: 11px; color: #95a5a6; margin-top: 6px; }

.empty-tip { text-align: center; color: #b0bec5; padding: 40px 0; }

/* ===== 弹层 ===== */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-box {
  width: 440px;
  max-width: 92vw;
  max-height: 84vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 12px;
  padding: 24px 28px;
}

.modal-box h3 { font-size: 16px; margin-bottom: 16px; color: #174ea6; }

.modal-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 18px; }
.modal-actions .btn { width: auto; }

.result-box {
  background: #f0f7ff;
  border: 1px solid #c9dffb;
  border-radius: 8px;
  padding: 14px 16px;
  margin: 10px 0;
  font-size: 14px;
}

.result-box strong { color: #1a73e8; }

.clickable { color: #1a73e8; cursor: pointer; text-decoration: underline; }

/* ===== Toast ===== */
.toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(44, 62, 80, 0.92);
  color: #fff;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 200;
}
