/* =====================================================================
   托育帮家庭助手 · 平台管理后台 公共样式
   色板：侧边栏深青绿 #2F6B63 / 主色 #46A094 / 强调 #F2A65A
        危险 #E4574F / 背景 #F5F7F7 / 文字 #2D3436 / 星级金 #F5B942
   ===================================================================== */
:root {
  --sidebar-bg: #2F6B63;
  --sidebar-active: #3E827A;
  --primary: #46A094;
  --primary-deep: #2F6B63;
  --accent: #F2A65A;
  --danger: #E4574F;
  --bg: #F5F7F7;
  --card: #FFFFFF;
  --text: #2D3436;
  --muted: #7A8B8B;
  --border: #E2E8E8;
  --star: #F5B942;
  --shadow: 0 1px 3px rgba(45, 52, 54, 0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

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;
  line-height: 1.6;
}

a { color: var(--primary-deep); text-decoration: none; }

#app { display: flex; min-height: 100vh; }

/* ---------------- 侧边栏 ---------------- */
.sidebar {
  width: 216px;
  background: var(--sidebar-bg);
  color: #DFEDEB;
  flex-shrink: 0;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
}
.sidebar-logo {
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.logo-text {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 1px;
}
.logo-text em { font-style: normal; color: var(--accent); }
.logo-sub {
  font-size: 12px;
  color: #B9D2CE;
  margin-top: 4px;
  letter-spacing: 2px;
}
.sidebar-nav { flex: 1; padding: 12px 0; overflow-y: auto; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 20px;
  color: #DFEDEB;
  font-size: 14px;
  border-left: 3px solid transparent;
  transition: background .15s;
}
.nav-item:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.nav-item.active {
  background: var(--sidebar-active);
  color: #fff;
  border-left-color: var(--accent);
  font-weight: 600;
}
.nav-icon { width: 20px; text-align: center; font-size: 15px; }
.sidebar-foot {
  padding: 14px 20px;
  font-size: 12px;
  color: #B9D2CE;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

/* ---------------- 主区 / 顶栏 ---------------- */
.main { margin-left: 216px; flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 56px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow);
}
.topbar-title { font-size: 16px; font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.admin-name { color: var(--muted); font-size: 13px; }
.content { padding: 20px 24px 40px; flex: 1; min-width: 0; }

/* ---------------- 卡片 ---------------- */
.card {
  background: var(--card);
  border-radius: 8px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  margin-bottom: 16px;
}
.card-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-title .card-extra { margin-left: auto; font-weight: 400; font-size: 13px; color: var(--muted); }
.section-gap { height: 16px; }

/* ---------------- 筛选栏 ---------------- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}
.filter-bar .form-group { margin-bottom: 0; }
.filter-bar .form-label { font-size: 12px; color: var(--muted); margin-bottom: 2px; }

/* ---------------- 表格 ---------------- */
.table-wrap { overflow-x: auto; }
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.table th {
  background: #F0F5F4;
  color: #4A5B5A;
  font-weight: 600;
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td {
  padding: 10px 12px;
  border-bottom: 1px solid #EFF3F3;
  vertical-align: top;
}
.table tbody tr:hover { background: #FAFCFC; }
.table tbody tr.clickable { cursor: pointer; }
.table .row-expand td { background: #FBFDFC; border-bottom: 1px solid var(--border); }
.money { font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.money::after { content: " 元"; font-weight: 400; color: var(--muted); font-size: 12px; }
.num { font-variant-numeric: tabular-nums; }

/* ---------------- 徽标 / 状态色 ---------------- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  white-space: nowrap;
  line-height: 1.6;
}
.badge-gray   { background: #EEF1F1; color: #6B7A7A; }
.badge-blue   { background: #E6F2FB; color: #2E7DB2; }
.badge-green  { background: #E3F4EF; color: #2F8F75; }
.badge-teal   { background: #E1F0EE; color: #2F6B63; }
.badge-orange { background: #FDF0E2; color: #C07A26; }
.badge-red    { background: #FDE8E7; color: #C0392F; }
.badge-purple { background: #EFEAFB; color: #7A5CC4; }
.badge-dark   { background: #3B4444; color: #fff; }
.badge-yellow { background: #FDF3D9; color: #9A7013; }

/* 星级金色彩签 */
.star-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 4px;
  background: #FEF6E3;
  color: #A8790F;
  border: 1px solid #F5DFAE;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.star-level {
  display: inline-block;
  min-width: 22px;
  text-align: center;
  color: #fff;
  background: var(--star);
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  padding: 1px 6px;
  box-shadow: inset 0 -1px 0 rgba(0,0,0,.15);
}

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 7px 16px;
  font-size: 13px;
  cursor: pointer;
  background: #fff;
  color: var(--text);
  transition: all .15s;
  white-space: nowrap;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: #3A8E84; }
.btn-deep { background: var(--primary-deep); color: #fff; }
.btn-deep:hover:not(:disabled) { background: #275C55; }
.btn-accent { background: var(--accent); color: #5C3A12; }
.btn-accent:hover:not(:disabled) { background: #EC9540; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #D04038; }
.btn-outline { border-color: #CBD9D8; color: #4A5B5A; background: #fff; }
.btn-outline:hover:not(:disabled) { border-color: var(--primary); color: var(--primary-deep); background: #F4FAF9; }
.btn-sm { padding: 4px 10px; font-size: 12px; border-radius: 5px; }
.btn-block { width: 100%; }

/* ---------------- 表单 ---------------- */
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; }
.form-label .req { color: var(--danger); margin-left: 2px; }
.form-tip { font-size: 12px; color: var(--muted); margin-top: 3px; }
input[type="text"], input[type="password"], input[type="number"],
input[type="month"], input[type="date"], select, textarea {
  width: 100%;
  border: 1px solid #CBD9D8;
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 13px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
  outline: none;
  transition: border-color .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(70, 160, 148, .15); }
textarea { min-height: 72px; resize: vertical; }
.form-inline { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.form-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 16px; }
.form-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }

/* ---------------- 弹窗 ---------------- */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(30, 40, 40, 0.55);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 8vh 16px 16px;
  z-index: 999;
  overflow-y: auto;
  animation: fadeIn .15s;
}
.modal {
  background: #fff;
  border-radius: 10px;
  width: 100%;
  max-width: 520px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
  animation: slideUp .2s;
}
.modal-lg { max-width: 760px; }
.modal-head {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-head h3 { font-size: 15px; font-weight: 600; }
.modal-close {
  border: none;
  background: none;
  font-size: 18px;
  color: var(--muted);
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}
.modal-close:hover { color: var(--danger); }
.modal-body { padding: 18px 20px; max-height: 62vh; overflow-y: auto; }
.modal-foot {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------------- 图片放大灯箱 ---------------- */
.lightbox-mask {
  position: fixed;
  inset: 0;
  background: rgba(10, 16, 16, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1200;
  cursor: zoom-out;
}
.lightbox-mask img { max-width: 92vw; max-height: 88vh; border-radius: 6px; box-shadow: 0 8px 40px rgba(0,0,0,.5); }
.img-thumb {
  width: 100%;
  max-width: 160px;
  height: 110px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
  cursor: zoom-in;
  background: #EEF2F2;
}

/* ---------------- 审核页布局 ---------------- */
.audit-layout { display: flex; gap: 16px; align-items: flex-start; }
.audit-left { width: 330px; flex-shrink: 0; }
.audit-right { flex: 1; min-width: 0; }
.tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.tab {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid #CBD9D8;
  background: #fff;
  font-size: 13px;
  color: #4A5B5A;
  cursor: pointer;
  transition: all .15s;
}
.tab:hover { border-color: var(--primary); color: var(--primary-deep); }
.tab.active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.list-item {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  margin-bottom: 10px;
  transition: border-color .15s, box-shadow .15s;
}
.list-item:hover { border-color: var(--primary); }
.list-item.active { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(70, 160, 148, .18); }
.list-item-title { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.list-item-meta { margin-top: 6px; color: var(--muted); font-size: 12px; display: flex; flex-wrap: wrap; gap: 4px 12px; }

/* 详情字段网格 */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 24px;
  font-size: 13px;
}
.detail-grid .d-item { display: flex; }
.detail-grid .d-label { color: var(--muted); width: 96px; flex-shrink: 0; }
.detail-grid .d-value { flex: 1; word-break: break-all; }
.img-grid { display: flex; flex-wrap: wrap; gap: 10px; }

/* 审核时间线 */
.timeline { padding: 4px 0 4px 6px; }
.tl-item { position: relative; padding: 0 0 18px 26px; border-left: 2px solid #E2E8E8; margin-left: 8px; }
.tl-item:last-child { border-left-color: transparent; padding-bottom: 4px; }
.tl-dot {
  position: absolute;
  left: -7px;
  top: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--primary);
}
.tl-dot.red { border-color: var(--danger); }
.tl-dot.orange { border-color: var(--accent); }
.tl-dot.dark { border-color: #3B4444; }
.tl-time { font-size: 12px; color: var(--muted); }
.tl-action { font-weight: 600; margin: 1px 0; }
.tl-reason { font-size: 12px; color: #5A6A69; background: #F4F7F7; border-radius: 6px; padding: 6px 10px; margin-top: 4px; display: inline-block; }

/* 统计卡片 */
.stat-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.stat-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 18px;
  box-shadow: var(--shadow);
}
.stat-label { font-size: 13px; color: var(--muted); }
.stat-value { font-size: 26px; font-weight: 700; margin-top: 6px; font-variant-numeric: tabular-nums; }
.stat-value.accent { color: var(--accent); }
.stat-value.primary { color: var(--primary); }
.stat-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
@media (max-width: 1100px) { .stat-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }

/* 空态 / 加载 */
.empty { text-align: center; color: var(--muted); padding: 40px 0; font-size: 13px; }
.loading { text-align: center; color: var(--muted); padding: 24px 0; }

/* 分页 */
.pagination { display: flex; gap: 6px; align-items: center; margin-top: 14px; flex-wrap: wrap; }
.pagination button {
  border: 1px solid #CBD9D8;
  background: #fff;
  color: #4A5B5A;
  border-radius: 5px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
}
.pagination button:hover:not(:disabled) { border-color: var(--primary); color: var(--primary-deep); }
.pagination button.cur { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.pagination button:disabled { opacity: .5; cursor: not-allowed; }
.pagination .pg-info { font-size: 12px; color: var(--muted); }

/* Toast */
.toast {
  padding: 10px 16px;
  border-radius: 6px;
  color: #fff;
  font-size: 13px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  max-width: 380px;
  transition: opacity .3s, transform .3s;
}
.toast-error { background: #D04038; }
.toast-success { background: #2F8F75; }
.toast-info { background: #2E7DB2; }
.toast-out { opacity: 0; transform: translateY(-6px); }

/* 登录页 */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #2F6B63 0%, #3E827A 55%, #46A094 100%);
  padding: 20px;
}
.login-box {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.22);
  padding: 36px 36px 30px;
}
.login-logo { text-align: center; margin-bottom: 24px; }
.login-logo .brand { font-size: 24px; font-weight: 700; color: var(--primary-deep); }
.login-logo .brand em { font-style: normal; color: var(--accent); }
.login-logo .sub { font-size: 13px; color: var(--muted); margin-top: 6px; letter-spacing: 3px; }
.login-foot { text-align: center; font-size: 12px; color: var(--muted); margin-top: 16px; }
.login-error { color: var(--danger); font-size: 13px; margin-bottom: 10px; min-height: 20px; }

/* 星级规则说明 */
.rule-list { list-style: none; }
.rule-list li { position: relative; padding-left: 18px; margin-bottom: 8px; font-size: 13px; color: #4A5B5A; }
.rule-list li::before { content: ""; position: absolute; left: 2px; top: 8px; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); }

/* 通用工具 */
.text-muted { color: var(--muted); }
.text-danger { color: var(--danger); }
.text-accent { color: #C07A26; }
.fw-600 { font-weight: 600; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-center { display: flex; align-items: center; gap: 8px; }
.flex-wrap { flex-wrap: wrap; }
.word-break { word-break: break-all; }
