/* ===== 公共 ===== */
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  font-size: 14px;
  color: #2c3340;
  background: #f4f6f9;
  line-height: 1.6;
}
a { color: #2b6cb0; text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

/* ===== 前台（手机风格） ===== */
.wrap { max-width: 480px; margin: 0 auto; background: #fff; min-height: 100vh; }
.hero { padding: 20px 18px 14px; background: linear-gradient(135deg, #2f6fed, #17b6c4); color: #fff; }
.hero h1 { margin: 0 0 8px; font-size: 22px; line-height: 1.35; }
.hero p { margin: 0; font-size: 14px; opacity: .92; white-space: pre-wrap; }
.panel { padding: 16px 18px 30px; }

/* 广告页店铺封面：宽度100%，高度自适应 */
.ad-cover { width: 100%; background: #eef2f8; line-height: 0; }
.ad-cover img { width: 100%; height: auto; display: block; }
.ad-cover-preview { width: 240px; height: auto; border-radius: 8px; border: 1px solid #e2e9f3; margin-bottom: 8px; display: block; }
.panel h2 { font-size: 16px; margin: 18px 0 10px; padding-left: 10px; border-left: 3px solid #2f6fed; }
.card { border: 1px solid #e6ebf2; border-radius: 10px; overflow: hidden; margin-bottom: 14px; background: #fff; box-shadow: 0 2px 8px rgba(20,40,80,.05); }
.card .cover { width: 100%; background: #eef2f8; line-height: 0; }
.card .cover img { width: 100%; height: auto; display: block; }
.card .cover.empty { display: flex; align-items: center; justify-content: center; color: #7c8aa0; background: #eef2f8; font-size: 13px; line-height: 1.6; padding: 40px 0; }
.card .body { padding: 10px 12px; }
.card .body .t { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.card .body .m { font-size: 12px; color: #7c8aa0; }

/* ===== 表单 ===== */
.field { margin-bottom: 14px; }
.field label { display: block; margin-bottom: 6px; font-weight: 600; color: #45526b; }
.input, .select, .textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #d7dfea; border-radius: 8px;
  font-size: 14px; background: #fff; outline: none;
}
.input:focus, .select:focus, .textarea:focus { border-color: #2f6fed; box-shadow: 0 0 0 3px rgba(47,111,237,.12); }
.textarea { min-height: 120px; resize: vertical; font-family: inherit; }
.btn {
  display: inline-block; padding: 10px 18px; border: none; border-radius: 8px;
  background: #2f6fed; color: #fff; font-size: 14px; cursor: pointer;
}
.btn:hover { background: #245ad1; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-block { display: block; width: 100%; text-align: center; }
.btn-gray { background: #7a879b; }
.btn-gray:hover { background: #66748a; }
.btn-sm { padding: 5px 12px; font-size: 13px; border-radius: 6px; }
.btn-line { background: #fff; color: #2f6fed; border: 1px solid #2f6fed; }
.btn-line:hover { background: #f1f5ff; }
.btn-danger { background: #e25252; }

.msg { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-size: 13px; }
.msg-ok { background: #e8f7ee; color: #14794a; border: 1px solid #bfe8cf; }
.msg-err { background: #fdecec; color: #b02222; border: 1px solid #f6c9c9; }

.empty-tip { padding: 26px; text-align: center; color: #96a1b5; font-size: 13px; }

/* 我的活动：次数列表 */
.stat-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px dashed #e8edf5; }
.stat-row:last-child { border-bottom: none; }
.stat-row .n { font-weight: 600; }
.stat-row .c { font-size: 13px; color: #6f7d94; }
.stat-row .c b { color: #2f6fed; }
.stat-row .c .rest { color: #e25252; }

/* ===== 后台布局：左菜单 + 右内容 ===== */
.admin { display: flex; min-height: 100vh; }
.side {
  width: 200px; flex: 0 0 200px; background: #1f2a3a; color: #c9d3e2;
  display: flex; flex-direction: column;
}
.side .logo { padding: 20px 18px; font-size: 16px; font-weight: 700; color: #fff; border-bottom: 1px solid #2b394c; }
.side nav { flex: 1; padding: 10px 0; }
.side nav a {
  display: block; padding: 12px 18px; color: #c9d3e2; font-size: 14px;
  border-left: 3px solid transparent; text-decoration: none;
}
.side nav a:hover { background: #263446; color: #fff; }
.side nav a.on { background: #263446; color: #fff; border-left-color: #4c8dff; }
.side .side-foot { padding: 14px 18px; border-top: 1px solid #2b394c; font-size: 13px; }
.side .side-foot a { color: #93a2b8; }

.main { flex: 1; min-width: 0; padding: 22px 26px 40px; }
.pg-title { font-size: 19px; margin: 0 0 18px; }
.pg-title .sub { font-size: 12px; color: #8d99ad; font-weight: 400; margin-left: 8px; }

.box { background: #fff; border: 1px solid #e6ebf2; border-radius: 10px; padding: 18px 20px; margin-bottom: 18px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 16px; }
.toolbar .fi { display: flex; flex-direction: column; gap: 4px; }
.toolbar .fi label { font-size: 12px; color: #7c8aa0; }
.toolbar .input, .toolbar .select { width: auto; min-width: 160px; padding: 8px 10px; }

table.tb { width: 100%; border-collapse: collapse; background: #fff; }
table.tb th, table.tb td { padding: 11px 12px; border-bottom: 1px solid #edf1f7; text-align: left; font-size: 14px; vertical-align: middle; }
table.tb th { background: #f7f9fc; color: #45526b; font-weight: 600; font-size: 13px; }
table.tb tr:hover td { background: #fafcff; }
table.tb td.muted { color: #96a1b5; }
.thumb { width: 82px; height: 52px; border-radius: 6px; object-fit: cover; background: #eef2f8; }
.thumb-empty { width: 82px; height: 52px; border-radius: 6px; background: #eef2f8; color: #9aa6b8; font-size: 12px; display: flex; align-items: center; justify-content: center; }

/* 状态标签 */
.tag { display: inline-block; padding: 2px 9px; border-radius: 10px; font-size: 12px; line-height: 1.7; white-space: nowrap; }
.tag-on { background: #e8f7ee; color: #14794a; border: 1px solid #bfe8cf; }
.tag-off { background: #f0f2f5; color: #7c8aa0; border: 1px solid #dde2ea; }

/* 上传提示 */
.file-hint { font-size: 12px; color: #8d99ad; margin-top: 6px; }

/* 广告页活动排序 */
.sort-list { border: 1px solid #e2e9f3; border-radius: 8px; overflow: hidden; background: #fff; margin-bottom: 8px; }
.sort-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-bottom: 1px solid #edf1f7; background: #fbfcff; }
.sort-row:last-child { border-bottom: none; }
.sort-row .idx { width: 22px; height: 22px; flex: 0 0 22px; border-radius: 50%; background: #2f6fed; color: #fff; font-size: 12px; display: flex; align-items: center; justify-content: center; }
.sort-row .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.sort-row .ops { flex: 0 0 auto; display: flex; gap: 6px; }

.pager { display: flex; gap: 8px; align-items: center; margin-top: 16px; flex-wrap: wrap; }
.pager a, .pager .on {
  padding: 6px 11px; border: 1px solid #dde5f0; border-radius: 6px; background: #fff;
  font-size: 13px; color: #45526b;
}
.pager a:hover { border-color: #4c8dff; color: #2f6fed; text-decoration: none; }
.pager .on { background: #2f6fed; border-color: #2f6fed; color: #fff; }
.pager-info { font-size: 12px; color: #8d99ad; margin-right: 6px; }

/* 统计 */
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.card-stat { background: #fff; border: 1px solid #e6ebf2; border-radius: 10px; padding: 16px 18px; }
.card-stat .k { font-size: 12px; color: #8d99ad; margin-bottom: 8px; }
.card-stat .v { font-size: 26px; font-weight: 700; color: #2f6fed; }
.card-stat.green .v { color: #14905c; }
.card-stat.orange .v { color: #e08a24; }
.card-stat.red .v { color: #d8493f; }

/* 登录页 */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #1f2a3a, #2f4d7a); }
.login-box { width: 360px; background: #fff; border-radius: 12px; padding: 30px 28px 26px; box-shadow: 0 18px 40px rgba(10,20,40,.25); }
.login-box h1 { margin: 0 0 6px; font-size: 20px; text-align: center; }
.login-box .tip { text-align: center; color: #8d99ad; font-size: 12px; margin-bottom: 22px; }
.login-box .foot { margin-top: 16px; text-align: center; font-size: 12px; color: #9aa6b8; }

/* 活动多选 */
.check-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.check-list label {
  display: flex; gap: 8px; align-items: center; padding: 9px 12px;
  border: 1px solid #dde5f0; border-radius: 8px; cursor: pointer; font-size: 13px; background: #fff;
}
.check-list label:hover { border-color: #4c8dff; }
.check-list input { margin: 0; }

@media (max-width: 900px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .admin { flex-direction: column; }
  .side { width: 100%; flex: none; }
  .side nav { display: flex; flex-wrap: wrap; }
  .side nav a { border-left: none; border-bottom: 3px solid transparent; padding: 10px 14px; }
  .side nav a.on { border-bottom-color: #4c8dff; }
}
