/* ============================================================
   微信对话生成器 - 后台样式
   ============================================================ */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: #f4f5f7;
  color: #222;
}

a { color: #07c160; text-decoration: none; }
a:hover { opacity: .85; }

/* ---------- 登录页 ---------- */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, #0b7a4b, #07c160 60%, #a3ecc0); }
.login-card { width: 380px; max-width: 92vw; background: #fff; border-radius: 16px; padding: 36px 34px; box-shadow: 0 20px 60px rgba(0,0,0,.2); }
.login-title { font-size: 22px; color: #07c160; text-align: center; }
.login-sub { text-align: center; color: #999; font-size: 13px; margin: 6px 0 24px; }
.login-foot { display: flex; justify-content: space-between; margin-top: 18px; font-size: 12px; color: #aaa; }

/* ---------- 表单 ---------- */
.form-item { margin-bottom: 14px; }
.form-item label { display: block; font-size: 13px; color: #555; margin-bottom: 6px; }
.form-item input {
  width: 100%; padding: 10px 12px; border: 1px solid #ddd; border-radius: 8px; font-size: 14px; outline: none;
}
.form-item input:focus { border-color: #07c160; }
.form-item .form-tip { display: block; font-size: 12px; color: #999; margin-top: 5px; line-height: 1.6; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px; border-radius: 8px; border: none; cursor: pointer;
  font-size: 14px; text-decoration: none; line-height: 1.4; transition: filter .15s;
}
.btn:hover { filter: brightness(.94); }
.btn-primary { background: #07c160; color: #fff; }
.btn-ghost { background: #f0f0f0; color: #333; }
.btn-danger { background: #fdecec; color: #e33; }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 6px; }
.inline-form { display: inline-flex; }

/* ---------- 提示 ---------- */
.alert { max-width: 1240px; margin: 16px auto 0; padding: 12px 18px; border-radius: 10px; font-size: 14px; }
.alert-ok { background: #e8f9f0; color: #07914d; border: 1px solid #b7ecd1; }
.alert-err { background: #fdecec; color: #c0392b; border: 1px solid #f5c2c2; }

/* ---------- 顶栏 ---------- */
.admin-top { background: #fff; border-bottom: 1px solid #eee; position: sticky; top: 0; z-index: 50; }
.admin-top-inner { max-width: 1240px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; gap: 12px; flex-wrap: wrap; }
.admin-logo { font-size: 18px; font-weight: 700; color: #07c160; }
.admin-logo small { font-size: 12px; color: #aaa; font-weight: 400; }
.admin-user { display: flex; align-items: center; gap: 10px; font-size: 13px; color: #555; }

/* ---------- 主体 ---------- */
.admin-main { max-width: 1240px; margin: 0 auto; padding: 20px 16px 60px; }

/* 统计卡片 */
.stat-cards { display: flex; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.stat-card { flex: 1; min-width: 150px; background: #fff; border-radius: 12px; padding: 18px 20px; box-shadow: 0 2px 10px rgba(0,0,0,.05); }
.stat-num { font-size: 26px; font-weight: 700; color: #07c160; }
.stat-label { font-size: 13px; color: #999; margin-top: 4px; }

/* 导航 */
.admin-tabs { display: flex; gap: 6px; margin-bottom: 16px; background: #fff; border-radius: 10px; padding: 6px; box-shadow: 0 2px 10px rgba(0,0,0,.05); width: fit-content; }
.admin-tabs a { padding: 9px 22px; border-radius: 8px; font-size: 14px; color: #555; }
.admin-tabs a.active { background: #07c160; color: #fff; font-weight: 600; }

/* 卡片 */
.card { background: #fff; border-radius: 12px; padding: 18px; margin-bottom: 18px; box-shadow: 0 2px 10px rgba(0,0,0,.05); }
.card-narrow { max-width: 480px; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 12px; flex-wrap: wrap; }
.card-head h2 { font-size: 16px; font-weight: 600; }
.card-head h2 small { font-size: 12px; color: #999; font-weight: 400; margin-left: 6px; }
.empty { text-align: center; color: #999; padding: 40px 0; font-size: 14px; }

/* 表格 */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; color: #888; font-weight: 500; border-bottom: 1px solid #eee; padding: 10px 8px; white-space: nowrap; }
.table td { padding: 11px 8px; border-bottom: 1px solid #f4f4f4; vertical-align: middle; }
.table tr:hover td { background: #fafbfc; }
.td-title { max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-ops { white-space: nowrap; }
.td-ops .btn, .td-ops .inline-form { margin-right: 6px; }

/* 搜索 */
.search-form { display: flex; gap: 8px; align-items: center; }
.search-form input[type="text"] { padding: 7px 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 13px; outline: none; width: 220px; }
.search-form input[type="text"]:focus { border-color: #07c160; }

/* 标签 */
.tag { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; }
.tag-on { background: #e8f9f0; color: #07914d; }
.tag-off { background: #f0f0f0; color: #888; }

/* 公告表单 */
.ann-form textarea { width: 100%; padding: 10px 12px; border: 1px solid #ddd; border-radius: 8px; font-size: 14px; outline: none; resize: vertical; font-family: inherit; }
.ann-form textarea:focus { border-color: #07c160; }
.ann-form-row { display: flex; align-items: center; gap: 14px; margin-top: 12px; flex-wrap: wrap; font-size: 13px; color: #555; }
.ann-form-row label { display: flex; align-items: center; gap: 6px; }
.ann-form-row input[type="checkbox"] { width: 16px; height: 16px; accent-color: #07c160; }

/* 密码表单 */
.pwd-form { max-width: 420px; }
.pwd-form .form-item input { background: #fafbfc; }

/* 页脚 */
.admin-foot { text-align: center; color: #bbb; font-size: 12px; padding: 10px 0 40px; }

/* 响应式 */
@media (max-width: 720px) {
  .td-title { max-width: 140px; }
  .table { font-size: 12px; }
  .search-form input[type="text"] { width: 130px; }
  .admin-tabs { width: 100%; }
  .admin-tabs a { flex: 1; text-align: center; }
}
