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

:root {
  --primary: #FF7043;
  --primary-light: #FFF3E0;
  --bg: #f5f6fa;
  --white: #fff;
  --text: #333;
  --text-secondary: #888;
  --border: #eee;
  --danger: #e74c3c;
  --sidebar-w: 220px;
}

body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; }

/* ====== 登录页 ====== */
.login-page {
  display: flex; align-items: center; justify-content: center; min-height: 100vh;
  background: linear-gradient(135deg, #FFF3E0, #FFCCBC);
}
.login-box {
  background: var(--white); border-radius: 16px; padding: 48px 40px;
  width: 380px; box-shadow: 0 8px 32px rgba(0,0,0,0.08);
}
.login-header { text-align: center; margin-bottom: 32px; }
.login-header h1 { font-size: 28px; color: var(--primary); }
.login-header p { color: var(--text-secondary); margin-top: 4px; }

.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 500; color: var(--text); }
.form-group input {
  width: 100%; height: 44px; border: 2px solid var(--border); border-radius: 10px;
  padding: 0 14px; font-size: 14px; transition: border-color 0.2s;
}
.form-group input:focus { outline: none; border-color: var(--primary); }
.form-error { color: var(--danger); font-size: 13px; min-height: 20px; margin-bottom: 8px; }

/* ====== 管理后台布局 ====== */
.admin-page { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); background: #2c3e50; color: #ecf0f1;
  display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0; z-index: 100;
}
.sidebar-brand { padding: 24px 20px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.sidebar-brand h2 { font-size: 20px; }
.sidebar-brand small { font-size: 12px; opacity: 0.6; }
.sidebar-nav { flex: 1; padding: 12px 0; }
.nav-item {
  display: block; padding: 12px 20px; color: rgba(255,255,255,0.7);
  text-decoration: none; transition: all 0.2s; font-size: 14px;
}
.nav-item:hover, .nav-item.active { background: rgba(255,255,255,0.1); color: #fff; }
.sidebar-footer { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,0.1); font-size: 13px; display: flex; justify-content: space-between; }
.sidebar-footer a { color: var(--primary); text-decoration: none; }

.main-content { margin-left: var(--sidebar-w); flex: 1; padding: 32px; }
.page { display: none; }
.page.active { display: block; }
.page-title { font-size: 24px; margin-bottom: 24px; color: var(--text); }
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.page-header .page-title { margin-bottom: 0; }

/* ====== 统计卡片 ====== */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px; }
.stat-card {
  background: var(--white); border-radius: 12px; padding: 24px;
  display: flex; align-items: center; gap: 16px; box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.stat-card-icon { width: 52px; height: 52px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 24px; flex-shrink: 0; }
.stat-card-value { font-size: 28px; font-weight: 700; color: var(--text); }
.stat-card-label { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }

/* ====== 表格 ====== */
.table-wrapper { background: var(--white); border-radius: 12px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.04); }
table { width: 100%; border-collapse: collapse; }
thead { background: #fafafa; }
th { text-align: left; padding: 14px 16px; font-weight: 600; font-size: 13px; color: var(--text-secondary); border-bottom: 1px solid var(--border); }
td { padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 13px; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #fafafa; }

/* ====== 按钮 ====== */
.btn-primary {
  background: var(--primary); color: #fff; border: none; border-radius: 8px;
  padding: 12px 24px; font-size: 14px; font-weight: 600; cursor: pointer; transition: opacity 0.2s;
}
.btn-primary:hover { opacity: 0.9; }
.btn-secondary { background: var(--white); color: var(--primary); border: 2px solid var(--primary); border-radius: 8px; padding: 10px 20px; font-size: 13px; cursor: pointer; }
.btn-danger { background: none; color: var(--danger); border: 1px solid var(--danger); border-radius: 6px; padding: 4px 12px; font-size: 12px; cursor: pointer; }
.btn-sm { padding: 8px 16px; font-size: 13px; }

/* ====== 筛选栏 ====== */
.filter-bar { display: flex; gap: 10px; align-items: center; }
.filter-bar select {
  height: 36px; border: 1px solid var(--border); border-radius: 8px; padding: 0 12px; font-size: 13px;
}

/* ====== 模态框 ====== */
.modal { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.4); display: flex; align-items: center; justify-content: center; z-index: 200; }
.modal-content { background: var(--white); border-radius: 14px; width: 420px; max-height: 80vh; overflow-y: auto; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--border); }
.modal-header h3 { font-size: 16px; }
.modal-close { font-size: 24px; cursor: pointer; color: var(--text-secondary); }
#modalBody { padding: 20px 24px; }
#modalBody .form-group { margin-bottom: 16px; }
#modalBody .form-group label { font-size: 13px; }
#modalBody .form-group input, #modalBody .form-group select { width: 100%; height: 40px; border: 1px solid var(--border); border-radius: 8px; padding: 0 12px; font-size: 13px; }
#modalBody .form-group input:focus, #modalBody .form-group select:focus { outline: none; border-color: var(--primary); }
#modalBody .btn-primary { width: 100%; margin-top: 8px; }

.badge {
  display: inline-block; padding: 2px 10px; border-radius: 10px; font-size: 12px;
}
.badge-feed   { background: #FFF3E0; color: #FF8A65; }
.badge-play   { background: #E8F5E9; color: #66BB6A; }
.badge-sleep  { background: #E8EAF6; color: #7986CB; }
.badge-diaper { background: #FFF8E1; color: #FFB74D; }
.badge-care   { background: #E0F2F1; color: #4DB6AC; }
