/* ============================================
   优学家教平台 · 管理后台样式（绿色主题）
   ============================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: "PingFang SC", "Microsoft YaHei", sans-serif; background: #f5f8f7; color: #1d2129; font-size: 14px; }
a { color: #059669; text-decoration: none; }
button { cursor: pointer; border: none; font-family: inherit; }

/* ---------- 登录页 ---------- */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh;
  background: linear-gradient(135deg, #10b981 0%, #0d9d76 100%); }
.login-box { background: #fff; border-radius: 16px; padding: 44px 40px; width: 380px; box-shadow: 0 20px 60px rgba(0,0,0,.2); }
.login-box h1 { font-size: 21px; text-align: center; margin-bottom: 6px; }
.login-box .sub { font-size: 13px; color: #86909c; text-align: center; margin-bottom: 26px; }
.login-box input { width: 100%; height: 44px; border: 1px solid #e5e6eb; border-radius: 8px; padding: 0 14px; font-size: 14px; outline: none; margin-bottom: 12px; }
.login-box input:focus { border-color: #10b981; }
.login-box .btn-login { width: 100%; height: 44px; background: #10b981; color: #fff; border-radius: 8px; font-size: 15px; margin-top: 6px; }
.login-box .tip { font-size: 12px; color: #c9cdd4; text-align: center; margin-top: 14px; line-height: 1.7; }
.login-error { background: #ffece8; color: #f53f3f; border-radius: 8px; padding: 9px 12px; font-size: 13px; margin-bottom: 14px; }

/* ---------- 布局 ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 210px; background: #fff; border-right: 1px solid #f2f3f5; padding: 20px 12px; flex-shrink: 0; }
.logo { font-size: 17px; font-weight: 700; color: #10b981; padding: 6px 12px 22px; }
.menu-item { display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-radius: 8px; font-size: 14px; color: #4e5969; cursor: pointer; margin-bottom: 3px; }
.menu-item:hover { background: #f5f8f7; }
.menu-item.active { background: rgba(16,185,129,.1); color: #059669; font-weight: 600; }
.menu-item .badge { margin-left: auto; background: #ff7d00; color: #fff; font-size: 11px; padding: 1px 7px; border-radius: 99px; }
.sidebar-footer { margin-top: 22px; padding: 14px 12px 0; border-top: 1px solid #f2f3f5; font-size: 12px; color: #86909c; }
.sidebar-footer .who { margin-bottom: 10px; line-height: 1.8; }
.btn-exit { width: 100%; padding: 8px; background: #f2f3f5; color: #86909c; border-radius: 6px; font-size: 12px; }

.main { flex: 1; padding: 24px 28px; min-width: 0; }
.page-title { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.page-sub { font-size: 13px; color: #86909c; margin-bottom: 20px; }

/* ---------- 统计卡 ---------- */
.stats-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 24px; }
.stats-grid.cols4 { grid-template-columns: repeat(4, 1fr); }
.stats-grid.cols3 { grid-template-columns: repeat(3, 1fr); }
.stat-card { background: #fff; border-radius: 12px; padding: 18px 20px; box-shadow: 0 2px 12px rgba(0,0,0,.05); }
.stat-card .v { font-size: 25px; font-weight: 700; }
.stat-card .l { font-size: 12px; color: #86909c; margin-top: 6px; }
.stat-card.primary { background: linear-gradient(135deg, #10b981 0%, #0d9d76 100%); }
.stat-card.primary .v, .stat-card.primary .l { color: #fff; }
.stat-card .v.warn { color: #ff7d00; }

/* ---------- 图表 ---------- */
.chart-card { background: #fff; border-radius: 12px; padding: 20px; box-shadow: 0 2px 12px rgba(0,0,0,.05); margin-bottom: 20px; }
.chart-card h3 { font-size: 14px; margin-bottom: 16px; color: #4e5969; }
.chart { display: flex; align-items: flex-end; gap: 16px; height: 150px; padding: 0 8px; }
.chart .bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.chart .bar { width: 60%; max-width: 40px; background: linear-gradient(180deg, #34d399, #10b981); border-radius: 6px 6px 0 0; min-height: 3px; }
.chart .bar-label { font-size: 11px; color: #86909c; }
.chart .bar-val { font-size: 11px; color: #059669; font-weight: 600; }

/* ---------- 筛选/表格 ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; align-items: center; }
.toolbar .tab-btn { padding: 7px 18px; background: #fff; border-radius: 99px; font-size: 13px; color: #4e5969; display: inline-block; }
.toolbar .tab-btn.active { background: #10b981; color: #fff; }
.toolbar form.select-form { display: flex; gap: 8px; align-items: center; }
.toolbar select, .toolbar input[type=text] { height: 34px; border: 1px solid #e5e6eb; border-radius: 8px; padding: 0 10px; font-size: 13px; outline: none; background: #fff; }
.toolbar input[type=text]:focus, .toolbar select:focus { border-color: #10b981; }

.table-card { background: #fff; border-radius: 12px; box-shadow: 0 2px 12px rgba(0,0,0,.05); overflow: auto; margin-bottom: 20px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { background: #fafbfc; color: #86909c; font-weight: 500; text-align: left; padding: 12px 14px; white-space: nowrap; border-bottom: 1px solid #f2f3f5; }
td { padding: 12px 14px; border-bottom: 1px solid #f7f8fa; vertical-align: middle; }
tr:hover td { background: #fafcfa; }
.td-title { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.td-sub { font-size: 12px; color: #86909c; margin-top: 3px; }
.amount { font-weight: 700; color: #ff6b35; }

/* ---------- 标签 ---------- */
.tag { font-size: 11px; padding: 2px 8px; border-radius: 4px; display: inline-block; white-space: nowrap; }
.tag-demand { color: #165dff; background: rgba(22,93,255,.1); }
.tag-teacher { color: #059669; background: rgba(16,185,129,.1); }
.tag-org { color: #d48806; background: #fff7e6; }
.tag-vip { color: #d48806; background: #fff7e6; }
.tag-commission { color: #059669; background: rgba(16,185,129,.1); }
.tag-pending { color: #ff7d00; background: rgba(255,125,0,.1); }
.tag-approved { color: #059669; background: rgba(16,185,129,.1); }
.tag-rejected { color: #f53f3f; background: rgba(245,63,63,.08); }
.tag-verified { color: #059669; background: rgba(16,185,129,.1); }
.tag-none { color: #86909c; background: #f2f3f5; }
.tag-danger { color: #f53f3f; background: rgba(245,63,63,.08); }

/* ---------- 按钮 ---------- */
.btn { padding: 6px 14px; border-radius: 6px; font-size: 13px; display: inline-block; }
.btn-pass { background: rgba(16,185,129,.1); color: #059669; }
.btn-pass:hover { background: rgba(16,185,129,.2); }
.btn-reject { background: rgba(245,63,63,.08); color: #f53f3f; }
.btn-reject:hover { background: rgba(245,63,63,.15); }
.btn-gray { background: #f2f3f5; color: #86909c; }
.btn-gray:hover { background: #e5e6eb; }
.btn-primary { background: #10b981; color: #fff; }
.btn-primary:hover { background: #0d9d76; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-row { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- 表单 ---------- */
.form-card { background: #fff; border-radius: 12px; padding: 22px 24px; box-shadow: 0 2px 12px rgba(0,0,0,.05); margin-bottom: 20px; max-width: 640px; }
.form-card h3 { font-size: 15px; margin-bottom: 16px; }
.form-item { margin-bottom: 14px; }
.form-item label { display: block; font-size: 13px; color: #4e5969; margin-bottom: 5px; }
.form-item input[type=text], .form-item input[type=password], .form-item input[type=number], .form-item input[type=url], .form-item select, .form-item textarea {
  width: 100%; height: 38px; border: 1px solid #e5e6eb; border-radius: 8px; padding: 0 12px; font-size: 13px; outline: none; background: #fff; }
.form-item textarea { height: 76px; padding: 10px 12px; resize: vertical; font-family: inherit; }
.form-item input:focus, .form-item select:focus, .form-item textarea:focus { border-color: #10b981; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-tip { font-size: 12px; color: #c9cdd4; margin-top: 4px; }

/* ---------- 图片 ---------- */
.cert-imgs { display: flex; gap: 8px; flex-wrap: wrap; }
.cert-imgs img { width: 110px; height: 80px; object-fit: cover; border-radius: 6px; background: #f2f3f5; cursor: pointer; }
.avatar-sm { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; background: #f2f3f5; vertical-align: middle; }
.ad-thumb { width: 120px; height: 60px; object-fit: cover; border-radius: 6px; background: #f2f3f5; }

/* ---------- 广告图预览（表单内即时预览） ---------- */
.img-preview { margin-top: 8px; }
.img-preview img { max-width: 320px; max-height: 140px; border-radius: 8px; background: #f2f3f5; display: none; }

/* ---------- 开关 ---------- */
.switch-btn { padding: 4px 12px; border-radius: 99px; font-size: 12px; }
.switch-on { background: rgba(16,185,129,.12); color: #059669; }
.switch-off { background: #f2f3f5; color: #86909c; }

/* ---------- 空态 ---------- */
.empty { text-align: center; color: #c9cdd4; font-size: 13px; padding: 60px 0; }

/* ---------- 分页 ---------- */
.pager { display: flex; gap: 6px; justify-content: flex-end; margin-bottom: 20px; }
.pager a, .pager span { padding: 6px 12px; background: #fff; border-radius: 6px; font-size: 13px; color: #4e5969; }
.pager .cur { background: #10b981; color: #fff; }

/* ---------- 弹窗（图片大图预览） ---------- */
#imgModal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.7); z-index: 99; align-items: center; justify-content: center; cursor: zoom-out; }
#imgModal img { max-width: 86vw; max-height: 86vh; border-radius: 8px; }
