/* ============ 吉商城客户案例库 - 全局样式 ============ */
:root {
  --primary: #e64340;
  --primary-dark: #c93633;
  --primary-light: #fdeceb;
  --bg: #f5f6f8;
  --card: #ffffff;
  --text: #2b2f36;
  --text-2: #6b7280;
  --border: #e5e7eb;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 16px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.14);
}

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

html, 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); text-decoration: none; }
img { display: block; }

/* ---------- 顶部导航 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #fff;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}
.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; }
.brand .logo {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, var(--primary), #ff8a5c);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 17px; flex: none;
}
.topbar .sub { color: var(--text-2); font-size: 12px; font-weight: 400; }

.searchbox {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 999px; padding: 7px 16px; min-width: 260px;
}
.searchbox input {
  border: none; outline: none; background: transparent;
  font-size: 14px; width: 100%; color: var(--text);
}
.searchbox .icon { color: var(--text-2); flex: none; }

/* ---------- 行业筛选 ---------- */
.chips-wrap { max-width: 1200px; margin: 16px auto 0; padding: 0 20px; }
.chips {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.chip {
  border: 1px solid var(--border); background: #fff; color: var(--text-2);
  border-radius: 999px; padding: 6px 14px; cursor: pointer;
  font-size: 13px; transition: all 0.15s; user-select: none;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.active {
  background: var(--primary); border-color: var(--primary); color: #fff;
  font-weight: 600;
}
.chip .cnt { opacity: 0.7; font-size: 12px; margin-left: 4px; }
.chip.active .cnt { opacity: 0.9; }

/* ---------- 案例卡片 ---------- */
.container { max-width: 1200px; margin: 0 auto; padding: 20px; }

.result-info { color: var(--text-2); font-size: 13px; margin: 4px 2px 14px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}
.case-card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
  display: flex; flex-direction: column;
  border: 1px solid transparent;
  transition: transform 0.15s, box-shadow 0.15s;
}
.case-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.card-head {
  padding: 14px 16px 0;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 8px;
}
.card-head h3 { font-size: 15px; font-weight: 700; word-break: break-all; }
.tag {
  flex: none; font-size: 11px; color: var(--primary);
  background: var(--primary-light); border-radius: 6px;
  padding: 2px 8px; font-weight: 600; margin-top: 2px;
}

.qr-box {
  margin: 12px 16px 0; border-radius: 10px; overflow: hidden;
  background: #fafafa; border: 1px solid var(--border);
  cursor: zoom-in; position: relative;
}
.qr-box img { width: 100%; height: auto; min-height: 120px; object-fit: contain; background: #fff; }
.qr-box .placeholder {
  height: 130px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px;
  color: #b9bfc9; font-size: 12px;
}
.qr-box .placeholder .big { font-size: 34px; }
.qr-hint {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: linear-gradient(transparent, rgba(0,0,0,.55));
  color: #fff; font-size: 11px; text-align: center; padding: 16px 0 6px;
  pointer-events: none;
}

.shots {
  display: flex; gap: 8px; padding: 10px 16px 0; overflow-x: auto;
}
.shot {
  width: 58px; height: 58px; border-radius: 8px; object-fit: cover;
  border: 1px solid var(--border); cursor: zoom-in; flex: none;
  background: #f3f4f6;
}
.shots .empty { color: #b9bfc9; font-size: 12px; padding: 2px 0; }

.card-desc {
  padding: 10px 16px 0; color: var(--text-2); font-size: 12.5px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; flex: 1;
}

.card-foot {
  padding: 12px 16px 14px; display: flex; align-items: center; gap: 8px;
}
.btn-demo {
  background: var(--primary); color: #fff; border-radius: 8px;
  padding: 7px 14px; font-size: 12.5px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 5px;
}
.btn-demo:hover { background: var(--primary-dark); }
.btn-demo:disabled { opacity: 0.4; pointer-events: none; }
.no-demo { font-size: 12px; color: #c3c8d1; }

.empty {
  grid-column: 1 / -1; text-align: center; color: var(--text-2);
  padding: 70px 20px;
}
.empty .big { font-size: 44px; margin-bottom: 10px; }

/* ---------- 灯箱 ---------- */
.lightbox {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.82);
  display: none; align-items: center; justify-content: center;
  z-index: 200; padding: 30px;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 92vw; max-height: 86vh; border-radius: 10px;
  box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5); background: #fff;
}
.lightbox .lb-cap {
  position: absolute; bottom: 18px; left: 0; right: 0; text-align: center;
  color: #fff; font-size: 13px; text-shadow: 0 1px 4px rgba(0,0,0,.6);
}
.lb-close {
  position: absolute; top: 16px; right: 20px; width: 40px; height: 40px;
  border-radius: 50%; background: rgba(255,255,255,.15); color: #fff;
  border: none; font-size: 20px; cursor: pointer; line-height: 1;
}
.lb-close:hover { background: rgba(255,255,255,.3); }

/* ---------- 管理端 ---------- */
.admin-wrap { max-width: 1100px; margin: 0 auto; padding: 24px 20px 60px; }
.admin-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 18px; flex-wrap: wrap;
}
.admin-head h2 { font-size: 20px; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--border); background: #fff; color: var(--text);
  border-radius: 8px; padding: 8px 16px; cursor: pointer; font-size: 13.5px;
  transition: all 0.15s; font-weight: 500;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-dark); }
.btn.danger { color: #d93834; }
.btn.danger:hover { border-color: #d93834; background: #fdf0ef; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* 登录 */
.login-card {
  max-width: 380px; margin: 90px auto; background: #fff;
  border-radius: 16px; box-shadow: var(--shadow-lg); padding: 36px 32px;
}
.login-card .brand { justify-content: center; margin-bottom: 8px; }
.login-card h2 { text-align: center; font-size: 18px; margin-bottom: 22px; }
.login-card .field { margin-bottom: 16px; }
.login-card label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.login-card input {
  width: 100%; border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 12px; font-size: 14px; outline: none;
}
.login-card input:focus { border-color: var(--primary); }
.login-card .btn { width: 100%; justify-content: center; padding: 11px; font-size: 15px; }
.login-err { color: #d93834; font-size: 13px; margin-top: 10px; text-align: center; min-height: 18px; }

/* 表格 */
.table-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { background: #fafbfc; color: var(--text-2); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #fafbfc; }
.td-name { font-weight: 600; }
.td-thumb { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; border: 1px solid var(--border); background: #f3f4f6; }
.td-thumb.ph { display: flex; align-items: center; justify-content: center; color: #c3c8d1; font-size: 16px; }
.td-actions { white-space: nowrap; }
.td-actions .btn { padding: 5px 10px; font-size: 12.5px; margin-right: 6px; }
.row-ops { display: flex; gap: 8px; }

/* 弹窗表单 */
.modal-mask {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.5);
  display: none; align-items: flex-start; justify-content: center;
  z-index: 150; padding: 40px 16px; overflow-y: auto;
}
.modal-mask.open { display: flex; }
.modal {
  background: #fff; border-radius: 16px; width: 100%; max-width: 720px;
  box-shadow: var(--shadow-lg); padding: 24px 28px 28px;
}
.modal h3 { font-size: 17px; margin-bottom: 18px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 13px; color: var(--text-2); font-weight: 500; }
.field input, .field textarea, .field select {
  border: 1px solid var(--border); border-radius: 8px; padding: 9px 12px;
  font-size: 13.5px; outline: none; font-family: inherit; background: #fff;
}
.field input:focus, .field textarea:focus { border-color: var(--primary); }
.field textarea { resize: vertical; min-height: 70px; }
.field .hint { font-size: 12px; color: #aab0ba; }

/* 图片上传区 */
.img-edit { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.img-item {
  position: relative; width: 84px; height: 84px; border-radius: 10px;
  overflow: hidden; border: 1px solid var(--border); background: #f3f4f6;
}
.img-item img { width: 100%; height: 100%; object-fit: cover; }
.img-item .rm {
  position: absolute; top: 2px; right: 2px; width: 20px; height: 20px;
  border-radius: 50%; background: rgba(0, 0, 0, 0.6); color: #fff;
  border: none; cursor: pointer; font-size: 12px; line-height: 1;
}
.img-item .rm:hover { background: #d93834; }
.img-add {
  width: 84px; height: 84px; border: 2px dashed #d5d9e0; border-radius: 10px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; color: #9aa1ab; font-size: 11px; cursor: pointer; background: #fafbfc;
}
.img-add:hover { border-color: var(--primary); color: var(--primary); }
.img-add .plus { font-size: 22px; line-height: 1; }
.url-add { display: flex; gap: 6px; align-items: center; }
.url-add input { flex: 1; min-width: 200px; }

.form-foot {
  display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px;
  padding-top: 16px; border-top: 1px solid var(--border);
}

.toast {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%) translateY(-20px);
  background: #32363e; color: #fff; padding: 10px 22px; border-radius: 999px;
  font-size: 13.5px; z-index: 300; opacity: 0; transition: all 0.25s; pointer-events: none;
  box-shadow: var(--shadow-lg);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.ok { background: #16a34a; }
.toast.err { background: #d93834; }

.footer { text-align: center; color: #b0b6c0; font-size: 12px; padding: 30px 0 40px; }

/* 响应式 */
@media (max-width: 720px) {
  .topbar-inner { padding: 10px 14px; }
  .searchbox { min-width: 100%; }
  .chips-wrap { padding: 0 14px; }
  .container { padding: 14px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
  .form-grid { grid-template-columns: 1fr; }
  .admin-wrap { padding: 16px 12px 50px; }
}
